Skip to content

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

Open
chfast wants to merge 1 commit into
masterfrom
amsterdam/7954
Open

Implement EIP-7954: "Increase Maximum Contract Size"#1575
chfast wants to merge 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.41%. Comparing base (c1a0c7c) to head (1f62a80).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1575   +/-   ##
=======================================
  Coverage   97.41%   97.41%           
=======================================
  Files         163      163           
  Lines       14680    14699   +19     
  Branches     3407     3410    +3     
=======================================
+ Hits        14300    14319   +19     
  Misses        280      280           
  Partials      100      100           
Flag Coverage Δ
eest-develop 89.37% <62.50%> (-0.05%) ⬇️
eest-develop-gmp 26.04% <22.72%> (-0.03%) ⬇️
eest-legacy 17.49% <9.09%> (-0.01%) ⬇️
eest-libsecp256k1 27.66% <22.72%> (-0.03%) ⬇️
eest-stable 89.35% <62.50%> (-0.05%) ⬇️
evmone-unittests 92.64% <95.45%> (+0.02%) ⬆️

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

Components Coverage Δ
core 95.97% <100.00%> (+<0.01%) ⬆️
tooling 90.32% <ø> (ø)
tests 99.80% <100.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
lib/evmone/instructions_calls.cpp 99.23% <100.00%> (+0.01%) ⬆️
test/state/host.cpp 100.00% <100.00%> (ø)
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 on lines +219 to 222
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)
return {EVMC_OUT_OF_GAS, gas_left};
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).
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