Debug & Trace APIs (EVM Only)

Ethereum

debug Namespace

debug_getBadBlocks
debug_getRawBlock
debug_getRawHeader
debug_storageRangeAt
debug_traceBlock
debug_traceBlockByHash
debug_traceBlockByNumber
debug_traceCall
debug_traceTransaction

trace Namespace

Erigon only

trace_block
trace_call
trace_callMany
trace_filter
trace_rawTransaction
trace_replayBlockTransactions
trace_replayTransaction
trace_transaction


Polygon

debug Namespace

debug_getBadBlocks
debug_storageRangeAt
debug_traceBlock
debug_traceBlockByHash
debug_traceBlockByNumber
debug_traceCall
debug_traceTransaction

trace Namespace

Erigon only

trace_block
trace_call
trace_callMany
trace_filter
trace_rawTransaction
trace_replayBlockTransactions
trace_replayTransaction
trace_transaction


Tips for trace methods

Trace Options

You may give trace API function a secondary optional argument, which specifies the options for this specific call. The possible options are:

  • disableStorage: BOOLEAN - Setting this to true will disable storage capture (default = false).
  • disableMemory: BOOLEAN - Setting this to true will disable memory capture (default = false).
  • disableStack: BOOLEAN - Setting this to true will disable stack capture (default = false).
  • enableReturnData: BOOLEAN - Setting this to true will disable stack capture (default = false).
  • tracer: STRING - Setting this option enables transaction tracing using Go or JavaScript-based tracers. For more details, please refer to https://geth.ethereum.org/docs/developers/evm-tracing/built-in-tracers. When this option is enabled, all four preceding parameters will be ignored. You can also use pre-defined tracing tools as listed below:
Tracer NameDescription
4byteTracerThe 4byteTracer collects 4-byte identifiers for post-processing. It collects method identifiers along with the size of the provided data, enabling a reverse lookup of signatures corresponding to the data size.
callTracerThe callTracer is a transaction tracing tool equipped with the capability to extract and report all internal calls and other useful information generated within a transaction.
fastCallTracerfallCallTracer is the Go-native version of callTracer. It offers a 10x performance improvement compared to callTracer since it does not execute in the JavaScript VM. If performance is a top priority, please consider using fastCallTracer instead of callTracer.
evmdisTracerThe evmdisTracer provides sufficient information to execute the disassembly in evmdis format.
noopTracerThe noopTracer is a basic boilerplate code in JavaScript used for transaction tracing within a JavaScript object.
opcountTracerThe opcountTracer is a sample tracing tool that counts the number of operations executed by the KLVM (K Framework LLVM) before the transaction is completed.
prestateTracerThe prestateTracer outputs sufficient information to generate transaction local execution from a custom-assembled genesis block.
revertTracerThe revertTracer outputs the error string of the REVERT opcode. If execution does not revert, it will output an empty string.
unigramTracerThe unigramTracer returns the frequency of each opcode occurrence.
bigramTracerThe bigramTracer returns the frequency of occurrences of consecutive pairs of opcodes.
trigramTracerThe trigramTracer returns the frequency of occurrences of consecutive triplets of opcodes.