feat(tests): EIP-8037 reject tx when gas_limit covers regular but not state intrinsic#2876
Merged
spencer-tb merged 3 commits intoJun 10, 2026
Conversation
6 tasks
… state intrinsic EIP-8037 splits a transaction's intrinsic gas into a regular component and a state component (NEW_ACCOUNT for CREATE, NEW_ACCOUNT + AUTH_BASE per authorization for set_code). The sender must cover both: any `gas_limit < regular + state` is invalid with `INTRINSIC_GAS_TOO_LOW`. The existing `test_create_tx_intrinsic_gas_boundary` pins gas_limit at the upper boundary (`total - 1`). This change adds two functions that pin gas_limit at the lower end of the rejected interval — `regular` and `regular + 1` — where an implementation that omits the state component from its pre-validate intrinsic check would erroneously accept the transaction: - `test_create_tx_below_total_intrinsic` (CREATE) - `test_set_code_tx_below_total_intrinsic` (set_code, N = 1, 2, 3 auths)
ee5de04 to
6af8798
Compare
spencer-tb
previously approved these changes
Jun 10, 2026
spencer-tb
left a comment
Contributor
There was a problem hiding this comment.
LGTM!
Added suggestion for extra case!
…state_gas_set_code.py
…state_gas_set_code.py
spencer-tb
approved these changes
Jun 10, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #2876 +/- ##
===================================================
- Coverage 90.53% 90.52% -0.01%
===================================================
Files 535 535
Lines 32897 32893 -4
Branches 3021 3021
===================================================
- Hits 29782 29778 -4
Misses 2596 2596
Partials 519 519
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
EIP-8037 splits a transaction's intrinsic gas into a regular component and a state component (NEW_ACCOUNT for CREATE, NEW_ACCOUNT + AUTH_BASE per authorization for set_code). The sender must cover both: any
gas_limit < regular + stateis invalid withINTRINSIC_GAS_TOO_LOW.The existing
test_create_tx_intrinsic_gas_boundarypins gas_limit at the upper boundary (total - 1). This change adds two functions that pin gas_limit at the lower end of the rejected interval—regularandregular + 1—where an implementation that omits the state component from its pre-validate intrinsic check would erroneously accept the transaction:test_create_tx_below_total_intrinsic(CREATE)test_set_code_tx_below_total_intrinsic(set_code, N = 1, 2, 3 auths)🔗 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.