Repository navigation
fix(light): correctness and robustness in client verification - #1353
Conversation
Verify query proofs and block results against the trusted header at the same height. AppHash and ResultsHash are committed in the header at the block's own height (same-block execution), so anchoring verification to the next height compared against a header that does not commit the data being verified. A witness that reports a header conflicting with the primary's now fails the comparison instead of being silently dropped; the dissenting witness is kept, since the primary may be the faulty party. The witness comparison goroutine also returns after reporting a conflict so each witness sends exactly one result on the channel. Validator-set responses from providers are nil-checked for the threshold public key and quorum hash before use, the threshold key is re-requested on a retry after a timed-out first attempt, and the pagination loop now advances the page index so a total that is not a multiple of the page size terminates. Adds table-driven tests covering same-block verification anchoring, the witness comparison flow, and the multi-page validator-set path. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Addresses misspell linter finding in errors.go. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Review complete (commit b3bbeff) |
thepastaclaw
left a comment
There was a problem hiding this comment.
Code Review
PR is a well-targeted light-client robustness fix: same-block proof anchoring (resp.Height instead of resp.Height+1), validator pagination page++, threshold-pubkey retry-on-timeout, nil-guards on ThresholdPublicKey/QuorumHash, and turning witness-vs-primary header conflicts into a hard failure instead of a silent witness drop (with the missing return after the conflict channel send in detector). Tests cover each behavior change. One small nit: a newly-introduced error message formats a *int64 with %d.
💬 1 nitpick(s)
Summary
Hardens the light client's verification path against several correctness and robustness issues.
Changes
H+1offset inlight/rpc/client.gothat verified proofs against the wrong header.provider/httppage increment so result sets whose total isn't a multiple of the page size no longer cause an infinite request loop.ThresholdPublicKey/quorumHashagainst nil before use.🤖 Generated with Claude Code