Skip to content

Commit b5d0fbf

Browse files
authored
document debug.traceCall (#22382)
1 parent b7f5e58 commit b5d0fbf

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

docs/_rpc/ns-debug.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@ type StdTraceConfig struct {
361361
362362
This method is similar to `debug_standardTraceBlockToFile`, but can be used to obtain info about a block which has been _rejected_ as invalid (for some reason).
363363
364-
365364
### debug_traceTransaction
366365
367366
**OBS** In most scenarios, `debug.standardTraceBlockToFile` is better suited for tracing!
@@ -515,6 +514,54 @@ Usage example, returns the top element of the stack at each CALL opcode only:
515514
516515
debug.traceTransaction(txhash, {tracer: '{data: [], fault: function(log) {}, step: function(log) { if(log.op.toString() == "CALL") this.data.push(log.stack.peek(0)); }, result: function() { return this.data; }}'});
517516
517+
### debug_traceCall
518+
519+
The `debug_traceCall` method lets you run an `eth_call` on top of a given block. The block can be specified either by hash or by number. It takes the same input object as a `eth_call`.
520+
It returns the same output as `debug_traceTransaction`. A tracer can be specified as a third argument, similar to `debug_traceTransaction`.
521+
522+
`Object` - The transaction call object
523+
- `from`: `DATA`, 20 Bytes - (optional) The address the transaction is sent from.
524+
- `to`: `DATA`, 20 Bytes - The address the transaction is directed to.
525+
- `gas`: `QUANTITY` - (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.
526+
- `gasPrice`: `QUANTITY` - (optional) Integer of the gasPrice used for each paid gas
527+
- `value`: `QUANTITY` - (optional) Integer of the value sent with this transaction
528+
- `data`: `DATA` - (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation
529+
530+
| Client | Method invocation |
531+
|:-------:|-----------------------------------|
532+
| Go | `debug.TraceCall(args ethapi.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, config *TraceConfig) (*ExecutionResult, error)` |
533+
| Console | `debug.traceCall(object, blockNrOrHash, [options])` |
534+
| RPC | `{"method": "debug_traceCall", "params": [object, blockNrOrHash, {}]}` |
535+
536+
#### Example
537+
538+
No specific call options:
539+
```
540+
> debug.traceCall(null, "0x0")
541+
{
542+
failed: false,
543+
gas: 53000,
544+
returnValue: "",
545+
structLogs: []
546+
}
547+
```
548+
Tracing a call with a destination and specific sender, disabling the storage and memory output (less data returned over RPC)
549+
```
550+
debug.traceCall({
551+
from: "0xdeadbeef292929291929394949595949339292929,
552+
to:"0xde929f939d939d393f939393f93939f393929023",
553+
gas: "0x7a120",
554+
data: "0xf00d4b5d00000000000000000000000001291230982139282304923482304912923823920000000000000000000000001293123098123928310239129839291010293810"
555+
},
556+
"latest", {disableStorage:true, disableMemory: true})
557+
```
558+
Curl example:
559+
```
560+
> curl -H "Content-Type: application/json" -X POST localhost:8545 --data '{"jsonrpc":"2.0","method":"debug_traceCall","params":[null, "pending"],"id":1}'
561+
{"jsonrpc":"2.0","id":1,"result":{"gas":53000,"failed":false,"returnValue":"","structLogs":[]}}
562+
```
563+
564+
518565
### debug_verbosity
519566
520567
Sets the logging verbosity ceiling. Log messages with level

0 commit comments

Comments
 (0)