Skip to content

Track intrinsic gas pseudo opcodes in meterBundle#3573

Draft
niran wants to merge 1 commit into
mainfrom
niran/meter-bundle-intrinsic-gas
Draft

Track intrinsic gas pseudo opcodes in meterBundle#3573
niran wants to merge 1 commit into
mainfrom
niran/meter-bundle-intrinsic-gas

Conversation

@niran

@niran niran commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add opt-in pseudo opcode buckets for transaction intrinsic gas in meterBundle opcode gas output
  • tag top-level value transfers by new vs existing recipient account
  • add regression coverage for top-level value transfers and CALL-with-value new-account gas deltas

Testing

  • cargo +nightly fmt --package base-metering
  • cargo test -p base-metering value -- --nocapture
  • cargo test -p base-metering metered_opcodes_parse_recognizes_intrinsic_pseudo_opcodes

type=routine
risk=low
impact=sev5

@cb-heimdall

Copy link
Copy Markdown
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@niran niran force-pushed the niran/meter-bundle-intrinsic-gas branch from a8da0b0 to 4261fd4 Compare June 24, 2026 16:32
Comment thread crates/execution/metering/src/meter.rs Outdated
Comment thread crates/execution/metering/src/meter.rs
@niran niran force-pushed the niran/meter-bundle-intrinsic-gas branch from 4261fd4 to b8f0e17 Compare June 24, 2026 16:56
Comment thread crates/execution/metering/src/meter.rs Outdated
@niran niran force-pushed the niran/meter-bundle-intrinsic-gas branch 2 times, most recently from f15a52a to 9c69bbd Compare June 24, 2026 17:28
Comment thread crates/execution/metering/src/meter.rs Outdated
@niran niran force-pushed the niran/meter-bundle-intrinsic-gas branch from 9c69bbd to 3a7621c Compare June 24, 2026 17:33
Comment thread crates/execution/metering/src/meter.rs
@niran niran force-pushed the niran/meter-bundle-intrinsic-gas branch from 3a7621c to 1a24d03 Compare June 24, 2026 17:38
Comment thread crates/execution/metering/src/meter.rs
@niran niran force-pushed the niran/meter-bundle-intrinsic-gas branch from 1a24d03 to b1bcfba Compare June 24, 2026 17:48
Comment thread crates/execution/metering/src/meter.rs Outdated
@niran niran force-pushed the niran/meter-bundle-intrinsic-gas branch 2 times, most recently from caa0c02 to 275a455 Compare June 24, 2026 17:59
Comment thread crates/execution/metering/src/meter.rs
Comment thread crates/execution/metering/src/meter.rs Outdated
Comment thread crates/execution/metering/src/meter.rs Outdated
@niran niran force-pushed the niran/meter-bundle-intrinsic-gas branch 2 times, most recently from b76a5ca to bcf3b2c Compare June 24, 2026 18:35
Comment thread crates/execution/metering/src/meter.rs Outdated
@niran niran force-pushed the niran/meter-bundle-intrinsic-gas branch from bcf3b2c to 6e6ab19 Compare June 24, 2026 19:31
@github-actions

Copy link
Copy Markdown
Contributor

<!-- CLAUDE_REVIEW_SUMMARY -->

Review Summary

This revision addresses all 11 prior review findings. The changes are well-structured and the code quality is good.

Previously raised issues — now resolved

Finding Resolution
Missing access list / authorization gas in INTRINSIC_TOTAL Now computed and included
No early return when pseudo_opcodes is empty Early return added at line 413
live_value_recipients loop unconditionally doing I/O Guarded by meters_value_transfer_effects flag
pending_state not consulted for account liveness lookup_value_recipient_is_dead now checks pending_state.bundle_state first
Missing EIP-3860 initcode word cost INTRINSIC_INITCODE_WORD component now included
live_value_recipients populated before checking revert Now gated on tx_succeeded
Unnecessary .collect before .extend Removed; iterator passed directly
Internal CALL/CREATE not tracked in liveness cache Acknowledged with doc comment (lines 725-728)
HashSet of String for fixed pseudo opcodes Changed to HashSet of static str
Local gas constant definitions Constants now imported from revm::context_interface::cfg::gas
TX_EFFECT entries emitted for reverted txs Now gated on tx_succeeded in intrinsic_gas_entries

Current state

No new issues found. The implementation is clean:

  • Gas constants are imported from revm (except INTRINSIC_BASE_GAS = 21_000, which is a universal constant unchanged since Ethereum genesis)
  • The opt-in pseudo opcode feature is properly gated to avoid overhead when disabled
  • Account liveness checks correctly consult pending state before canonical state
  • Value transfer effect classification is conditioned on transaction success
  • Test coverage includes top-level value transfers, CALL-with-value to new vs existing accounts, and case-insensitive pseudo opcode parsing

@github-actions

Copy link
Copy Markdown
Contributor

✅ base-std fork tests: all 616 passed

base/base is fully in sync with the base-std spec.

Dependency Ref Commit
base-std main 4658f1b7
base-anvil 0092692587d8d064dd2c6923ce26a682c58f3694 00926925

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.

2 participants