BNB Smart Chain

BNB Smart Chain

debug_traceBlock

Where the by-hash and by-number tracers ask the node to look a block up, debug_traceBlock hands the node the block. You pass raw RLP-encoded bytes and it re-executes them against the parent state, replaying every transaction at the opcode level. That decoupling is the whole point: the block need not sit on the canonical chain, or anywhere on disk, for you to trace it. Post the payload to BNB Smart Chain (BSC), chain ID 56, at https://bsc.therpc.io/YOUR_API_KEY. Because the parent state still has to exist for the replay to succeed, this is a heavy debug call that wants a debug-enabled archive node behind it.

Use cases

  • Trace a hand-built or modified block that never made it on-chain, the kind a simulation or test harness produces locally.
  • Replay a block straight from RLP bytes you already hold, such as a payload captured off the p2p wire before any node accepted it.

Parameters

#NameTypeRequiredDescription
1rlpBlockstringYesRLP-encoded block data. The block must be a valid, known block; the node re-executes it against the parent state.
2optionsobjectNoSame tracer configuration object as debug_traceTransaction.

Response

TypeDescription
arrayArray of per-transaction trace results in block order, identical in shape to debug_traceBlockByHash output.

Example request

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "debug_traceBlock",
"params": [
"0xf9...",
{}
],
"id": 1
}'

Try it live in the BNB Smart Chain playground.

Errors & troubleshooting

CodeMessageCause
-32601Method not founddebug namespace not enabled on the node.
-32602Invalid paramsRLP data is malformed, empty, or does not decode to a valid block structure.
-32000block not foundParent state for the provided block is not available (archive state missing).

Common pitfalls

  • Getting the RLP encoding byte-perfect is the awkward part. Most callers fetch the block via eth_getBlockByHash with full transactions, then re-encode it themselves.
  • The parent state has to be on disk for the replay to run. A pruned node will report the parent state as missing, so reach for an archive node on anything historical.
  • Cost tracks debug_traceBlockByHash because both replay the full block. A fat block returns a fat response and may be rate-limited on lower tiers.

Supported networks

  • Mainnet — Chain ID: 56
  • Testnet — Chain ID: 97

See also

Parameters

0x-prefixed RLP-encoded block

Same tracer configuration object as debug_traceTransaction.

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"debug_traceBlock","params":["",{}]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.