Skip to content

fix(tests): change INVALID_DEPOSIT_EVENT_LAYOUT to BlockException #1773

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 2 commits into from
Jun 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Users can select any of the artifacts depending on their testing needs for their
- 🐞 `fill` no longer writes generated fixtures into an existing, non-empty output directory; it must now be empty or `--clean` must be used to delete it first ([#1608](https://github.com/ethereum/execution-spec-tests/pull/1608)).
- 🐞 zkEVM marked tests have been removed from `tests-deployed` tox environment into its own separate workflow `tests-deployed-zkevm` and are filled by `evmone-t8n` ([#1617](https://github.com/ethereum/execution-spec-tests/pull/1617)).
- ✨ Field `postStateHash` is now added to all `blockchain_test` and `blockchain_test_engine` tests that use `exclude_full_post_state_in_output` in place of `postState`. Fixes `evmone-blockchaintest` test consumption and indirectly fixes coverage runs for these tests ([#1667](https://github.com/ethereum/execution-spec-tests/pull/1667)).
- 🔀 Changed INVALID_DEPOSIT_EVENT_LAYOUT to a BlockException instead of a TransactionException ([#1773](https://github.com/ethereum/execution-spec-tests/pull/1773)).

#### `consume`

Expand Down
10 changes: 5 additions & 5 deletions src/ethereum_clis/clis/besu.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,11 @@ class BesuExceptionMapper(ExceptionMapper):
BlockException.SYSTEM_CONTRACT_EMPTY: (
r"(Invalid system call, no code at address)|" r"(Invalid system call address:)"
),
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT: (
r"Invalid (amount|index|pubKey|signature|withdrawalCred) (offset|size): "
r"expected (\d+), but got (-?\d+)|"
r"Invalid deposit log length\. Must be \d+ bytes, but is \d+ bytes"
),
TransactionException.INITCODE_SIZE_EXCEEDED: (
r"transaction invalid Initcode size of \d+ exceeds maximum size of \d+"
),
Expand All @@ -337,11 +342,6 @@ class BesuExceptionMapper(ExceptionMapper):
TransactionException.NONCE_MISMATCH_TOO_LOW: (
r"transaction invalid transaction nonce \d+ below sender account nonce \d+"
),
TransactionException.INVALID_DEPOSIT_EVENT_LAYOUT: (
r"Invalid (amount|index|pubKey|signature|withdrawalCred) (offset|size): "
r"expected (\d+), but got (-?\d+)|"
r"Invalid deposit log length\. Must be \d+ bytes, but is \d+ bytes"
),
TransactionException.GAS_LIMIT_EXCEEDS_MAXIMUM: (
r"transaction invalid Transaction gas limit must be at most \d+"
),
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_clis/clis/erigon.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ErigonExceptionMapper(ExceptionMapper):
),
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_DEPOSIT_EVENT_LAYOUT: "could not parse requests logs",
BlockException.SYSTEM_CONTRACT_EMPTY: "Syscall failure: Empty Code at",
BlockException.SYSTEM_CONTRACT_CALL_FAILED: "Unprecedented Syscall failure",
BlockException.INVALID_REQUESTS: "invalid requests root hash in header",
Expand Down
6 changes: 3 additions & 3 deletions src/ethereum_clis/clis/ethereumjs.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ class EthereumJSExceptionMapper(ExceptionMapper):
"sender doesn't have enough funds to send tx"
),
TransactionException.NONCE_MISMATCH_TOO_LOW: "the tx doesn't have the correct nonce",
TransactionException.INVALID_DEPOSIT_EVENT_LAYOUT: (
"Error verifying block while running: error: number exceeds 53 bits"
),
TransactionException.GAS_ALLOWANCE_EXCEEDED: "tx has a higher gas limit than the block",
BlockException.INCORRECT_EXCESS_BLOB_GAS: "Invalid 4844 transactions",
BlockException.INVALID_RECEIPTS_ROOT: "invalid receipttrie",
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT: (
"Error verifying block while running: error: number exceeds 53 bits"
),
# TODO EVMONE needs to differentiate when the section is missing in the header or body
EOFException.MISSING_STOP_OPCODE: "err: no_terminating_instruction",
EOFException.MISSING_CODE_HEADER: "err: code_section_missing",
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_clis/clis/ethrex.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class EthrexExceptionMapper(ExceptionMapper):
TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED: (
"Exceeded MAX_BLOB_GAS_PER_BLOCK"
),
TransactionException.INVALID_DEPOSIT_EVENT_LAYOUT: ("Invalid deposit request layout"),
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT: ("Invalid deposit request layout"),
BlockException.INVALID_REQUESTS: (
"Requests hash does not match the one in the header after executing"
),
Expand Down
1 change: 1 addition & 0 deletions src/ethereum_clis/clis/execution_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ class ExecutionSpecsExceptionMapper(ExceptionMapper):
TransactionException.GAS_ALLOWANCE_EXCEEDED: "ion: ",
BlockException.SYSTEM_CONTRACT_EMPTY: "System contract address",
BlockException.SYSTEM_CONTRACT_CALL_FAILED: "call failed:",
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT: "deposit",
# TODO EVMONE needs to differentiate when the section is missing in the header or body
EOFException.MISSING_STOP_OPCODE: "err: no_terminating_instruction",
EOFException.MISSING_CODE_HEADER: "err: code_section_missing",
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_clis/clis/geth.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class GethExceptionMapper(ExceptionMapper):
TransactionException.TYPE_4_TX_PRE_FORK: ("transaction type not supported"),
TransactionException.INITCODE_SIZE_EXCEEDED: "max initcode size exceeded",
TransactionException.NONCE_MISMATCH_TOO_LOW: "nonce too low",
TransactionException.INVALID_DEPOSIT_EVENT_LAYOUT: "unable to parse deposit data",
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT: "unable to parse deposit data",
BlockException.INCORRECT_BLOB_GAS_USED: "blob gas used mismatch",
BlockException.INCORRECT_EXCESS_BLOB_GAS: "invalid excessBlobGas",
BlockException.INVALID_VERSIONED_HASHES: "invalid number of versionedHashes",
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_clis/clis/nethermind.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ class NethermindExceptionMapper(ExceptionMapper):
BlockException.INVALID_GAS_USED_ABOVE_LIMIT: (
"ExceededGasLimit: Gas used exceeds gas limit."
),
TransactionException.INVALID_DEPOSIT_EVENT_LAYOUT: (
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT: (
"DepositsInvalid: Invalid deposit event layout:"
),
}
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_clis/clis/reth.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class RethExceptionMapper(ExceptionMapper):
TransactionException.TYPE_4_TX_PRE_FORK: (
"eip 7702 transactions present in pre-prague payload"
),
TransactionException.INVALID_DEPOSIT_EVENT_LAYOUT: (
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT: (
"failed to decode deposit requests from receipts"
),
BlockException.INVALID_REQUESTS: "mismatched block requests hash",
Expand Down
10 changes: 5 additions & 5 deletions src/ethereum_test_exceptions/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,6 @@ class TransactionException(ExceptionBase):
"""
Transaction type 4 included before activation fork.
"""
INVALID_DEPOSIT_EVENT_LAYOUT = auto()
"""
Transaction emits a `DepositEvent` in the deposit contract (EIP-6110), but the layout
of the event does not match the required layout.
"""


@unique
Expand Down Expand Up @@ -604,6 +599,11 @@ class BlockException(ExceptionBase):
"""
Block header's hash does not match the actually computed hash of the block.
"""
INVALID_DEPOSIT_EVENT_LAYOUT = auto()
"""
Transaction emits a `DepositEvent` in the deposit contract (EIP-6110), but the layout
of the event does not match the required layout.
"""


@unique
Expand Down
8 changes: 3 additions & 5 deletions tests/prague/eip6110_deposits/test_modified_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from ethereum_test_exceptions.exceptions import TransactionException
from ethereum_test_exceptions.exceptions import BlockException
from ethereum_test_tools import (
Account,
Alloc,
Expand Down Expand Up @@ -178,13 +178,12 @@ def test_invalid_layout(
to=Spec.DEPOSIT_CONTRACT_ADDRESS,
sender=sender,
gas_limit=100_000,
error=TransactionException.INVALID_DEPOSIT_EVENT_LAYOUT,
)

blockchain_test(
pre=pre,
blocks=[
Block(txs=[tx], exception=TransactionException.INVALID_DEPOSIT_EVENT_LAYOUT),
Block(txs=[tx], exception=BlockException.INVALID_DEPOSIT_EVENT_LAYOUT),
],
post={},
)
Expand Down Expand Up @@ -223,13 +222,12 @@ def test_invalid_log_length(blockchain_test: BlockchainTestFiller, pre: Alloc, s
to=Spec.DEPOSIT_CONTRACT_ADDRESS,
sender=sender,
gas_limit=100_000,
error=TransactionException.INVALID_DEPOSIT_EVENT_LAYOUT,
)

blockchain_test(
pre=pre,
blocks=[
Block(txs=[tx], exception=TransactionException.INVALID_DEPOSIT_EVENT_LAYOUT),
Block(txs=[tx], exception=BlockException.INVALID_DEPOSIT_EVENT_LAYOUT),
],
post={},
)
Loading