Skip to content

feat: add transaction context crate#19

Open
bmuddha wants to merge 1 commit into
solana-accountfrom
transaction-context
Open

feat: add transaction context crate#19
bmuddha wants to merge 1 commit into
solana-accountfrom
transaction-context

Conversation

@bmuddha

@bmuddha bmuddha commented May 28, 2026

Copy link
Copy Markdown
Collaborator

What changed

Added the solana-transaction-context crate, an engine-shaped fork of Agave's
crate patched in workspace-wide via [patch.crates-io].

Why

Engine execution needs the low-level structures it runs over, reshaped so VM
handlers can remap account data on writes through a mapped region instead of
copying through a serialized input buffer.

Closes #10.

Impact

  • Introduces TransactionContext, InstructionContext, and the
    TransactionAccounts store with AccountRef/AccountRefMut views.
  • Accounts live in UnsafeCell behind explicit borrow counters, keeping borrows
    local to the context.
  • ExecutionRecord returns keyed accounts, return data, touched-account count,
    and account resize delta; TransactionAccounts tracks resize and per-instruction
    lamports deltas.

Reviewer notes

Borrow counters are released on drop; outstanding references must be gone before a
context is deconstructed (Rc::try_unwrap failures there are real lifetime bugs).
Divergences are documented in solana/README.md (Transaction Context, VM Account
Mapping, Access-Violation Growth).

Follow-up

program-runtime and svm build on this crate upstack.

bmuddha commented May 28, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Free

Run ID: 92fa47c9-1c28-4bd7-b07a-f462ef424103

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

@bmuddha bmuddha force-pushed the transaction-context branch from c4029f9 to e4a023f Compare May 29, 2026 09:08
@bmuddha bmuddha force-pushed the transaction-context branch 2 times, most recently from 27ca11d to ff1197d Compare June 1, 2026 15:29
@bmuddha bmuddha force-pushed the solana-account branch 2 times, most recently from 9f791a8 to aab5a4e Compare June 2, 2026 18:26
@bmuddha bmuddha force-pushed the transaction-context branch 2 times, most recently from 7f5babf to b1bb9fd Compare June 5, 2026 12:10
@bmuddha bmuddha force-pushed the transaction-context branch from b1bb9fd to f7c2bac Compare June 16, 2026 10:08
@bmuddha bmuddha force-pushed the transaction-context branch from f7c2bac to 881f449 Compare June 22, 2026 19:14
@bmuddha bmuddha force-pushed the solana-account branch 2 times, most recently from 2bad847 to a7a8ce1 Compare June 23, 2026 14:17
@bmuddha bmuddha force-pushed the transaction-context branch from 881f449 to 59ad79e Compare June 23, 2026 14:17
@bmuddha bmuddha force-pushed the transaction-context branch from 59ad79e to a9fc42e Compare June 24, 2026 14:49
@bmuddha bmuddha force-pushed the transaction-context branch from a9fc42e to a5c02e4 Compare June 26, 2026 10:36
@bmuddha bmuddha force-pushed the solana-account branch 2 times, most recently from 0012407 to a0e05c5 Compare June 26, 2026 16:33
@bmuddha bmuddha force-pushed the transaction-context branch 2 times, most recently from 49572d6 to 83e3b6d Compare June 30, 2026 13:19
@bmuddha bmuddha force-pushed the transaction-context branch from 83e3b6d to 885578c Compare June 30, 2026 21:16
@bmuddha bmuddha force-pushed the solana-account branch 2 times, most recently from 0bf814e to 21739eb Compare July 1, 2026 20:03
@bmuddha bmuddha force-pushed the transaction-context branch 3 times, most recently from d382bc2 to f92b443 Compare July 2, 2026 19:39
@bmuddha bmuddha force-pushed the transaction-context branch 2 times, most recently from 28cf2cc to e32412c Compare July 6, 2026 09:01
@bmuddha bmuddha force-pushed the transaction-context branch from e32412c to 7f03467 Compare July 6, 2026 14:46
@bmuddha bmuddha marked this pull request as ready for review July 6, 2026 15:05
@bmuddha bmuddha force-pushed the transaction-context branch from 7f03467 to 2940e4c Compare July 7, 2026 14:15
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.

1 participant