feat(spec-specs, tests): remove per-tx state gas pre-check and add 2D block gas validity test#2583
Merged
spencer-tb merged 2 commits intoMar 28, 2026
Conversation
db26b2c to
9a940d9
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## eips/amsterdam/eip-8037 #2583 +/- ##
==========================================================
Coverage ? 83.63%
==========================================================
Files ? 642
Lines ? 39705
Branches ? 4057
==========================================================
Hits ? 33207
Misses ? 5798
Partials ? 700
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…action The per-tx state gas check (`tx.gas > state_gas_available`) reserved a transaction's full gas limit against the state gas budget, which double-counts the tx's single gas budget across both dimensions. This undermines the 2D gas model where `max(regular, state)` allows blocks to be full on one dimension while having room in the other. Block-end validation (`max(block_regular_gas_used, block_state_gas_used) <= gas_limit`) already catches state gas overflow. Closes ethereum#2578
Verify that a block with 5 SSTORE transactions is valid under 2D gas accounting (max(regular, state) <= gas_limit) even when sum(tx_gas_used) exceeds gas_limit. Catches clients using 1D gasPool accounting.
9a940d9 to
cdeb839
Compare
a111d7f
into
ethereum:eips/amsterdam/eip-8037
12 checks passed
spencer-tb
added a commit
to spencer-tb/execution-specs
that referenced
this pull request
Apr 1, 2026
… gas validity test (ethereum#2583) Co-authored-by: Stefan <22667037+qu0b@users.noreply.github.com>
marioevz
pushed a commit
that referenced
this pull request
Apr 9, 2026
… gas validity test (#2583) Co-authored-by: Stefan <22667037+qu0b@users.noreply.github.com>
github-merge-queue Bot
pushed a commit
to lambdaclass/ethrex
that referenced
this pull request
Apr 10, 2026
…ing (#6447) Bump BAL fixtures from v5.5.1 to v5.6.1 across Makefile, CI workflows, docs, and fixture URL files. Fix two EIP-8037 correctness issues in `system.rs`: move the `is_static` check to CREATE/CREATE2 handlers (Amsterdam+ only) before stack pops and gas charging, matching ethereum/execution-specs#2608; move `increase_state_gas(STATE_GAS_NEW_ACCOUNT)` into `generic_create()` after `MAX_INIT_CODE_SIZE` validation so oversized CREATE doesn't burn state gas for an account never created. Fix per-tx gas check in `levm/mod.rs` to use `block_regular_gas_used` instead of `max(regular, state)` per ethereum/execution-specs#2583, and apply `min(TX_MAX_GAS_LIMIT, tx.gas)` cap per EIP-7825. Applied across `execute_block`, `execute_block_pipeline`, and `execute_block_parallel`. Update `payload.rs` to track `remaining_gas` using regular gas capacity only for Amsterdam. All 1103 BAL consume-engine tests pass. Along with ethereum/execution-specs#2632
marioevz
pushed a commit
that referenced
this pull request
Apr 10, 2026
… gas validity test (#2583) Co-authored-by: Stefan <22667037+qu0b@users.noreply.github.com>
felix314159
pushed a commit
to felix314159/execution-specs
that referenced
this pull request
Apr 14, 2026
… gas validity test (ethereum#2583) Co-authored-by: Stefan <22667037+qu0b@users.noreply.github.com>
felix314159
pushed a commit
that referenced
this pull request
Apr 16, 2026
… gas validity test (#2583) Co-authored-by: Stefan <22667037+qu0b@users.noreply.github.com>
spencer-tb
added a commit
that referenced
this pull request
Apr 17, 2026
… gas validity test (#2583) Co-authored-by: Stefan <22667037+qu0b@users.noreply.github.com>
marioevz
pushed a commit
that referenced
this pull request
Apr 20, 2026
… gas validity test (#2583) Co-authored-by: Stefan <22667037+qu0b@users.noreply.github.com>
spencer-tb
added a commit
that referenced
this pull request
Apr 20, 2026
… gas validity test (#2583) Co-authored-by: Stefan <22667037+qu0b@users.noreply.github.com>
spencer-tb
added a commit
to spencer-tb/execution-specs
that referenced
this pull request
Apr 21, 2026
… gas validity test (ethereum#2583) Co-authored-by: Stefan <22667037+qu0b@users.noreply.github.com>
spencer-tb
added a commit
to spencer-tb/execution-specs
that referenced
this pull request
Apr 21, 2026
… gas validity test (ethereum#2583) Co-authored-by: Stefan <22667037+qu0b@users.noreply.github.com>
spencer-tb
added a commit
that referenced
this pull request
Apr 21, 2026
… gas validity test (#2583) Co-authored-by: Stefan <22667037+qu0b@users.noreply.github.com>
fselmo
pushed a commit
that referenced
this pull request
May 5, 2026
… gas validity test (#2583) Co-authored-by: Stefan <22667037+qu0b@users.noreply.github.com>
spencer-tb
added a commit
to spencer-tb/execution-specs
that referenced
this pull request
May 22, 2026
… gas validity test (ethereum#2583) Co-authored-by: Stefan <22667037+qu0b@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗒️ Description
Remove the per-tx state gas reservation check from
check_transaction. The checktx.gas > block_gas_limit - block_state_gas_useddouble-counts a tx's single gas budget across both dimensions, undermining the 2D gas model. Block-end validation (max(block_regular_gas_used, block_state_gas_used) <= gas_limit) already catches state gas overflow.Also adds a test (credit @qu0b) verifying 2D block gas validity when
sum(tx_gas_used) > gas_limit.🔗 Related Issues or PRs