Skip to content

Commit 90e4ca1

Browse files
spencer-tbmarioevz
andauthored
chore(cli): reth/geth 6110 exception mapper (#2271)
* chore(cli): reth 6110 exception mapper. * chore(cli): lint me baby one more time. * chore(cli): bump geth 6110 as well. * Update src/ethereum_clis/clis/reth.py --------- Co-authored-by: Mario Vega <[email protected]>
1 parent 2ad649c commit 90e4ca1

File tree

2 files changed

+17
-31
lines changed

2 files changed

+17
-31
lines changed

src/ethereum_clis/clis/geth.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,26 +72,10 @@ class GethExceptionMapper(ExceptionMapper):
7272
TransactionException.INITCODE_SIZE_EXCEEDED: "max initcode size exceeded",
7373
TransactionException.NONCE_MISMATCH_TOO_LOW: "nonce too low",
7474
TransactionException.NONCE_MISMATCH_TOO_HIGH: "nonce too high",
75-
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT: "unable to parse deposit data",
7675
BlockException.INCORRECT_BLOB_GAS_USED: "blob gas used mismatch",
7776
BlockException.INCORRECT_EXCESS_BLOB_GAS: "invalid excessBlobGas",
7877
BlockException.INVALID_VERSIONED_HASHES: "invalid number of versionedHashes",
7978
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
9579
BlockException.SYSTEM_CONTRACT_CALL_FAILED: "system call failed to execute:",
9680
BlockException.INVALID_BLOCK_HASH: "blockhash mismatch",
9781
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: "block RLP-encoded size exceeds maximum",
@@ -107,6 +91,23 @@ class GethExceptionMapper(ExceptionMapper):
10791
r"blob gas used \d+ exceeds maximum allowance \d+"
10892
),
10993
BlockException.INVALID_GAS_USED_ABOVE_LIMIT: r"invalid gasUsed: have \d+, gasLimit \d+",
94+
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT: (
95+
r"invalid requests hash|failed to parse deposit logs"
96+
),
97+
# Geth does not validate the sizes or offsets of the deposit
98+
# contract logs. As a workaround we have set
99+
# INVALID_DEPOSIT_EVENT_LAYOUT equal to INVALID_REQUESTS.
100+
#
101+
# Although this is out of spec, it is understood that this
102+
# will not cause an issue so long as the mainnet/testnet
103+
# deposit contracts don't change.
104+
#
105+
# The offsets are checked second and the sizes are checked
106+
# third within the `is_valid_deposit_event_data` function:
107+
# https://eips.ethereum.org/EIPS/eip-6110#block-validity
108+
#
109+
# EELS definition for `is_valid_deposit_event_data`:
110+
# https://github.com/ethereum/execution-specs/blob/5ddb904fa7ba27daeff423e78466744c51e8cb6a/src/ethereum/forks/prague/requests.py#L51
110111
}
111112

112113

src/ethereum_clis/clis/reth.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,6 @@ 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
5136
BlockException.INVALID_RECEIPTS_ROOT: "receipt root mismatch",
5237
BlockException.INVALID_STATE_ROOT: "mismatched block state root",
5338
BlockException.INVALID_BLOCK_HASH: "block hash mismatch",

0 commit comments

Comments
 (0)