Skip to content

Commit b2a3558

Browse files
authored
chore(tests): safer workaround for EIP-6110 deposit log checks (#2233)
* chore(cli): safe solution to 6110. * chore(docs): changelog and lint fix.
1 parent 0ef435a commit b2a3558

File tree

4 files changed

+31
-34
lines changed

4 files changed

+31
-34
lines changed

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Test fixtures for use by clients are available for each release on the [Github r
3232

3333
### 🧪 Test Cases
3434

35+
- ✨ Add safe EIP-6110 workaround to allow Geth/Reth to pass invalid deposit request tests even thought they are out of spec ([#2177](https://github.com/ethereum/execution-spec-tests/pull/2177), [#2233](https://github.com/ethereum/execution-spec-tests/pull/2233)).
3536
- ✨ Add an EIP-7928 test case targeting the `SELFDESTRUCT` opcode. ([#2159](https://github.com/ethereum/execution-spec-tests/pull/2159)).
3637

3738
## [v5.0.0](https://github.com/ethereum/execution-spec-tests/releases/tag/v5.0.0) - 2025-09-05

src/ethereum_clis/clis/geth.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,21 @@ class GethExceptionMapper(ExceptionMapper):
7777
BlockException.INCORRECT_EXCESS_BLOB_GAS: "invalid excessBlobGas",
7878
BlockException.INVALID_VERSIONED_HASHES: "invalid number of versionedHashes",
7979
BlockException.INVALID_REQUESTS: "invalid requests hash",
80+
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT: "invalid requests hash",
81+
# Geth does not validate the sizes or offsets of the deposit
82+
# contract logs. As a workaround we have set
83+
# INVALID_DEPOSIT_EVENT_LAYOUT equal to INVALID_REQUESTS.
84+
#
85+
# Although this is out of spec, it is understood that this
86+
# will not cause an issue so long as the mainnet/testnet
87+
# deposit contracts don't change.
88+
#
89+
# The offsets are checked second and the sizes are checked
90+
# third within the `is_valid_deposit_event_data` function:
91+
# https://eips.ethereum.org/EIPS/eip-6110#block-validity
92+
#
93+
# EELS definition for `is_valid_deposit_event_data`:
94+
# https://github.com/ethereum/execution-specs/blob/5ddb904fa7ba27daeff423e78466744c51e8cb6a/src/ethereum/forks/prague/requests.py#L51
8095
BlockException.SYSTEM_CONTRACT_CALL_FAILED: "system call failed to execute:",
8196
BlockException.INVALID_BLOCK_HASH: "blockhash mismatch",
8297
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: "block RLP-encoded size exceeds maximum",

src/ethereum_clis/clis/reth.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,21 @@ class RethExceptionMapper(ExceptionMapper):
3333
"failed to decode deposit requests from receipts"
3434
),
3535
BlockException.INVALID_REQUESTS: "mismatched block requests hash",
36+
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT: "mismatched block requests hash",
37+
# Reth does not validate the sizes or offsets of the deposit
38+
# contract logs. As a workaround we have set
39+
# INVALID_DEPOSIT_EVENT_LAYOUT equal to INVALID_REQUESTS.
40+
#
41+
# Although this is out of spec, it is understood that this
42+
# will not cause an issue so long as the mainnet/testnet
43+
# deposit contracts don't change.
44+
#
45+
# The offsets are checked second and the sizes are checked
46+
# third within the `is_valid_deposit_event_data` function:
47+
# https://eips.ethereum.org/EIPS/eip-6110#block-validity
48+
#
49+
# EELS definition for `is_valid_deposit_event_data`:
50+
# https://github.com/ethereum/execution-specs/blob/5ddb904fa7ba27daeff423e78466744c51e8cb6a/src/ethereum/forks/prague/requests.py#L51
3651
BlockException.INVALID_RECEIPTS_ROOT: "receipt root mismatch",
3752
BlockException.INVALID_STATE_ROOT: "mismatched block state root",
3853
BlockException.INVALID_BLOCK_HASH: "block hash mismatch",

tests/prague/eip6110_deposits/test_modified_contract.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -217,23 +217,6 @@ def test_invalid_layout(
217217
txs=[tx],
218218
exception=[
219219
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT,
220-
BlockException.INVALID_REQUESTS,
221-
# INVALID_REQUESTS is an alternative workaround for
222-
# Geth/Reth only.
223-
#
224-
# Geth/Reth do not validate the sizes or offsets of the
225-
# deposit contract logs.
226-
#
227-
# Although this is out of spec, it is understood that this
228-
# will not cause an issue so long as the mainnet/testnet
229-
# deposit contracts don't change.
230-
#
231-
# This offsets are checked second and the sizes are checked
232-
# third within the `is_valid_deposit_event_data` function:
233-
# https://eips.ethereum.org/EIPS/eip-6110#block-validity
234-
#
235-
# EELS definition for `is_valid_deposit_event_data`:
236-
# https://github.com/ethereum/execution-specs/blob/5ddb904fa7ba27daeff423e78466744c51e8cb6a/src/ethereum/forks/prague/requests.py#L51
237220
],
238221
),
239222
],
@@ -293,23 +276,6 @@ def test_invalid_log_length(blockchain_test: BlockchainTestFiller, pre: Alloc, s
293276
txs=[tx],
294277
exception=[
295278
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT,
296-
BlockException.INVALID_REQUESTS,
297-
# INVALID_REQUESTS is an alternative workaround for
298-
# Geth/Reth only.
299-
#
300-
# Geth/Reth do not validate the sizes or offsets of the
301-
# deposit contract logs.
302-
#
303-
# Although this is out of spec, it is understood that this
304-
# will not cause an issue so long as the mainnet/testnet
305-
# deposit contracts don't change.
306-
#
307-
# This offsets are checked second and the sizes are checked
308-
# third within the `is_valid_deposit_event_data` function:
309-
# https://eips.ethereum.org/EIPS/eip-6110#block-validity
310-
#
311-
# EELS definition for `is_valid_deposit_event_data`:
312-
# https://github.com/ethereum/execution-specs/blob/5ddb904fa7ba27daeff423e78466744c51e8cb6a/src/ethereum/forks/prague/requests.py#L51
313279
],
314280
),
315281
],

0 commit comments

Comments
 (0)