fix(spec-specs, tests): EIP-8037 strict block-gas inclusion rule#2892
Open
chfast wants to merge 1 commit into
Open
fix(spec-specs, tests): EIP-8037 strict block-gas inclusion rule#2892chfast wants to merge 1 commit into
chfast wants to merge 1 commit into
Conversation
EIP-8037 specifies the per-dimension inclusion check at block start as:
min(TX_MAX_GAS_LIMIT, tx.gas) <= regular_gas_available
tx.gas <= state_gas_available
EELS Amsterdam was subtracting intrinsic.state / intrinsic.regular from
tx.gas in each dimension, which let a transaction with non-zero state
intrinsic (CREATE, EIP-7702 set_code) be included when tx.gas exceeded
block.gas_limit by up to intrinsic.regular (state-dim) or intrinsic.state
(regular-dim). evmone, revm, and erigon enforce the EIP literally and
reject; pre-bump geth rejects too.
Add a parametrized test under EIP-8037 covering the boundary across all
post-EIP-7702 tx types and contract-creation kinds, at two block-gas-limit
values to avoid hard-coded-cap false-positives.
Member
|
We are in the process of merging EIP-8037 to Once the PR is merged we can point this to the |
This was referenced May 26, 2026
chfast
added a commit
to ipsilon/evmone
that referenced
this pull request
Jun 2, 2026
EIP-8037 §"Transaction validation" rule 2 requires a per-tx inclusion
check against the per-dimension remaining budget:
min(TX_MAX_GAS_LIMIT, tx.gas) <= regular_gas_available
tx.gas <= state_gas_available
Add `state_block_gas_left` parameter to `validate_transaction` and
enforce both checks for Amsterdam+; default to 0 in the header for
pre-Amsterdam call sites that ignore state-gas. Errors are
`GAS_LIMIT_REACHED` (mapped to `TransactionException.GAS_ALLOWANCE_EXCEEDED`
by EEST).
Also flip the existing Amsterdam intrinsic-cap check from
`GAS_LIMIT_EXCEEDS_MAXIMUM` to `INTRINSIC_GAS_TOO_LOW`: EELS raises
`InsufficientTransactionGasError` here ("the tx can't pay its
intrinsic within the reservoir bound"), not the EIP-7825 absolute-cap
exception.
Note on EELS divergence: amsterdam/fork.py:561-583 currently subtracts
intrinsic.state / intrinsic.regular from tx.gas in each dimension
(`min(TX_MAX_GAS_LIMIT, tx.gas - intrinsic.state)` etc.), which is
more permissive than the EIP. ethereum/execution-specs#2892 aligns
EELS back with the EIP literal. This implementation follows the EIP
text directly — same as revm/erigon/pre-bump-geth.
`test::transition` (the TestState wrapper used by state-transition
unit tests and state tests) passes `block_gas_left` as both budgets,
since those tests run a single tx in a fresh block.
evmone-unittests: 1116 / 1116 pass.
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
EIP-8037 specifies the per-dimension inclusion check at block start as:
EELS Amsterdam was subtracting intrinsic.state / intrinsic.regular from tx.gas in each dimension, which let a transaction with non-zero state intrinsic (CREATE, EIP-7702 set_code) be included when tx.gas exceeded block.gas_limit by up to intrinsic.regular (state-dim) or intrinsic.state (regular-dim). evmone, revm, and erigon enforce the EIP literally and reject; pre-bump geth rejects too.
Add a parametrized test under EIP-8037 covering the boundary across all post-EIP-7702 tx types and contract-creation kinds, at two block-gas-limit values to avoid hard-coded-cap false-positives.
🔗 Related Issues or PRs
N/A.
✅ Checklist
just statictype(scope):.mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_frommarker.