eth/tracers: fix standardTraceBlockToFile: instantiate EVM instance with the intended tracer configuration if the tx is intended to be traced

This commit is contained in:
Jared Wasinger 2025-05-05 13:04:13 +08:00
parent 1b18ba2423
commit b208335f47

View file

@ -813,6 +813,7 @@ func (api *API) standardTraceBlockToFile(ctx context.Context, block *types.Block
Tracer: logger.NewJSONLogger(&logConfig, writer), Tracer: logger.NewJSONLogger(&logConfig, writer),
EnablePreimageRecording: true, EnablePreimageRecording: true,
} }
evm = vm.NewEVM(vmctx, statedb, chainConfig, vmConf)
} }
// Execute the transaction and flush any traces to disk // Execute the transaction and flush any traces to disk
statedb.SetTxContext(tx.Hash(), i) statedb.SetTxContext(tx.Hash(), i)