trace_replayBlockTransactions — Polygon JSON-RPC
Trace format. This interface returns Parity-style call frames. Where the response includes vmTrace and stateDiff, both are null: opcode traces and state diffs are not supported. For trace_callMany, calls are independent simulations and do not share the state changes of preceding calls.
https://triport.io/polygon- Network
- Polygon
- Scope
- polygon_trace
- Auth
- x-token: $TRIPORT_API_KEY (or Authorization: Bearer)
- Rate limit
- Pro — 3 rps · Business — 10 rps (burst above sustained)
Endpoint and plans: Polygon RPC endpoint.
This method replays the transactions of one block and groups call frames by transaction. Use it to correlate nested calls with their containing transactions. The adapter fills trace; it does not produce storage changes or opcode-level traces. Both stateDiff and vmTrace remain null.
Block-wide tracing can be expensive. Bound concurrency, handle execution errors per transaction and use trace_transaction when investigating only one transaction. trace_block exposes the block's call frames in a flat trace list. A block lookup alone does not prove that its execution state remains available for replay.
Parameters
Positional params array, [blockParameter, traceTypes]:
blockParameterstringrequired0x-prefixed hex block number (e.g. "0x4470eb3") or a tag ("latest", "earliest").traceTypesarray of stringrequired["trace"] for call frames. The vmTrace and stateDiff fields are unsupported and remain null.Response
result is an array with one entry per transaction in the block, in execution
order. Unsupported vmTrace and stateDiff fields are always null.
resultarrayresult[].transactionHashstringresult[].outputstringresult[].tracearray | null"trace" was requested). Each frame has action, result, subtraces, traceAddress, and type.result[].trace[].actionobjectcallType/from/to/value/gas/input, or creation fields).result[].trace[].resultobjectgasUsed and output (or an error string if it reverted).result[].trace[].traceAddressarray[] is the top-level call).result[].trace[].subtracesnumberresult[].stateDiffnullresult[].vmTracenullErrors
| Code | Meaning | When it happens |
|---|---|---|
403 | tier_insufficient | Your key is below Pro tier (or lacks the polygon_trace scope). The error data includes current_tier, required_tier, and an upgrade_url. |
429 | rate_limited | You exceeded your tier's RPS for polygon_trace (Pro 3 / Business 10), including burst. The data carries limit_rps, burst_capacity, and retry_after_sec — back off and retry. |
401 | unauthorized | Missing or invalid Authorization header. |
HTTP 403 | method_unknown | Method not enabled for this key/chain. |
-32602 | invalid params | Bad block parameter, or a traceTypes value other than "trace" / "vmTrace" / "stateDiff". |
Authentication, tier and rate-limit failures use HTTP status codes with top-level error fields. Execution failures use JSON-RPC errors. See the shared error reference.
Examples
JavaScript (fetch)
const res = await fetch("https://triport.io/polygon", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "trace_replayBlockTransactions",
params: ["0x4470eb3", ["trace"]],
}),
});
const { result } = await res.json();
console.log(result.length, "transactions replayed");Notes
- Retain transaction hashes and trace addresses when indexing nested calls. They identify a frame within a transaction.
- Null state-diff fields mean unsupported output, not proof that no state changed.
- Reconcile recent block results by block hash after a reorganization.
- Polygon
trace_filteris unavailable; do not use it as a range-query fallback. - See trace_block, trace_transaction and debug_traceBlockByNumber for related interfaces.