Skip to content

feat: EIP-7954 — double max code size and initcode limit (Amsterdam)#12

Merged
garyschulte merged 2 commits intoConsensys:mainfrom
Gabriel-Trintinalia:eip-7954
Apr 1, 2026
Merged

feat: EIP-7954 — double max code size and initcode limit (Amsterdam)#12
garyschulte merged 2 commits intoConsensys:mainfrom
Gabriel-Trintinalia:eip-7954

Conversation

@Gabriel-Trintinalia
Copy link
Copy Markdown

@Gabriel-Trintinalia Gabriel-Trintinalia commented Mar 20, 2026

Summary

Implements EIP-7954 for the Amsterdam hardfork.

Doubles the contract size limits:

Limit Pre-Amsterdam Amsterdam+
Max deployed code size 24,576 bytes 32,768 bytes
Max initcode size (EIP-3860) 49,152 bytes 65,536 bytes

The new limits apply conditionally — pre-Amsterdam behaviour is unchanged.

Changes

  • src/handler/validation.zig — TX-level initcode size check uses 65536 for Amsterdam+
  • src/interpreter/host.zigsetupCreate and finalizeCreate use 32768/65536 for Amsterdam+
  • src/interpreter/opcodes/call.zigCREATE and CREATE2 initcode guards updated

Part 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.amsterdam is 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 use 65536 (vs 49152) for Amsterdam+. Deployed code size validation in Host.finalizeCreate now uses 32768 (vs 24576) for Amsterdam+.

Adds shared primitives constants (primitives.main.zig) for MAX_CODE_SIZE/MAX_INITCODE_SIZE and 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.

Copy link
Copy Markdown
Collaborator

@garyschulte garyschulte left a comment

Choose a reason for hiding this comment

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

functionally good, needs cleanup for maintainability

Gabriel-Trintinalia and others added 2 commits April 1, 2026 05:07
- 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>
@garyschulte garyschulte merged commit f3d1ad7 into Consensys:main Apr 1, 2026
6 checks passed
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