Skip to content

Commit e3b3af4

Browse files
committed
website: fix out-of-date tracing docs (#28406)
This update covers this PRs: - ethereum/go-ethereum#26414 - ethereum/go-ethereum#27183 - ethereum/go-ethereum#26291 - ethereum/go-ethereum#26048
1 parent 3a9247c commit e3b3af4

File tree

3 files changed

+72
-45
lines changed

3 files changed

+72
-45
lines changed

docs/developers/evm-tracing/custom-tracer.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,10 @@ If the step function throws an exception or executes an illegal operation at any
216216
- `gas` - Number, gas budget of the transaction
217217
- `gasUsed` - Number, amount of gas used in executing the transaction (excludes txdata costs)
218218
- `gasPrice` - Number, gas price configured in the transaction being executed
219-
- `intrinsicGas` - Number, intrinsic gas for the transaction being executed
220219
- `value` - big.Int, amount to be transferred in wei
221220
- `block` - Number, block number
222221
- `output` - Buffer, value returned from EVM
223-
- `time` - String, execution runtime
222+
- `error` - String, non-empty if there was an EVM error
224223
225224
And these fields are only available for tracing mined transactions (i.e. not available when doing `debug_traceCall`):
226225

docs/interacting-with-geth/rpc/ns-debug.md

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -494,36 +494,48 @@ References:
494494

495495
```js
496496
> debug.traceBlock("0xblock_rlp")
497-
{
498-
gas: 85301,
499-
returnValue: "",
500-
structLogs: [{
501-
depth: 1,
502-
error: "",
503-
gas: 162106,
504-
gasCost: 3,
505-
memory: null,
506-
op: "PUSH1",
507-
pc: 0,
508-
stack: [],
509-
storage: {}
497+
[
498+
{
499+
txHash: "0xabba...",
500+
result: {
501+
gas: 85301,
502+
returnValue: "",
503+
structLogs: [{
504+
depth: 1,
505+
error: "",
506+
gas: 162106,
507+
gasCost: 3,
508+
memory: null,
509+
op: "PUSH1",
510+
pc: 0,
511+
stack: [],
512+
storage: {}
513+
},
514+
/* snip */
515+
{
516+
depth: 1,
517+
error: "",
518+
gas: 100000,
519+
gasCost: 0,
520+
memory: ["0000000000000000000000000000000000000000000000000000000000000006", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000060"],
521+
op: "STOP",
522+
pc: 120,
523+
stack: ["00000000000000000000000000000000000000000000000000000000d67cbec9"],
524+
storage: {
525+
0000000000000000000000000000000000000000000000000000000000000004: "8241fa522772837f0d05511f20caa6da1d5a3209000000000000000400000001",
526+
0000000000000000000000000000000000000000000000000000000000000006: "0000000000000000000000000000000000000000000000000000000000000001",
527+
f652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f: "00000000000000000000000002e816afc1b5c0f39852131959d946eb3b07b5ad"
528+
}
529+
}]
530+
}
510531
},
511-
/* snip */
512532
{
513-
depth: 1,
514-
error: "",
515-
gas: 100000,
516-
gasCost: 0,
517-
memory: ["0000000000000000000000000000000000000000000000000000000000000006", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000060"],
518-
op: "STOP",
519-
pc: 120,
520-
stack: ["00000000000000000000000000000000000000000000000000000000d67cbec9"],
521-
storage: {
522-
0000000000000000000000000000000000000000000000000000000000000004: "8241fa522772837f0d05511f20caa6da1d5a3209000000000000000400000001",
523-
0000000000000000000000000000000000000000000000000000000000000006: "0000000000000000000000000000000000000000000000000000000000000001",
524-
f652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f: "00000000000000000000000002e816afc1b5c0f39852131959d946eb3b07b5ad"
525-
}
526-
}]
533+
txHash: "0xacca...",
534+
result: {
535+
/* snip */
536+
}
537+
}
538+
]
527539
```
528540

529541
### debug_traceBlockByNumber

docs/interacting-with-geth/rpc/ns-eth.md

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Executes a new message call immediately, without creating a transaction on the b
1515

1616
**Parameters:**
1717

18-
The method takes 3 parameters: an unsigned transaction object to execute in read-only mode; the block number to execute the call against; and an optional state override-set to allow executing the call against a modified chain state.
18+
The method takes 4 parameters: an unsigned transaction object to execute in read-only mode; the block number to execute the call against; an optional state override-set to allow executing the call against a modified chain state; and an optional set of overrides for the block context.
1919

2020
1. `Object` - Transaction call object
2121

@@ -43,21 +43,37 @@ The method takes 3 parameters: an unsigned transaction object to execute in read
4343
- It can be used for smart contract analysis by extending the code deployed on chain with custom methods and invoking them. This avoids having to download and reconstruct the entire state in a sandbox to run custom code against.
4444
- It can be used to debug smart contracts in an already deployed large suite of contracts by selectively overriding some code or state and seeing how execution changes. Specialized tooling will probably be necessary.
4545

46-
**Example:**
46+
**Example:**
47+
48+
```json
49+
{
50+
"0xd9c9cd5f6779558b6e0ed4e6acf6b1947e7fa1f3": {
51+
"balance": "0xde0b6b3a7640000"
52+
},
53+
"0xebe8efa441b9302a0d7eaecc277c09d20d684540": {
54+
"code": "0x...",
55+
"state": {
56+
""
57+
}
58+
}
59+
}
60+
```
61+
62+
4. `Object` - Block override set
63+
64+
The fields of this optional object customize the block as part of which the call is simulated. The object contains the following fields:
65+
66+
| Field | Type | Bytes | Optional | Description |
67+
|---------------|----------|-------|----------|----------------------------------------------------------|
68+
| `number` | Quantity | <32 | Yes | Fake block number |
69+
| `difficulty` | Quantity | <32 | Yes | Fake difficulty. Note post-merge difficulty should be 0. |
70+
| `time` | Quantity | <8 | Yes | Fake block timestamp |
71+
| `gasLimit` | Quantity | <8 | Yes | Block gas capacity |
72+
| `coinbase` | String | 20 | Yes | Block fee recipient |
73+
| `random` | Binary | 32 | Yes | Fake PrevRandao value |
74+
| `baseFee` | Quantity | <32 | Yes | Block base fee (see EIP-1559) |
75+
| `blobBaseFee` | Quantity | <32 | Yes | Block blob base fee (see EIP-4844) |
4776

48-
```json
49-
{
50-
"0xd9c9cd5f6779558b6e0ed4e6acf6b1947e7fa1f3": {
51-
"balance": "0xde0b6b3a7640000"
52-
},
53-
"0xebe8efa441b9302a0d7eaecc277c09d20d684540": {
54-
"code": "0x...",
55-
"state": {
56-
""
57-
}
58-
}
59-
}
60-
```
6177

6278
**Response:**
6379

0 commit comments

Comments
 (0)