JSON-RPCMethods

debug_traceTransaction: parameters, returns and CU

Replay a transaction execution and inspect its call tree or execution trace.

Summary

Reconstruct and replay the execution of a transaction to produce an execution trace. Official documentation

Compute units (CU) and pricing

CU per call

100 CU

Price per 1M calls (USD)

$10.00

Parameters

ParameterTypeDescription
transactionHashHASH32-byte transaction hash to trace as 0x-prefixed hex.
optionsobjectTrace options object (optional): tracer is callTracer, flatCallTracer, prestateTracer, 4byteTracer or noopTracer, omitted uses the default struct logger, and any other value returns -32602 tracer not allowed; tracerConfig passes tracer-specific options (such as onlyTopCall and withLog for callTracer, diffMode for prestateTracer); timeout is at most 30s; reexec is a Geth-compatible option (non-negative integer, 0 is valid): the maximum number of blocks to walk back and re-execute when rebuilding historical state, not a target block number, and it does not change the trace target; accepting the parameter does not mean any re-execution occurred, and support depends on the chain node implementation.

Returns

  • Type: ARRAY (flatCallTracer); OBJECT (callTracer, prestateTracer, 4byteTracer, noopTracer, default struct logger)
  • Description: The tracer determines the return shape: flatCallTracer returns an array of flat trace entries, each containing action, type, an integer-array traceAddress, subtraces, and result on success or error on failure; block and transaction context fields depend on the node and call mode, blockHash and transactionHash may be null for simulated calls, and Arbitrum entries may also include beforeEVMTransfers and afterEVMTransfers. callTracer returns a CallFrame tree object; prestateTracer returns an address-keyed account-state object by default, or a state-diff object with pre and post in diffMode; 4byteTracer returns an object mapping signature and calldata size to occurrence count; noopTracer returns an empty object; omitting tracer returns the default struct logger object with gas, failed, returnValue and structLogs.

Notes

The target transaction's block must be within the chain's state window (state_window_blocks); out-of-window requests return -32011 (not billed).

Request example

export BLOCKVECTRA_API_KEY=rgw_your_api_key

curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \
  -H 'Content-Type: application/json' \
  -H "x-api-key: $BLOCKVECTRA_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "method": "debug_traceTransaction",
    "params": [
      "<transactionHash>",
      {
        "tracer": "callTracer"
      }
    ],
    "id": 1
  }'

Supported chains

Available on all supported chains except: Arbitrum Nova (arbnova_mainnet), Arc (arc_mainnet), Base (base_mainnet), Berachain (berachain_mainnet), Boba (boba_mainnet), BNB Smart Chain (bsc_mainnet), Celo (celo_mainnet), Ethereum Sepolia (eth_sepolia), Fraxtal (fraxtal_mainnet), Gnosis (gnosis_mainnet), HyperEVM (hyperevm_mainnet), Ink (ink_mainnet), Katana (katana_mainnet), Linea (linea_mainnet), Metal L2 (metall2_mainnet), Mode (mode_mainnet), OP Mainnet (op_mainnet), Rootstock (rootstock_mainnet), Soneium (soneium_mainnet), Unichain (unichain_mainnet), World Chain (world_mainnet), Zora (zora_mainnet).

Last updated: