Skip to content

Commit

Permalink
Documented debug_traceCall (#1439)
Browse files Browse the repository at this point in the history
* Documented debug_traceCall

Signed-off-by: Atreay Kukanur <66585295+ATREAY@users.noreply.github.com>

* updated changes

Signed-off-by: Atreay Kukanur <66585295+ATREAY@users.noreply.github.com>

* -s added debug_traceCall method in objects.md

Signed-off-by: Atreay Kukanur <66585295+ATREAY@users.noreply.github.com>

* Update docs/public-networks/reference/api/index.md

Signed-off-by: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com>

---------

Signed-off-by: Atreay Kukanur <66585295+ATREAY@users.noreply.github.com>
Signed-off-by: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com>
Co-authored-by: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com>
  • Loading branch information
ATREAY and alexandratran authored Nov 16, 2023
1 parent 76f2b82 commit fb0b3cc
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 1 deletion.
72 changes: 72 additions & 0 deletions docs/public-networks/reference/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1741,6 +1741,78 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceBlockByNumber","param
# JSON result
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"gas": 21000,
"failed": false,
"returnValue": "",
"structLogs": [
{
"pc": 0,
"op": "STOP",
"gas": 0,
"gasCost": 0,
"depth": 1,
"stack": [],
"memory": [],
"storage": null,
"reason": null
}
]
}
]
}
```
<!--/tabs-->
### `debug_traceCall`
Performs an [`eth_call`](#eth_call) within the execution environment of a given block, using the final state of its parent block as the base, and provides a detailed trace of the executed opcodes.
#### Parameters
- `call`: _object_ - [transaction call object](objects.md#transaction-call-object)
- `blockNumber` or `blockHash`: _string_ - hexadecimal or decimal integer representing a block number, block hash, or one of the string tags `latest`, `earliest`, `pending`, `finalized`, or `safe`, as described in [block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter)
- `options`: _object_ - request options object with the following fields (all optional and default to `false`):
- `disableStorage`: _boolean_ - `true` disables storage capture.
- `disableMemory`: _boolean_ - `true` disables memory capture.
- `disableStack` : _boolean_ - `true` disables stack capture.
#### Returns
`result`: _array_ of _objects_ - list of [trace objects](objects.md#trace-object)
<!--tabs-->
# curl HTTP request
```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceCall","params":[{"from":"","to":"","gas":"0xfffff2","gasPrice":"0xef","value":"0x0","data":""},"latest",{"disableMemory":true,"disableStack":true,"disableStorage":true}], "id":1}' http://127.0.0.1:8545
```
# wscat WS request
```json
{
"jsonrpc": "2.0",
"method": "debug_traceCall",
"params": [{"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73","0x0050000000000000000000000000000000000000", "0xfffff2","0xef","0x0","0x0000000000000000000000000030000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000001"},"latest",{"disableMemory":true,"disableStack":true,"disableStorage":true}],
"id": 1
}
```
# JSON result
```json
{
"jsonrpc": "2.0",
Expand Down
2 changes: 1 addition & 1 deletion docs/public-networks/reference/api/objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Log information returned as part of the [Trace object](#trace-object).

## Trace object

Returned by [`debug_traceBlock`](index.md#debug_traceblock), [`debug_traceBlockByHash`](index.md#debug_traceblockbyhash), [`debug_traceBlockByNumber`](index.md#debug_traceblockbynumber), and [`debug_traceTransaction`](index.md#debug_tracetransaction).
Returned by [`debug_traceBlock`](index.md#debug_traceblock), [`debug_traceBlockByHash`](index.md#debug_traceblockbyhash), [`debug_traceBlockByNumber`](index.md#debug_traceblockbynumber), [`debug_traceTransaction`](index.md#debug_tracetransaction), and [`debug_traceCall`](index.md#debug_tracecall).

| Key | Type | Value |
| --- | :-: | --- |
Expand Down

0 comments on commit fb0b3cc

Please sign in to comment.