Skip to content

Fix a bug that Tendermint fails when a locked proposal is not imported #1626

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

Merged
merged 3 commits into from
Jun 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions core/src/consensus/tendermint/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,13 @@ impl Worker {
TwoThirdsMajority::Lock(_, block_hash) => Some(*block_hash),
};
let block_hash = block_hash_candidate.filter(|hash| {
let block =
self.client().block(&BlockId::Hash(*hash)).expect("Already got imported block hash");
let block = match self.client().block(&BlockId::Hash(*hash)) {
Some(block) => block,
// When a node locks on a proposal and doesn't imported the proposal yet,
// we could not check the proposal's generated time.
// To make the network healthier in the corner case, we send a prevote message to the locked block.
None => return true,
};
self.is_generation_time_relevant(&block.decode_header())
});
self.generate_and_broadcast_message(block_hash, is_restoring);
Expand Down