Skip to content

Commit ea8cd3c

Browse files
committed
Add storage read whenever there is a sstore
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.
1 parent 37883dd commit ea8cd3c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

eth/tracers/native/zero.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ func (t *zeroTracer) addSLOADToAccount(addr libcommon.Address, key libcommon.Has
379379

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

0 commit comments

Comments
 (0)