Skip to content

core/types: use bor system address as sender address of state-sync tr…

12ab66e
Select commit
Loading
Failed to load commit list.
Open

(feat): tracing support for state-sync transactions #2172

core/types: use bor system address as sender address of state-sync tr…
12ab66e
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Apr 3, 2026 in 41m 23s

Code review found 1 important issue

Found 2 candidates, confirmed 2. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 1
Severity File:Line Issue
🔴 Important core/parallel_state_processor.go:422-433 parallel_state_processor: Finalize receives raw statedb instead of tracingStateDB, suppressing OnLog hooks
🟣 Pre-existing eth/state_accessor.go:241-250 Resource leak in stateAtTransaction replay loop on ApplyMessage failure

Annotations

Check failure on line 433 in core/parallel_state_processor.go

See this annotation in the file changed.

@claude claude / Claude Code Review

parallel_state_processor: Finalize receives raw statedb instead of tracingStateDB, suppressing OnLog hooks

The parallel state processor adds OnTxStart/OnTxEnd hooks for state-sync transactions (lines 425-452) but passes raw statedb to Finalize (line 437) instead of a tracingStateDB wrapper, so OnLog hooks never fire for any logs emitted during state-sync EVM execution. The same PR explicitly fixed the sequential path (state_processor.go line 165) by passing tracingStateDB, but omitted the analogous fix in parallel_state_processor.go. Fix: create a tracingStateDB = state.NewHookedState(statedb, hooks)

Check notice on line 250 in eth/state_accessor.go

See this annotation in the file changed.

@claude claude / Claude Code Review

Resource leak in stateAtTransaction replay loop on ApplyMessage failure

This is a pre-existing resource leak in `stateAtTransaction` (`eth/state_accessor.go`): when `core.ApplyMessage` fails for any intermediate transaction in the replay loop (line 284–285), the function returns an error without calling `release()`, leaking the live trie node reference acquired from `stateAtBlock` at line 255. The PR's new bounds check at lines 244–247 is correctly placed before `stateAtBlock` and does not introduce this leak, but the pre-existing `ApplyMessage` failure path in the