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
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Test fixtures for use by clients are available for each release on the [Github r

### πŸ“‹ Misc

- 🐞 Fix duplicate storage write issues for block access lists EIP-7928 implementation ([#1743](https://github.com/ethereum/execution-specs/pull/1743)).

### πŸ§ͺ Test Cases

- 🐞 Fix BALs opcode OOG test vectors by updating the Amsterdam commit hash in specs and validating appropriately on the testing side ([#2293](https://github.com/ethereum/execution-spec-tests/pull/2293)).
Expand Down
16 changes: 14 additions & 2 deletions src/ethereum/forks/amsterdam/block_access_lists/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ def add_storage_write(
Add a storage write operation to the block access list.

Records a storage slot modification for a given address at a specific
transaction index. Multiple writes to the same slot are tracked
separately, maintaining the order and transaction index of each change.
transaction index. If multiple writes occur to the same slot within the
same transaction (same block_access_index), only the final value is kept.

Parameters
----------
Expand All @@ -149,6 +149,18 @@ def add_storage_write(
if slot not in builder.accounts[address].storage_changes:
builder.accounts[address].storage_changes[slot] = []

# Check if there's already an entry with the same block_access_index
# If so, update it with the new value, keeping only the final write
changes = builder.accounts[address].storage_changes[slot]
for i, existing_change in enumerate(changes):
if existing_change.block_access_index == block_access_index:
# Update the existing entry with the new value
changes[i] = StorageChange(
block_access_index=block_access_index, new_value=new_value
)
return

# No existing entry found, append new change
change = StorageChange(
block_access_index=block_access_index, new_value=new_value
)
Expand Down
Loading