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
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | rlpBlock | string | Yes | RLP-encoded block data. The block must be a valid, known block; the node re-executes it against the parent state. |
| 2 | options | object | No | Same tracer configuration object as debug_traceTransaction. |
Response
| Type | Description |
|---|---|
| array | Array of per-transaction trace results in block order, identical in shape to debug_traceBlockByHash output. |
Example request
Try it live in the BNB Smart Chain playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32601 | Method not found | debug namespace not enabled on the node. |
-32602 | Invalid params | RLP data is malformed, empty, or does not decode to a valid block structure. |
-32000 | block not found | Parent 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_getBlockByHashwith 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_traceBlockByHashbecause 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.