feat: add missing ERC-7562 opcodes and expand test coverage#3
Merged
Conversation
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)
769258a to
db97ce2
Compare
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.
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:
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.