@@ -436,22 +436,30 @@ def merge_on_failure(child_frame: StateChanges) -> None:
436436 # merged on failure - they are discarded
437437
438438
439- def commit_transaction_frame (tx_frame : StateChanges ) -> None :
439+ def commit_transaction_frame (
440+ tx_frame : StateChanges ,
441+ state : "State" ,
442+ ) -> None :
440443 """
441444 Commit transaction frame to block frame.
442445
443- Unlike merge_on_success(), this merges ALL changes without net-zero
444- filtering (each tx's changes recorded at their respective index) .
446+ Filters net-zero changes before merging to ensure only actual state
447+ modifications are recorded in the block access list .
445448
446449 Parameters
447450 ----------
448451 tx_frame :
449452 The transaction frame to commit.
453+ state :
454+ The current state (used for net-zero filtering).
450455
451456 """
452457 assert tx_frame .parent is not None
453458 block_frame = tx_frame .parent
454459
460+ # Filter net-zero changes before committing
461+ filter_net_zero_frame_changes (tx_frame , state )
462+
455463 # Merge address accesses
456464 block_frame .touched_addresses .update (tx_frame .touched_addresses )
457465
@@ -468,7 +476,7 @@ def commit_transaction_frame(tx_frame: StateChanges) -> None:
468476 for addr , idx , nonce in tx_frame .nonce_changes :
469477 block_frame .nonce_changes .add ((addr , idx , nonce ))
470478
471- # Merge code changes (net-zero filtering done in normalize_transaction)
479+ # Merge code changes
472480 for (addr , idx ), final_code in tx_frame .code_changes .items ():
473481 block_frame .code_changes [(addr , idx )] = final_code
474482
0 commit comments