Skip to content

fix(state): let validators recover quorum public keys after a key-less update - #1656

Merged
lklimek merged 14 commits into
devfrom
fix/valset-public-keys-refresh
Dec 2, 2026
Merged

lklimek merged 14 commits into
devfrom
fix/valset-public-keys-refresh

Conversation

@lklimek

@lklimek lklimek commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

TL;DR: Validators can resume proposal and vote verification when their quorum keys arrive, and report when those keys are missing.

User story

As a Dash Platform node operator, I want my validator to resume participation when it receives the quorum keys and alert me while it is waiting for them.

Scenario

Base flow

The application sends Tenderdash a new quorum. Its first update omits the member public keys and a later update for the same quorum supplies them.

Actual behavior

The node can remain unable to verify proposals or collect votes after the keys arrive. It can reject its own proposal and lose its proposer turn. While its keys are unverified, a stale proposer key can also cause it to reject a genuine proposal for a block that already has a verified commit.

Expected behavior

The node uses the validated keys at the height after the update is committed. While the set is unready, it accepts a proposal when a verified commit matches its height, round and block ID. An active validator logs one ERROR per continuous period of missing keys for its quorum and sets a metric to 1. When that quorum's keys are restored, it logs one INFO and sets the metric to 0. Until its keys are verified, the node does not send a proposal when its turn comes. The network moves to the next round once the other validators time out or enough of them vote to skip it. Validators need verified quorum keys to send their own round-skip votes and can still follow valid round-skip certificates from peers while waiting for those keys.

Detailed discussion

What was done

This PR targets dev.

  • NewValidatorSetCheckPublicKeys, used for nonempty genesis sets and quorum rotation, derives HasPublicKeys from share presence. ValidatorSetFromProto derives it from decoded shares and calls ValidateBasic, which validates complete shares against the threshold public key.
  • UpdateWithChangeSet derives availability after applying membership changes. A replaced member can retain an omitted share from a ready set with the same quorum hash and threshold key. A same-quorum ABCI update to a ready set must leave all members with shares after eligible shares are retained. Same-quorum ABCI updates that complete a set using unverified shares from unchanged members must recover the threshold key to mark the set ready. A complete set supplied by ABCI must pass validation. Updates without member changes preserve the readiness flag.
  • The local consensus store and the light client's trusted store share a compatibility decoder. It covers current, previous and historical consensus sets and both light-block lookups. If complete shares in a legacy false-flag record fail validation, the record loads with HasPublicKeys=false once structural checks pass. Both stores retain the individual shares, which the consensus store supplies for historical evidence verification. Peer protobuf decoding rejects inconsistent complete shares.
  • Outbound P2P light blocks omit the member and proposer public keys when the local validator set is unready. The validator-set hash still commits to the quorum hash and threshold public key. Ready sets include their keys.
  • When the current set has HasPublicKeys=false, proposal verification uses the existing matching-commit path, even if the selected proposer retains a public key. A ready set with a proposer key verifies the individual proposal signature. This also applies to the node's own proposal: an unready proposer cannot verify it before a matching commit exists, so it neither accepts nor gossips it and its round times out. A node with an unready set is not trusted to vouch for a proposal, including its own. Local round-skip vote signing and broadcasts, including resends, require HasPublicKeys=true. The node continues processing peer round-skip votes and certificates. An unready set tracks no prevotes, so proposal gossip omits the ProposalPOL message for it. Without a matching commit, an unready validator's local prevote is nil and is not sent: it prevotes nil after the propose timeout, and vote intake refuses its own votes while the set is unready.
  • The gauge is tendermint_consensus_validator_missing_quorum_keys with the default instrumentation.namespace. It is 1 while the local node belongs to the active quorum and the set lacks verified keys, and 0 otherwise.

Application-side delivery of keys for the active quorum and recovery of an already stalled height are outside this PR.

Testing

  • types covers readiness after change sets and protobuf decoding with either wire flag. TestValidatorSetEmptyChangeSetIsNoOp verifies that an empty change set preserves the entire validator set, including its readiness flag.
  • internal/state covers same-quorum refreshes, rejection of invalid shares and additions without shares to ready quorums, partial refresh after reload, updates without member changes, and reloading complete, consistent or inconsistent legacy shares.
  • light/store/db adds TestLightStoreReloadKeepsInconsistentLegacyPublicKeys. It reopens the trusted store, checks that LightBlock and LightBlockBefore preserve the legacy shares and flag, and verifies that the peer decoder rejects the same record.
  • internal/statesync covers strict receiver decoding of a served light block from an unready set with retained, inconsistent shares. It checks the validator-set hash, local share retention and the full protobuf response for ready sets.
  • internal/consensus covers proposal and vote verification after refresh and readiness logs and metrics for validators and observers. It also covers proposal acceptance and block application with a verified matching commit and a stale proposer key in an unready set, plus rejection of an invalid proposal signature in a ready set with a matching commit.
  • Local verification on 4d334703 plus the ready-quorum validation change passed targeted and full race tests in internal/state and types, and diff lint in internal/state.
  • Local verification on bc43b6b19 plus the validator-store and empty-change-set fixes passed targeted and full race tests and diff lint in types, internal/state and light/store/db. Earlier local race tests covered quorum recovery in internal/consensus and evidence verification in internal/evidence. The published GitHub checks recorded for c564cefe5 cover that revision.
  • Local verification on f7b12d146 plus the proposal fix passed targeted race tests and diff lint in internal/consensus. The full race run timed out waiting for a prevote in TestLoadHeightProgressUnderSustainedFlood. The test passed in isolation with the fix and with the starting production code.
  • TestStateRoundSkipVoteRequiresReadyValidatorSet checks that a ready validator sends its own skip vote and an unready validator withholds its own vote, counts a valid peer vote, and advances on a peer certificate.
  • TestGossiper/TestGossipProposalWithoutPrevotes checks that the proposal is sent without ProposalPOL when local prevotes are unavailable.
  • The full ./internal/consensus package passed with the race detector on c573f6773 and 53d3f6965.

Breaking changes

None.

🤖 Co-authored by Claudius the Magnificent AI Agent

🤖 Generated with Claude Code

PR Hygiene · 728d5fe

  • Bots — thepastaclaw ✓
  • Self-review — posted; again after any push
  • Build green
  • Approvals — you own every area touched; none needed

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

lklimek and others added 3 commits November 26, 2026 15:11
…m updates

A validator set's HasPublicKeys flag decides whether a node can verify
proposals and collect votes. A same-quorum validator-set update copied
the old flag and UpdateWithChangeSet never recomputed it, so a node
that first received a quorum without member public keys stayed unable
to verify proposals or votes for that whole quorum, even after the
application later supplied the keys.

Derive the flag from the resulting set wherever a set is built or
updated: same-quorum updates, UpdateWithChangeSet, the genesis state,
sets loaded from protobuf (the stored flag is local derived state) and
the light client's HTTP provider. Sets with keys are validated as
NewValidatorSetCheckPublicKeys does. Hashes, proposer selection and
sign bytes are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
When this node is a member of the active quorum but its validator set
lacks the members' public keys, it cannot verify proposals or collect
votes. Log an error once per quorum and set the new gauge
consensus_validator_missing_quorum_keys to 1 until the keys arrive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Log at INFO when a quorum's missing member keys arrive, so the earlier
error has a matching recovery line, and skip the readiness report when
the store has no metrics or logger. Test that ValidatorSetFromProto
ignores the wire has_public_keys flag in both directions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@lklimek lklimek added this to the v2.0 milestone Nov 26, 2026
@thepastaclaw

thepastaclaw commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Final review complete — no blockers (commit 728d5fe) · triage: critical

@lklimek
lklimek marked this pull request as ready for review November 27, 2026 21:53

@lklimek lklimek left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/self-reviewed

@github-actions

Copy link
Copy Markdown

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Nov 27, 2026

@thepastaclaw thepastaclaw left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final validation — Phase 2 only (queue backlog)

Updated after discussion: 1 finding(s) of this review were settled in the inline threads; 2 blocking finding(s) still stand.

  • ⏭️ Deferred (maintainer decision): 🟡 Validators can keep waiting after Core learns the active quorum's shares (tracked in dashpay/platform#6339)

Changes requested: 2 blockers

  • A same-quorum address update can erase keys a validator already has — types/validator_set.go:930-934 (new)
    Impact: A validator whose local keys are ahead of Drive's cache can stop collecting votes at the next height after a routine metadata update, and consensus can stall if too few validators remain able to form a commit.
  • Oversized HTTP validator sets now trigger BLS recovery before the size check — light/provider/http/http.go:258-264 (new; not shown inline, see below)
    Impact: A light client or RPC state-sync node can spend substantial CPU on a validator set it must reject, delaying failover beyond the provider deadline.

This PR recomputes quorum-key availability so validators can resume proposal verification and vote collection at the next height after a complete, valid ABCI refresh, and adds a readiness gauge and logs. The Linux build, vet, lint, vulnerability scan, unit tests, app tests, and both end-to-end jobs passed; the review and PR Hygiene checks were pending.

🔴 2 blocking | 🟡 2 1 suggestion(s)

1 finding(s) not shown inline (the lines are not part of this PR's diff)

🔴 Blocking: Oversized HTTP validator sets now trigger BLS recovery before the size check
Impact: A light client or RPC state-sync node can spend substantial CPU on a validator set it must reject, delaying failover beyond the provider deadline.
light/provider/http/http.go:258-264

The new constructor marks a complete-looking response as keyed, so this first ValidateBasic call invokes quadratic BLS interpolation before checking the canonical quorum size. On the base, this call used HasPublicKeys=false and rejected oversized sets for known quorum types before recovery. The pagination loop caps requests but not the number of entries returned, and recovery does not observe the request context while the light client holds providerMutex. Successful multi-member fetches also recover the same key again in LightBlock.ValidateBasic; on the base only that final check recovered it. Enforce actual page and aggregate limits, check the quorum's structural constraints before BLS work, and validate complete shares once at the light-block boundary.

source: gpt-6.2-sol (phase2-reviewer: general, tenderdash-consensus-security)

Review provenance

Source: reviewer 1: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: tenderdash-consensus-security); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: tenderdash-consensus-security); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: normal by gpt-6.2-sol (effort low) — The diff changes quorum key availability and validation across several paths, but the changes are narrow and do not alter signature verification rules.
  • Phase 1 reviewers: not run (skipped for throughput: 29 PRs queued, above the 10 limit)
  • Second Phase-2 pass: on this first full review every Phase-2 reviewer also ran a second, independent time, and the verifier weighed both sets
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.2-sol — tenderdash-consensus-security (completed, effort high); agent phase2-reviewer, gpt-6.2-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.2-sol — tenderdash-consensus-security (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `types/validator_set.go`:
- [BLOCKING] types/validator_set.go:930-934: A same-quorum address update can erase keys a validator already has
  Impact: A validator whose local keys are ahead of Drive's cache can stop collecting votes at the next height after a routine metadata update, and consensus can stall if too few validators remain able to form a commit.
  A validator can lose vote collection without a quorum rotation. State sync can install a complete set from local Dash Core (`internal/statesync/stateprovider.go:348`, `:446–502`), independently of Drive's cache. Drive 5.1.0-rc.1 sends its cached set on a same-quorum address change and leaves `pub_key` absent for members whose shares it did not cache. Tenderdash allows that omission, replaces the matching member record in `applyUpdates`, and now clears `HasPublicKeys` instead of rejecting the missing share as the base did on a fully keyed node. With the quorum hash and threshold key unchanged, the block's `NextValidatorsHash` still matches, but the next height's `HeightVoteSet` drops incoming votes. Preserve existing shares for retained members when a positive-power update omits them and both the quorum hash and threshold key are unchanged. Continue validating supplied replacements, and test that vote collection survives the metadata update.
- [SUGGESTION] types/validator_set.go:1341-1344: Previously accepted inconsistent shares can prevent an upgraded node from starting
  Impact: An operator cannot start from an existing database if either saved validator set contains a complete set of legacy shares that does not recover the recorded threshold key.
  The node can fail before the application gets a chance to correct its data. On the base, a same-quorum update on a keyless set inherited `HasPublicKeys=false`, so individually valid shares that did not recover the threshold key could be persisted and reloaded. The new decoder enables recovery for any complete set and rejects those bytes. `internal/state/state.go:247–257` decodes both current and previous sets, and `node/node.go:743–749` returns either error from startup. This is a compatibility risk for databases populated by such ABCI updates; the reported Drive cache path does not itself establish that inconsistent shares were written. Add a local-state recovery path that quarantines bad legacy shares without changing quorum metadata or relaxing peer validation, and cover the case where only `LastValidators` is affected.

In `light/provider/http/http.go`:
- [BLOCKING] light/provider/http/http.go:258-264: Oversized HTTP validator sets now trigger BLS recovery before the size check
  Impact: A light client or RPC state-sync node can spend substantial CPU on a validator set it must reject, delaying failover beyond the provider deadline.
  The new constructor marks a complete-looking response as keyed, so this first `ValidateBasic` call invokes quadratic BLS interpolation before checking the canonical quorum size. On the base, this call used `HasPublicKeys=false` and rejected oversized sets for known quorum types before recovery. The pagination loop caps requests but not the number of entries returned, and recovery does not observe the request context while the light client holds `providerMutex`. Successful multi-member fetches also recover the same key again in `LightBlock.ValidateBasic`; on the base only that final check recovered it. Enforce actual page and aggregate limits, check the quorum's structural constraints before BLS work, and validate complete shares once at the light-block boundary.

In `internal/consensus/state_data.go`:
- [SUGGESTION → DEFERRED by a maintainer; not blocking, do not fix in this PR] internal/consensus/state_data.go:154-156: Validators can keep waiting after Core learns the active quorum's shares
  Impact: On Drive 5.1.0-rc.1, a validator that starts the quorum without shares can miss the rest of its term even after its local Core recovers them.
  The Tenderdash refresh works when an ABCI update arrives, but the reported Drive release does not generate one when Core learns the active quorum's shares. `update_quorum_info_v0` queries Core only for quorum hashes missing from its cache, and `validator_set_update_v2` serializes that cache on same-quorum changes. The companion PR, dashpay/platform#6358, explicitly skips the quorum Tenderdash already holds. Track active-quorum refresh separately in Drive, which owns the cache and emits the ABCI update, and make the rollout notes explicit that this PR enables recovery after delivery but does not trigger delivery.
Out-of-scope follow-up suggestions (2)

These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.

  • Light clients reject historical light blocks with partial shares — Both the base and this head can retain partial shares on a not-yet-keyed set. The RPC and P2P serving paths return the stored records, and LightBlock.ValidateBasic rejects mixed sets before state sync can authenticate them against local Core.
    • Follow-up: File a follow-up to serve a threshold-only copy while shares are incomplete, leaving local records intact and retaining receiver validation of complete sets.
  • A null HTTP validator entry can panic the light client — JSON decoding preserves null entries in the validator slice. Both the base and this head pass them to the constructor, whose copy helper dereferences each validator before validation.
    • Follow-up: File a follow-up to reject nil entries with ErrBadLightBlock before construction and cover the public HTTP provider path.

Comment thread types/validator_set.go Resolved
Comment thread types/validator_set.go Resolved
Comment thread internal/consensus/state_data.go Resolved
@github-actions

Copy link
Copy Markdown

Your move: thepastaclaw requested changes on this head; dismiss the review or push a fix; thepastaclaw left review threads unresolved; resolve them.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Nov 27, 2026
lklimek and others added 4 commits November 29, 2026 09:17
Keep omitted shares for retained validators when the quorum identity
matches, and discard inconsistent legacy shares on local store reads.
Restore the HTTP provider constructor and cover the recovery log.

Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Carry omitted shares forward only from a ready set with the same quorum
hash and threshold key. Keep individually stored shares available for
historical evidence and require successful recovery before promoting a
same-quorum update that depends on unverified shares.

Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Share the local validator-set decoder across consensus and light-client
stores. Keep legacy shares with readiness disabled when threshold
recovery fails and structural validation passes.

Preserve the validator set when an update contains no member changes.

Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Require same-quorum ABCI updates to preserve complete public key shares
when the current validator set is ready. Check after retaining eligible
shares from existing members.

Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added waiting-bots Waiting for the review bots to report on this head and removed waiting-self-review Waiting for the author to post /self-reviewed labels Nov 29, 2026

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review — Final validation — Phase 1 + Phase 2

New on this head: This head adds compatibility decoding for legacy validator sets, preserves omitted quorum shares during same-quorum updates, and rejects incomplete updates to ready quorums. Build, tests, end-to-end checks, vet, vulnerability scanning, and lint passed on the reviewed head; PR Hygiene remains in progress.

🟡 3 suggestion(s)

Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.

Review provenance

Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: tenderdash-consensus-security); reviewer 3: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: critical by gpt-6.2-sol (effort low) — The diff intricately changes when ABCI updates make quorum keys eligible for consensus verification in internal/state/current_round_state.go and how types/validator_set.go validates complete shares, with distinct handling for peer input and legacy stored records.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity quota lookup failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
  • New since the last final review (c564cefe): 1 new blocker(s) went to an independent confirmation pass (the final verifier's model in a fresh session, without its reasoning): 1 not confirmed (no longer blocking)
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-astra — general (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — tenderdash-consensus-security (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `internal/state/store.go`:
- [SUGGESTION] internal/state/store.go:587-590: Stored unrecoverable shares are sent to peers as if they were verified
  Impact: During state sync, a node with a legacy false-flag set can send a light block that the receiving upgraded node rejects as malformed, causing the requester to withdraw an otherwise usable provider.
  `LoadValidators` now intentionally returns legacy complete shares that fail threshold recovery, and `fetchLightBlock` passes that set directly to `LightBlock.ToProto`. The state-sync sender therefore transmits the unverified shares unchanged. The receiver uses strict `LightBlockFromProto`, which reconstructs the complete share set and rejects it when recovery does not match the threshold key; the dispatcher reports `errMalformedLightBlock` and the backfill worker can abandon the provider. Preserve the shares in local storage for evidence and repair, but build an outbound light-block copy with the unverified member shares omitted so peers receive a structurally valid keyless set.

In `internal/state/current_round_state.go`:
- [SUGGESTION] internal/state/current_round_state.go:362-378: Recovery across multiple valid partial deliveries is not covered at the state boundary
  Impact: A regression in `NewCurrentRoundState` could leave a validator set keyless after valid shares arrive in separate updates even though the lower-level validator-set test continues to pass.
  The state-level refresh test covers an update with all shares at once and a partial update that remains unrecoverable, while the lower-level test stops after `UpdateWithChangeSet`. It does not exercise the normal ABCI-facing sequence where one valid subset is committed, a later update supplies only the remaining members, and `NewCurrentRoundState` must clear the keyless state after threshold recovery succeeds. Add a state test that commits the first subset, applies the remaining subset without resending the first, and asserts that `NextValidators.HasPublicKeys` becomes true.
- [SUGGESTION] internal/state/current_round_state.go:372-378: Failed quorum-key recovery still lets stale shares authenticate proposals
  Impact: A validator that receives a partial refresh containing complete but unrecoverable shares can reject the honest proposer or authenticate a proposal with the wrong member key, preventing safe consensus progress.
  The application can reach this path through a same-quorum ABCI update after a legacy false-flag validator set has been loaded with retained shares. `validateSameQuorumUpdate` deliberately leaves the individual `PubKey` values in place, clears `HasPublicKeys`, and returns success when structural validation passes even though threshold recovery fails. At the next height, proposer selection still exposes the retained member key, and `Proposaler.verifyProposal` chooses individual-key verification solely from `proposer.PubKey != nil`; it does not consult `HasPublicKeys`. The node therefore checks an obsolete or incorrect share instead of using the keyless/commit-backed path, while vote collection is already disabled. Keep the shares for historical evidence and future refreshes, but quarantine them from live proposer verification whenever threshold recovery has failed, for example by making the proposer selector or verification path honor `HasPublicKeys`.

  _Raised as blocking. An independent pass did not find a failure someone would actually hit, so it does not block: The verifier does use a retained non-nil proposer key even when HasPublicKeys is false, so a stale share can cause it to reject a genuine proposal. But the merge base already loaded false-flag records with their shares intact, preserved unchanged shares on the same partial ABCI update, and used the same proposer-key check. The new fallback preserves that behavior on failed recovery, and an authenticated commit can still be applied once its block parts arrive without accepting the proposal._

Comment thread internal/state/store.go Resolved
Comment thread internal/state/current_round_state.go Resolved
Comment thread internal/state/current_round_state.go Resolved
Comment thread types/validator_set.go Resolved
Comment thread types/validator_set.go Resolved
@github-actions

Copy link
Copy Markdown

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Nov 29, 2026
Commit a partial ABCI validator update, then supply only the remaining
shares and verify that the same quorum becomes ready.

Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
lklimek and others added 5 commits November 29, 2026 23:35
Omit member and proposer public keys from P2P light blocks when the
local validator set is unready. This lets strict peer decoding accept
historical light blocks with retained, inconsistent shares.

Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nready

Use the existing matching-commit fallback until the active validator set
has verified member shares. A retained proposer key may be stale even
when present.

Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
An unready validator can remain in a waiting round after a proposal
arrives without a matching commit. Require verified quorum keys for
local round-skip signing, broadcasts, and resends on proposer silence.
Continue processing peer round-skip votes and certificates.

Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added waiting-bots Waiting for the review bots to report on this head and removed waiting-self-review Waiting for the author to post /self-reviewed labels Nov 30, 2026

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review — Final validation — Phase 1 + Phase 2

New on this head: This head completes quorum-key recovery across updates, quarantines unverified shares in state-sync responses, and updates proposal and round-skip handling for keyless validator sets. All build, test, lint, vet, protobuf, security, and e2e checks succeeded; PR Hygiene remains in progress and the review check is queued.

🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)

Review provenance

Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-astra (agent: phase2-reviewer, role: tenderdash-consensus-security); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: critical by gpt-6.2-sol (effort low) — This is a large, intricate change to consensus-critical validator-set and quorum key handling, proposal and vote verification, peer-facing light-block deserialization, state persistence compatibility, and state sync paths, including cryptographic key validation in types/validator_set.go and consensus state transitions.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity quota lookup failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
  • New since the last final review (aae3cec2): 1 new blocker(s) went to an independent confirmation pass (the final verifier's model in a fresh session, without its reasoning): 1 judged invalid (dropped)
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-astra — general (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — tenderdash-consensus-security (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.

No unresolved findings remain from the prior review on this head.

Comment thread internal/state/store.go Resolved
Comment thread internal/state/current_round_state.go Resolved
Comment thread internal/state/current_round_state.go Resolved
@github-actions

Copy link
Copy Markdown

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Nov 30, 2026

@lklimek lklimek left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/self-reviewed

@lklimek
lklimek enabled auto-merge (squash) December 2, 2026 06:59
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

Policy satisfied — this can merge.
Full checklist in the description.

@github-actions github-actions Bot removed the waiting-self-review Waiting for the author to post /self-reviewed label Dec 2, 2026
@lklimek
lklimek merged commit 2fd6a07 into dev Dec 2, 2026
37 checks passed
@lklimek
lklimek deleted the fix/valset-public-keys-refresh branch December 2, 2026 07:00
@github-actions github-actions Bot modified the milestones: v2.0, v2.1 Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants