Skip to content

feat: add customized solana-account crate - #13

Open
bmuddha wants to merge 2 commits into
solana-upstreamfrom
solana-account
Open

feat: add customized solana-account crate#13
bmuddha wants to merge 2 commits into
solana-upstreamfrom
solana-account

Conversation

@bmuddha

@bmuddha bmuddha commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

What changed

Customized the imported solana-account baseline with owned and copy-on-write
account representations, borrowed account layout helpers, codec helpers, sysvar
support, and focused tests.

Why

accountsdb needs an account representation that can borrow from mapped storage
and promote to owned storage only when writes require it.

Closes #5.

Impact

  • Replaces the upstream account representation with Account,
    AccountSharedData, and a borrowed/owned copy-on-write model.
  • Defines the borrowed in-memory layout used by storage-backed accounts.
  • Registers the customized crate in the workspace while keeping mutability and
    routing decisions above this crate.

Reviewer notes

The borrowed layout is layout-bound and must stay 8-byte aligned. This crate
should remain storage-source agnostic.

Follow-up

transaction-context, program-runtime, and svm adapt to this representation
in the next stack PRs; storage consumers arrive later.

@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@bmuddha, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f7178b1a-9690-4a2b-976e-4ef8dff48ab9

📥 Commits

Reviewing files that changed from the base of the PR and between 077348e and c684aa7.

📒 Files selected for processing (23)
  • .gitattributes
  • .gitignore
  • Cargo.toml
  • clippy.toml
  • solana/account/Cargo.toml
  • solana/account/README.md
  • solana/account/src/account.rs
  • solana/account/src/codec.rs
  • solana/account/src/cow/borrowed.rs
  • solana/account/src/cow/mod.rs
  • solana/account/src/cow/owned.rs
  • solana/account/src/cow/tests.rs
  • solana/account/src/lib.rs
  • solana/account/src/patch.rs
  • solana/account/src/state_traits.rs
  • solana/account/src/sysvar.rs
  • solana/account/src/testkit.rs
  • solana/account/src/tests/account.rs
  • solana/account/src/tests/mod.rs
  • solana/account/src/tests/state_traits.rs
  • solana/account/src/tests/sysvar.rs
  • solana/account/src/traits.rs
  • src/lib.rs

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a new solana-account crate with owned and copy-on-write account representations, aligned borrowed storage, account traits, serialization and sysvar helpers, patch handling, test utilities, and extensive validation.

Changes

solana-account crate

Layer / File(s) Summary
Workspace and crate manifest setup
.gitattributes, .gitignore, Cargo.toml, solana/account/Cargo.toml, solana/account/README.md
Registers the crate, centralizes dependencies and features, updates repository metadata, and documents the borrowed storage layout.
Core account type and traits
solana/account/src/account.rs, solana/account/src/codec.rs, solana/account/src/traits.rs
Adds Account, serialization and account-info helpers, bincode codecs, and readable/writable account abstractions.
Borrowed zero-copy buffer layout
solana/account/src/cow/borrowed.rs
Adds aligned double-buffered account storage with sequence-based commit, reset, rollback, and mutable data operations.
Owned storage and shared account orchestration
solana/account/src/cow/owned.rs, solana/account/src/cow/mod.rs
Adds owned serialization, account building, copy-on-write promotion, dirty tracking, account modes, flags, conversions, and sequence-locked reads.
Patches, typed state, and sysvar helpers
solana/account/src/patch.rs, solana/account/src/state_traits.rs, solana/account/src/sysvar.rs
Adds account field patches, typed bincode state access, and sysvar account construction and conversion functions.
Crate wiring, testkit, and validation
solana/account/src/lib.rs, solana/account/src/testkit.rs, solana/account/src/tests/*, solana/account/src/cow/tests.rs
Wires modules and re-exports, provides aligned borrowed-account test utilities, and tests account mutations, serialization, copy-on-write behavior, borrowed image lifecycle, typed state, sysvar round trips, and sequence-lock reads.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant AccountSharedData
  participant CoWAccount
  participant BorrowedAccount
  participant AccountHeader
  Caller->>AccountSharedData: update account data
  AccountSharedData->>CoWAccount: request mutable backing
  CoWAccount->>BorrowedAccount: translate or promote
  BorrowedAccount->>AccountHeader: stage shadow image
  Caller->>BorrowedAccount: commit
  BorrowedAccount->>AccountHeader: publish sequence
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR implements the requested solana-account fork and copy-on-write storage support for accountsdb.
Out of Scope Changes check ✅ Passed No clearly unrelated code changes stand out beyond the crate, helpers, tests, and supporting config.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title clearly summarizes the main change: a customized solana-account crate.
Description check ✅ Passed The description matches the changeset and explains the account model, helpers, tests, and purpose.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch solana-account

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bmuddha
bmuddha changed the base branch from graphite-base/13 to solana-upstream July 27, 2026 13:32
@bmuddha
bmuddha force-pushed the solana-account branch 2 times, most recently from 54be71a to d1e8c56 Compare July 28, 2026 14:25
@bmuddha
bmuddha force-pushed the solana-account branch 3 times, most recently from f30b82c to 8af975f Compare July 31, 2026 13:48
@bmuddha
bmuddha force-pushed the solana-account branch 2 times, most recently from 7f962ee to be63f7e Compare July 31, 2026 20:58
@bmuddha bmuddha self-assigned this Aug 4, 2026
@bmuddha
bmuddha requested a review from a team August 5, 2026 00:22
@bmuddha
bmuddha force-pushed the solana-account branch 2 times, most recently from 4abd3ab to a0b0b83 Compare August 5, 2026 13:26
@bmuddha

bmuddha commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fork solana-account for copy-on-write account storage

1 participant