Skip to content

Tracer options ​

The options object of debug_traceTransaction, debug_traceCall and the other debug_trace* methods.

Without a tracer, the node uses the struct logger: one entry for each EVM step. The struct logger answer is large. For most uses, callTracer or prestateTracer is a better choice.

Fields ​

FieldTypeMeaning
tracerstringcallTracer, flatCallTracer, prestateTracer, 4byteTracer, noopTracer, muxTracer or erc7562Tracer. Default: the struct logger.
tracerConfigobjectThe options of the chosen tracer. The rows below list them.
tracerConfig.onlyTopCallbooleancallTracer: trace the top call only, without the inner calls.
tracerConfig.withLogbooleancallTracer: add the logs of each call.
tracerConfig.includePrecompilesbooleanflatCallTracer: keep the calls to precompiled contracts.
tracerConfig.diffModebooleanprestateTracer: return the state before and after (pre and post), not the state before only.
tracerConfig.disableCodebooleanprestateTracer: leave out the contract code.
tracerConfig.disableStoragebooleanprestateTracer: leave out the storage.
tracerConfig.withLog (erc7562Tracer)booleanerc7562Tracer: add the logs of each call.
tracerConfig.ignoredOpcodeslist of hex numberserc7562Tracer: opcodes that the tracer does not record, for example ["0x50"].
tracerConfig (muxTracer)objectmuxTracer: an object with one key per tracer (callTracer, flatCallTracer, prestateTracer, 4byteTracer, noopTracer) and its config as the value.
disableStackbooleanStruct logger: leave out the stack. Default: false.
enableMemorybooleanStruct logger: add the memory. Default: false.
enableReturnDatabooleanStruct logger: add returnData to each step, the data that the last inner call of the frame returned. A create that succeeds gives no data. Default: false.
disableStoragebooleanStruct logger: leave out the storage. Default: false.
timeoutstringJavaScript tracers: the time limit for each transaction, as a Go duration, for example "10s". Default: 60 s.
stateOverridesState overridedebug_traceCall and debug_traceCallMany: change the state before the calls.
blockOverridesBlock overridedebug_traceCall only: change the block fields for the call.
txIndexhex numberdebug_traceCall only: run the call on the state of the parent block after the transactions of the block before this index.

Notes ​

  • A tracer that is not a built-in name is JavaScript code, as in reth (geth's JavaScript tracer API). The hooks are setup(config), step(log, db), fault(log, db), enter(frame), exit(result) and result(ctx, db). The global functions are toHex, toWord, toAddress, toContract, toContract2, slice, isPrecompiled and bigInt.
  • Each transaction gets a new JavaScript engine with reth's limits: 200000 loop iterations in one function call and a limit on nested calls (RuntimeLimit: ...). The engine also has a memory limit of 256 MiB.
  • A hook that throws fails the call frame, as in reth. In step, the frame reverts after that opcode with no output. In enter, the call does not run. In exit, the caller sees a revert. In enter and exit the call uses all its gas and its output is the error text.
  • The error texts of the JavaScript engine (syntax errors, exceptions, positions) can be different from the texts of reth. See Differences from reth.
  • timeout (for example "10s") limits the run time of a JavaScript tracer, for each transaction. The default is 60 s. reth does not use this field.
  • An answer larger than 160 MiB gives -32008 Response is too big. The struct logger, callTracer, flatCallTracer, muxTracer, erc7562Tracer and prestateTracer count the size of their answer while they record. When the answer becomes too large, the tracer stops, and the request gets -32008 before the node writes the answer. debug_traceCallMany counts the answers of all its calls against one limit. 0.9.6 and earlier counted only for the struct logger, and started the count again for each call of a bundle.
  • The request time limit (--rpc-timeout) also stops a traced call or transaction while it runs. The request then gets -32603 request timed out. 0.9.6 and earlier checked the limit only before each call and each transaction.

Used by ​

debug_traceBlock, debug_traceBlockByHash, debug_traceBlockByNumber, debug_traceCall, debug_traceCallMany, debug_traceTransaction.