Skip to content

Commit

Permalink
Add storage read whenever there is a sstore
Browse files Browse the repository at this point in the history
This fixes an issue when a storage slot is
* written but got reverted
* never read by sLoad opcode

When this happens, we still need to include the storage slot in the trace.
  • Loading branch information
cffls committed Nov 6, 2024
1 parent 37883dd commit ea8cd3c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions eth/tracers/native/zero.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ func (t *zeroTracer) addSLOADToAccount(addr libcommon.Address, key libcommon.Has

func (t *zeroTracer) addSSTOREToAccount(addr libcommon.Address, key libcommon.Hash, value *uint256.Int) {
t.tx.Traces[addr].StorageWritten[key] = value
t.tx.Traces[addr].StorageReadMap[key] = struct{}{}
t.addOpCodeToAccount(addr, vm.SSTORE)
}

Expand Down

0 comments on commit ea8cd3c

Please sign in to comment.