Skip to content

eth/tracers: add transaction index to state-sync reciept

6758995
Select commit
Loading
Failed to load commit list.
Open

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

eth/tracers: add transaction index to state-sync reciept
6758995
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Apr 2, 2026 in 36m 57s

Code review found 1 important issue

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

Details

Severity Count
🔴 Important 1
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important consensus/bor/statefull/processor.go:214-224 ApplyStateSyncEvents: dead error check silently ignores EVM execution failures
🟡 Nit consensus/bor/abi/common.go:15-18 consensus/bor/abi/common.go: ABI parse errors silently swallowed at package init

Annotations

Check failure on line 224 in consensus/bor/statefull/processor.go

See this annotation in the file changed.

@claude claude / Claude Code Review

ApplyStateSyncEvents: dead error check silently ignores EVM execution failures

In `ApplyStateSyncEvents`, the error guard `if err \!= nil` at line 215 is dead code because `ApplyBorMessage` always returns `nil` as its Go error — EVM-level failures (reverts, gas exhaustion) are stored in `result.Err`, not the function's second return value. As a result, any EVM failure during state-sync event replay is silently ignored, `totalGasUsed` still accumulates gas from failed calls, and the final `ExecutionResult` is always returned with `Err: nil`, misleading tracers into believin

Check warning on line 18 in consensus/bor/abi/common.go

See this annotation in the file changed.

@claude claude / Claude Code Review

consensus/bor/abi/common.go: ABI parse errors silently swallowed at package init

The two package-level ABI variables in the new `consensus/bor/abi/common.go` file silently discard parse errors (`vABI, _ = abi.JSON(...)` and `sABI, _ = abi.JSON(...)`), leaving zero-value `abi.ABI{}` structs if the hardcoded ABI strings are ever malformed. This won't panic at startup and will only surface as a confusing runtime error when `Pack`/`Unpack` is first called; use a `mustParseABI` helper that panics on init instead.