Commit graph

194 commits

Author SHA1 Message Date
Daniel Liu
5f3613e203
fix(eth): add index to callTracer log #33629 (#2044)
closes https://github.com/ethereum/go-ethereum/issues/33566

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2026-02-28 17:01:13 +04:00
Daniel Liu
9f720806e1
refactor(core): remove unnecessary parameters #30776 (#2068) 2026-02-20 13:51:30 +05:30
Daniel Liu
296d612167
fix(eth): align traceBlockParallel with Prague parent-hash pre-exec (#2067)
traceBlockParallel replays transactions from the parent state to build per-tx prestate for tracers. In the previous flow, Prague's parent-hash system contract processing was not applied before replay, so the prepared state could diverge from canonical block execution semantics.

This commit keeps the parallel tracing path consistent with block processing rules by applying ProcessParentBlockHash before tx replay when Prague is active.

The regression test TestTraceBlockParallelPragueParentHashSystemCall is strengthened to assert the actual EIP-2935 history slot value (ring-buffer key for block-1) equals block.ParentHash(), instead of relying on an indirect EXTCODESIZE side effect. This makes the test deterministic and directly tied to the bug.

Validation: go test ./eth/tracers -run TestTraceBlockParallelPragueParentHashSystemCall
2026-02-17 15:00:55 +05:30
Daniel Liu
bba58ec20b
fix(eth): fix state hooks in API #30830 (#2066) 2026-02-17 14:44:47 +05:30
Daniel Liu
cfca45a7eb
refactor(all): rework EVM constructor #30745 (#2065) 2026-02-17 14:35:18 +05:30
Daniel Liu
373037032f
fix(eth): do system contract processing prior to parallel-tracing #30520 (#2064) 2026-02-17 14:22:39 +05:30
Daniel Liu
cc2109342c
feat(core): implement EIP-2935 #29465 #30924 (#2033) 2026-02-12 09:01:26 +05:30
Daniel Liu
85f2bebfd1
refactor(all): move genesis initialization to blockchain #25523 (#2018) 2026-02-10 16:56:34 +05:30
Daniel Liu
d7a42cb038
refactor(core): clean up EVM environmental structure #31061 (#1985) 2026-02-10 16:40:54 +05:30
Daniel Liu
e39a523260
refactor(all): cleanup the APIs for initializing genesis #25473 #26747 (#2017)
* refactor(all): cleanup the APIs for initializing genesis #25473

* fix(core): fix accessor mismatch for genesis state #26747
2026-02-07 00:18:39 +05:30
Daniel Liu
d74c23cca1
perf(core): use uint256 in state #28598 (#1977) 2026-02-05 13:59:23 +05:30
Daniel Liu
3fd03e0814
core, core/types: rename AuthList to SetCodeAuthorizations #30935 (#1884) 2025-12-23 15:40:53 +05:30
Daniel Liu
8c380e76f5
core, eth/tracers: support debug_traceCall for special tx, fix #1870 (#1872)
- Fix "invalid transaction v, r, s values" error when calling debug_traceCall
  on BlockSigners contract (0x89)
- Fix "nonce too low" error by respecting Message.SkipNonceChecks flag
- ApplySignTransaction now accepts *Message and uses msg.From directly
- Add fallback to signature recovery for real transactions
- Skip nonce validation when SkipNonceChecks=true (for traceCall)
- Add comprehensive unit tests for both scenarios

Root cause: BlockSigners uses special fast-path that calls
ApplySignTransaction directly, which previously attempted signature
recovery on unsigned transactions from debug_traceCall.

Fixes #1870
2025-12-22 12:02:05 +05:30
Daniel Liu
510be504ef
eth/tracers: prestate lookup EIP7702 delegation account #32080 (#1828)
Implement https://github.com/ethereum/go-ethereum/issues/32078
Parse and lookup the delegation account if EIP7702 is enabled.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
2025-12-20 11:12:33 +05:30
Daniel Liu
142b1155d8
all: implement eip-7702 set code tx #30078 (#1759) 2025-12-19 14:09:45 +04:00
Daniel Liu
999ded17da
all: change chain head markers from block to header #26777 (#1846) 2025-12-16 07:36:51 +04:00
Daniel Liu
ebbbdf2bff
core/state: move state log mechanism to a separate layer #30569 #30732 (#1775) 2025-12-16 07:33:19 +04:00
Daniel Liu
7f89733a09
eth/tracers, core: handle non-EVM tx tracing, fix #1863 (#1865)
* Detect non-EVM special transactions and construct a synthetic top level callFrame in OnTxStart.
* GetResult returns the virtual frame for non-EVM txs to preserve debug API compatibility.
* Add bounds checks in OnTxEnd and OnLog to avoid panics when callstack is empty.
* Add unit tests to verify the fix
2025-12-15 12:33:32 +04:00
Daniel Liu
4c098ddf1f
core/vm: fold EVMInterpreter into EVM #32352 (#1838) 2025-12-04 10:31:40 +05:30
Daniel Liu
0050bef807
all: rework trc21 (#1777) 2025-11-18 11:24:56 +05:30
Daniel Liu
e34bbe10c6
core: persist bad blocks #21827 #27489 (#1771) 2025-11-15 16:51:21 +05:30
Daniel Liu
3af629078a
internal/ethapi: eth_simulateV1 #27720 (#1606) 2025-11-08 16:09:18 +05:30
Daniel Liu
6e8d261e42
all: eliminate zero owner variables (#1587) 2025-10-08 12:38:32 +08:00
Daniel Liu
8938e27932
all: move err to the last position of return values (#1581) 2025-10-08 12:29:38 +08:00
Daniel Liu
241a5b3fb2
all: using testing.B.Loop (#1554)
* p2p: using testing.B.Loop

* core/state: using testing.B.Loop

* eth: using testing.B.Loop

* log: using testing.B.Loop

* core: using testing.B.Loop

* core/vm: using testing.B.Loop

* core/types: using testing.B.Loop

* crypto: using testing.B.Loop
2025-09-24 07:59:48 +08:00
Daniel Liu
81e3bd0f90
eth/tracers/logger: fix json-logger output missing #30804 (#1502)
Fixes a flaw introduced in
https://github.com/ethereum/go-ethereum/pull/29795 , discovered while
reviewing https://github.com/ethereum/go-ethereum/pull/30633 .

Co-authored-by: Martin HS <martin@swende.se>
2025-09-21 18:53:13 +08:00
Daniel Liu
ff779bae72
eth/tracers: fill the creationMethod in flatCall #30539 (#1501)
`flatCallTracer` will now specify the type of a create in the action
via the `creationMethod` field.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-21 18:52:27 +08:00
Daniel Liu
af69d382ff
eth/tracers: various fixes #30540 (#1491)
Breaking changes:

- The ChainConfig was exposed to tracers via VMContext passed in
`OnTxStart`. This is unnecessary specially looking through the lens of
live tracers as chain config remains the same throughout the lifetime of
the program. It was there so that native API-invoked tracers could
access it. So instead we moved it to the constructor of API tracers.

Non-breaking:

- Change the default config of the tracers to be `{}` instead of nil.
This way an extra nil check can be avoided.

Refactoring:

- Rename `supply` struct to `supplyTracer`.
- Un-export some hook definitions.

Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
2025-09-17 09:04:38 +08:00
Daniel Liu
33b4940d56
core/tracing, eth/tracers/live: supply delta live tracer #29347 (#1475)
Introduces the first built-in live tracer. The supply tracer tracks ETH supply changes across blocks
and writes the output to disk. This will need to be enabled through CLI using the `--vmtrace supply` flag.

Co-authored-by: Chris Ziogas <ziogaschr@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-17 08:46:12 +08:00
Daniel Liu
ff68a46709
eth/tracers: fix json logger for evm blocktest #29795 (#1470) 2025-09-17 08:45:25 +08:00
wit liu
99e2885b03
all: fix misspell (#1510)
Co-authored-by: wit <wit765765346@gmail>
2025-09-17 08:27:52 +08:00
Daniel Liu
993c60f16c
eth/tracers/logger: improve markdown logger #30805 (#1508)
This PR improves the output of the markdown logger a bit.

- Remove `RStack` field,
- Move `Stack` last, since it may have very large vertical expansion
- Make the pre- and post-exec  metadata structured into a bullet-list

Co-authored-by: Martin HS <martin@swende.se>
2025-09-17 08:25:49 +08:00
Daniel Liu
20e3de2c4b
eth/tracers: add disableCode/Storage options for prestateTracer #30648 (#1498)
When using the prestateTracer, in some cases users are only concerned
with balances or nonce information, and are not interested in the lengthy
contract code or storage data.

Therefore, this PR introduces two new configuration options in the
`prestateTracerConfig` structure:
- `disableCode`
- `disableStorage`

These options allow users to control whether the tracer returns contract
code and storage data during execution tracing. By setting these
options, users can more flexibly customize their needs and focus on
obtaining information that is more critical and relevant to their
specific use cases.

These options work with the default mode as well as `diffMode: true`.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
2025-09-17 08:22:13 +08:00
Daniel Liu
35e5143fe7
eth/tracers: fix issues with benchmarks #30667 (#1500) 2025-09-17 08:18:51 +08:00
Daniel Liu
ea187b53bd
eth/tracers: flatCallTracer error compatible with parity #30497 (#1499)
Compatible error message in the flat call tracer with parity-style endpoints.

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
2025-09-17 08:18:09 +08:00
Daniel Liu
2b906f22f1
eth/tracers/js: avoid compiling js bigint when not needed #30640 (#1497)
While looking at some mem profiles from `evm` runs, I noticed that
`goja` compilation of the bigint library was present. The bigint library
compilation happens in a package `init`, whenever the package
`eth/tracers/js` is loaded. This PR changes it to load lazily when
needed.

It becomes slightly faster with this change, and slightly less alloc:y.

Non-scientific benchmark with 100 executions:
```
time for i in {1..100}; do ./evm --code 6040 run; done;
 ```

current `master`:

```
real    0m6.634s
user    0m5.213s
sys     0m2.277s
```
Without compiling bigint
```
real    0m5.802s
user    0m4.191s
sys     0m1.965s
```

Co-authored-by: Martin HS <martin@swende.se>
2025-09-17 08:17:18 +08:00
Daniel Liu
88086e820e
eth/tracers: fix golangci-lint warnings #30587 (#1489) 2025-09-13 10:51:42 +08:00
Daniel Liu
af6c09a5aa
eth/tracers/internal/tracetest: include tracerConfig in created tracing test #30364 (#1487)
Fixes the tracer test filler for when there is tracerConfig.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
2025-09-13 10:50:55 +08:00
Daniel Liu
f5e76ea6df
eth/tracers: avoid panic in state test runner #30332 (#1485)
Make tracers more robust by handling `nil` receipt as input.
Also pass in a receipt with gas used in the state test runner.
Closes https://github.com/ethereum/go-ethereum/issues/30117.

---------

Co-authored-by: Martin HS <martin@swende.se>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-13 10:50:10 +08:00
Daniel Liu
1597be6879
eth/tracers/js: add coinbase addr to ctx #30231 (#1484)
Add coinbase address to javascript tracer context.

This PR adds the `coinbase` address to `jsTracer.ctx`, allowing access
to the coinbase address (fee receipient) in custom JavaScript tracers.

Example usage:

```javascript
result: function(ctx) {
  return toAddress(ctx.coinbase);
}
```

This change enables custom tracers to access coinbase address,
previously unavailable, enhancing their capabilities to match built-in
tracers.

Co-authored-by: Dylan Vassallo <dylan.vassallo@hotmail.com>
2025-09-13 10:49:17 +08:00
Daniel Liu
ea239d5b15
eth/tracers, internal/ethapi: remove unnecessary map pointer in state override #30094 (#1483) 2025-09-13 10:41:51 +08:00
Daniel Liu
a00d95bf1a
eth/tracers/native: remove unnecessary check #30071 (#1477) 2025-09-13 10:40:18 +08:00
Daniel Liu
5ef325b759
eth/downloader, eth/tracer: fix typos in comments #29707 (#1472)
Co-authored-by: trillo <trillo8652@gmail.com>
2025-09-13 10:30:25 +08:00
Daniel Liu
db1082355d
eth/tracers: clear error for non-reverting pre-homestead fail #29824 (#1471)
Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
2025-09-13 10:29:34 +08:00
Daniel Liu
eb9af0b0af
eth/tracers: fix #29800 #29811 (#1467) 2025-09-13 10:27:18 +08:00
Daniel Liu
23e2e20da9
eth/tracers/native: fix flatCallTracer Stop() bug #29623 (#1465)
Co-authored-by: Dragan Milic <dragan@netice9.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-13 10:26:00 +08:00
Daniel Liu
47abf2eb16
core/vm: better error-info for vm errors #29354 (#1464)
Co-authored-by: Martin HS <martin@swende.se>
2025-09-13 10:20:34 +08:00
Daniel Liu
b896f4dce1
eth/tracers: use slices.Contains #29461 (#1463)
Co-authored-by: Aaron Chen <aaronchen.lisp@gmail.com>
2025-09-13 10:18:06 +08:00
Daniel Liu
bb458d0eed
eth/tracers/js: consistent name for method receivers #29375 (#1461)
Co-authored-by: Brandon Liu <lzqcn2000@126.com>
2025-09-13 10:16:43 +08:00
Daniel Liu
bcf007335a
eth/tracers/logger: using maps.Equal #29384 (#1460)
Co-authored-by: cui <523516579@qq.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-09-13 10:10:24 +08:00