Repository navigation
fix(consensus): preserve catch-up allowance for rejected votes - #1479
Conversation
Retain a provisional catch-up round and charge its validator's allowance only after its first vote is admitted. Preserve the existing verification paths, error results and two-round quota under the height vote set lock. Co-Authored-By: OpenAI GPT-6 Astra <[email protected]> <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>
|
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: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
|
✅ Final review complete — no blockers (commit 1207045) · triage: low · Phase 2 only (queue backlog) |
PR HygieneState: ready-to-merge · commit
Self-review is an author attestation that you have read the diff: This check passes when the policy is satisfied; the repository decides whether merging requires it. |
|
@thepastaclaw review No review for |
|
@thepastaclaw review No review for |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 2 only (queue backlog)
Verified the changes at 1207045; no actionable in-scope defects were found. Newly allocated catch-up rounds remain provisional under the existing lock, rejected votes leave no retained round or allowance entry, and successful admission preserves the two-round quota and existing verification paths. Focused tests for both consensus packages passed with CGO/BLS, the race detector, and the deadlock build tag; git diff --check passed and the worktree remains clean.
Review provenance
Source: reviewer 1: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6-astra (agent: phase2-reviewer, role: tenderdash-consensus-security); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)
- Triage:
lowbygpt-6-astra(effort low) — The production change is a small, contained update to HeightVoteSet.addVote that retains catch-up rounds and charges allowance only after successful admission under the existing lock, without changing verification logic or consensus rules, and the remaining changes are regression tests. - Phase 1 reviewers: not run (skipped for throughput: 22 PRs queued, above the 10 limit)
- Fresh verifier:
gpt-6-astra— final-verifier; agentastra-verifier - Phase 2 reviewers:
gpt-6-astra— general (completed, effort medium); agentphase2-reviewer,gpt-6-astra— tenderdash-consensus-security (completed, effort medium); agentphase2-reviewer
|
/self-reviewed |
TL;DR: Rejected future-round votes no longer consume the allowance needed for a validator's later valid catch-up vote.
User story
As a validator operator, I want catch-up capacity to be charged only for admitted votes, to achieve reliable consensus recovery when peers relay malformed votes.
Scenario
Base flow
A lagging node receives future-round votes naming a validator while trying to catch up with consensus.
Actual behavior
Two votes that fail signature or proof verification can consume that validator's two-round allowance. A later valid vote for another future round is then rejected as unwanted.
Expected behavior
Rejected votes leave no round or allowance entry. Successfully admitted votes retain the existing two-round limit.
Detailed discussion
Issue being fixed or feature implemented
HeightVoteSet.addVotepermanently created a catch-up round and charged the claimed validator before the vote's signature, verification budget, or proof was accepted.What was done?
How Has This Been Tested?
Regression tests first demonstrated allowance consumption after invalid signatures, denied verification budgets, and mismatched proofs. Focused coverage now includes both prevotes and precommits, valid verified votes, existing-round preservation, the two-round ceiling, concurrent admission, and the consensus action path.
The focused golangci-lint v2.13.2 run reported zero new issues, and
git diff --checkpassed.Breaking Changes
None. This changes only accounting for votes that were rejected and never admitted.
Checklist
For repository code-owners and collaborators only
🤖 Co-authored by Claudius the Magnificent AI Agent