-
Notifications
You must be signed in to change notification settings - Fork 167
feat(consume): add ExceptionMapper
support to the consume-engine simulator
#1416
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
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
ede149b
fix(exceptions): UndefinedException return on new
marioevz eae3ebf
feat(rpc,plugins/consume): Support exception mapper
marioevz 42a2ffd
fix(exceptions): Allow undefined mapper
marioevz 44848a0
feat(plugins/consume): Add more mappers
marioevz 750ac8f
fix(logging): don't use newlines within log messages
danceratopz 612b70d
refactor(exceptions,specs): ExceptionWithMessage contains a list
marioevz 71a5ba6
new(exceptions): Add `INVALID_BLOCK_HASH` exception
marioevz dee4312
feat(clis): Add ethjs exceptions
marioevz de2c2e6
feat(clis): Add geth exceptions
marioevz 5830a42
feat(plugins/consume): Add besu exceptions
marioevz e96339e
feat(plugins/consume): Add nethermind exceptions
marioevz 3d19f12
feat(plugins/consume): Add reth exceptions
marioevz 090b278
feat(consume): add `--strict-exception-matching` parameter
marioevz 4ad226b
more reth exceptions
marioevz aa0ddb4
refactor mappers
marioevz f8dd490
add ethjs exception
marioevz 6c32905
fix(tests): EIP-7685: Add expected exception to `test_invalid_multi_t…
marioevz 4285133
add reth exception
marioevz b30eca7
fix(plugins/consume): log failure
marioevz 922e4cd
feat(clis): Add Erigon Exception Mapper
marioevz 1eba8c5
feat(specs): Allow setting expected block exception for state tests (…
marioevz 6913aac
fix(tests): Add block exceltion to test_blob_type_tx_pre_fork
marioevz 2f6a05f
fix(clis): Exceptions in mappers
marioevz a1a2752
change(plugins/consume): Enable strict exception matching by default
marioevz 23296c9
fix(specs): Exception message check on strict match
marioevz de60efb
docs: changelog
marioevz fe57dd3
chore(clis): update exception mappers for TYPE_4_TX_PRE_FORK
danceratopz aa07b4d
refactor(consume): cache exception mappers in session-scoped fixture
danceratopz 5067df6
refactor(consume): make string match more robust by applying `lower()`
danceratopz 7988a7e
feat(consume): allow disabling of strict exception checking per fork
danceratopz 6c9628b
refactor(consume/hive): create `strict_exception_matching` fixture
marioevz 4d574d8
fix: whitelist
marioevz bea0594
changelog: Add exception
marioevz 4963923
changelog: Invalid versioned hashes exception
marioevz f6b1d9f
refactor(consume/engine): Better error logging
marioevz 0d9d8b5
fix(clis/reth): Exception mapper
marioevz 696e2e9
fix(clis/besu): Exception mapper
marioevz deb8a3f
fix(clis/geth): Exception mapper
marioevz a83d867
fix(clis/ethereumjs): Exception mapper
marioevz 4b50b15
fix(clis/erigon): Exception mapper
marioevz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,14 @@ Test fixtures for use by clients are available for each release on the [Github r | |
|
||
### 💥 Breaking Change | ||
|
||
#### Consume engine strict exception checking | ||
|
||
`consume engine` now checks exceptions returned by the execution clients in their Engine API responses, specifically in the `validationError`field of the `engine_newPayloadVX` method. | ||
|
||
While not strictly a breaking change since tests will continue to run normally, failures are expected if a client modifies their exception messages. | ||
|
||
This feature can be disabled by using `--disable-strict-exception-matching` for specific clients or forks. | ||
|
||
### 🛠️ Framework | ||
|
||
#### `fill` | ||
|
@@ -19,6 +27,7 @@ Test fixtures for use by clients are available for each release on the [Github r | |
#### `consume` | ||
|
||
- 🐞 Fix fixture tarball downloading with regular, non-Github release URLS and with numerical versions in regular release specs, e.g., `[email protected]` ([#1437](https://github.com/ethereum/execution-spec-tests/pull/1437)). | ||
- ✨ `consume engine` now has strict exception mapping enabled by default ([#1416](https://github.com/ethereum/execution-spec-tests/pull/1416)). | ||
|
||
#### Tools | ||
|
||
|
@@ -27,7 +36,10 @@ Test fixtures for use by clients are available for each release on the [Github r | |
|
||
#### Exceptions | ||
|
||
- ✨ New exceptions `BlockException.SYSTEM_CONTRACT_EMPTY` and `BlockException.SYSTEM_CONTRACT_CALL_FAILED` to handle EIP updates [#9508](https://github.com/ethereum/EIPs/pull/9508) and [#9582](https://github.com/ethereum/EIPs/pull/9582) ([#1394](https://github.com/ethereum/execution-spec-tests/pull/1394)). | ||
- ✨ `BlockException.SYSTEM_CONTRACT_EMPTY`: Raised when a required system contract was not found in the state by the time it was due to execution with a system transaction call ([#1394](https://github.com/ethereum/execution-spec-tests/pull/1394)). | ||
- ✨ `BlockException.SYSTEM_CONTRACT_CALL_FAILED`: Raised when a system contract call made by a system transaction fails ([#1394](https://github.com/ethereum/execution-spec-tests/pull/1394)). | ||
- ✨ `BlockException.INVALID_BLOCK_HASH`: Raised when the calculated block hash does not match the expectation (Currently only during Engine API calls) ([#1416](https://github.com/ethereum/execution-spec-tests/pull/1416)). | ||
- ✨ `BlockException.INVALID_VERSIONED_HASHES`: Raised when a discrepancy is found between versioned hashes in the payload and the ones found in the transactions ([#1416](https://github.com/ethereum/execution-spec-tests/pull/1416)). | ||
|
||
### 🧪 Test Cases | ||
|
||
|
@@ -37,6 +49,7 @@ Test fixtures for use by clients are available for each release on the [Github r | |
- ✨ [EIP-7623](https://eips.ethereum.org/EIPS/eip-7623): Additionally parametrize transaction validity tests with the `to` set to an EOA account (previously only contracts) ([#1422](https://github.com/ethereum/execution-spec-tests/pull/1422)). | ||
- ✨ [EIP-7251](https://eips.ethereum.org/EIPS/eip-7251): Add EIP-7251 test cases for modified consolidations contract that allows more consolidations ([#1465](https://github.com/ethereum/execution-spec-tests/pull/1465)). | ||
- ✨ [EIP-6110](https://eips.ethereum.org/EIPS/eip-6110): Add extra deposit request edge cases, sending eth to the deposit contract while sending a deposit request ([#1467](https://github.com/ethereum/execution-spec-tests/pull/1467)). | ||
- ✨ [EIP-6110](https://eips.ethereum.org/EIPS/eip-6110): Add cases for deposit log layout and other topics (ERC-20) transfer ([#1371](https://github.com/ethereum/execution-spec-tests/pull/1371)). | ||
- ✨ [EIP-7251](https://eips.ethereum.org/EIPS/eip-7251): Remove pytest skips for consolidation request cases ([#1449](https://github.com/ethereum/execution-spec-tests/pull/1449)). | ||
- ✨ [EIP-7002](https://eips.ethereum.org/EIPS/eip-7002), [EIP-7251](https://eips.ethereum.org/EIPS/eip-7251): Add cases to verify behavior of contracts missing at fork ([#1394](https://github.com/ethereum/execution-spec-tests/pull/1394)). | ||
- ✨ [EIP-7002](https://eips.ethereum.org/EIPS/eip-7002), [EIP-7251](https://eips.ethereum.org/EIPS/eip-7251): Add cases to verify behavior of system contract errors invalidating a block ([#1394](https://github.com/ethereum/execution-spec-tests/pull/1394)). | ||
|
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"""Erigon execution client transition tool.""" | ||
|
||
from ethereum_test_exceptions import BlockException, ExceptionMapper, TransactionException | ||
|
||
|
||
class ErigonExceptionMapper(ExceptionMapper): | ||
"""Erigon exception mapper.""" | ||
|
||
mapping_substring = { | ||
TransactionException.SENDER_NOT_EOA: "sender not an eoa", | ||
TransactionException.INITCODE_SIZE_EXCEEDED: "max initcode size exceeded", | ||
TransactionException.INSUFFICIENT_ACCOUNT_FUNDS: ( | ||
"insufficient funds for gas * price + value" | ||
), | ||
TransactionException.INTRINSIC_GAS_TOO_LOW: "intrinsic gas too low", | ||
TransactionException.INSUFFICIENT_MAX_FEE_PER_GAS: "fee cap less than block base fee", | ||
TransactionException.PRIORITY_GREATER_THAN_MAX_FEE_PER_GAS: "tip higher than fee cap", | ||
TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS: "max fee per blob gas too low", | ||
TransactionException.NONCE_MISMATCH_TOO_LOW: "nonce too low", | ||
TransactionException.TYPE_3_TX_PRE_FORK: "blob txn is not supported by signer", | ||
TransactionException.TYPE_3_TX_INVALID_BLOB_VERSIONED_HASH: ( | ||
"invalid blob versioned hash, must start with VERSIONED_HASH_VERSION_KZG" | ||
), | ||
TransactionException.TYPE_3_TX_ZERO_BLOBS: "a blob stx must contain at least one blob", | ||
TransactionException.TYPE_3_TX_WITH_FULL_BLOBS: "rlp: expected String or Byte", | ||
TransactionException.TYPE_3_TX_CONTRACT_CREATION: "wrong size for To: 0", | ||
TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED: ( | ||
"blobs/blobgas exceeds max" | ||
), | ||
TransactionException.TYPE_4_EMPTY_AUTHORIZATION_LIST: ( | ||
"SetCodeTransaction without authorizations is invalid" | ||
), | ||
TransactionException.TYPE_4_TX_CONTRACT_CREATION: "wrong size for To: 0", | ||
TransactionException.TYPE_4_TX_PRE_FORK: "setCode tx is not supported by signer", | ||
TransactionException.INVALID_DEPOSIT_EVENT_LAYOUT: "could not parse requests logs", | ||
BlockException.INVALID_REQUESTS: "invalid requests root hash in header", | ||
BlockException.INVALID_BLOCK_HASH: "invalid block hash", | ||
} | ||
mapping_regex = { | ||
BlockException.INCORRECT_BLOB_GAS_USED: r"blobGasUsed by execution: \d+, in header: \d+", | ||
BlockException.INCORRECT_EXCESS_BLOB_GAS: r"invalid excessBlobGas: have \d+, want \d+", | ||
} |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.