Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
Transaction,
Withdrawal,
)
from execution_testing.test_types.block_access_list import BlockAccessList
from execution_testing.test_types.receipt_types import TransactionReceipt

from .cli_types import (
Expand Down Expand Up @@ -167,6 +166,8 @@ class ClientBackend:
start_block: Dict[str, Any] | None
"""Client head after global pre-run setup; per-test chains off this."""

attests_block_access_list_hash: ClassVar[bool] = False

# t8n-compatibility stubs — fill's filler reads these on the backend.
opcode_count: OpcodeCount | None = None
opcode_count_per_block: List[OpcodeCount] | None = None
Expand Down Expand Up @@ -507,9 +508,9 @@ def _build_result(
block_access_list_hash: Hash | None = None
bal_rlp = getattr(built_payload, "block_access_list", None)
if bal_rlp is not None:
block_access_list_hash = Hash(
BlockAccessList.from_rlp(bal_rlp).rlp.keccak256()
)
# Hash the client's own bytes: a re-encode of the decoded BAL
# would diverge whenever the client's RLP is non-canonical.
block_access_list_hash = Hash(bal_rlp.keccak256())

return Result(
state_root=built_payload.state_root,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
callers continue to work unchanged.
"""

from typing import List, Protocol, runtime_checkable
from typing import ClassVar, List, Protocol, runtime_checkable

from execution_testing.exceptions import ExceptionMapper

Expand All @@ -44,6 +44,14 @@ class FillerBackend(Protocol):
for test assertions (t8n: True; live-client: typically False).
"""

attests_block_access_list_hash: ClassVar[bool]
"""
Whether ``Result.block_access_list_hash`` is computed by the backend
rather than derived by EEST from the BAL body the backend returned
(t8n: True; live-client: False, since an engine ``ExecutionPayload``
carries the body but no hash).
"""

def evaluate(
self,
*,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ class TransitionTool(EthereumCLI):
supports_opcode_count: ClassVar[bool] = False
supports_xdist: ClassVar[bool] = True
supports_blob_params: ClassVar[bool] = False
attests_block_access_list_hash: ClassVar[bool] = True
fork_name_map: ClassVar[Dict[str, str]] = {}

@abstractmethod
Expand Down
19 changes: 10 additions & 9 deletions packages/testing/src/execution_testing/specs/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,15 +990,16 @@ def generate_block_data(
"provided by the transition tool"
)

computed_block_access_list_hash = Hash(t8n_bal.rlp.keccak256())
assert (
computed_block_access_list_hash
== header.block_access_list_hash
), (
"Block access list hash in header does not match the "
f"computed hash from BAL: {header.block_access_list_hash} "
f"!= {computed_block_access_list_hash}"
)
if t8n.attests_block_access_list_hash:
computed_block_access_list_hash = Hash(t8n_bal.rlp.keccak256())
assert (
computed_block_access_list_hash
== header.block_access_list_hash
), (
"Block access list hash in header does not match the "
f"computed hash from BAL: {header.block_access_list_hash} "
f"!= {computed_block_access_list_hash}"
)

if block.rlp_modifier is not None:
# Modify any parameter specified in the `rlp_modifier` after
Expand Down
Loading