debug_traceBlockByHash
Last updated:
debug_traceBlockByHash re-executes all transactions contained in the block with the
given hash and returns an EVM trace for each transaction, in block order. It is the
hash-addressed counterpart to debug_traceBlockByNumber
and produces the same per-transaction trace shape as
debug_traceTransaction.
Use it when you need to reconstruct exactly what happened inside a block — internal calls, value transfers, reverts, and state changes — without tracing each transaction individually. Common uses are indexing internal transactions, reconciling token transfers, and post-mortem analysis of a failed or exploited block.
Tracing replays the full block against an archived state, so it is significantly more
expensive than a normal read. It is gated to the pro and business tiers and rate
limited more tightly than eth_* reads. Choose a tracer with the tracer option to
control the output: omit it for the raw opcode-level struct log, or pass a built-in
tracer such as callTracer (call tree) or prestateTracer (touched state) for a
compact, structured result.
Parameters
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| result | object |
Examples
curl https://triport.io/sol \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"id":1,"method":"debug_traceBlockByHash","params":[],"jsonrpc":"2.0"}'const res = await fetch("https://triport.io/sol", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
body: JSON.stringify({
"id": 1,
"method": "debug_traceBlockByHash",
"params": [],
"jsonrpc": "2.0"
}),
});
const data = await res.json();import requests
resp = requests.post(
"https://triport.io/sol",
headers={"Authorization": "Bearer <api-key>"},
json={"id":1,"method":"debug_traceBlockByHash","params":[],"jsonrpc":"2.0"},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Networks: mainnet.
- Credit cost: 5 per call.
FAQ
- What does debug_traceBlockByHash do?
- Replays every transaction in a block (identified by its hash) through the EVM and returns a trace for each one.
- How many credits does debug_traceBlockByHash cost?
- debug_traceBlockByHash costs 5 credit(s) per call on Triport by default.
- Is debug_traceBlockByHash available over WebSocket?
- debug_traceBlockByHash is an HTTP JSON-RPC method.