fix(legacy/netsync): classify and observe pre-warm validation errors#785
fix(legacy/netsync): classify and observe pre-warm validation errors#785ordishs wants to merge 1 commit intobsv-blockchain:mainfrom
Conversation
|
🤖 Claude Code Review Status: Complete Summary: No issues found. This PR successfully adds observability to pre-warm validation errors while preserving drop semantics. What this PR does well:
Design rationale confirmed: |
|
Benchmark Comparison ReportBaseline: Current: Summary
All benchmark results (sec/op)
Threshold: >10% with p < 0.05 | Generated: 2026-04-29 03:30 UTC |



Closes #4590.
Summary
The
validateTransactionspre-warm path discarded all errors fromvalidationClient.Validatewith_, _ =. Policy errors during pre-warm are expected (warm-up runs before full validation), but critical errors (service unavailable, consensus-level tx invalidity, processing failures) were also silently swallowed. Ops had no signal that pre-warm was failing.Decision
Add observability (log + counter), keep drop semantics. Same pattern as #4585 (PR #781). Real validation runs at subtree-validation time and catches consensus violations on its own — making pre-warm part of the validation gate would risk false-positive block rejections from classification mistakes.
Fix
prometheusLegacyNetsyncPrewarmErrorscounter vec withclasslabel (tx_invalid,service,processing,policy,other).classifyAndCountPrewarmError(logger, err)that classifies viaerrors.Isand logs at the appropriate level (debug for policy, warn for service/processing/other, error for tx_invalid).Validatecall sites invalidateTransactions(small-batch path and goroutine-pool path) now capture the error and route through the helper.g.Wait()still ignored.Test plan
classifyAndCountPrewarmErrorfor each class; assert counter increments.go test -race ./services/legacy/netsync/...passes.