Implement Commit message#1770
Merged
majecty merged 3 commits intoCodeChain-io:masterfrom Sep 11, 2019
Merged
Conversation
d006da8 to
44c4034
Compare
c9b76d7 to
042694c
Compare
foriequal0
requested changes
Sep 11, 2019
| height, | ||
| }) => { | ||
| ctrace!(ENGINE, "Received RequestCommit for {} from {:?}", height, token); | ||
| let (result, receiver) = crossbeam::unbounded(); |
| votes, | ||
| }) => { | ||
| ctrace!(ENGINE, "Received Commit for {:?} from {:?}", height, token); | ||
| let (result, receiver) = crossbeam::unbounded(); |
| } | ||
| } | ||
|
|
||
| if peer_vote_step.height == self.height { |
Contributor
There was a problem hiding this comment.
This condition cannot be removed.
!(self.height < peer_vote_step.height && !self.step.is_commit())
== self.height >= peer_vote_step.height || self.step.is_commit()
| #[allow(clippy::cognitive_complexity)] | ||
| fn on_commit_message( | ||
| &mut self, | ||
| height: Height, |
Contributor
There was a problem hiding this comment.
Height is already in the block
| return None | ||
| } | ||
|
|
||
| if commit_height != self.height { |
Contributor
There was a problem hiding this comment.
Suggested change
| if commit_height != self.height { | |
| else if commit_height > self.height { |
|
|
||
| if self.client().block(&BlockId::Hash(block_hash)).is_some() { | ||
| cdebug!(ENGINE, "Committed block is already imported {}", block_hash); | ||
| self.move_to_step( |
Contributor
There was a problem hiding this comment.
Pull the common move_to_step out of the conditional statement.
added 3 commits
September 11, 2019 17:58
Before this commit, Tendermint extension only requests current height and view's votes. Handling only the current view's message makes code simple. However, there may be a commit before the current view. This creates a liveness problem. After this commit, a node requests a Commit message if some of its peer's height is higher than the node. The commit message is not related to the node's current view. The Commit message fixes the liveness problem.
042694c to
ddb887a
Compare
This was referenced Sep 18, 2019
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.
See #1768