Skip to content

Implement EIP-7954: "Increase Maximum Contract Size" - #1575

Merged
chfast merged 1 commit into
masterfrom
amsterdam/7954
Aug 10, 2026
Merged

Implement EIP-7954: "Increase Maximum Contract Size"#1575
chfast merged 1 commit into
masterfrom
amsterdam/7954

Conversation

@chfast

@chfast chfast commented Jun 29, 2026

Copy link
Copy Markdown
Member

Amsterdam raises the deployed contract code limit from 0x6000 (EIP-170) to 0x10000, and the init code limit from 0xC000 to 0x20000 (EIP-3860 keeps the init code limit at twice the code limit).

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.72%. Comparing base (155eb66) to head (0fd3a00).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1575   +/-   ##
=======================================
  Coverage   97.71%   97.72%           
=======================================
  Files         171      171           
  Lines       15607    15629   +22     
  Branches     3610     3613    +3     
=======================================
+ Hits        15251    15273   +22     
  Misses        269      269           
  Partials       87       87           
Flag Coverage Δ
eest-develop 88.58% <62.50%> (-0.05%) ⬇️
eest-develop-gmp 26.50% <20.00%> (-0.03%) ⬇️
eest-legacy 17.14% <8.00%> (-0.02%) ⬇️
eest-libsecp256k1 28.80% <20.00%> (-0.03%) ⬇️
eest-stable 88.58% <62.50%> (-0.05%) ⬇️
evmone-unittests 93.44% <96.00%> (+0.02%) ⬆️

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

Components Coverage Δ
core 96.10% <100.00%> (+<0.01%) ⬆️
tooling 91.92% <ø> (ø)
tests 99.80% <100.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
lib/evmone/instructions_calls.cpp 99.27% <100.00%> (+0.01%) ⬆️
test/state/host.cpp 99.54% <100.00%> (+<0.01%) ⬆️
test/state/state.cpp 99.69% <100.00%> (+<0.01%) ⬆️
test/unittests/state_transition_create_test.cpp 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates evmone’s protocol limits for the Amsterdam fork to implement EIP-7954, increasing the maximum deployed contract code size and the corresponding initcode size limit (per EIP-3860’s “2× code size” rule).

Changes:

  • Introduce Amsterdam-specific constants for max deployed code size (0x10000) and max initcode size (0x20000).
  • Update CREATE/initcode size validation in both the EVM (CREATE opcode path) and transaction validation logic for Amsterdam.
  • Update the test host’s created-code size enforcement and add unit tests for the new deployed code-size boundary.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/unittests/state_transition_create_test.cpp Adds Amsterdam EIP-7954 boundary tests for create transactions (max code size / above max).
test/state/state.cpp Raises transaction-level initcode size limit for Amsterdam during validation.
test/state/host.cpp Raises created-code size enforcement limit for Amsterdam in the test host implementation.
lib/evmone/instructions_calls.cpp Raises CREATE/CREATE2 initcode size limit in the interpreter for Amsterdam.
lib/evmone/constants.hpp Adds Amsterdam max code/initcode size constants.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/unittests/state_transition_create_test.cpp
Comment thread test/unittests/state_transition_create_test.cpp

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread lib/evmone/instructions_calls.cpp
Amsterdam raises the deployed contract code limit from 0x6000 (EIP-170)
to 0x10000, and the init code limit from 0xC000 to 0x20000 (EIP-3860
keeps the initcode limit at twice the code limit).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (2)

lib/evmone/instructions_calls.cpp:222

  • The CREATE/CREATE2 path for the raised initcode limit remains untested. The existing evm_eip3860_initcode_test.cpp covers both opcodes only at Paris/Shanghai and the 0xC000 boundary, while the new state-transition tests exercise contract output size rather than the CREATE operand size. Please extend those opcode tests with Amsterdam cases at 0x20000 and 0x20001, and retain a pre-Amsterdam boundary case.
    const size_t max_init_code_size =
        state.rev >= EVMC_AMSTERDAM ? MAX_INITCODE_SIZE_AMSTERDAM : MAX_INITCODE_SIZE;
    if (state.rev >= EVMC_SHANGHAI && init_code_size > max_init_code_size)

test/state/state.cpp:530

  • The Amsterdam transaction-initcode boundary is not exercised by the added tests: both new create transactions use the short ret(...) program, so this branch could still reject 0x20000-byte initcode or accept 0x20001 bytes unnoticed. Please add transaction-validation cases for Amsterdam at and above the new limit, ideally also pinning Osaka to the old 0xC000 limit.
    const size_t max_initcode_size =
        rev >= EVMC_AMSTERDAM ? MAX_INITCODE_SIZE_AMSTERDAM : MAX_INITCODE_SIZE;
    if (rev >= EVMC_SHANGHAI && !tx.to.has_value() && tx.data.size() > max_initcode_size)

@chfast
chfast merged commit d321ee4 into master Aug 10, 2026
24 checks passed
@chfast
chfast deleted the amsterdam/7954 branch August 10, 2026 23:19
chfast added a commit that referenced this pull request Aug 11, 2026
Amsterdam raises the deployed contract code limit from 0x6000 (EIP-170)
to 0x10000, and the init code limit from 0xC000 to 0x20000 (EIP-3860
keeps the init code limit at twice the code limit).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants