Skip to content

Commit a5c7b29

Browse files
committed
fix(docs): Fix issues with toxenvs: lint, doc, json_infra
1 parent 65c63b1 commit a5c7b29

File tree

7 files changed

+23
-12
lines changed

7 files changed

+23
-12
lines changed

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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.

src/ethereum/amsterdam/block_access_lists/builder.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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

src/ethereum/amsterdam/block_access_lists/tracker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff 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

325324
def 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.

src/ethereum/amsterdam/blocks.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
history of all state transitions that have happened since the genesis of the
99
chain.
1010
"""
11+
1112
from dataclasses import dataclass
1213
from 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

src/ethereum/amsterdam/fork.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
)
3131

3232
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 (
3436
StateChangeTracker,
35-
build,
36-
compute_block_access_list_hash,
3737
set_transaction_index,
3838
track_balance_change,
3939
)

src/ethereum/amsterdam/vm/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,15 @@
2222
from ethereum.crypto.hash import Hash32
2323
from ethereum.exceptions import EthereumException
2424

25-
from ..block_access_lists import BlockAccessListBuilder
25+
from ..block_access_lists.builder import BlockAccessListBuilder
2626
from ..blocks import Log, Receipt, Withdrawal
2727
from ..fork_types import Address, Authorization, VersionedHash
2828
from ..state import State, TransientStorage
2929
from ..transactions import LegacyTransaction
3030
from ..trie import Trie
3131

3232
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
3634

3735

3836
@dataclass

src/ethereum/genesis.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)