> ## 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_traceBlockByHash

Traces every transaction in the block specified by block hash 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 Linea Mainnet can trace the last 512 blocks, about an hour. For older blocks, `debug_traceBlockByNumber` and `debug_traceBlockByHash` return an empty list even when the block has transactions, and `debug_traceTransaction` returns JSON-RPC error `-32603` with the message `Internal error`. The example below uses a block from 3 December 2026: replace it with a block or transaction from the last 512 blocks, for example from `eth_getBlockByNumber` with `"latest"`.

## **Parameters**

`blockHash` - String - Required - The block hash.

`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 transaction shown, nested calls cut to one per level)
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "txHash": "0x5dc8d47cfcda136bcd84d3661c7bbaf4e53e23ba70b46bb5a310481ed724a034",
      "result": {
        "from": "0xdeb02f83136766adf5f9add4a93b38de28087fee",
        "gas": "0x7a120",
        "gasUsed": "0x1c5ef",
        "to": "0x61b7492a40ae4c403629703a38d24851caa1e7e4",
        "input": "0xde5e0b9a000a5d7ac72f7f6e102979738bd07b91fc6346571ca8e2c44daa37c89f0a4f2d00000000000000000000000000000000000000000000000000000000...",
        "calls": [
          {
            "from": "0x61b7492a40ae4c403629703a38d24851caa1e7e4",
            "gas": "0x6d150",
            "gasUsed": "0x29c0",
            "to": "0x1f4b7011ee3d53969bb67f59428a9ec0477856e9",
            "input": "0x3937306f000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000...",
            "value": "0x0",
            "type": "CALL"
          }
        ],
        "value": "0x0",
        "type": "CALL"
      }
    }
  ]
}
```

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


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