go-ethereum/eth/tracers
Daniel Liu 429d7aca05 eth/tracers: align traceBlockParallel with pre-exec system calls
traceBlockParallel rebuilt per-tx prestate by replaying transactions but did
not execute the same pre-exec system calls that traceBlock/traceChain apply
before transaction execution. This created a semantic mismatch under post-
merge forks (EIP-4788/Prague), where tracer-visible state could diverge from
the canonical block execution context.

Root cause
- The parallel fast-replay path initialized EVM and immediately started tx
  replay.
- It skipped:
  - ProcessBeaconBlockRoot (EIP-4788)
  - ProcessParentBlockHash (Prague / EIP-2935)

Fix
- In traceBlockParallel, after constructing EVM on parent state and before tx
  replay, execute the same pre-exec system calls as other tracing paths:
  - ProcessBeaconBlockRoot when block has a beacon root
  - ProcessParentBlockHash when Prague rules are active
- This makes parallel tracing state preparation behaviorally equivalent to
  traceBlock and traceChain.

Regression test
- Add TestTraceBlockParallelPragueParentHashSystemCall.
- Build a post-merge test chain (beacon+ethash faker), seed history storage
  contract in genesis, run traceBlockParallel, and assert that the EIP-2935
  ring-buffer slot for block-1 stores block.ParentHash().
- The test fails without the fix and passes with it.

Validation
- go test ./eth/tracers -run TestTraceBlockParallelPragueParentHashSystemCall
- go test ./eth/tracers -run 'TestTraceBlock|TestTraceCall|TestTraceTransaction'
2026-02-25 15:36:29 +08:00
..
internal eth/tracers/native: add index to callTracer log (#33629) 2026-01-28 13:32:27 +01:00
js core: miner: reduce allocations in block building (#33375) 2026-02-03 08:19:16 +01:00
live eth/tracers: fix supply tracer uncle accounting (#31882) 2025-08-26 15:44:16 +02:00
logger eth/catalyst: implement testing_buildBlockV1 (#33656) 2026-02-23 15:56:31 +01:00
native cmd/evm: add --opcode.count flag to t8n (#33800) 2026-02-17 20:42:53 +01:00
api.go eth/tracers: align traceBlockParallel with pre-exec system calls 2026-02-25 15:36:29 +08:00
api_test.go eth/tracers: align traceBlockParallel with pre-exec system calls 2026-02-25 15:36:29 +08:00
dir.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
live.go eth/tracers: various fixes (#30540) 2024-10-17 06:51:47 +02:00
tracers_test.go eth: using testing.B.Loop (#32657) 2025-09-19 17:00:29 -06:00
tracker.go eth/traces: add state limit (#25812) 2022-10-06 10:48:04 +02:00
tracker_test.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00