Repository navigation
fix(types): input validation and bounds checks - #1342
Conversation
Tighten validation and resource bounds in the types package: - Bound PartSetHeader.Total to MaxBlockPartsCount in ValidateBasic, so an oversized declared part count is rejected on the proposal path (via Proposal -> BlockID -> PartSetHeader.ValidateBasic) before allocation. - Bind a block part's outer Index to its proof Index in both Part.ValidateBasic and PartSet.AddPart, preventing a part from being relabeled into another slot. Adds the ErrPartSetIndexMismatch sentinel. - Make the threshold-signature recoverer return errors instead of terminating on inconsistent input: NewSignsRecoverer now returns (*SignsRecoverer, error) and the count-mismatch, non-precommit, and AddThresholdSignature paths return errors that propagate to the recovery call site. The quorum-time hard failure is left intentional and documented. - Cap the number of tracked peer majority claims per vote set (maxPeerMaj23s), dropping excess claims from unseen peers without erroring so callers do not disconnect honest peers. Adds table-driven tests for each change. 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:
📝 WalkthroughWalkthrough
ChangesSignsRecoverer error refactor and core validation hardening
Tests covering validation changes
Test callsites and helpers
Sequence Diagram(s)sequenceDiagram
participant Caller
participant NewSignsRecoverer
participant init as sigs.init
participant addVoteExtensionSigs
Caller->>NewSignsRecoverer: votes []*Vote
NewSignsRecoverer->>init: sigs.init(votes)
loop each vote
init->>addVoteExtensionSigs: validate extension state
alt extension rule violation or count mismatch
addVoteExtensionSigs-->>init: fmt.Errorf(...)
init-->>NewSignsRecoverer: error
NewSignsRecoverer-->>Caller: nil, error
else valid
addVoteExtensionSigs-->>init: nil
end
end
init-->>NewSignsRecoverer: nil
NewSignsRecoverer-->>Caller: *SignsRecoverer, nil
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 9d7a400) |
There was a problem hiding this comment.
Code Review
PR cleanly delivers its stated goals: PartSetHeader.Total bounded before allocation in ValidateBasic, Part.Index pinned to Proof.Index in both ValidateBasic and AddPart, NewSignsRecoverer returns errors instead of aborting on inconsistent input (with the remaining quorum-time panic documented as intentional), and maxPeerMaj23s caps peer-driven map growth without spurious peer disconnects. Test coverage tracks each change. Two non-blocking observations remain about the new code: a silent/order-dependent peer-cap drop path, and an ordering issue in addVoteExtensionSigs where state is initialized before the type guard. Claude's two findings were validated against source. Codex coverage was degraded: the Codex ACP session exited nonzero and did not produce usable review findings, so no Codex findings were carried forward.
🟡 1 suggestion(s) | 💬 1 nitpick(s)
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `types/vote_set.go`:
- [SUGGESTION] types/vote_set.go:397-430: maxPeerMaj23s cap is silent and order-dependent — log dropped claims and document the chosen bound
The cap correctly prevents unbounded growth of `peerMaj23s` and `votesByBlock`, but the drop path is invisible to operators and the chosen value is undocumented:
1. **First-come-first-served, silently.** Once 256 distinct peer IDs are recorded (line 427), every later first-time peer is dropped with `return nil`. Because `votesByBlock.peerMaj23` is only set when a peer's claim is accepted (lines 433-444), the late-arriving honest peer's claim is invisible — including to the conflicting-vote bypass that gates on `!votesByBlock.peerMaj23`. On a catching-up node whose first 256 peer slots happen to be filled by stale or attacker-driven claims for the wrong block, a legitimate maj23 signal for the actual winning block can be lost with no log line or metric to attribute the loss after the fact.
2. **256 vs. Dash LLMQ sizes.** Dash mainnet uses LLMQ types like `LLMQ_400_60` (400 members), and non-validator peers can also gossip `VoteSetMaj23Message`. 256 is plausibly above any realistic per-node peer count but is also close enough to one live quorum size that a future operator will want to know why this number was chosen. Add a justification on the `maxPeerMaj23s` doc comment ("chosen because…") and at minimum a `logger.Debug` (or a counter) on the drop path. Neither point is a blocker; flagging because silent dropping is the only safety net the reactor now has.
There was a problem hiding this comment.
Pull request overview
This PR strengthens input validation and bounds-checking in the types package to reduce DoS/memory-growth risk and to ensure inconsistent threshold-signature recovery inputs surface as errors rather than causing process aborts. It also updates in-repo call sites/tests to accommodate an exported API change (NewSignsRecoverer now returns an error).
Changes:
- Add bounds checks for
PartSetHeader.Totaland bindPart.Indexto its proof’s index to prevent relabeling. - Make
NewSignsRecoverer(and related vote-extension processing) return errors instead of panicking; update call sites accordingly. - Cap the number of tracked peer 2/3-majority claims per
VoteSetto bound peer-driven memory growth, with tests.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
types/vote_test.go |
Adjust test data to stay within new PartSetHeader.Total validation bounds. |
types/vote_set.go |
Adds maxPeerMaj23s cap and updates threshold-signature recovery to handle NewSignsRecoverer errors. |
types/vote_set_test.go |
Adds coverage for the peer-majority cap behavior and its effect on tracked state. |
types/validation_test.go |
Updates tests for new NewSignsRecoverer return signature. |
types/signs_recoverer.go |
Converts constructor/init paths from panics to errors and documents the new contract. |
types/signs_recoverer_test.go |
Updates existing tests and adds new error-path test coverage. |
types/proposal_test.go |
Adjusts part count values to satisfy new bounds checks. |
types/part_set.go |
Adds PartSetHeader.Total upper bound check and enforces part index/proof index binding. |
types/part_set_test.go |
Adds tests for PartSetHeader.Total validation and part index/proof binding. |
types/evidence_test.go |
Adjusts part count values to satisfy new bounds checks. |
light/helpers_test.go |
Updates for new NewSignsRecoverer return signature. |
internal/store/store_test.go |
Updates call site for new signature (but currently drops the constructor error). |
internal/state/validation_test.go |
Updates for new NewSignsRecoverer return signature. |
internal/state/test/factory/block.go |
Updates for new NewSignsRecoverer return signature. |
internal/state/helpers_test.go |
Updates for new NewSignsRecoverer return signature. |
- raise maxPeerMaj23s to 4096 (above any realistic peer count / LLMQ size) and document the bound; log dropped claims when the cap is hit - signs recoverer: check vote type before initializing extensions, and reject a vote whose extension count differs from the established count (was silently accepted on the zero-extension path) - store test: handle NewSignsRecoverer/Recover errors instead of discarding them Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
thepastaclaw
left a comment
There was a problem hiding this comment.
Code Review
The PR's added validation in NewSignsRecoverer leaves one concrete hole: a zero-extension vote arriving before the first extension-carrying vote silently bypasses the new mismatch detection, defeating the constructor's promised contract. A secondary defensive-depth gap remains in ThresholdVoteExtension.AddThresholdSignature where slice→array conversions can panic on malformed input; this is not reachable through normally validated votes (ValidatorProTxHash length is enforced in Vote.ValidateBasic), so it is a suggestion only. Note: validation was static; I did not run go test ./types.
🔴 1 blocking | 🟡 1 suggestion(s)
1 additional finding(s) omitted (not in diff).
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `types/signs_recoverer.go`:
- [BLOCKING] types/signs_recoverer.go:118-130: Zero-extension vote before the first extension-carrying vote bypasses mismatch detection
The new establishment logic only records the expected extension count from the first vote that actually carries extensions. With input order `[precommit(0 extensions), precommit(N extensions), ...]`, the first vote returns early at lines 120-122 without setting `v.voteExtensions`, the second vote then initializes `v.voteExtensions` from itself at line 123, and the length check at lines 127-130 sees `N == N` for every later vote. `NewSignsRecoverer` returns no error even though the input set is inconsistent. The added test (`zero extensions after non-zero established count`) only covers the reverse order. To honor the PR's promised constructor contract, track whether any vote has been observed (e.g., a separate `initialized` bool seeded on the first vote regardless of extension count), and reject a later non-empty extension set if earlier votes had zero, mirroring the existing reverse-direction check.
In `types/vote_extension.go`:
- [SUGGESTION] types/vote_extension.go:404-413: AddThresholdSignature panics on short validator/sig slices instead of returning an error
`AddThresholdSignature` converts `validator` to `[crypto.ProTxHashSize]byte` and `sig` to `ThresholdSignature` ([bls12381.SignatureSize]byte) without length checks. In Go 1.20+ both conversions panic when the slice length differs from the array length. Through the normal `NewSignsRecoverer` flow this is currently shielded because `Vote.ValidateBasic` (vote.go:268) enforces `ValidatorProTxHash` length and signature verification rejects malformed signatures, but this PR is explicitly about ensuring `NewSignsRecoverer` returns errors rather than aborting the process for inconsistent input. Adding length checks here closes the defensive gap and removes a latent panic from any future caller. The fix is local: validate both lengths, return an error, and only then perform the conversion (the existing length check in `ThresholdRecover` at line 422 happens too late).
…lidation - signs recoverer: establish the expected vote-extension count from the first vote observed (regardless of count) so a mixed-presence set is rejected in both orders, not only when zero-extension votes arrive last - part set: return ErrPartSetIndexMismatch from Part.ValidateBasic so callers can match it with errors.Is (PartSet.AddPart already did) - vote extension: validate validator/signature lengths in AddThresholdSignature before the array conversion, returning an error instead of panicking on malformed input Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
@thepastaclaw I need your review and approval |
|
@thepastaclaw I need your review and approval |
thepastaclaw
left a comment
There was a problem hiding this comment.
Code Review
PR cleanly resolves the prior recoverer/length-validation blockers. One in-scope suggestion remains: Commit.ValidateBasic does not propagate the new PartSetHeader.Total bound through BlockID.ValidateBasic, leaving CommitMessage as the only p2p-layer entry point that bypasses the validation contract the rest of this PR establishes. Go toolchain access was not granted to the Codex agent, so focused tests were not run; reasoning is from code inspection.
🟡 1 suggestion(s)
1 additional finding(s) omitted (not in diff).
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `types/block.go`:
- [SUGGESTION] types/block.go:855-866: Propagate PartSetHeader bound through Commit.ValidateBasic
Commit.ValidateBasic only rejects a nil BlockID; it never calls BlockID.ValidateBasic. Vote.ValidateBasic (types/vote.go:258), Proposal.ValidateBasic (types/proposal.go:78), Header.ValidateBasic (types/block.go:490), and BlockMeta.ValidateBasic (types/block_meta.go:82) all route through BlockID.ValidateBasic, which now enforces the new PartSetHeader.Total <= MaxBlockPartsCount bound this PR added. CommitMessage.ValidateBasic (internal/consensus/msgs.go:276) delegates straight to Commit.ValidateBasic, so an oversized commit BlockID.PartSetHeader.Total passes the p2p message-layer check and is only stopped later by the threshold-signature verify before NewPartSetFromHeader allocates in state_try_add_commit.go:61. That is defense-in-depth rather than a directly exploitable bug, but it leaves the exported ValidateBasic contract inconsistent with the rest of the PR. Add BlockID.ValidateBasic here so the new bound is enforced uniformly.
Commit.ValidateBasic checked for a nil BlockID but never called BlockID.ValidateBasic(), leaving the PartSetHeader.Total > MaxBlockPartsCount bound unenforced on the CommitMessage / p2p path. Add the call (after the nil check, consistent with every other ValidateBasic in the file) so an oversized PartSetHeader.Total is rejected before allocation. Also update TestCommit_ValidateBasic: add a dedicated case for the oversized-Total rejection, and supply a valid StateID in the fixtures that carry a non-nil Hash so they pass BlockID.ValidateBasic's StateID length check (which was added as part of this PR). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
thepastaclaw
left a comment
There was a problem hiding this comment.
Code Review
Cumulative re-review of PR #1342 at head 48220d4. The prior finding about Commit.ValidateBasic not propagating the new PartSetHeader.Total bound is FIXED in the latest commit (BlockID.ValidateBasic is now invoked from Commit.ValidateBasic, with a regression test added). No new in-scope findings: the codex-flagged vote-extension payload-identity gap in addVoteExtensionSigs is a real but pre-existing issue, present before the PR and neither introduced nor exposed/worsened by the PR's panic-to-error conversion and length/initialization tightening; recorded as out-of-scope for separate maintainer follow-up. PR is ready to merge.
…nsensus (SEC-001) (#1362) * fix(types): stop vote-extension count mismatch from halting consensus (SEC-001) A single Byzantine validator could broadcast a precommit for the about-to-commit block carrying a mismatched (e.g. zero) vote-extension count. Its own signatures are valid, so it passed every admission check and entered votesByBlock. Once the quorum threshold was crossed, types.SignsRecoverer either returned a length-mismatch error or - if the bad vote was in the minimal quorum-crossing set - left too few consistent extension shares to recover, and addVerifiedVote panicked, halting every node (a network-wide liveness DoS). PR #1342 relocated rather than removed this panic; v1.5.x silently skipped zero-extension precommits and so was not affected. Fix (both parts are needed): - signs_recoverer.go: restore the v1.5.x behaviour - a precommit with no vote extensions contributes only its block signature and is skipped for vote-extension recovery instead of producing an error. Dropping the share is safe: every vote's own extension signatures are verified against its validator key before admission (Vote.Verify -> QuorumSignData.Verify), so a Byzantine validator can influence only the count of extensions it offers, never their content. A genuine non-zero count mismatch is still reported (it has no safe canonical interpretation). - vote_set.go: addVerifiedVote no longer commits maj23 and crashes at the exact crossing vote. Because the BLS recovery threshold equals the consensus quorum threshold, the minimal crossing set may not yet hold enough consistent extension shares. It now tentatively sets maj23 (so the recoverer sees the correct quorum-reached state), attempts recovery, and on failure rolls maj23 back and retries as more honest votes arrive; maj23 is finalized only once recovery actually succeeds. A hard fail is retained solely for the genuinely-unattributable case where every validator has already voted for the block and recovery still fails. Adds TestVoteSet_AddVote_MismatchedVoteExtensionCountDoesNotHalt, which drives the real AddVote -> addVerifiedVote -> recovery path with the Byzantine vote added first and asserts no panic, quorum still reached, and a commit that verifies against the threshold public key. Updates two TestSignsRecovererErrors cases that asserted the removed #1342 behaviour. Co-Authored-By: Claude Opus 4.8 <[email protected]> * fix(types): recover vote-extensions from the count-consistent majority (SEC-001) Follow-up to 69ef559. That commit fixed the ZERO-extension trigger but a NON-ZERO count mismatch still halted: a Byzantine validator that precommits the winning block with, say, 1 extension while honest validators produce 2 would, once all validators had voted, hit the retained hard-fail panic ("received vote extensions with different length") - an ATTRIBUTABLE Byzantine input, contradicting the comment that the panic only covers unattributable errors. Root cause: addVoteExtensionSigs seeded the canonical extension count from the first vote and errored on any mismatch, so recovery could never fall back to the consistent honest majority. Fix: recover from the count-consistent majority, not the first vote. - vote_set.go: new canonicalVoteExtensionCount groups a block's votes by extension count and sums each group's voting power; the canonical count is the one backed by >= the threshold-signature recovery power. The bar is the FIXED, LLMQ-type-derived recovery threshold (QuorumTypeThresholdVotingPower), NOT the configurable commit gate (QuorumVotingThresholdPower). This matters: the VotingPowerThreshold override (GO-003) can set the commit gate below 1/2 of the power, under which two count-groups could both clear it and the smallest-count tie-break could wrongly pick a Byzantine count - starving recovery and halting the chain. The recovery threshold is always >= ~2/3 (> 1/2) of the quorum power, so at most one group can ever reach it: the selection is deterministic across nodes (no fork), the tie-break is unreachable, and the canonical count is always the honest one under < 1/3 Byzantine power. recoverThresholdSigns passes it to the recoverer and returns an error when no count reaches the threshold (handled by the existing retry/backstop). - validator_set.go: add QuorumTypeThresholdVotingPower (the type-derived recovery threshold, ignoring the override) and route QuorumVotingThresholdPower's fallback through it (no behaviour change); document that QuorumVotingThresholdPower honors the override. - signs_recoverer.go: WithCanonicalVoteExtensionCount makes addVoteExtensionSigs contribute extension shares only from votes carrying the canonical count - excluding a differing-count minority (zero OR non-zero) - while every vote still contributes its block signature. No count mismatch is treated as an error on this path. Excluding a vote is safe: each vote's own extension signatures are verified at admission, so a Byzantine validator can influence only the count it offers, never the content. The retained panic now fires only when every validator has voted yet no count is backed by the recovery threshold power (> 1/3 Byzantine, a BFT-safety violation) or the BLS layer is broken - genuinely unattributable, as the comment states. Also folds in two low-severity review items: - Document IsQuorumReached as lock-free, internal-use-only (called under voteSet.mtx) and non-monotonic during recovery (nil -> tentative -> nil), steering external callers to the locked accessors. No behaviour change. - Make the regression test name/coverage honest. Tests (types/vote_set_test.go): - TestVoteSet_AddVote_InconsistentVoteExtensionCountDoesNotHalt: table-driven over zero-count (all voted), non-zero mismatch (all voted), non-zero mismatch (not all voted); each asserts no panic + valSet.VerifyCommit. - TestVoteSet_AddVote_SubThirdCommitGateUsesRecoveryThreshold: with a sub-1/3 VotingPowerThreshold override, a Byzantine count must NOT be selected; asserts the honest count is canonical and the commit verifies. Fails (halts) on revert. - TestVoteSet_AddVote_NoRecoverableExtensionCountPanics: a > 1/3 split where no count reaches the recovery threshold must fire the backstop hard-fail. Co-Authored-By: Claude Opus 4.8 <[email protected]> * docs(types): correct recovery-threshold comments for quorum-type variability The three inline comments in vote_set.go and validator_set.go incorrectly asserted that the LLMQ recovery threshold is always >= ~2/3 (> 1/2) of quorum power. In practice some devnet/test types (LLMQType_DEVNET, TEST_DIP0024, DEVNET_DIP0024) have exactly 50% thresholds, while all production Platform types are >= 60%. The uniqueness argument (at most one extension-count group can reach the threshold) does not require > 1/2: under the standard < 1/3 Byzantine assumption the Byzantine group holds < 1/3 < 50% <= threshold for all supported types and therefore cannot form a qualifying group on its own. For > 1/2 threshold types the stronger pigeonhole guarantee additionally applies. The tiebreak is exercisable only under BFT-violating Byzantine stake. No logic changes; comments only. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(types): build threshold-sign verification from canonical vote, not triggering vote (SEC-001) quorumDataSigns was constructed from the just-added triggering vote (MakeQuorumSignsWithVoteSet at line 241) and passed into recoverThresholdSignsAndVerify. After recoverThresholdSigns selected the canonical-count group (votes backed by >= QuorumTypeThreshold power) and populated thresholdVoteExtSigs with canonicalCount signatures, makeQuorumSigns() returned a QuorumSigns with VoteExtensionSignatures of length == canonicalCount. But quorumDataSigns.VerifyVoteExtensions checked against the *triggering* vote's extension count via len(q.VoteExtensionSignItems) — causing a spurious length-mismatch error whenever the triggering vote carried a Byzantine-crafted count different from the canonical one. Attack scenario (gate > recovery threshold, supported by validateThreshold when VotingPowerThreshold is set): 10 validators @ 100 power, recovery=700, commit gate=800, 3 Byzantine with ext=1 voting last. 7 honest votes (ext=2) reach 700 (below gate); Byzantine vote 8 triggers (sum=800), recovery succeeds with canonical count 2 but verify fails (1 vs 2 sign items) → maj23 rollback. Same for votes 9 and 10 → all-voted backstop panic. Deterministic liveness DoS under an operator-configurable and validated configuration. Fix: after recoverThresholdSigns returns, find any vote in blockVotes whose total extension count matches len(thresholdVoteExtSigs) (the canonical count) and build the verification QuorumSignData from it. This guarantees sign-item count == recovered-signature count regardless of what the triggering vote carries. Also removes the now-dead quorumDataSigns parameter from recoverThresholdSignsAndVerify and addVerifiedVote, and the MakeQuorumSignsWithVoteSet call that only existed to supply it. Adds a deterministic regression test (gate=800 > recovery=700, Byzantine votes last) that panics pre-fix and passes with the fix. Adds a TODO for the perf suggestion (🟡 thepastaclaw): skip BLS recovery re-attempts when no count-group's power changed since last attempt (deferred; correctness before optimization). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(consensus): log swallowed recovery error, reset stale threshold sigs on rollback, clarify vote-copy Follow-up to the SEC-001 vote-extension fix in addVerifiedVote. Three self-review items on the recovery/rollback path: 1. Observability (:342): the error from recoverThresholdSignsAndVerify was surfaced only on the all-votes-present panic path; on the soft-retry path it was silently discarded. Thread a log.Logger into types.VoteSet (no-op default via functional option, so existing NewVoteSet callers compile unchanged) and propagate the real logger from consensus State through HeightVoteSet. Log the failure at Debug - it is an expected, benign retry that fires on every post-gate vote while maj23 is unset, so Warn/Error would be noise. The error is NOT propagated to AddVote (callers treat that as a rejected/punishable vote). 2. Stale-state rollback (:361): recoverThresholdSigns may set thresholdBlockSig/thresholdVoteExtSigs before the later verification fails. The rollback previously reset only maj23, leaving stale, unverified signatures behind. Reset both signature fields alongside maj23 so they are recomputed on the next successful recovery. 3. Clarity (:365): document why the error path intentionally skips copying votes into voteSet.votes - the vote already lives in the persistent votesByBlock bucket that the next recovery attempt reads, and voteSet.votes is the finalization "publish" step, which must not run while maj23 is rolled back. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(lint): correct British spelling flagged by misspell (behaviour→behavior) Two comment-only changes in height_vote_set.go and vote_set.go; swept all PR-changed Go files — no further British spellings found. Co-authored-by: Claudius the Magnificent <[email protected]> * style(types): convert TODO(perf) to NOTE(perf) per STYLE_GUIDE STYLE_GUIDE.md forbids TODO in source; single token change on vote_set.go:346. Co-authored-by: Claudius the Magnificent <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]>
Why this PR exists
typespackage accept values without fully validating their ranges or bounding resource use, and the threshold-signature recoverer aborts the process on inconsistent input instead of returning an error.What was done
PartSetHeader.TotaltoMaxBlockPartsCountinValidateBasic, so an oversized declared part count is rejected on the proposal path (Proposal→BlockID→PartSetHeader.ValidateBasic) before allocation.Indexto its proofIndexin bothPart.ValidateBasicandPartSet.AddPart, preventing a part from being relabeled into another slot. Adds theErrPartSetIndexMismatchsentinel.NewSignsRecoverernow returns(*SignsRecoverer, error), and the count-mismatch, non-precommit, andAddThresholdSignaturepaths return errors that propagate to the recovery call site. (The quorum-time hard failure is left intentional and documented.) All in-tree callers are updated.maxPeerMaj23s), dropping excess claims from unseen peers without erroring so honest peers are not disconnected.How Has This Been Tested?
go build ./...,go test ./types/..., and-raceruns over the changed areas (PartSet/SignsRecoverer/VoteSet) pass locally; CI runs the full suite.Breaking Changes
NewSignsRecoverersignature changes from*SignsRecovererto(*SignsRecoverer, error). It is exported from thetypespackage; all in-repo callers are updated in this PR. External importers that construct a recoverer directly will need to handle the returned error.Checklist
Attribution
🤖 Co-authored by Claudius the Magnificent AI Agent
Summary by CodeRabbit
New Features
Bug Fixes
Tests