trace_replayBlockTransactions — Polygon JSON-RPC

Status: Available

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.

POSThttps://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]:

blockParameterstringrequired
Block to replay: a 0x-prefixed hex block number (e.g. "0x4470eb3") or a tag ("latest", "earliest").
traceTypesarray of stringrequired
Use ["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.

resultarray
One entry per transaction in the block, in execution order.
result[].transactionHashstring
Hash of the transaction this entry replays.
result[].outputstring
Hex return data of the top-level transaction call.
result[].tracearray | null
Flat list of Parity call frames (present when "trace" was requested). Each frame has action, result, subtraces, traceAddress, and type.
result[].trace[].actionobject
The call/create that this frame performed (callType/from/to/value/gas/input, or creation fields).
result[].trace[].resultobject
Outcome of the frame: gasUsed and output (or an error string if it reverted).
result[].trace[].traceAddressarray
Path of child-call indices locating this frame in the call tree ([] is the top-level call).
result[].trace[].subtracesnumber
Count of direct child frames.
result[].stateDiffnull
Unsupported by this interface; always null, including when requested.
result[].vmTracenull
Unsupported by this interface; always null, including when requested.

Errors

CodeMeaningWhen it happens
403tier_insufficientYour key is below Pro tier (or lacks the polygon_trace scope). The error data includes current_tier, required_tier, and an upgrade_url.
429rate_limitedYou 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.
401unauthorizedMissing or invalid Authorization header.
HTTP 403method_unknownMethod not enabled for this key/chain.
-32602invalid paramsBad 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_filter is unavailable; do not use it as a range-query fallback.
  • See trace_block, trace_transaction and debug_traceBlockByNumber for related interfaces.