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
11 changes: 7 additions & 4 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,13 @@ func (s *StateDB) AddLog(log *types.Log) {
log.TxHash = s.thash
log.TxIndex = uint(s.txIndex)
log.Index = s.logSize

s.logs[s.thash] = append(s.logs[s.thash], log)
s.logSize++

if s.logger != nil && s.logger.OnLog != nil {
s.logger.OnLog(log)
}
s.logs[s.thash] = append(s.logs[s.thash], log)
s.logSize++
}

func (s *StateDB) GetLogs(hash common.Hash, blockHash common.Hash) []*types.Log {
Expand Down Expand Up @@ -826,8 +828,9 @@ func (s *StateDB) Copy() *StateDB {
// to the snapshot tree, we need to copy that as well. Otherwise, any
// block mined by ourselves will cause gaps in the tree, and force the
// miner to operate trie-backed only.
snaps: s.snaps,
snap: s.snap,
snaps: s.snaps,
snap: s.snap,
logger: s.logger,
}
// Deep copy cached state objects.
for addr, obj := range s.stateObjects {
Expand Down
3 changes: 3 additions & 0 deletions eth/tracers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,9 @@ func (api *API) traceTx(
}
}

// Set the tracer for the stateDB
statedb.SetLogger(tracer.Hooks)

// Run the transaction with tracing enabled.
vmenv := vm.NewEVM(vmctx, txContext, statedb, api.backend.ChainConfig(), vm.Config{Tracer: tracer.Hooks, NoBaseFee: true})
if precompiles != nil {
Expand Down