Skip to content

feat(spec-specs, tests): add EIP-7954 Increase Maximum Contract Size#2850

Merged
marioevz merged 7 commits into
ethereum:forks/amsterdamfrom
Carsons-Eels:eips/amsterdam/eip-7954
May 15, 2026
Merged

feat(spec-specs, tests): add EIP-7954 Increase Maximum Contract Size#2850
marioevz merged 7 commits into
ethereum:forks/amsterdamfrom
Carsons-Eels:eips/amsterdam/eip-7954

Conversation

@Carsons-Eels
Copy link
Copy Markdown
Contributor

@Carsons-Eels Carsons-Eels commented May 13, 2026

🗒️ Description

Merge changes necessary for implementing EIP-7954 into the forks/amsterdam branch.

🔗 Related Issues or PRs

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    just static
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->
Baby Dumpling Squid” by Saspotato, CC BY-NC-SA 2.0

raxhvl and others added 5 commits April 27, 2026 16:52
* ✨ 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.
@Carsons-Eels Carsons-Eels requested review from fselmo and marioevz and removed request for fselmo May 13, 2026 16:30
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.14%. Comparing base (93984e2) to head (e315799).
⚠️ Report is 35 commits behind head on forks/amsterdam.

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     
Flag Coverage Δ
unittests 87.14% <100.00%> (-1.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@danceratopz danceratopz changed the title feat(spec-specs, spec-tests): add EIP-7954 Increase Maximum Contract Size feat(spec-specs, tests): add EIP-7954 Increase Maximum Contract Size May 13, 2026
@danceratopz danceratopz added A-tests Area: Consensus tests. C-feat Category: an improvement or new feature A-spec-specs Area: Specification—The Ethereum specification itself (eg. `src/ethereum/*`) labels May 13, 2026
@Carsons-Eels Carsons-Eels marked this pull request as ready for review May 14, 2026 18:23
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.
@Carsons-Eels
Copy link
Copy Markdown
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.

Copy link
Copy Markdown
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! I've added the remaining TODOs to the original EIP implementation issue here: #2028 (comment)

@marioevz marioevz merged commit c198ebf into ethereum:forks/amsterdam May 15, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-spec-specs Area: Specification—The Ethereum specification itself (eg. `src/ethereum/*`) A-tests Area: Consensus tests. C-feat Category: an improvement or new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants