fix(consensus): prevote nil upon timeout when Proposal is missing (backport #2218)#2309
Merged
fix(consensus): prevote nil upon timeout when Proposal is missing (backport #2218)#2309
Conversation
melekes
approved these changes
Feb 12, 2024
Collaborator
|
@Mergifyio rebase |
Contributor
Author
❌ Unable to rebase: user
|
) This bug was possibly introduced by #1203. This PR refactored the consensus operation, propose -> prevote transition (`defaultDoPrevote` method), to match the pseudo-code. The refactoring assumed that when `cs.ProposalBlock` is unset (nil), so should be `cs.Proposal` (meaning that the node didn't receive the round proposal). In this case, the node must prevote nil. The added test unit describes a scenario where `cs.Proposal` is nil (not received), but the block ` cs.ProposalBlock` is received because the node sees a Polka for a block, then receives the full associated block. The node must prevote nil in this scenario, in line with #1203. But the lack of the test on `cs.Proposal` leads to a bug. This bug does not affect previous releases except for `v1.0`. --- #### PR checklist - [ ] Tests written/updated - [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments - [ ] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec (cherry picked from commit 2f2e882)
c691dc6 to
4eeb587
Compare
cason
approved these changes
Feb 12, 2024
cason
left a comment
There was a problem hiding this comment.
Diffs are identical to the original PR.
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.
This is an automatic backport of pull request #2218 done by Mergify.
Mergify commands and options
More conditions and actions can be found in the documentation.
You can also trigger Mergify actions by commenting on this pull request:
@Mergifyio refreshwill re-evaluate the rules@Mergifyio rebasewill rebase this PR on its base branch@Mergifyio updatewill merge the base branch into this PR@Mergifyio backport <destination>will backport this PR on<destination>branchAdditionally, on Mergify dashboard you can:
Finally, you can contact us on https://mergify.com