Skip to content

Commit 64f949d

Browse files
authored
chore(clis): add block rlp size limit errors (eip-7934). (ethereum#1789)
1 parent d1998f1 commit 64f949d

File tree

6 files changed

+12
-28
lines changed

6 files changed

+12
-28
lines changed

src/ethereum_clis/clis/besu.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,6 @@ class BesuExceptionMapper(ExceptionMapper):
262262
"Payload BlobGasUsed does not match calculated BlobGasUsed"
263263
),
264264
BlockException.INVALID_GAS_USED_ABOVE_LIMIT: "Header validation failed (FULL)",
265-
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: (
266-
# TODO:
267-
""
268-
),
269265
# TODO EVMONE needs to differentiate when the section is missing in the header or body
270266
EOFException.MISSING_STOP_OPCODE: "err: no_terminating_instruction",
271267
EOFException.MISSING_CODE_HEADER: "err: code_section_missing",
@@ -326,6 +322,9 @@ class BesuExceptionMapper(ExceptionMapper):
326322
r"expected (\d+), but got (-?\d+)|"
327323
r"Invalid deposit log length\. Must be \d+ bytes, but is \d+ bytes"
328324
),
325+
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: (
326+
r"Block size of \d+ bytes exceeds limit of \d+ bytes"
327+
),
329328
TransactionException.INITCODE_SIZE_EXCEEDED: (
330329
r"transaction invalid Initcode size of \d+ exceeds maximum size of \d+"
331330
),

src/ethereum_clis/clis/erigon.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ class ErigonExceptionMapper(ExceptionMapper):
4040
BlockException.SYSTEM_CONTRACT_CALL_FAILED: "Unprecedented Syscall failure",
4141
BlockException.INVALID_REQUESTS: "invalid requests root hash in header",
4242
BlockException.INVALID_BLOCK_HASH: "invalid block hash",
43-
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: (
44-
# TODO:
45-
""
46-
),
43+
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: "block exceeds max rlp size",
4744
}
4845
mapping_regex = {
4946
TransactionException.GAS_LIMIT_EXCEEDS_MAXIMUM: (

src/ethereum_clis/clis/geth.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ class GethExceptionMapper(ExceptionMapper):
6767
TransactionException.TYPE_4_TX_CONTRACT_CREATION: (
6868
"input string too short for common.Address, decoding into (types.SetCodeTx).To"
6969
),
70-
TransactionException.GAS_LIMIT_EXCEEDS_MAXIMUM: (
71-
"transaction exceeds maximum allowed gas limit"
72-
),
70+
TransactionException.GAS_LIMIT_EXCEEDS_MAXIMUM: "transaction gas limit too high",
7371
TransactionException.TYPE_4_TX_PRE_FORK: ("transaction type not supported"),
7472
TransactionException.INITCODE_SIZE_EXCEEDED: "max initcode size exceeded",
7573
TransactionException.NONCE_MISMATCH_TOO_LOW: "nonce too low",
@@ -80,10 +78,7 @@ class GethExceptionMapper(ExceptionMapper):
8078
BlockException.INVALID_REQUESTS: "invalid requests hash",
8179
BlockException.SYSTEM_CONTRACT_CALL_FAILED: "system call failed to execute:",
8280
BlockException.INVALID_BLOCK_HASH: "blockhash mismatch",
83-
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: (
84-
# TODO:
85-
""
86-
),
81+
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: "block RLP-encoded size exceeds maximum",
8782
# TODO EVMONE needs to differentiate when the section is missing in the header or body
8883
EOFException.MISSING_STOP_OPCODE: "err: no_terminating_instruction",
8984
EOFException.MISSING_CODE_HEADER: "err: code_section_missing",

src/ethereum_clis/clis/nethermind.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,7 @@ class NethermindExceptionMapper(ExceptionMapper):
361361
"ExceededGasLimit: Gas used exceeds gas limit."
362362
),
363363
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: (
364-
# TODO:
365-
""
364+
"ExceededBlockSizeLimit: Exceeded block size limit"
366365
),
367366
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT: (
368367
"DepositsInvalid: Invalid deposit event layout:"

src/ethereum_clis/clis/nimbus.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,14 @@ class NimbusExceptionMapper(ExceptionMapper):
8787
"invalid tx: one of blobVersionedHash has invalid version"
8888
),
8989
# TODO: temp solution until mapper for nimbus is fixed
90-
TransactionException.GAS_LIMIT_EXCEEDS_MAXIMUM: ("zero gasUsed but transactions present"),
90+
TransactionException.GAS_LIMIT_EXCEEDS_MAXIMUM: "zero gasUsed but transactions present",
9191
# This message is the same as TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED
9292
TransactionException.TYPE_3_TX_BLOB_COUNT_EXCEEDED: "exceeds maximum allowance",
9393
TransactionException.TYPE_3_TX_ZERO_BLOBS: "blob transaction missing blob hashes",
94-
TransactionException.INTRINSIC_GAS_TOO_LOW: "intrinsic gas too low",
94+
TransactionException.INTRINSIC_GAS_TOO_LOW: "zero gasUsed but transactions present",
9595
TransactionException.INTRINSIC_GAS_BELOW_FLOOR_GAS_COST: "intrinsic gas too low",
96-
TransactionException.INITCODE_SIZE_EXCEEDED: "max initcode size exceeded",
97-
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: (
98-
# TODO:
99-
""
100-
),
96+
TransactionException.INITCODE_SIZE_EXCEEDED: "zero gasUsed but transactions present",
97+
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: "zero gasUsed but transactions present",
10198
# TODO EVMONE needs to differentiate when the section is missing in the header or body
10299
EOFException.MISSING_STOP_OPCODE: "err: no_terminating_instruction",
103100
EOFException.MISSING_CODE_HEADER: "err: code_section_missing",

src/ethereum_clis/clis/reth.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ class RethExceptionMapper(ExceptionMapper):
3737
BlockException.INVALID_STATE_ROOT: "mismatched block state root",
3838
BlockException.INVALID_BLOCK_HASH: "block hash mismatch",
3939
BlockException.INVALID_GAS_USED: "block gas used mismatch",
40-
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: (
41-
# TODO:
42-
""
43-
),
40+
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: "block is too large: ",
4441
}
4542
mapping_regex = {
4643
TransactionException.NONCE_MISMATCH_TOO_LOW: r"nonce \d+ too low, expected \d+",

0 commit comments

Comments
 (0)