go-ethereum/eth/tracers/native
rayoo 2c846b5601 eth/tracers: forward V2 state hooks through mux tracer
The mux tracer never exposed OnNonceChangeV2 or OnCodeChangeV2 on the
Hooks struct it returns. A child tracer that only implements the V2
variants (which include a reason parameter - CodeChangeReason /
NonceChangeReason) silently received no events when wrapped behind the
mux.

Worse, OnCodeChangeV2 had a fanout method defined (added in #33148) but
was never wired into the outer Hooks{} literal, so it was dead code.
OnNonceChangeV2 had neither the fanout nor the wire.

Mirror the precedence already used in core/state_processor.go and the
OnSystemCall fix from #34862: expose only the V2 variants on the Hooks
struct, and have the fanout prefer each child's V2 hook, falling back
to V1 when only V1 is set. Exposing both V1 and V2 simultaneously would
have tripped the "cannot have both" guard in WrapWithJournal and made
statedb_hooked pick only V2 (so V1-only children would still lose
events).

Callers: a child tracer registered via muxTracer config that tracks
nonce changes with NonceChangeReason (e.g. to detect EIP-7702
authorizations vs contract creation) or code changes with
CodeChangeReason (e.g. to filter self-destruct from creation) was
functionally broken - no events reached the child at all for
OnNonceChangeV2, and OnCodeChangeV2 specifically became dead code
after #33148.

Add a regression test covering both V2-only and V1-only children.
2026-05-04 21:35:14 +08:00
..
4byte.go eth/tracers: various fixes (#30540) 2024-10-17 06:51:47 +02:00
call.go eth/tracers/native: add index to callTracer log (#33629) 2026-01-28 13:32:27 +01:00
call_flat.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
call_flat_test.go eth/tracers: various fixes (#30540) 2024-10-17 06:51:47 +02:00
erc7562.go eth/tracers/native: include SWAP16 in default ignored opcodes (#33381) 2025-12-10 15:13:47 +08:00
gen_account_json.go eth/tracers: fix codehash in prestate diffmode (#34675) 2026-04-16 16:51:26 +08:00
gen_callframe_json.go eth/tracers/native: set created address to nil in case of failure (#26779) 2023-03-07 14:39:11 +01:00
gen_callframewithopcodes_json.go eth/tracers/native: add erc7562 tracer (#31006) 2025-05-20 15:38:33 +02:00
gen_flatcallaction_json.go eth/tracers: add native flatCallTracer (aka parity style tracer) (#26377) 2023-02-28 13:54:37 +03:30
gen_flatcallresult_json.go eth/tracers: add native flatCallTracer (aka parity style tracer) (#26377) 2023-02-28 13:54:37 +03:30
keccak256_preimage.go eth/tracers/native: add keccak256preimage tracer (#32569) 2025-09-26 18:05:27 +02:00
keccak256_preimage_test.go eth/tracers/native: add keccak256preimage tracer (#32569) 2025-09-26 18:05:27 +02:00
mux.go eth/tracers: forward V2 state hooks through mux tracer 2026-05-04 21:35:14 +08:00
mux_test.go eth/tracers: forward V2 state hooks through mux tracer 2026-05-04 21:35:14 +08:00
noop.go eth/tracers: various fixes (#30540) 2024-10-17 06:51:47 +02:00
opcode_counter.go cmd/evm: add --opcode.count flag to t8n (#33800) 2026-02-17 20:42:53 +01:00
prestate.go eth/tracers: fix codehash in prestate diffmode (#34675) 2026-04-16 16:51:26 +08:00