Skip to content

Support sBPF v3 loader programs - #26

Closed
GabrielePicco wants to merge 4 commits into
mainfrom
fix/sbpf-v3-loader-compat
Closed

GabrielePicco wants to merge 4 commits into
mainfrom
fix/sbpf-v3-loader-compat

Conversation

@GabrielePicco

@GabrielePicco GabrielePicco commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • align the loader-v4/runtime path with the 4.0 Solana stack and upstream solana-sbpf 0.14.4
  • keep the MagicBlock transaction-context extensions available on the updated dependency path
  • adapt SVM call sites for the 4.0 transaction-context and program-cache APIs

Validation

  • cargo check -p solana-svm
  • local validator clone/finalize check against MagicBlock devnet remotes succeeded with LoaderV4 success

Summary by CodeRabbit

  • Chores

    • Updated workspace dependencies to Solana/Agave 4.0 ecosystem releases, including compute budget, loader, and system program crates.
    • Bumped SBPF virtual machine and transaction processing libraries to newer versions.
  • Refactor

    • Reorganized internal transaction context and instruction handling for improved modularity.
  • Tests

    • Updated integration tests to align with dependency and API changes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 12729e969b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Cargo.toml
@coderabbitai

coderabbitai Bot commented Jun 18, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@GabrielePicco, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 41 minutes and 40 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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 credits.

🚦 How do rate limits work?

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

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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1dba59fd-911d-431a-84ce-fe65bed91a22

📥 Commits

Reviewing files that changed from the base of the PR and between f4d9b86 and c96e229.

📒 Files selected for processing (2)
  • .github/workflows/cargo-test.yml
  • Cargo.toml

Walkthrough

Upgrades all Solana/Agave workspace crates from version 3.1 to 4.0, restructures the transaction-context crate with new public modules and a split InstructionTrace tuple type, extends TransactionContext::new with a new parameter, and adapts transaction_processor and supporting SVM files to match the updated API surface.

Changes

Solana/Agave 4.0 upgrade

Layer / File(s) Summary
Workspace and crate version bumps
Cargo.toml, transaction-context/Cargo.toml
All Solana/Agave workspace dependencies are bumped from 3.1 to 4.0 (and solana-sbpf to 0.14.4). solana-program-runtime switches from a local path to the published 4.0 crate and its [patch.crates-io] override is removed. transaction-context/Cargo.toml pins its version to "4.0.0".
New transaction-context public API
transaction-context/src/lib.rs
Adds public instruction, instruction_accounts, and transaction submodules. Defines transaction::InstructionTrace<'ix_data> as a 3-tuple of parallel vectors. TransactionContext::new gains a _number_of_top_level_instructions parameter. Adds get_current_instruction_index, configure_instruction_at_index, and configure_top_level_instruction_for_tests. take_instruction_trace returns the new tuple type.
transaction_processor core adaptation
svm/src/transaction_processor.rs
Updates imports to solana_transaction_context::transaction paths. TransactionContext::new in execute_loaded_transaction receives tx.num_instructions(). deconstruct_transaction is refactored to consume the 3-tuple trace. replenish_program_cache's missing-program entries are extended to a (Pubkey, ProgramCacheMatchCriteria, u64) 3-tuple carrying last_modification_slot, propagated through the cooperative-loading closure into finish_cooperative_loading_task.
Import path fixes across SVM files
svm/src/transaction_commit_result.rs, svm/src/transaction_execution_result.rs, svm/src/rent_calculator.rs, svm/src/transaction_account_state_info.rs
TransactionReturnData import is updated to the solana_transaction_context::transaction submodule path in two files. rent_calculator.rs reorders imports; transaction_account_state_info.rs imports TransactionContext from the new submodule path.
Test call-site updates
svm/src/account_loader.rs, svm/src/message_processor.rs, svm/src/transaction_account_state_info.rs, svm/src/transaction_processor.rs, svm/tests/integration_test.rs, svm/tests/mock_bank.rs
All TransactionContext::new test call sites gain the new trailing argument. Integration tests add SVMStaticMessage, pass EXECUTION_SLOT to global_program_cache.merge, and switch to direct program_instructions_iter() method calls. mock_bank.rs adds allow_memory_region_zero: false to the loader Config.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: upgrading dependencies to support sBPF v3 loader programs via Solana 4.0 stack alignment.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sbpf-v3-loader-compat

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 and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7912594f63

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread transaction-context/src/lib.rs
@GabrielePicco

Copy link
Copy Markdown
Contributor Author

Closing in favour of magicblock-labs/magicblock-validator#1346

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