feat: EIP-7954 — double max code size and initcode limit (Amsterdam)#12
Merged
garyschulte merged 2 commits intoConsensys:mainfrom Apr 1, 2026
Merged
Conversation
garyschulte
reviewed
Mar 20, 2026
Collaborator
garyschulte
left a comment
There was a problem hiding this comment.
functionally good, needs cleanup for maintainability
- MAX_CODE_SIZE: 24576 → 32768 (Amsterdam+) - MAX_INITCODE_SIZE: 49152 → 65536 (Amsterdam+) Applies conditional limits in validation.zig (tx CREATE check), host.zig (setupCreate + finalizeCreate), and call.zig (CREATE + CREATE2 opcode initcode guards). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
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.
Summary
Implements EIP-7954 for the Amsterdam hardfork.
Doubles the contract size limits:
The new limits apply conditionally — pre-Amsterdam behaviour is unchanged.
Changes
src/handler/validation.zig— TX-level initcode size check uses65536for Amsterdam+src/interpreter/host.zig—setupCreateandfinalizeCreateuse32768/65536for Amsterdam+src/interpreter/opcodes/call.zig—CREATEandCREATE2initcode guards updatedPart of Amsterdam hardfork
Related PRs: EIP-7843 (SLOTNUM), EIP-8024 (DUPN/SWAPN/EXCHANGE), EIP-7708 (transfer logs), EIP-8037 (state gas reservoir)
Note
Medium Risk
Changes consensus-critical CREATE/CREATE2 validation and deployed-code limits gated on
SpecId.amsterdam, so incorrect gating or constant usage could cause fork-dependent execution mismatches.Overview
Implements EIP-7954 for Amsterdam by doubling contract size limits when
SpecId.amsterdamis enabled.CREATE/CREATE2 initcode size checks are updated across tx validation (
validation.zig), opcode execution (opcodes/call.zig), and host pre-exec guards (host.zig) to use65536(vs49152) for Amsterdam+. Deployed code size validation inHost.finalizeCreatenow uses32768(vs24576) for Amsterdam+.Adds shared primitives constants (
primitives.main.zig) forMAX_CODE_SIZE/MAX_INITCODE_SIZEand Amsterdam-specific doubled variants, and replaces scattered local constants/hardcoded limits with these spec-gated values.Written by Cursor Bugbot for commit b12e101. This will update automatically on new commits. Configure here.