Skip to content

v4.4: Refactor - Move ComputeMeter from InvokeContext to TransactionContext (backport of #15818) - #15919

Merged
Lichtso merged 2 commits into
v4.4from
mergify/bp/v4.4/pr-15818
Oct 13, 2026
Merged

Lichtso merged 2 commits into
v4.4from
mergify/bp/v4.4/pr-15818

Conversation

@mergify

@mergify mergify Bot commented Oct 9, 2026

Copy link
Copy Markdown

Problem

Summary of Changes

  • Moves the ComputeMeter struct from the program-runtime crate into the transaction-context crate.
  • ComputeMeter becomes a constructor parameter of TransactionContext (instead of InvokeContext).
  • Adds the DEFAULT_INSTRUCTION_COMPUTE_UNIT_LIMIT to the transaction-context crate, too.
  • Redirects the helper functions:
    • InvokeContext::consume()
    • InvokeContext::consume_checked()
    • InvokeContext::get_remaining()
    • InvokeContext::mock_set_remaining()

Testing

This is pure code movement, no tests had to be adjusted.


This is an automatic backport of pull request #15818 done by Mergify.

…ntext` (#15818)

* Moves ComputeMeter from InvokeContext to TransactionContext.

* Review feedback

(cherry picked from commit 75dd3a2)

# Conflicts:
#	Cargo.lock
#	program-runtime/Cargo.toml
@mergify
mergify Bot requested a review from a team as a code owner October 9, 2026 12:37
@mergify mergify Bot added the conflicts label Oct 9, 2026
@mergify mergify Bot assigned Lichtso Oct 9, 2026
@mergify

mergify Bot commented Oct 9, 2026

Copy link
Copy Markdown
Author

Cherry-pick of 75dd3a2 has failed:

On branch mergify/bp/v4.4/pr-15818
Your branch is up to date with 'origin/v4.4'.

You are currently cherry-picking commit 75dd3a2.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   dev-bins/Cargo.lock
	modified:   program-runtime/src/cpi.rs
	modified:   program-runtime/src/invoke_context.rs
	modified:   program-runtime/src/lib.rs
	modified:   program-runtime/src/vm.rs
	modified:   program-test/src/lib.rs
	modified:   programs/bpf_loader/src/lib.rs
	modified:   programs/sbf/Cargo.lock
	modified:   programs/vote/src/vote_processor.rs
	modified:   programs/zk-elgamal-proof/src/lib.rs
	modified:   rpc/src/rpc.rs
	modified:   runtime/src/bank/builtins/core_bpf_migration/mod.rs
	modified:   runtime/src/bank/tests.rs
	modified:   svm/src/conformance/setup.rs
	modified:   svm/src/conformance/txn/harness.rs
	modified:   svm/src/transaction_processor.rs
	modified:   syscalls/src/lib.rs
	modified:   syscalls/src/logging.rs
	modified:   syscalls/src/mem_ops.rs
	modified:   syscalls/src/sysvar.rs
	modified:   transaction-context/Cargo.toml
	modified:   transaction-context/src/lib.rs
	modified:   transaction-context/src/transaction.rs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   Cargo.lock
	both modified:   program-runtime/Cargo.toml

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify

mergify Bot commented Oct 9, 2026

Copy link
Copy Markdown
Author

The Firedancer team maintains a line-for-line reimplementation of the
native programs, and until native programs are moved to BPF, those
implementations must exactly match their Agave counterparts.
If this PR represents a change to a native program implementation (not
tests), please include a reviewer from the Firedancer team. And please
keep refactors to a minimum.

@anza-xyz anza-xyz deleted a comment from mergify Bot Oct 9, 2026
@Lichtso Lichtso removed the conflicts label Oct 9, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.58824% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.4%. Comparing base (968b24c) to head (4c2e2a5).

Additional details and impacted files
@@            Coverage Diff            @@
##             v4.4   #15919     +/-   ##
=========================================
- Coverage    82.4%    82.4%   -0.1%     
=========================================
  Files         934      934             
  Lines      372021   371928     -93     
=========================================
- Hits       306697   306559    -138     
- Misses      65324    65369     +45     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Lichtso
Lichtso requested a review from buffalojoec October 9, 2026 14:40

@buffalojoec buffalojoec 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.

LGTM, let's just make sure we really need it backported first.

@Lichtso
Lichtso merged commit d8f67d0 into v4.4 Oct 13, 2026
53 checks passed
@Lichtso
Lichtso deleted the mergify/bp/v4.4/pr-15818 branch October 13, 2026 13:19
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.

4 participants