Skip to content

feat(tests, spec-specs): raise EIP-7954 max code size to 64KiB - #2987

Merged
danceratopz merged 3 commits into
ethereum:forks/amsterdamfrom
spencer-tb:eips/amsterdam/eip-7954-64kib
Jun 16, 2026
Merged

feat(tests, spec-specs): raise EIP-7954 max code size to 64KiB#2987
danceratopz merged 3 commits into
ethereum:forks/amsterdamfrom
spencer-tb:eips/amsterdam/eip-7954-64kib

Conversation

@spencer-tb

@spencer-tb spencer-tb commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

🗒️ Description

Apply the EIP-7954 constant update from ethereum/EIPs#11540.

Required changes:

  • Initcode generator: widen the deploy-code-length PUSH2 to PUSH3 once code exceeds 64 KiB-1.
  • test_max_code_size_fork_transition: deploy parent.max_code_size() + 1 so the code size boundary is exercised via the code deposit check in isolation from the initcode-size limit.
  • test_cases.md: drop the stale test_max_initcode_size_gas_metering_via_create row (moved to the EIP-8037 suite), document test_warm_after_failed_create_over_max_code_size, and update the transition test row.

🔗 Related Issues or PRs

EIP-7954 tracker:

✅ 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).

Cute Animal Picture

cute animal

@spencer-tb spencer-tb added A-spec-specs Area: Specification—The Ethereum specification itself (eg. `src/ethereum/*`) C-feat Category: an improvement or new feature A-tests Area: Consensus tests. P-medium labels Jun 15, 2026
@spencer-tb
spencer-tb force-pushed the eips/amsterdam/eip-7954-64kib branch from b9194d3 to 7a55901 Compare June 15, 2026 12:22
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.28%. Comparing base (b1a898f) to head (46a8ddb).
⚠️ Report is 5 commits behind head on forks/amsterdam.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           forks/amsterdam    #2987      +/-   ##
===================================================
- Coverage            90.52%   81.28%   -9.24%     
===================================================
  Files                  535      620      +85     
  Lines                32895    36641    +3746     
  Branches              3022     3311     +289     
===================================================
+ Hits                 29778    29784       +6     
- Misses                2595     6335    +3740     
  Partials               522      522              
Flag Coverage Δ
unittests 81.28% <100.00%> (-9.24%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

@spencer-tb
spencer-tb force-pushed the eips/amsterdam/eip-7954-64kib branch from 7a55901 to 27a19ea Compare June 15, 2026 13:36
@spencer-tb
spencer-tb requested a review from danceratopz June 15, 2026 13:39
@spencer-tb
spencer-tb marked this pull request as ready for review June 15, 2026 13:39
@LouisTsai-Csie
LouisTsai-Csie self-requested a review June 15, 2026 15:24

@danceratopz danceratopz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Will spend a bit more time on this tomorrow.

Comment thread tests/amsterdam/eip7954_increase_max_contract_size/test_fork_transition.py Outdated

@LouisTsai-Csie LouisTsai-Csie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Leave a note here, not blocking the merge but hope this could be added to the tracker or resolved in a follow-up PR.

  • build_unique_contract_initcode: this still uses the legacy max code size, since the deployed contract is based on Jochemnet, which is not updated to the latest spec.
  • test_tstore_rollback_on_failed_create: the test logic is correct but the docstring description needs updated.
  • test_codesize_valid: I believe this is stress testing the CODESIZE opcode but the new spec exceeds the old limit, we should update this too.
  • test_create_address_warm_after_fail: there are parametrization that is touching the old code size limit.
  • test_create_large_result, test_create_oo_gafter_max_codesize: this one is capped at Prauge, not sure why but it should support from Osaka to Amsterdam.
  • test_codecopy_benchmark: the max code size is hardcoded to 24576
  • Spec class object under block access list is still using hardcoded 24576 (you could find it by searching 24_576).
  • test_create2_code_size_limit and test_create_code_size_limit: docstring needs updated, 0x8000 -> 0x10000

There are some cases marked with @pytest.mark.valid_before("EIP7954"), i think we should revisit these cases again later and try to make it more general for different max code size length.

spencer-tb and others added 2 commits June 16, 2026 12:05
Co-authored-by: danceratopz <danceratopz@gmail.com>
@spencer-tb

Copy link
Copy Markdown
Contributor Author

Leave a note here, not blocking the merge but hope this could be added to the tracker or resolved in a follow-up PR.

Added these to the EIP tracker issue: #2028 (comment)

@danceratopz danceratopz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! LGTM! Will add a follow-up PR with a new test case.

@danceratopz
danceratopz merged commit e35d103 into ethereum:forks/amsterdam Jun 16, 2026
26 checks passed
@danceratopz

Copy link
Copy Markdown
Member

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 P-medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants