Skip to content

Merge branch 'develop' into state-sync-tracing

f499ceb
Select commit
Loading
Failed to load commit list.
Open

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

Merge branch 'develop' into state-sync-tracing
f499ceb
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Apr 7, 2026 in 41m 48s

Code review found 2 important issues

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

Details

Severity Count
🔴 Important 2
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important eth/tracers/state_sync_txn_tracer.go:64-73 stateSyncTxnTracer.OnTxEnd unconditionally calls inner OnTxEnd even when createdTopLevel is false, causing callTracer pa
🔴 Important eth/tracers/api.go:808-825 traceBlockParallel hardcodes txs[len(txs)-1] for state-sync tx, producing nil/wrong results when state-sync is not the l

Annotations

Check failure on line 73 in eth/tracers/state_sync_txn_tracer.go

See this annotation in the file changed.

@claude claude / Claude Code Review

stateSyncTxnTracer.OnTxEnd unconditionally calls inner OnTxEnd even when createdTopLevel is false, causing callTracer panic on 0-event state-sync tx

In `stateSyncTxnTracer.OnTxEnd` (state_sync_txn_tracer.go:71-73), the inner `OnTxEnd` is forwarded unconditionally regardless of whether `createdTopLevel` is true — unlike `OnExit` on line 67 which is correctly guarded. When a `StateSyncTxType` transaction carries zero bridge events, `ApplyStateSyncEvents` returns early and no EVM hooks fire, leaving the inner `callTracer`'s `callstack` empty; the unconditional `OnTxEnd` forward then causes a runtime panic (`index out of range [0] with length 0`

Check failure on line 825 in eth/tracers/api.go

See this annotation in the file changed.

@claude claude / Claude Code Review

traceBlockParallel hardcodes txs[len(txs)-1] for state-sync tx, producing nil/wrong results when state-sync is not the last transaction

In `traceBlockParallel` (api.go:773-825), the txloop sets `isStateSyncPresent = true` for any `StateSyncTxType` at index `i`, but the post-loop section unconditionally uses `txs[len(txs)-1]` and `TxIndex: len(txs)-1`, hardcoding the assumption that state-sync is always the last transaction. When `debug_traceBadBlock` is called on a malformed bad block where the state-sync tx is at position `j < len(txs)-1`, this produces three errors: (1) `results[j]` stays nil (loop skipped it with `continue`),