File tree Expand file tree Collapse file tree 7 files changed +23
-12
lines changed
Expand file tree Collapse file tree 7 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -495,6 +495,9 @@ ignore = [
495495"src/ethereum_spec_tools/evm_tools/t8n/evm_trace.py" = [
496496 " N815" # The traces must use camel case in JSON property names
497497]
498+ "src/ethereum/amsterdam/blocks.py" = [
499+ " E501" # Line too long - needed for long ref links
500+ ]
498501
499502[tool .ruff .lint .mccabe ]
500503# Set the maximum allowed cyclomatic complexity. C901 default is 10.
Original file line number Diff line number Diff line change @@ -305,7 +305,6 @@ def add_code_change(
305305
306306 [`CREATE`]: ref:ethereum.amsterdam.vm.instructions.system.create
307307 [`CREATE2`]: ref:ethereum.amsterdam.vm.instructions.system.create2
308- [`SETCODE`]: ref:ethereum.amsterdam.vm.instructions.system.setcode
309308 """
310309 ensure_account (builder , address )
311310
Original file line number Diff line number Diff line change @@ -311,7 +311,6 @@ def track_code_change(
311311
312312 [`CREATE`]: ref:ethereum.amsterdam.vm.instructions.system.create
313313 [`CREATE2`]: ref:ethereum.amsterdam.vm.instructions.system.create2
314- [`SETCODE`]: ref:ethereum.amsterdam.vm.instructions.system.setcode
315314 """
316315 track_address_access (tracker , address )
317316 add_code_change (
@@ -323,7 +322,7 @@ def track_code_change(
323322
324323
325324def finalize_transaction_changes (
326- tracker : StateChangeTracker , state : "State" # noqa: U100
325+ tracker : StateChangeTracker , state : "State"
327326) -> None :
328327 """
329328 Finalize changes for the current transaction.
Original file line number Diff line number Diff line change 88history of all state transitions that have happened since the genesis of the
99chain.
1010"""
11+
1112from dataclasses import dataclass
1213from typing import Tuple
1314
@@ -243,10 +244,14 @@ class Header:
243244
244245 bal_hash : Hash32
245246 """
246- Hash of the Block Access List containing all accounts and storage
247- locations accessed during block execution. Introduced in [EIP-7928].
247+ [SHA2-256] hash of the Block Access List containing all accounts and
248+ storage locations accessed during block execution. Introduced in
249+ [EIP-7928]. See [`compute_block_access_list_hash`][cbalh] for more
250+ details.
248251
249252 [EIP-7928]: https://eips.ethereum.org/EIPS/eip-7928
253+ [cbalh]: ref:ethereum.amsterdam.block_access_lists.rlp_utils.compute_block_access_list_hash # noqa: E501
254+ [SHA2-256]: https://en.wikipedia.org/wiki/SHA-2
250255 """
251256
252257
Original file line number Diff line number Diff line change 3030)
3131
3232from . import vm
33- from .block_access_lists import (
33+ from .block_access_lists .builder import build
34+ from .block_access_lists .rlp_utils import compute_block_access_list_hash
35+ from .block_access_lists .tracker import (
3436 StateChangeTracker ,
35- build ,
36- compute_block_access_list_hash ,
3737 set_transaction_index ,
3838 track_balance_change ,
3939)
Original file line number Diff line number Diff line change 2222from ethereum .crypto .hash import Hash32
2323from ethereum .exceptions import EthereumException
2424
25- from ..block_access_lists import BlockAccessListBuilder
25+ from ..block_access_lists . builder import BlockAccessListBuilder
2626from ..blocks import Log , Receipt , Withdrawal
2727from ..fork_types import Address , Authorization , VersionedHash
2828from ..state import State , TransientStorage
2929from ..transactions import LegacyTransaction
3030from ..trie import Trie
3131
3232if TYPE_CHECKING :
33- from ..block_access_lists import StateChangeTracker
34-
35- __all__ = ("Environment" , "Evm" , "Message" )
33+ from ..block_access_lists .tracker import StateChangeTracker # noqa: F401
3634
3735
3836@dataclass
Original file line number Diff line number Diff line change @@ -233,6 +233,7 @@ def add_genesis_block(
233233 "timestamp" : genesis .timestamp ,
234234 "extra_data" : genesis .extra_data ,
235235 "nonce" : genesis .nonce ,
236+
236237 }
237238
238239 if has_field (hardfork .Header , "mix_digest" ):
@@ -258,6 +259,9 @@ def add_genesis_block(
258259 if has_field (hardfork .Header , "requests_hash" ):
259260 fields ["requests_hash" ] = Hash32 (b"\0 " * 32 )
260261
262+ if has_field (hardfork .Header , "bal_hash" ):
263+ fields ["bal_hash" ] = Hash32 (b"\0 " * 32 )
264+
261265 genesis_header = hardfork .Header (** fields )
262266
263267 block_fields = {
@@ -272,6 +276,9 @@ def add_genesis_block(
272276 if has_field (hardfork .Block , "requests" ):
273277 block_fields ["requests" ] = ()
274278
279+ if has_field (hardfork .Block , "block_access_list" ):
280+ block_fields ["block_access_list" ] = rlp .encode ([])
281+
275282 genesis_block = hardfork .Block (** block_fields )
276283
277284 chain .blocks .append (genesis_block )
You can’t perform that action at this time.
0 commit comments