Fix a step regression bug in Tendermint::worker::new_blocks#1772
Merged
majecty merged 1 commit intoCodeChain-io:masterfrom Sep 11, 2019
Merged
Fix a step regression bug in Tendermint::worker::new_blocks#1772majecty merged 1 commit intoCodeChain-io:masterfrom
majecty merged 1 commit intoCodeChain-io:masterfrom
Conversation
majecty
requested changes
Sep 11, 2019
There was a problem hiding this comment.
Why is the self.height needed?
It seems the two expressions are the same.
- (self.height, Step::Propose) > (self.height, self.step.to_step())
- Step::Propose > self.step.to_step()
bc24e15 to
ad32319
Compare
A regression in the step can cause a node double-vote.
ad32319 to
0346863
Compare
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.
We can observe the regression in the node's peer state update log.
Reconstructed timeline of the node from log of other nodes:
(Timestamp may not be monotonic due to the network recover)
height: 468212, view: 0, step: Precommit.height: 468215, view: 0, step: Precommit{ height: 468212, view: 0, step: Precommit }Tendermint::worker::new_blocks([468213, 468214(proposal)], [])height_changed = true;self.move_to_height(468213);self.save_last_confirmed_view(0);self.on_imported_proposal(468214);self.move_to_height(468214);self.move_to_step(Step::Prevote);self.request_messages_to_all({ 468214, 0, Prevote });self.generate_and_broadcast_message();self.move_to_step(Step::Propose); }// this is a regressionnetwork::Event::SetTimerStep { Step::Propose }self.move_to_step(Step::Prevote); }self.votes_received = BitSet::new();self.request_messages_to_all({ 468214, 0, Prevote });self.generate_and_broadcast_message();// this is a double vote167729828.log
350381008.log
388247645.log
729999778.log
744880070.log
760824946.log
913276364.log