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

# debug_traceBlockByNumber | Arc

> Arc API method that returns detailed traces for all transactions in a block specified by block number. Chainstack Arc reference.

Arc API method that returns detailed traces for all transactions in a block specified by block number. This is useful for analyzing all contract interactions within a specific block.

## Parameters

* `blockNumber` — the block number (hex) or tag (`latest`, `earliest`, `pending`)
* `tracerConfig` — (optional) tracer configuration object:
  * `tracer` — tracer type (e.g., `callTracer`, `prestateTracer`)
  * `timeout` — (optional) timeout for the trace
  * `tracerConfig` — (optional) tracer-specific configuration

## Response

* `result` — array of trace objects, one for each transaction in the block. The format depends on the tracer used.

For `callTracer`, each trace contains:

* `from` — sender address
* `to` — recipient address
* `gas` — gas provided
* `gasUsed` — gas consumed
* `input` — call data
* `output` — return data
* `calls` — nested array of internal calls
* `type` — call type (CALL, DELEGATECALL, etc.)

## `debug_traceBlockByNumber` code examples

<CodeGroup>
  ```javascript ethers.js theme={"system"}
  const ethers = require('ethers');
  const NODE_URL = "CHAINSTACK_NODE_URL";
  const provider = new ethers.JsonRpcProvider(NODE_URL);

  const traceBlock = async (blockNumber) => {
      const traces = await provider.send("debug_traceBlockByNumber", [
        blockNumber,
        { tracer: "callTracer" }
      ]);

      console.log(`Block contains ${traces.length} transaction traces`);
      for (let i = 0; i < traces.length; i++) {
        const trace = traces[i].result;
        console.log(`\nTx ${i}: ${trace.from} -> ${trace.to}`);
        console.log(`  Type: ${trace.type}, Gas Used: ${trace.gasUsed}`);
        if (trace.calls) {
          console.log(`  Internal calls: ${trace.calls.length}`);
        }
      }
    };

  traceBlock("latest");
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3

  node_url = "CHAINSTACK_NODE_URL"
  web3 = Web3(Web3.HTTPProvider(node_url))

  result = web3.provider.make_request("debug_traceBlockByNumber", [
      "latest",
      {"tracer": "callTracer"}
  ])

  traces = result['result']
  print(f"Block contains {len(traces)} transaction traces")

  for i, tx_trace in enumerate(traces):
      trace = tx_trace['result']
      print(f"\nTx {i}: {trace['from']} -> {trace.get('to', 'Contract Creation')}")
      print(f"  Type: {trace['type']}, Gas Used: {trace['gasUsed']}")
      if 'calls' in trace:
          print(f"  Internal calls: {len(trace['calls'])}")
  ```

  ```bash cURL theme={"system"}
  curl -X POST "CHAINSTACK_NODE_URL" \
    -H "Content-Type: application/json" \
    -d '{
      "jsonrpc": "2.0",
      "method": "debug_traceBlockByNumber",
      "params": ["latest", {"tracer": "callTracer"}],
      "id": 1
    }'
  ```
</CodeGroup>


## OpenAPI

````yaml openapi/arc_node_api/debug_and_trace/debug_traceBlockByNumber.json POST /
openapi: 3.0.0
info:
  title: Chainstack Node API
  version: 1.0.0
  description: This is an API for interacting with a Chainstack node.
servers:
  - url: https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c
security: []
paths:
  /:
    post:
      tags:
        - upload
      summary: debug_traceBlockByNumber
      operationId: debug_traceBlockByNumber
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: debug_traceBlockByNumber
                params:
                  type: array
                  default:
                    - '0x3480c62'
                    - tracer: callTracer
      responses:
        '200':
          description: Returns the result of debug_traceBlockByNumber.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        result:
                          type: object
                          properties:
                            from:
                              type: string
                            gas:
                              type: string
                            gasUsed:
                              type: string
                            to:
                              type: string
                            input:
                              type: string
                            output:
                              type: string
                            error:
                              type: string
                            revertReason:
                              type: string
                            calls:
                              type: array
                              items:
                                type: object
                                properties:
                                  from:
                                    type: string
                                  gas:
                                    type: string
                                  gasUsed:
                                    type: string
                                  to:
                                    type: string
                                  input:
                                    type: string
                                  output:
                                    type: string
                                  error:
                                    type: string
                                  revertReason:
                                    type: string
                                  calls:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        from:
                                          type: object
                                        gas:
                                          type: object
                                        gasUsed:
                                          type: object
                                        to:
                                          type: object
                                        input:
                                          type: object
                                        type:
                                          type: object
                                  value:
                                    type: string
                                  type:
                                    type: string
                            value:
                              type: string
                            type:
                              type: string
                        txHash:
                          type: string
              example:
                jsonrpc: '2.0'
                id: 1
                result:
                  - result:
                      from: '0x19d7cf8ea0ce468417d1eda365a222a9dcbc7d27'
                      gas: '0x927c0'
                      gasUsed: '0xc550'
                      to: '0xd011948bd0d6d433d4ba6df9dc44eb9a2bfa555f'
                      input: >-
                        0xb61d27f60000000000000000000000001ff9c167b50d05910ffdadb82d3d2da4508330ca0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000040a617bee00000000000000000000000000000000000000000000000000000000
                      output: >-
                        0x4e487b710000000000000000000000000000000000000000000000000000000000000012
                      error: execution reverted
                      revertReason: division or modulo by zero
                      calls:
                        - from: '0xd011948bd0d6d433d4ba6df9dc44eb9a2bfa555f'
                          gas: '0x89bee'
                          gasUsed: '0x5c52'
                          to: '0xd206ac7fef53d83ed4563e770b28dba90d0d9ec8'
                          input: >-
                            0xb61d27f60000000000000000000000001ff9c167b50d05910ffdadb82d3d2da4508330ca0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000040a617bee00000000000000000000000000000000000000000000000000000000
                          output: >-
                            0x4e487b710000000000000000000000000000000000000000000000000000000000000012
                          error: execution reverted
                          revertReason: division or modulo by zero
                          calls:
                            - from: '0xd011948bd0d6d433d4ba6df9dc44eb9a2bfa555f'
                              gas: '0x7530'
                              gasUsed: '0xf1'
                              to: '0x1ff9c167b50d05910ffdadb82d3d2da4508330ca'
                              input: >-
                                0x01ffc9a701ffc9a700000000000000000000000000000000000000000000000000000000
                              type: STATICCALL
                            - from: '0xd011948bd0d6d433d4ba6df9dc44eb9a2bfa555f'
                              gas: '0x82a56'
                              gasUsed: '0xb84'
                              to: '0x1ff9c167b50d05910ffdadb82d3d2da4508330ca'
                              input: '0x0a617bee'
                              output: >-
                                0x4e487b710000000000000000000000000000000000000000000000000000000000000012
                              error: execution reverted
                              revertReason: division or modulo by zero
                              value: '0x0'
                              type: CALL
                          value: '0x0'
                          type: DELEGATECALL
                      value: '0x0'
                      type: CALL
                    txHash: >-
                      0xfc48f7c70e8ffaa46b1110dc43f32e90f65434a0949edab384d066c820c57ee2

````