Skip to content

feat: add missing ERC-7562 opcodes and expand test coverage#3

Merged
boolafish merged 2 commits into
mainfrom
feat/add-missing-opcodes-and-tests
Dec 23, 2025
Merged

feat: add missing ERC-7562 opcodes and expand test coverage#3
boolafish merged 2 commits into
mainfrom
feat/add-missing-opcodes-and-tests

Conversation

@boolafish

Copy link
Copy Markdown
Collaborator

Add BLOBHASH (0x49) and BLOBBASEFEE (0x4A) opcodes to forbidden opcode validation as required by ERC-7562 [OP-011]. These opcodes were missing from the checker implementation.

Significantly expand test coverage for forbidden opcodes from 7% (1/14) to 35% (6/17) by adding tests for:

  • GASPRICE (0x3A)
  • GASLIMIT (0x45)
  • COINBASE (0x41)
  • ORIGIN (0x32)
  • INVALID (0xFE)

The INVALID opcode test uses try-catch to allow debug trace capture before revert, enabling proper validation of the opcode detection.

All 15 tests passing.

Add BLOBHASH (0x49) and BLOBBASEFEE (0x4A) opcodes to forbidden opcode
validation as required by ERC-7562 [OP-011]. These opcodes were missing
from the checker implementation.

Significantly expand test coverage for forbidden opcodes from 7% (1/14)
to 35% (6/17) by adding tests for:
- GASPRICE (0x3A)
- GASLIMIT (0x45)
- COINBASE (0x41)
- ORIGIN (0x32)
- INVALID (0xFE)

The INVALID opcode test uses try-catch to allow debug trace capture
before revert, enabling proper validation of the opcode detection.

All 15 tests passing.
Enable Solidity optimizer in foundry.toml to prevent contract size
limit issues in CI. Without optimization, EntryPoint compiles to
28,975 bytes, exceeding EIP-170's 24,576 byte limit by 4,399 bytes.

Also pin solc version to 0.8.30 for consistency between local and CI.

Contract sizes with solc 0.8.30 + optimizer (runs=200):
- EntryPoint: 16,299 bytes (margin: 8,277 bytes) ✅
- ERC4337Checker: 14,282 bytes (margin: 10,294 bytes) ✅
- All contracts well under the 24KB limit

Without optimizer (CI was failing):
- EntryPoint: 28,975 bytes (OVER limit by 4,399 bytes) ❌
- ERC4337Checker: 20,551 bytes (margin: 4,025 bytes)
@boolafish boolafish force-pushed the feat/add-missing-opcodes-and-tests branch from 769258a to db97ce2 Compare December 23, 2025 07:31
@boolafish boolafish merged commit 57662cf into main Dec 23, 2025
1 check passed
@boolafish boolafish deleted the feat/add-missing-opcodes-and-tests branch December 23, 2025 07:32
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.

1 participant