Repository navigation
Conversation
haikoschol
approved these changes
Nov 9, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
processIncomingtakesv.innerand had two early returns that left it held:validateCatchUpreturns nil, the outcome callback ran and the function returned without unlocking. That covers a catch-up at or below the best round, one short of the threshold, and one that fails to import or isn't completable. The nextv.inner.Lock()(pruneBackgroundRoundson the following poll) then blocks forever, and so does everyVoterState().Get(): the voter stops for good, and stopping it can only time out. It now unlocks right after the rejection, so theBadcallback also runs outside the lock.ValidateCommiterror. The commit path returned the error with the lock held. The voter ends on that error anyway, but callers ofVoterState().Get()then block forever. It now unlocks first, as theFinalizeBlockerror path a few lines below already does.In the Rust crate both returns release the lock when the guard drops.
Tests
go test -race -run TestVoter_StaysLiveAfterRejectedCatchUp ./pkg/finality-grandpaTestVoter_StaysLiveAfterRejectedCatchUpsends a valid catch-up, the same one again (now stale), one short of the threshold, and a valid one for a later round. It checks each outcome and that the voter ends at round 8. Without the fix it fails at the third: the voter never processes it.The
ValidateCommitpath has no test. Its error needs an environment whoseAncestryfails for a blockIsEqualOrDescendantOfaccepted.go test -race ./pkg/finality-grandpapasses.TestVoter_SkipsToLatestRoundAfterCatchUpis already flaky ondevelopment, about 1 run in 40 without this change: it asserts round 5 is not yet a background round right after sending the catch-up, which races the voter.Issues
Surfaced by ChainSafe/go-jam#850, whose catch-up fan-out can hand the voter more than one answer for the same round: the second one wedged it.