feat(spec-specs,forks,tests): cap total transaction gas at 2^32 - 1 (EIP-8037) - #3582
Open
spencer-tb wants to merge 1 commit into
Open
spencer-tb wants to merge 1 commit into
spencer-tb wants to merge 1 commit into
Conversation
16 tasks
…AS_LIMIT (2^32-1)
spencer-tb
force-pushed
the
eips/amsterdam/eip-8037-tx-total-gas-limit-cap
branch
from
September 18, 2026 14:12
278a980 to
1f9496d
Compare
spencer-tb
marked this pull request as ready for review
September 18, 2026 14:15
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #3582 +/- ##
================================================
Coverage 94.47% 94.47%
================================================
Files 624 624
Lines 36969 36972 +3
Branches 3334 3335 +1
================================================
+ Hits 34925 34928 +3
Misses 1443 1443
Partials 601 601
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Cap each transaction's total gas limit (
tx.gas) at2^32 - 1in Amsterdam, as specified in ethereum/EIPs#12311.Under EIP-8037, the existing EIP-7825 cap applies only to execution gas. This new cap bounds the total gas limit, including the state gas reservoir.
Implementation
TX_MAX_TOTAL_GAS_LIMITand reject transactions above it before the intrinsic-gas checks. ReuseTransactionGasLimitExceededError, which already maps toGAS_LIMIT_EXCEEDS_MAXIMUM.fork.transaction_total_gas_limit_cap():Nonebefore EIP-8037 and2**32 - 1from activation.state_gas_reservoirrequest that would exceed the cap raises a test-correctness error.Test coverage
Boundary tests cover all five transaction types, accepting transactions at the cap and rejecting those one gas above it. The block gas limit is set to twice the cap, so rejection can be attributed to the transaction cap.
Fork-transition tests check both boundaries:
2^32 - 12^32The boundary test is skipped in
executemode because live-network block gas limits are too low to isolate this rule. Filled fixtures check the transaction-level error through the exception mappers.Related Issues or PRs
ethereum/EIPs#12311
Checklist
just static<type>(<area>): <title>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.