debug_traceCall
The debug_traceCall method executes a call without creating a transaction on the blockchain and returns detailed trace information about the execution. This allows developers to simulate and debug contract calls on the Kaia network before actually sending them.
This method is invaluable for pre-execution debugging, gas estimation validation, testing contract interactions without spending KAIA, and understanding complex call sequences. Developers can use it to debug contract calls before committing them to the blockchain, identify potential revert reasons, analyze internal function calls, optimize gas usage by examining execution traces, test different parameter combinations, and simulate calls at specific block heights to understand historical behavior. The ability to trace calls without state changes makes this perfect for safe testing and debugging.
This method is available only on the full archive node.
Parameters
parameter | type | description |
|---|---|---|
transaction | object (required) | Transaction call object with fields like from, to, gas, gasPrice, value, and data |
blockParameter | string (required) | Block number in hex format (e.g., '0x10d4f') or one of the string tags: 'latest', 'earliest', or 'pending' |
traceConfig | object (optional) | Configuration object to customize the trace output |
Transaction Object Properties:
property | type | description |
|---|---|---|
from | string (optional) | Address the transaction is sent from (20 bytes) |
to | string (required) | Address the transaction is directed to (20 bytes) |
gas | string (optional) | Gas provided for the transaction execution (hex) |
gasPrice | string (optional) | Gas price in wei (hex) |
value | string (optional) | Value transferred in wei (hex) |
data | string (optional) | Hash of the method signature and encoded parameters |
Trace Config Properties:
property | type | description |
|---|---|---|
tracer | string (optional) | The type of tracer: 'callTracer' for call tree, 'prestateTracer' for state diff, '4byteTracer' for method signatures, or custom JavaScript tracer code |
timeout | string (optional) | Maximum time allowed for the trace operation (e.g., '10s'). Defaults to '5s' |
disableStorage | boolean (optional) | Set to true to disable storage capture |
disableMemory | boolean (optional) | Set to true to disable memory capture |
disableStack | boolean (optional) | Set to true to disable stack capture |
Return Object
The method returns detailed trace information with structure depending on the tracer used, following the same format as debug_traceTransaction.
Request Example
Response Example