Skip to content

Commit bccccdf

Browse files
committed
chore(spec-specs): Add Amsterdam docstring; update prepare msg
1 parent c24b76a commit bccccdf

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed

src/ethereum/forks/amsterdam/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
"""
2+
The Amsterdam fork ([EIP-7773]) includes block-level access lists.
3+
4+
### Changes
5+
6+
- [EIP-7928: Block-Level Access Lists][EIP-7928]
7+
8+
### Releases
9+
10+
[EIP-7928]: https://eips.ethereum.org/EIPS/eip-7928
11+
""" # noqa: E501
112

213
from ethereum.fork_criteria import Unscheduled
314

src/ethereum/forks/amsterdam/fork.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -993,9 +993,12 @@ def process_transaction(
993993
tx_hash=get_transaction_hash(encode_transaction(tx)),
994994
)
995995

996-
message = prepare_message(block_env, tx_env, tx)
997-
# Set transaction frame so call frames become children of it
998-
message.transaction_state_changes = tx_state_changes
996+
message = prepare_message(
997+
block_env,
998+
tx_env,
999+
tx,
1000+
tx_state_changes,
1001+
)
9991002

10001003
tx_output = process_message_call(message)
10011004

src/ethereum/forks/amsterdam/utils/message.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from ..fork_types import Address
1919
from ..state import get_account
20+
from ..state_tracker import StateChanges
2021
from ..transactions import Transaction
2122
from ..vm import BlockEnvironment, Message, TransactionEnvironment
2223
from ..vm.precompiled_contracts.mapping import PRE_COMPILED_CONTRACTS
@@ -27,6 +28,7 @@ def prepare_message(
2728
block_env: BlockEnvironment,
2829
tx_env: TransactionEnvironment,
2930
tx: Transaction,
31+
transaction_state_changes: StateChanges,
3032
) -> Message:
3133
"""
3234
Execute a transaction against the provided environment.
@@ -39,6 +41,8 @@ def prepare_message(
3941
Environment for the transaction.
4042
tx :
4143
Transaction to be executed.
44+
transaction_state_changes :
45+
State changes specific to this transaction.
4246
4347
Returns
4448
-------
@@ -87,4 +91,5 @@ def prepare_message(
8791
accessed_storage_keys=set(tx_env.access_list_storage_keys),
8892
disable_precompiles=False,
8993
parent_evm=None,
94+
transaction_state_changes=transaction_state_changes,
9095
)

src/ethereum/forks/amsterdam/vm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class Message:
142142
accessed_storage_keys: Set[Tuple[Address, Bytes32]]
143143
disable_precompiles: bool
144144
parent_evm: Optional["Evm"]
145-
transaction_state_changes: Optional[StateChanges] = None
145+
transaction_state_changes: StateChanges
146146

147147

148148
@dataclass

src/ethereum/forks/amsterdam/vm/instructions/system.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def generic_create(
144144
accessed_storage_keys=evm.accessed_storage_keys.copy(),
145145
disable_precompiles=False,
146146
parent_evm=evm,
147+
transaction_state_changes=evm.message.transaction_state_changes,
147148
)
148149

149150
child_evm = process_create_message(child_message)

0 commit comments

Comments
 (0)