Optimism
Bereit, das in der Produktion aufzurufen?
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
Optimism
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
debug_traceCall executes a call against a chosen OP Mainnet block state and returns a full opcode-level trace — all without broadcasting a transaction or spending any ETH. It is the simulation counterpart to debug_traceTransaction: you describe a call (the same fields as eth_call), pick a block to run it against, and the node traces the result, optionally applying state and block overrides. On OP Mainnet — the OP Stack rollup with ETH gas, chain ID 10 (0xa) — point the request at https://optimism.therpc.io/YOUR_API_KEY to preview exactly how a contract interaction would behave before you commit to it.
| # | Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
| 1 | transaction | object | Ja | Call object — same fields as eth_call: `from?`, `to`, `gas?`, `gasPrice?`, `maxFeePerGas?`, `maxPriorityFeePerGas?`, `value?`, `data?`. |
| 2 | blockParameter | string | Nein | Block number or tag defining the state against which the call is simulated.Standard: latest |
| 3 | options | object | Nein | Same tracer configuration object as debug_traceTransaction (tracer, tracerConfig, timeout, reexec, enableMemory, enableReturnData, disableStack, disableStorage, limit, debug). |
| 4 | stateOverrides | object | Nein | Optional map of address → { balance, nonce, code, state, stateDiff } overrides applied only for this call. |
| 5 | blockOverrides | object | Nein | Optional map of block-context fields to override (e.g. `number`, `time`, `gasLimit`, `coinbase`, `random`, `baseFee`) for the simulated call. |
| Typ | Beschreibung |
|---|---|
| object | Same shape as debug_traceTransaction: structLog array with default tracer, or tracer-specific object (callTracer, prestateTracer, etc.). |
Try it live in the Optimism playground.
| Code | Meldung | Ursache |
|---|---|---|
-32601 | Method not found | debug namespace not enabled on the node. |
-32602 | Invalid params | Transaction object is missing required fields or blockParameter is unrecognized. |
-32000 | execution reverted | Simulated call reverted; trace is still returned up to the revert point. |
coinbase, timestamp, or base fee — override these explicitly when it matters.callTracer or disable stack/memory/storage in the options to keep output small.Parameter
Call object — same fields as eth_call: `from?`, `to`, `gas?`, `gasPrice?`, `maxFeePerGas?`, `maxPriorityFeePerGas?`, `value?`, `data?`.
hex block number or "latest" | "earliest" | "pending"
Same tracer configuration object as debug_traceTransaction (tracer, tracerConfig, timeout, reexec, enableMemory, enableReturnData, disableStack, disableStorage, limit, debug).
Optional map of address → { balance, nonce, code, state, stateDiff } overrides applied only for this call.
Optional map of block-context fields to override (e.g. `number`, `time`, `gasLimit`, `coinbase`, `random`, `baseFee`) for the simulated call.