🛠️ debug_traceCall
RPC Method (Base Chain)
The debug_traceCall
method simulates a transaction without sending it, then returns a detailed trace of what would happen if it were executed on-chain — all within the context of a specific block.
This is especially useful for debugging contract calls, testing edge cases, and exploring how gas, storage, and logic behave — before actually executing the transaction.
Parameters
1. Transaction Call Object [required]
This is the same structure as an eth_call
. You describe the transaction you want to simulate:
from
(optional) — The sender addressto
(required) — Target contract or recipientgas
(optional) — Gas limit (not charged, but may affect simulation)gasPrice
(optional) — Gas price in hexvalue
(optional) — ETH or token value to senddata
(optional) — Encoded function call (ABI). Learn ABI basics (opens in a new tab)
2. Block Parameter [required]
Pick which block context the simulation should run in:
- Hex block number (e.g.
"0xA12BC"
) "latest"
,"earliest"
,"pending"
"safe"
/"finalized"
(only supported on Ethereum + Arbitrum)
đź“– More about block tags (opens in a new tab)
Confused about input formatting? Ask in the Chainnodes Telegram Chat (opens in a new tab)
3. Trace Type & Options [optional]
You can specify a custom tracer for deeper debugging.
tracer
(string) — Choose one:callTracer
: Tracks internal calls, inputs, outputs, revertsprestateTracer
: Shows balance, nonce, and storage touched
tracerConfig
(object) — Optional advanced options:onlyTopCall
— Skip sub-calls and only trace the main one
Extra config for advanced tracing (optional):
Option | Description |
---|---|
disableStorage | Skip storage tracing (faster) |
disableStack | Skip EVM stack changes |
disableMemory | Skip memory tracking |
disableReturnData | Don’t trace return value |
timeout | Set a timeout (default: 5s ) for complex traces |
If you specify a tracer like callTracer
, options like disableMemory
, disableStack
, etc. will be ignored.
If you don’t set a tracer, the method will fall back to Geth's built-in opcode logger (opens in a new tab).
Need RPC API keys?
Get 12.5M archival requests for free today.
Returns
If using callTracer
Field | Description |
---|---|
type | Type of call (CALL, DELEGATECALL, etc.) |
from | Sender |
to | Recipient |
gas | Gas supplied |
gasUsed | Gas used |
value | Transferred amount |
input | Calldata |
output | Return value |
error | Error message (if any) |
calls | Internal sub-calls |
revertReason | If reverted, the revert message |
If using prestateTracer
-
Shows contract state touched by the simulation:
balance
— Current ETH balancecode
— Bytecodenonce
— Transaction countstorage
— Mapped storage slots
If using no tracer (Struct/opcode
default)
Returns an EVM step-by-step trace:
gas
— Total gas usedfailed
— Whether execution failedreturnValue
— What the contract returnedstructLogs
— Execution log for each opcode step:pc
,op
,gas
,gasCost
stack
,memory
,storage
depth
— Call depthrefund
,error
Request
POST https://base-mainnet.chainnodes.org/YOUR-API-KEY
Example
- HTTPS POST Request with a JSON RPC call in the body
- Replace
YOUR-API-KEY
with the API key from your CHAINNODES Dashboard (opens in a new tab) - You can use a different supported network by replacing
base-mainnet
curl https://base-mainnet.chainnodes.org/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"method":"debug_traceCall","params":[{"to": "0x6d2e03b7effeae98bd302a9f836d0d6ab0002766", "gasPrice": "0x174876E800"} ,"latest" ],"id":1,"jsonrpc":"2.0"}'
Body
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"structLogs": [],
"gas": 21000,
"failed": false,
"returnValue": ""
}
}
JSON-RPC Base API Documentation by CHAINNODES is based on Erigon node client. Contact us if you are interested in specific methods that are only available on geth, besu, Nethermind or reth