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 = [
495
495
"src/ethereum_spec_tools/evm_tools/t8n/evm_trace.py" = [
496
496
" N815" # The traces must use camel case in JSON property names
497
497
]
498
+ "src/ethereum/amsterdam/blocks.py" = [
499
+ " E501" # Line too long - needed for long ref links
500
+ ]
498
501
499
502
[tool .ruff .lint .mccabe ]
500
503
# 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(
305
305
306
306
[`CREATE`]: ref:ethereum.amsterdam.vm.instructions.system.create
307
307
[`CREATE2`]: ref:ethereum.amsterdam.vm.instructions.system.create2
308
- [`SETCODE`]: ref:ethereum.amsterdam.vm.instructions.system.setcode
309
308
"""
310
309
ensure_account (builder , address )
311
310
Original file line number Diff line number Diff line change @@ -311,7 +311,6 @@ def track_code_change(
311
311
312
312
[`CREATE`]: ref:ethereum.amsterdam.vm.instructions.system.create
313
313
[`CREATE2`]: ref:ethereum.amsterdam.vm.instructions.system.create2
314
- [`SETCODE`]: ref:ethereum.amsterdam.vm.instructions.system.setcode
315
314
"""
316
315
track_address_access (tracker , address )
317
316
add_code_change (
@@ -323,7 +322,7 @@ def track_code_change(
323
322
324
323
325
324
def finalize_transaction_changes (
326
- tracker : StateChangeTracker , state : "State" # noqa: U100
325
+ tracker : StateChangeTracker , state : "State"
327
326
) -> None :
328
327
"""
329
328
Finalize changes for the current transaction.
Original file line number Diff line number Diff line change 8
8
history of all state transitions that have happened since the genesis of the
9
9
chain.
10
10
"""
11
+
11
12
from dataclasses import dataclass
12
13
from typing import Tuple
13
14
@@ -243,10 +244,14 @@ class Header:
243
244
244
245
bal_hash : Hash32
245
246
"""
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.
248
251
249
252
[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
250
255
"""
251
256
252
257
Original file line number Diff line number Diff line change 30
30
)
31
31
32
32
from . 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 (
34
36
StateChangeTracker ,
35
- build ,
36
- compute_block_access_list_hash ,
37
37
set_transaction_index ,
38
38
track_balance_change ,
39
39
)
Original file line number Diff line number Diff line change 22
22
from ethereum .crypto .hash import Hash32
23
23
from ethereum .exceptions import EthereumException
24
24
25
- from ..block_access_lists import BlockAccessListBuilder
25
+ from ..block_access_lists . builder import BlockAccessListBuilder
26
26
from ..blocks import Log , Receipt , Withdrawal
27
27
from ..fork_types import Address , Authorization , VersionedHash
28
28
from ..state import State , TransientStorage
29
29
from ..transactions import LegacyTransaction
30
30
from ..trie import Trie
31
31
32
32
if 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
36
34
37
35
38
36
@dataclass
Original file line number Diff line number Diff line change @@ -233,6 +233,7 @@ def add_genesis_block(
233
233
"timestamp" : genesis .timestamp ,
234
234
"extra_data" : genesis .extra_data ,
235
235
"nonce" : genesis .nonce ,
236
+
236
237
}
237
238
238
239
if has_field (hardfork .Header , "mix_digest" ):
@@ -258,6 +259,9 @@ def add_genesis_block(
258
259
if has_field (hardfork .Header , "requests_hash" ):
259
260
fields ["requests_hash" ] = Hash32 (b"\0 " * 32 )
260
261
262
+ if has_field (hardfork .Header , "bal_hash" ):
263
+ fields ["bal_hash" ] = Hash32 (b"\0 " * 32 )
264
+
261
265
genesis_header = hardfork .Header (** fields )
262
266
263
267
block_fields = {
@@ -272,6 +276,9 @@ def add_genesis_block(
272
276
if has_field (hardfork .Block , "requests" ):
273
277
block_fields ["requests" ] = ()
274
278
279
+ if has_field (hardfork .Block , "block_access_list" ):
280
+ block_fields ["block_access_list" ] = rlp .encode ([])
281
+
275
282
genesis_block = hardfork .Block (** block_fields )
276
283
277
284
chain .blocks .append (genesis_block )
You can’t perform that action at this time.
0 commit comments