Arbitrum - Error: missing trie node

Arbitrum One debug_ methods return "missing trie node" for blocks before the Nitro upgrade (block 22,207,818); trace those blocks with arbtrace_ methods.

On Arbitrum One, missing trie node from a debug_* method means the block you asked for is from before the Nitro upgrade. Nitro nodes can't execute Classic (pre-Nitro) blocks, so debug_* methods work only from block 22,207,818 onward. To trace older blocks, call the arbtrace_* methods instead.

Symptom

A debug_* call for a pre-Nitro block fails with missing trie node. Example request and error with a pre-Nitro block (block 19,358,002):

curl 'https://arbitrum-one-mainnet.gateway.tatum.io' \
  --header 'content-type: application/json' \
  --header 'x-api-key: {YOUR_API_KEY}' \
  --data '{
    "jsonrpc": "2.0",
    "method": "debug_traceBlockByHash",
    "params": [
      "0xc99530cd6cd2dcb4e88bec85d8b97c67dcdd276918740604b6b097fe58f57fc7",
      {"tracer": "callTracer", "timeout": "1m"}
    ],
    "id": 1
  }'
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32000,
    "message": "missing trie node 0000000000000000000000000000000000000000000000000000000000000000 (path ) <nil>"
  }
}

The impacted Arbitrum debug_* methods are debug_getBadBlocks, debug_storageRangeAt, debug_traceBlockByHash, debug_traceBlockByNumber, debug_traceCall and debug_traceTransaction (see Arbitrum One JSON-RPC methods).

Cause

The Arbitrum chain went through a hard fork from Classic to Nitro on August 31, 2022. Nitro nodes keep the data of Classic blocks but can't execute anything on them, and debug_* methods need to execute a block's transactions or read its state. For a Classic block, that state isn't available, so the node returns missing trie node.

Block 22,207,818 is the first Nitro block on Arbitrum One; blocks before it are Classic blocks. As a result, debug_* methods only work from block 22,207,818 to the current one. Two empty blocks between Classic and Nitro, 22,207,816 and 22,207,817, are missing from Tatum's node data (see Node data history).

Arbitrum Nova and Arbitrum Sepolia started as Nitro chains, so they have no Classic blocks.

Solution

  1. Check the block number. If you have a block hash, get the block with eth_getBlockByHash. A number below 22,207,818 (0x152dd4a) is a Classic block. For the example hash, number is 0x1276132 (19,358,002):

    curl 'https://arbitrum-one-mainnet.gateway.tatum.io' \
      --header 'content-type: application/json' \
      --header 'x-api-key: {YOUR_API_KEY}' \
      --data '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0xc99530cd6cd2dcb4e88bec85d8b97c67dcdd276918740604b6b097fe58f57fc7",false],"id":1}'
  2. Trace Classic blocks with arbtrace_* methods. If you need to retrieve older (pre-Nitro) blocks, use the alternative arbtrace_* methods. They are the Classic counterparts of trace_* methods and return only the trace type (no vmTrace or stateDiff):

    • arbtrace_block: the traces of all transactions in a block.
    • arbtrace_callMany: runs a list of calls in sequence on a pre-Nitro block and returns their traces.
    • arbtrace_transaction: all traces of a pre-Nitro transaction.
    • arbtrace_call, arbtrace_filter, arbtrace_replayBlockTransactions and arbtrace_replayTransaction.

    For example, arbtrace_block returns the traces of the block from the symptom:

    curl 'https://arbitrum-one-mainnet.gateway.tatum.io' \
      --header 'content-type: application/json' \
      --header 'x-api-key: {YOUR_API_KEY}' \
      --data '{"jsonrpc":"2.0","method":"arbtrace_block","params":["0x1276132"],"id":1}'
    {
      "id": 1,
      "jsonrpc": "2.0",
      "result": [
        {
          "action": {
            "callType": "call",
            "from": "0x32e651fb28164021dd47562d5ac69b5e97105376",
            "gas": "0x11715",
            "input": "0x",
            "to": "0xd2a1e6ca1a1b5dfa00487113f792ea082174932c",
            "value": "0x110d9316ec000"
          },
          "blockHash": "0xc99530cd6cd2dcb4e88bec85d8b97c67dcdd276918740604b6b097fe58f57fc7",
          "blockNumber": 19358002,
          "result": {
            "gasUsed": "0x0",
            "output": "0x"
          },
          "subtraces": 0,
          "traceAddress": [],
          "transactionHash": "0xf59629e9bd578719f1301f554d0f1896b75319e9a8d8ab161ecc302384c54d20",
          "transactionPosition": 0,
          "type": "call"
        }
      ]
    }
  3. Use debug_* methods from block 22,207,818 on. For Nitro blocks, debug_* methods work as usual, and arbtrace_* methods don't.

FAQ

Why does arbtrace_block return "not supported by classic node"?

arbtrace_* methods only cover Classic blocks. For block 22,207,818 and later, they return an error such as block number 0x152dd4a is not supported by classic node. Use debug_* methods for those blocks.

What does "missing trie node" mean on other EVM chains?

It usually means the node doesn't have the state of the block you asked for, for example a full node that keeps only recent state: a Geth full node stores the most recent 128 block states. Queries on historical state need an archive node; see Archival data.

Still stuck?

Report an issue to support with the method, the block number or hash, the full response and its x-request-id.


Did this page help you?