feat(spec-specs, tests): EIP-8037 - per-dimension block gas limit check at tx inclusion#2703
Merged
spencer-tb merged 3 commits intoethereum:eips/amsterdam/eip-8037from Apr 19, 2026
Conversation
762bcfb to
d6b99c2
Compare
d6b99c2 to
1568424
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## eips/amsterdam/eip-8037 #2703 +/- ##
==========================================================
Coverage ? 88.18%
==========================================================
Files ? 524
Lines ? 31120
Branches ? 3036
==========================================================
Hits ? 27444
Misses ? 3161
Partials ? 515
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:
|
3e1d7c4 to
44b47cc
Compare
c095a54 to
76392ef
Compare
76392ef to
de20761
Compare
Cleanups to the per-dimension block gas inclusion tests: - Combine `test_block_state_gas_limit_exact_fit` and `test_block_state_gas_limit_exceeded` into `test_block_state_gas_limit_boundary` parametrized `delta=[0, 1]` (ids `exact_fit`, `exceeded`) and inline the `_block_state_gas_limit_setup` helper. Removes ~45 lines with no coverage loss. - Fix docstring references in both boundary cases: state contribution is `tx.gas - intrinsic_regular`, not `tx.gas - TX_MAX_GAS_LIMIT`. - Tighten wording in `test_creation_tx_regular_check_subtracts_intrinsic_state` and add assertion messages that spell out the old-vs-new formula discrimination. - Apply ruff format (drop an unneeded line wrap on `create_intrinsic_regular` in `test_creation_tx_state_check_exceeded`). Co-authored-by: kclowes <kclowes@users.noreply.github.com>
de20761 to
75df96e
Compare
4 tasks
f253db1
into
ethereum:eips/amsterdam/eip-8037
13 of 16 checks passed
marioevz
pushed a commit
that referenced
this pull request
Apr 20, 2026
…ck at tx inclusion (#2703) * feat(tests): 8037 Check 2d gas before tx inclusion * feat(spec-specs): More tests for 2d tx inclusion spec change * fix(tests): consolidate state gas boundary tests and clean docstrings Cleanups to the per-dimension block gas inclusion tests: - Combine `test_block_state_gas_limit_exact_fit` and `test_block_state_gas_limit_exceeded` into `test_block_state_gas_limit_boundary` parametrized `delta=[0, 1]` (ids `exact_fit`, `exceeded`) and inline the `_block_state_gas_limit_setup` helper. Removes ~45 lines with no coverage loss. - Fix docstring references in both boundary cases: state contribution is `tx.gas - intrinsic_regular`, not `tx.gas - TX_MAX_GAS_LIMIT`. - Tighten wording in `test_creation_tx_regular_check_subtracts_intrinsic_state` and add assertion messages that spell out the old-vs-new formula discrimination. - Apply ruff format (drop an unneeded line wrap on `create_intrinsic_regular` in `test_creation_tx_state_check_exceeded`). Co-authored-by: kclowes <kclowes@users.noreply.github.com> --------- Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
4 tasks
spencer-tb
added a commit
that referenced
this pull request
Apr 20, 2026
…ck at tx inclusion (#2703) * feat(tests): 8037 Check 2d gas before tx inclusion * feat(spec-specs): More tests for 2d tx inclusion spec change * fix(tests): consolidate state gas boundary tests and clean docstrings Cleanups to the per-dimension block gas inclusion tests: - Combine `test_block_state_gas_limit_exact_fit` and `test_block_state_gas_limit_exceeded` into `test_block_state_gas_limit_boundary` parametrized `delta=[0, 1]` (ids `exact_fit`, `exceeded`) and inline the `_block_state_gas_limit_setup` helper. Removes ~45 lines with no coverage loss. - Fix docstring references in both boundary cases: state contribution is `tx.gas - intrinsic_regular`, not `tx.gas - TX_MAX_GAS_LIMIT`. - Tighten wording in `test_creation_tx_regular_check_subtracts_intrinsic_state` and add assertion messages that spell out the old-vs-new formula discrimination. - Apply ruff format (drop an unneeded line wrap on `create_intrinsic_regular` in `test_creation_tx_state_check_exceeded`). Co-authored-by: kclowes <kclowes@users.noreply.github.com> --------- Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
spencer-tb
added a commit
to spencer-tb/execution-specs
that referenced
this pull request
Apr 21, 2026
…ck at tx inclusion (ethereum#2703) * feat(tests): 8037 Check 2d gas before tx inclusion * feat(spec-specs): More tests for 2d tx inclusion spec change * fix(tests): consolidate state gas boundary tests and clean docstrings Cleanups to the per-dimension block gas inclusion tests: - Combine `test_block_state_gas_limit_exact_fit` and `test_block_state_gas_limit_exceeded` into `test_block_state_gas_limit_boundary` parametrized `delta=[0, 1]` (ids `exact_fit`, `exceeded`) and inline the `_block_state_gas_limit_setup` helper. Removes ~45 lines with no coverage loss. - Fix docstring references in both boundary cases: state contribution is `tx.gas - intrinsic_regular`, not `tx.gas - TX_MAX_GAS_LIMIT`. - Tighten wording in `test_creation_tx_regular_check_subtracts_intrinsic_state` and add assertion messages that spell out the old-vs-new formula discrimination. - Apply ruff format (drop an unneeded line wrap on `create_intrinsic_regular` in `test_creation_tx_state_check_exceeded`). Co-authored-by: kclowes <kclowes@users.noreply.github.com> --------- Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
spencer-tb
added a commit
to spencer-tb/execution-specs
that referenced
this pull request
Apr 21, 2026
…ck at tx inclusion (ethereum#2703) * feat(tests): 8037 Check 2d gas before tx inclusion * feat(spec-specs): More tests for 2d tx inclusion spec change * fix(tests): consolidate state gas boundary tests and clean docstrings Cleanups to the per-dimension block gas inclusion tests: - Combine `test_block_state_gas_limit_exact_fit` and `test_block_state_gas_limit_exceeded` into `test_block_state_gas_limit_boundary` parametrized `delta=[0, 1]` (ids `exact_fit`, `exceeded`) and inline the `_block_state_gas_limit_setup` helper. Removes ~45 lines with no coverage loss. - Fix docstring references in both boundary cases: state contribution is `tx.gas - intrinsic_regular`, not `tx.gas - TX_MAX_GAS_LIMIT`. - Tighten wording in `test_creation_tx_regular_check_subtracts_intrinsic_state` and add assertion messages that spell out the old-vs-new formula discrimination. - Apply ruff format (drop an unneeded line wrap on `create_intrinsic_regular` in `test_creation_tx_state_check_exceeded`). Co-authored-by: kclowes <kclowes@users.noreply.github.com> --------- Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
spencer-tb
added a commit
that referenced
this pull request
Apr 21, 2026
…ck at tx inclusion (#2703) * feat(tests): 8037 Check 2d gas before tx inclusion * feat(spec-specs): More tests for 2d tx inclusion spec change * fix(tests): consolidate state gas boundary tests and clean docstrings Cleanups to the per-dimension block gas inclusion tests: - Combine `test_block_state_gas_limit_exact_fit` and `test_block_state_gas_limit_exceeded` into `test_block_state_gas_limit_boundary` parametrized `delta=[0, 1]` (ids `exact_fit`, `exceeded`) and inline the `_block_state_gas_limit_setup` helper. Removes ~45 lines with no coverage loss. - Fix docstring references in both boundary cases: state contribution is `tx.gas - intrinsic_regular`, not `tx.gas - TX_MAX_GAS_LIMIT`. - Tighten wording in `test_creation_tx_regular_check_subtracts_intrinsic_state` and add assertion messages that spell out the old-vs-new formula discrimination. - Apply ruff format (drop an unneeded line wrap on `create_intrinsic_regular` in `test_creation_tx_state_check_exceeded`). Co-authored-by: kclowes <kclowes@users.noreply.github.com> --------- Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
9 tasks
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
Implements ethereum/EIPs#11536 (update to EIP-8037): at transaction inclusion time,
check_transactionenforces the block gas limit per gas dimension (regular, state) rather than only on the regular component. For each dimension the worst-case contribution must fit in the remaining budget. Block-end validation still enforcesmax(block_regular, block_state) <= block.gas_limit.Spec Change
Adds per-dimension checks to
check_transaction:intrinsicis now passed intocheck_transactionso both formulas have access to the split intrinsic cost. Both checks raiseGasUsedExceedsLimitError, which maps toTransactionException.GAS_ALLOWANCE_EXCEEDED.Tests
test_block_state_gas_limit_boundary[exact_fit](accepted)test_block_state_gas_limit_boundary[exceeded](rejected)test_creation_tx_regular_check_subtracts_intrinsic_statetest_single_tx_state_check_exceeds_block_limittest_creation_tx_state_check_exceeded🔗 Related Issues or PRs
✅ Checklist
just statictype(scope):.