[Fix] Fix quorum check for round advancement.#3617
Merged
vicsn merged 1 commit intoProvableHQ:stagingfrom Jun 4, 2025
Merged
Conversation
When deciding whether to advance from round `R` to `R+1`, this must check whether a quorum of certificates exists at round `R`, not `R+1`. This is just one of several ways in which a validator can advance its round, which is why this issue may have been "masked".
Contributor
|
This looks fine. However, I think when finding potential bugs in the consensus layer, there should be an actual unit/integration test that fails before the fix. Have you thought about if/how this could be tested? |
kaimast
approved these changes
Jun 3, 2025
Contributor
|
I am approving the PR. We will think about how to improve testing for primary's state in the future. |
Contributor
|
@raychu86 do you want to take another look before I merge this? |
raychu86
approved these changes
Jun 4, 2025
Collaborator
raychu86
left a comment
There was a problem hiding this comment.
Would like be able to test these properties more concretely, but this seems correct.
I believe the previous logic was safe due to the BFT properties, but didn't fully assist in maintaining the liveness because of the off-by-one.
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.
When deciding whether to advance from round
RtoR+1, this must check whether a quorum of certificates exists at roundR, notR+1.This is just one of several ways in which a validator can advance its round, which is why this issue may have been "masked".