Optimism
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Optimism
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
trace_replayTransaction replays a single historical OP Mainnet transaction and returns whichever combination of call-tree trace, opcode-level VM trace, and state diff you request through traceTypes. The stateDiff output is the standout: it maps every touched address to its balance, nonce, code, and storage changes, making it ideal for reconstructing exactly what a transaction altered. OP Mainnet is the OP Stack rollup where gas and value are denominated in ETH, chain ID 10 (0xa); send the request to https://optimism.therpc.io/YOUR_API_KEY with the transaction hash and your chosen trace types.
stateDiff to see which storage slot's value triggered the failure.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | transactionHash | string | نعم | Hash of the transaction to replay. |
| 2 | traceTypes | array | نعم | One or more of `"trace"`, `"vmTrace"`, `"stateDiff"`. At least one value is required. |
| النوع | الوصف |
|---|---|
| object | `{output, trace?, stateDiff?, vmTrace?}` — `trace` is the call tree, `stateDiff` maps each affected address to balance/nonce/code/storage diffs using `=` (unchanged), `+` (created), `-` (deleted), `*{from,to}` (modified), `vmTrace` is the Parity-format opcode trace. |
Try it live in the Optimism playground.
| الكود | الرسالة | السبب |
|---|---|---|
-32601 | Method not found | trace namespace not enabled or not supported by this client (primarily OpenEthereum/Nethermind/Erigon). |
-32602 | Invalid params | Transaction hash is missing/malformed or traceTypes is empty or contains unknown values. |
-32000 | transaction not found | Transaction does not exist or archive trace data is unavailable for that block. |
vmTrace on a complex OP Mainnet transaction produces enormous output; stick to trace or stateDiff when you do not need opcode-level detail.vmTrace format is Parity-specific — do not confuse it with the Geth debug_traceTransaction struct-log format.المعاملات
0x-prefixed 32-byte hash
["trace"] | ["trace","vmTrace","stateDiff"]