Appearance
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
| Field | Type | Meaning |
|---|---|---|
tracer | string | callTracer, flatCallTracer, prestateTracer, 4byteTracer, noopTracer, muxTracer or erc7562Tracer. Default: the struct logger. |
tracerConfig | object | The options of the chosen tracer. The rows below list them. |
tracerConfig.onlyTopCall | boolean | callTracer: trace the top call only, without the inner calls. |
tracerConfig.withLog | boolean | callTracer: add the logs of each call. |
tracerConfig.includePrecompiles | boolean | flatCallTracer: keep the calls to precompiled contracts. |
tracerConfig.diffMode | boolean | prestateTracer: return the state before and after (pre and post), not the state before only. |
tracerConfig.disableCode | boolean | prestateTracer: leave out the contract code. |
tracerConfig.disableStorage | boolean | prestateTracer: leave out the storage. |
tracerConfig.withLog (erc7562Tracer) | boolean | erc7562Tracer: add the logs of each call. |
tracerConfig.ignoredOpcodes | list of hex numbers | erc7562Tracer: opcodes that the tracer does not record, for example ["0x50"]. |
tracerConfig (muxTracer) | object | muxTracer: an object with one key per tracer (callTracer, flatCallTracer, prestateTracer, 4byteTracer, noopTracer) and its config as the value. |
disableStack | boolean | Struct logger: leave out the stack. Default: false. |
enableMemory | boolean | Struct logger: add the memory. Default: false. |
enableReturnData | boolean | Struct 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. |
disableStorage | boolean | Struct logger: leave out the storage. Default: false. |
timeout | string | JavaScript tracers: the time limit for each transaction, as a Go duration, for example "10s". Default: 60 s. |
stateOverrides | State override | debug_traceCall and debug_traceCallMany: change the state before the calls. |
blockOverrides | Block override | debug_traceCall only: change the block fields for the call. |
txIndex | hex number | debug_traceCall only: run the call on the state of the parent block after the transactions of the block before this index. |
Notes
- A
tracerthat is not a built-in name is JavaScript code, as in reth (geth's JavaScript tracer API). The hooks aresetup(config),step(log, db),fault(log, db),enter(frame),exit(result)andresult(ctx, db). The global functions aretoHex,toWord,toAddress,toContract,toContract2,slice,isPrecompiledandbigInt. - 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. Inenter, the call does not run. Inexit, the caller sees a revert. Inenterandexitthe 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,erc7562TracerandprestateTracercount 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_traceCallManycounts 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 -32603request 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.