Skip to main content
POST
/
66f812de2a6724a75a51f60dd6f2a154
debug_traceBlockByHash
curl --request POST \
  --url https://nd-954-882-037.p2pify.com/66f812de2a6724a75a51f60dd6f2a154 \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "debug_traceBlockByHash",
  "params": [
    "0xb3a662bef958318d25b80ba2ce6932d7e2f10262086247fa848f2d96de75fa18",
    {
      "tracer": "callTracer"
    }
  ]
}
'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": {}
}
Arbitrum API method that traces the execution of all transactions in a block identified by its hash. This method provides detailed traces for every transaction and call that took place in the block, including gas usage and performance metrics for each operation.
Learn how to deploy a node with the debug and trace API methods enabled.
This method is available for post-Nitro blocks only (block 22,207,815 and later). For pre-Nitro blocks, use arbtrace_block instead.
Get you own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • hash — the hash of the block to be traced.
  • tracer — an object identifying the type of tracer and its configuration:
    • 4byteTracer — tracer that captures the function signatures and call data sizes for all functions executed during a transaction, creating a map that links each selector and size combination to the number of times it occurred.
    • callTracer — tracer that captures information on all call frames executed during a transaction. The resulting nested list of call frames is organized into a tree structure that reflects the way the EVM works and can be used for debugging and analysis purposes.
    • prestateTracer — tracer with two modes: prestate and diff, where the former returns the accounts needed to execute a transaction, and the latter returns the differences between the pre and post-states of the transaction.

Response types

4byteTracer response

  • object — the 4byteTracer traces object:
    • result — a map of the function signature, the call data size, and how many times the function was called.

callTracer response

  • object — the callTracer traces object:
    • from — the address of the sender who initiated the transaction.
    • gas — the units of gas included in the transaction by the sender.
    • gasUsed — the total used gas by the call, encoded as hexadecimal.
    • to — the address of the recipient of the transaction if it was a transaction to an address. For contract creation transactions, this field is null.
    • input — the optional input data sent with the transaction.
    • output — the return value of the call, encoded as a hexadecimal string.
    • error — an error message in case the execution failed.
    • revertReason — the reason why the transaction was reverted, returned by the smart contract if any.
    • calls — a list of sub-calls made by the contract during the call, each represented as a nested call frame object.

prestateTracer response

  • object — the prestateTracer traces object:
    • smart contract address — the address of the smart contract associated with the result.
      • balance — the balance of the contract, expressed in Wei and encoded as a hexadecimal string.
      • code — the bytecode of the contract, encoded as a hexadecimal string.
      • nonce — the nonce of the account associated with the contract, represented as an unsigned integer.
      • storage — a map of key-value pairs representing the storage slots of the contract.

debug_traceBlockByHash code examples

const ethers = require('ethers');
const NODE_URL = "YOUR_CHAINSTACK_ENDPOINT";
const provider = new ethers.JsonRpcProvider(NODE_URL);

const traceBlockByHash = async (blockHash) => {
  const tracer = { tracer: "callTracer" };
  const traces = await provider.send("debug_traceBlockByHash", [blockHash, tracer]);
  console.log(traces);
};

traceBlockByHash("0xb3a662bef958318d25b80ba2ce6932d7e2f10262086247fa848f2d96de75fa18");

Use case

The debug_traceBlockByHash method is useful for auditing all transactions in a specific block. Developers can use it to analyze gas consumption patterns, identify function call frequencies using the 4byteTracer, or inspect the full call tree of every transaction in a block using the callTracer.

Body

application/json
id
integer
default:1
jsonrpc
string
default:2.0
method
string
default:debug_traceBlockByHash
params
(string | Tracer type · object)[]

The block hash.

Response

200 - application/json

The block traces.

jsonrpc
string
id
integer
result
object
Last modified on March 13, 2026