mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-08 07:58:40 +00:00
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. |
||
|---|---|---|
| .. | ||
| catalyst | ||
| downloader | ||
| ethconfig | ||
| fetcher | ||
| filters | ||
| gasestimator | ||
| gasprice | ||
| protocols | ||
| syncer | ||
| tracers | ||
| api_admin.go | ||
| api_backend.go | ||
| api_backend_test.go | ||
| api_debug.go | ||
| api_debug_test.go | ||
| api_miner.go | ||
| backend.go | ||
| dropper.go | ||
| handler.go | ||
| handler_eth.go | ||
| handler_eth_test.go | ||
| handler_snap.go | ||
| handler_test.go | ||
| peer.go | ||
| peerset.go | ||
| state_accessor.go | ||
| sync.go | ||
| sync_test.go | ||