Skip to content

Commit 984143b

Browse files
spencer-tbmarioevzfselmo
authored andcommitted
feat(tests): EIP-7934 - block rlp size limit test cases (ethereum#1730)
* feat(tests): block rlp size limit eip-7934 test cases. Co-authored-by: Mario Vega <marioevz@gmail.com> Co-authored-by: felipe <fselmo2@gmail.com> * fix: minor rename * Update tests/osaka/eip7934_block_rlp_limit/test_max_block_rlp_size.py Co-authored-by: felipe <fselmo2@gmail.com> * fix(tests): remove misleading block rlp cases --------- Co-authored-by: Mario Vega <marioevz@gmail.com> Co-authored-by: felipe <fselmo2@gmail.com>
1 parent 7dd3144 commit 984143b

File tree

17 files changed

+619
-154
lines changed

17 files changed

+619
-154
lines changed

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Users can select any of the artifacts depending on their testing needs for their
7272
-[EIP-7825](https://eips.ethereum.org/EIPS/eip-7825): Add test cases for the transaction gas limit of 30M gas ([#1711](https://github.com/ethereum/execution-spec-tests/pull/1711)).
7373
-[EIP-7951](https://eips.ethereum.org/EIPS/eip-7951): add test cases for `P256VERIFY` precompile to support secp256r1 curve [#1670](https://github.com/ethereum/execution-spec-tests/pull/1670).
7474
- ✨ Introduce blockchain tests for ZKEVM to cover the scenario of pure ether transfers [#1742](https://github.com/ethereum/execution-spec-tests/pull/1742).
75+
-[EIP-7934](https://eips.ethereum.org/EIPS/eip-7934): Add test cases for the block RLP max limit of 10MiB ([#1730](https://github.com/ethereum/execution-spec-tests/pull/1730)).
7576
-[EIP-7939](https://eips.ethereum.org/EIPS/eip-7939) Add count leading zeros (CLZ) opcode tests for Osaka ([#1733](https://github.com/ethereum/execution-spec-tests/pull/1733)).
7677

7778
## [v4.5.0](https://github.com/ethereum/execution-spec-tests/releases/tag/v4.5.0) - 2025-05-14

src/ethereum_clis/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@
1010
from .ethereum_cli import CLINotFoundInPathError, UnknownCLIError
1111
from .fixture_consumer_tool import FixtureConsumerTool
1212
from .transition_tool import TransitionTool
13-
from .types import Result, TransitionToolOutput
13+
from .types import (
14+
BlockExceptionWithMessage,
15+
Result,
16+
TransactionExceptionWithMessage,
17+
TransitionToolOutput,
18+
)
1419

1520
TransitionTool.set_default_tool(ExecutionSpecsTransitionTool)
1621
FixtureConsumerTool.set_default_tool(GethFixtureConsumer)
1722

1823
__all__ = (
1924
"BesuTransitionTool",
25+
"BlockExceptionWithMessage",
2026
"CLINotFoundInPathError",
2127
"EthereumJSTransitionTool",
2228
"EvmoneExceptionMapper",
@@ -29,6 +35,7 @@
2935
"NethtestFixtureConsumer",
3036
"NimbusTransitionTool",
3137
"Result",
38+
"TransactionExceptionWithMessage",
3239
"TransitionTool",
3340
"TransitionToolOutput",
3441
"UnknownCLIError",

src/ethereum_clis/clis/besu.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ 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+
),
265269
# TODO EVMONE needs to differentiate when the section is missing in the header or body
266270
EOFException.MISSING_STOP_OPCODE: "err: no_terminating_instruction",
267271
EOFException.MISSING_CODE_HEADER: "err: code_section_missing",

src/ethereum_clis/clis/erigon.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ 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+
),
4347
}
4448
mapping_regex = {
4549
TransactionException.GAS_LIMIT_EXCEEDS_MAXIMUM: (

src/ethereum_clis/clis/geth.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ class GethExceptionMapper(ExceptionMapper):
8080
BlockException.INVALID_REQUESTS: "invalid requests hash",
8181
BlockException.SYSTEM_CONTRACT_CALL_FAILED: "system call failed to execute:",
8282
BlockException.INVALID_BLOCK_HASH: "blockhash mismatch",
83+
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: (
84+
# TODO:
85+
""
86+
),
8387
# TODO EVMONE needs to differentiate when the section is missing in the header or body
8488
EOFException.MISSING_STOP_OPCODE: "err: no_terminating_instruction",
8589
EOFException.MISSING_CODE_HEADER: "err: code_section_missing",

src/ethereum_clis/clis/nethermind.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,10 @@ class NethermindExceptionMapper(ExceptionMapper):
360360
BlockException.INVALID_GAS_USED_ABOVE_LIMIT: (
361361
"ExceededGasLimit: Gas used exceeds gas limit."
362362
),
363+
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: (
364+
# TODO:
365+
""
366+
),
363367
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT: (
364368
"DepositsInvalid: Invalid deposit event layout:"
365369
),

src/ethereum_clis/clis/nimbus.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing import ClassVar, Dict, Optional
77

88
from ethereum_test_exceptions import (
9+
BlockException,
910
EOFException,
1011
ExceptionBase,
1112
ExceptionMapper,
@@ -93,6 +94,10 @@ class NimbusExceptionMapper(ExceptionMapper):
9394
TransactionException.INTRINSIC_GAS_TOO_LOW: "intrinsic gas too low",
9495
TransactionException.INTRINSIC_GAS_BELOW_FLOOR_GAS_COST: "intrinsic gas too low",
9596
TransactionException.INITCODE_SIZE_EXCEEDED: "max initcode size exceeded",
97+
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: (
98+
# TODO:
99+
""
100+
),
96101
# TODO EVMONE needs to differentiate when the section is missing in the header or body
97102
EOFException.MISSING_STOP_OPCODE: "err: no_terminating_instruction",
98103
EOFException.MISSING_CODE_HEADER: "err: code_section_missing",

src/ethereum_clis/clis/reth.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ 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+
),
4044
}
4145
mapping_regex = {
4246
TransactionException.NONCE_MISMATCH_TOO_LOW: r"nonce \d+ too low, expected \d+",

src/ethereum_test_exceptions/exceptions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,10 @@ class BlockException(ExceptionBase):
543543
"""
544544
Block withdrawals address is rlp of invalid address != 20 bytes.
545545
"""
546+
RLP_BLOCK_LIMIT_EXCEEDED = auto()
547+
"""
548+
Block's rlp encoding is larger than the allowed limit.
549+
"""
546550
INVALID_REQUESTS = auto()
547551
"""
548552
Block's requests are invalid.

src/ethereum_test_forks/base_fork.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,12 @@ def transaction_gas_limit_cap(cls, block_number: int = 0, timestamp: int = 0) ->
343343
"""Return the transaction gas limit cap, or None if no limit is imposed."""
344344
pass
345345

346+
@classmethod
347+
@abstractmethod
348+
def block_rlp_size_limit(cls, block_number: int = 0, timestamp: int = 0) -> int | None:
349+
"""Return the maximum RLP size of a block in bytes, or None if no limit is imposed."""
350+
pass
351+
346352
@classmethod
347353
@abstractmethod
348354
def precompiles(cls, block_number: int = 0, timestamp: int = 0) -> List[Address]:

0 commit comments

Comments
 (0)