> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validationcloud.io/llms.txt
> Use this file to discover all available pages before exploring further.

# debug_traceBlockByNumber

Traces every transaction in the block specified by block number and returns the tracer result for each one.

This method will use `80` [Compute Units](https://docs.validationcloud.io/nodeapi/about/billing.md).

***

> [!NOTE]
>
> Traces need the state of the traced block, so World Chain Mainnet can trace the last 10,064 blocks, about 5.6 hours at World Chain's 2-second block time. Older blocks return JSON-RPC error `-32603` with a message that contains `insufficient changesets to revert to block`.

## **Parameters**

`blockNumber` - String - Required  - The block number as a string in hexadecimal format.

`object` - Object - Required  - The tracer object with the following fields:

* `tracer` - String - The type of tracer, options are: `callTracer` or `prestateTracer`.
  * `callTracer` - String - The callTracer keeps track of all call frames, including depth - calls, that are made during a transaction.
  * `prestateTracer` - String - The prestateTracer replays the transaction and tracks every part of state that occurred during the transaction.
* `tracerConfig` - Object (Optional) - The object to specify the configurations of the tracer.
  * `onlyTopCall` - Boolean - When set to true, this will only trace the primary (top-level) call and not any sub-calls. It eliminates the additional processing for each call frame.

## **Returns**

`result` - An array with one entry per transaction in the block, each containing:

* `txHash` - The hash of the transaction.
* `result` - With `callTracer`, the call trace of the transaction, an object with:
  * `from` - The address the transaction is sent from.
  * `gas` - The integer of the gas provided for the transaction execution.
  * `gasUsed` - The integer of the gas used.
  * `to` - The address the transaction is directed to.
  * `input` - The data given at the time of input.
  * `output` - The data returned by the call, when present.
  * `value` - The integer of the value sent with this transaction.
  * `type` - The type of call.
  * `calls` - A list of sub-calls, when present.

With `prestateTracer`, each result is instead a map keyed by account address, holding the state the transaction touched (such as `balance`, `nonce`, `code` and `storage`).

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
// Result (first of the block's 4 traces shown)
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "result": {
        "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
        "gas": "0xf4240",
        "gasUsed": "0xb4a2",
        "to": "0x4200000000000000000000000000000000000015",
        "input": "0x3db6be2b000021f9000dd3ef0000000000000001000000006b12988b000000000195375b00000000000000000000000000000000000000000000000000000000...",
        "calls": [
          {
            "from": "0x4200000000000000000000000000000000000015",
            "gas": "0xe9b03",
            "gasUsed": "0x489b",
            "to": "0x6a97c5d55a21265326150efe12fc30fb21cbff56",
            "input": "0x3db6be2b000021f9000dd3ef0000000000000001000000006b12988b000000000195375b00000000000000000000000000000000000000000000000000000000...",
            "value": "0x0",
            "type": "DELEGATECALL"
          }
        ],
        "value": "0x0",
        "type": "CALL"
      },
      "txHash": "0x3c2ce509c485854992d5de1e47a8202a0b3e93e2270226a5c0a0b80a487e292d"
    },
    {
      "result": {
        "from": "0x009dcf67cc6d08394d72ddff30c14b7012896c29",
        "gas": "0x96cfb",
        "gasUsed": "0x60fd6",
        "to": "0x0000000071727de22e5e9d8baf0edac6f37da032",
        "input": "0x765e827f0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000009dcf67cc6d08394d72ddff30c14b70...",
        "calls": [
          {
            "from": "0x0000000071727de22e5e9d8baf0edac6f37da032",
            "gas": "0x148e8",
            "gasUsed": "0x65ea",
            "to": "0xa380ef7797fb48ddc63a085b815a74981e6a3dbf",
            "input": "0x19822f7c0000000000000000000000000000000000000000000000000000000000000060d6e226fa264ba5a15cb5e225de120b01776eb9359bda510a214c238d...",
            "output": "0x00006b12967b00006b129fdb0000000000000000000000000000000000000000",
            "value": "0x0",
            "type": "CALL"
          },
          {
            "from": "0x0000000071727de22e5e9d8baf0edac6f37da032",
            "gas": "0x7cc6f",
            "gasUsed": "0x4e5e4",
            "to": "0x0000000071727de22e5e9d8baf0edac6f37da032",
            "input": "0x0042dc530000000000000000000000000000000000000000000000000000000000000200000000000000000000000000a380ef7797fb48ddc63a085b815a7498...",
            "output": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "value": "0x0",
            "type": "CALL"
          }
        ],
        "value": "0x0",
        "type": "CALL"
      },
      "txHash": "0x976ede826ce145939ff1d6ba66d01aa5c8e9aea7fba57db427949a4516f870ce"
    }
  ]
}
```

```bash title="mainnet" theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl https://mainnet.worldchain.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"debug_traceBlockByNumber","params":["0x24bcf00",{"tracer":"callTracer"}],"id":1}'
    
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.