fix(validator): set Valid=false when ValidateTransactionBatch has per-item errors#769
fix(validator): set Valid=false when ValidateTransactionBatch has per-item errors#769ordishs wants to merge 2 commits intobsv-blockchain:mainfrom
Conversation
…-item errors (refs #4567)
|
🤖 Claude Code Review Status: Complete This PR correctly addresses a HIGH severity bug where Code Quality: The implementation is correct, efficient (early exit on first error), and well-tested with three comprehensive regression test cases covering mixed, all-valid, and all-invalid scenarios. Documentation: Godoc accurately updated to reflect the new behavior - the |
…ntics (refs #4567)
Benchmark Comparison ReportBaseline: Current: Summary
All benchmark results (sec/op)
Threshold: >10% with p < 0.05 | Generated: 2026-04-28 18:01 UTC |
|



Closes #4567.
Summary
The batch gRPC response hard-codes
Valid: trueregardless of per-item errors, so callers that branch on the top-level flag treat a fully-failed batch as success. The audit (#4567) classified this as HIGH because any client-side optimization that short-circuits onValid==truesilently accepts invalid transactions.Fix
Compute
validfromerrReasonsafterg.Wait():falseif any per-item error is non-nil,trueotherwise. SetValid: validin the response.Test plan
response.Valid == falseAND per-item errors are correctly populated.Valid == true, no errors.Valid == false.go test -race ./services/validator/...passes.