-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Commit message #1770
Implement Commit message #1770
Conversation
d006da8
to
44c4034
Compare
c9b76d7
to
042694c
Compare
height, | ||
}) => { | ||
ctrace!(ENGINE, "Received RequestCommit for {} from {:?}", height, token); | ||
let (result, receiver) = crossbeam::unbounded(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bounded(1)
votes, | ||
}) => { | ||
ctrace!(ENGINE, "Received Commit for {:?} from {:?}", height, token); | ||
let (result, receiver) = crossbeam::unbounded(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
@@ -1780,50 +1836,48 @@ impl Worker { | |||
} | |||
} | |||
|
|||
if peer_vote_step.height == self.height { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Height is already in the block
return None | ||
} | ||
|
||
if commit_height != self.height { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull the common move_to_step
out of the conditional statement.
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
See #1768