-
Notifications
You must be signed in to change notification settings - Fork 961
feat(statetest): spec-compliant expected exception handling #3198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bshastry
wants to merge
5
commits into
bluealloy:main
Choose a base branch
from
bshastry:feat/spec-compliant-expected-exceptions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat(statetest): spec-compliant expected exception handling #3198
bshastry
wants to merge
5
commits into
bluealloy:main
from
bshastry:feat/spec-compliant-expected-exceptions
Conversation
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
This PR makes the revme statetest runner spec-compliant for handling expected exceptions, matching the behavior of geth and other clients. ## Problem Previously, revme silently skipped tests when: - `tx_type()` returned `None` for invalid tx combinations (e.g., blob+create) - AND `expect_exception` was set This meant tests with expected exceptions were not actually validated, they just returned "All tests passed" without executing anything. ## Solution ### 1. Remove early transaction type rejection - `tx_type()` now always returns a `TransactionType` (not `Option`) - Invalid combinations (blob+create, 7702+create) are validated during EVM execution, not during parsing - This matches geth's `toMessage()` behavior ### 2. Add missing validations in handler - Added `BlobCreateTransaction` validation for EIP-4844 - Added `Eip7702CreateTransaction` validation for EIP-7702 - Both check `tx.kind().is_create()` and return appropriate errors ### 3. Proper exception matching - New `exception_map` module maps EEST exception strings to REVM errors - Supports pipe-separated multiple exceptions (`exc1|exc2`) - Comprehensive mapping for 30+ exception types ### 4. Always execute and validate - Removed silent `continue` in runner.rs - Tests with expected exceptions now execute and validate the error matches - State roots are computed and output (matching geth behavior) ## Results - 2297/2303 corpus tests passing (99.7%) - State roots match geth exactly for expected exception tests - Remaining 6 failures are pre-existing skip list issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Use U256::from() instead of .into() for test values (compilation fix) - Add unprefixed "SenderNotEOA" variant to exception mapping - Apply rustfmt formatting fixes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
CodSpeed Performance ReportMerging #3198 will not alter performanceComparing Summary
|
rakita
reviewed
Dec 2, 2025
Member
rakita
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Supportive, need to flush the mapping.
- Wrap URL in angle brackets to fix rustdoc bare-urls warning - Add TR_TypeNotSupported as alias for TYPE_NOT_SUPPORTED exception 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Add support for legacy TR_* exception names used in ethereum/legacytests: - TR_FeeCapLessThanBlocks -> GasPriceLessThanBasefee - TR_GasLimitReached -> CallerGasLimitMoreThanBlock - TR_NoFunds -> LackOfFundForMaxFee - TR_IntrinsicGas, TR_NoFundsOrGas, IntrinsicGas -> CallGasCostMoreThanGasLimit - TR_TipGtFeeCap -> PriorityFeeGreaterThanMaxFee - TR_NoFundsX -> OverflowPaymentInTransaction - TR_InitCodeLimitExceeded -> CreateInitCodeSizeLimit - TR_BLOBCREATE -> BlobCreateTransaction - TR_EMPTYBLOB -> EmptyBlobs - TR_BLOBLIST_OVERSIZE -> TooManyBlobs - TR_BLOBVERSION_INVALID -> BlobVersionNotSupported These mappings enable the state test runner to correctly match expected exceptions from the legacy test suite.
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.
This PR makes the revme statetest runner spec-compliant for handling expected exceptions, matching the behavior of geth and other clients.
Problem
Previously, revme silently skipped tests when:
tx_type()returnedNonefor invalid tx combinations (e.g., blob+create)expect_exceptionwas setThis meant tests with expected exceptions were not actually validated, they just returned "All tests passed" without executing anything.
Solution
1. Remove early transaction type rejection
tx_type()now always returns aTransactionType(notOption)toMessage()behavior2. Add missing validations in handler
BlobCreateTransactionvalidation for EIP-4844Eip7702CreateTransactionvalidation for EIP-7702tx.kind().is_create()and return appropriate errors3. Proper exception matching
exception_mapmodule maps EEST exception strings to REVM errorsexc1|exc2)4. Always execute and validate
continuein runner.rsResults
🤖 Generated with Claude Code