feat(spec-specs, tests): add EIP-7954 Increase Maximum Contract Size#2850
Merged
marioevz merged 7 commits intoMay 15, 2026
Merged
Conversation
* ✨ feat: Tests for new contract size * ✨ feat: Gas metering of initcode * ✨ feat: Transition, Mainnet tests * 🧹 chore: Names * fix: use gas constant instead of hard-coded number * fix: remove references to old_max that are not in tests * fix: align with other forks; use 2*code_size for initcode size * chore: fix lint * refactor: simplify gas calculation with gas cost API; add post check * refactor: use opcode metadata for gas calc * feat(test): add max_code with max_init_code in same test * refactor: simplify calls to compute_create_address; no conditional necessary * 🧹 chore: Simplify docstring * 🧹 chore: Simplify opcode based testing * 🧹 chore: Better names * 🧹 chore: types * version Co-authored-by: felipe <fselmo2@gmail.com> * feat(test): use deterministic deploy for similar contracts * refactor: use same max-size self-checking contract for tests - DRY max size contract for mainnet by including the superset in one and removing subset tests --------- Co-authored-by: raxhvl <raxhvl@users.noreply.github.com> Co-authored-by: fselmo <fselmo2@gmail.com>
The 2D gas metering test for max initcode size via CREATE is an EIP-8037 concern and now lives in the 8037 test suite. The 7954 max initcode enforcement is covered by test_max_initcode_size_via_create.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #2850 +/- ##
===================================================
- Coverage 88.17% 87.14% -1.03%
===================================================
Files 577 586 +9
Lines 35659 35792 +133
Branches 3490 3364 -126
===================================================
- Hits 31442 31192 -250
- Misses 3654 3950 +296
- Partials 563 650 +87
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:
|
8 tasks
These ported_static tests hardcode sizes around the pre-EIP-7954 24 KiB MAX_CODE_SIZE / 48 KiB MAX_INITCODE_SIZE limits, so paths that previously failed now succeed on Amsterdam and break their Account.NONEXISTENT expectations. I marked them valid_before(EIP7954). The remaining 22 params still cover EIP-2929 warming on Amsterdam. Equivalent Amsterdam-side coverage is provided by eip7954_increase_max_contract_size/test_max_code_size.py and test_max_initcode_size.py, which size against fork.max_code_size() / fork.max_initcode_size() and follow the same creation-tx, CREATE, and CREATE2 paths with the new limits.
Contributor
Author
|
Some of the ported static tests were failing because of assumptions that no longer apply after 7954, I marked them only valid until 7954. See my commit message for detail. Going to add one test that will cover a small gap left over from this. |
marioevz
approved these changes
May 15, 2026
Member
marioevz
left a comment
There was a problem hiding this comment.
LGTM, thanks! I've added the remaining TODOs to the original EIP implementation issue here: #2028 (comment)
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
Merge changes necessary for implementing EIP-7954 into the forks/amsterdam branch.
🔗 Related Issues or PRs
forks/amsterdam#2846✅ Checklist
just statictype(scope):.mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.Cute Animal Picture
“Baby Dumpling Squid” by Saspotato, CC BY-NC-SA 2.0