Implement EIP-7954: "Increase Maximum Contract Size"#1575
Open
chfast wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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 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).
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.
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).