Skip to content

Commit b3604f3

Browse files
authored
Make chain manager recover from current_round bug. (#4728) (#4729)
Backport of #4728. ## Motivation #4688 fixed a bug where the chain manager would set its `signed_proposal` but not update the current round accordingly. However, some existing chains may already be in a bad state. ## Proposal Detect the bad state and recompute the current round. ## Test Plan Backport and see if it makes the affected chains recover. Otherwise we should never see the warning log. ## Release Plan - These changes should: - be released in a new SDK, - be released in a validator hotfix. ## Links - Original bug fix: #4688 - PR to main: #4728 - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1 parent 009b318 commit b3604f3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

linera-chain/src/manager.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,16 @@ where
699699
}
700700
if let Some(old_proposal) = self.signed_proposal.get() {
701701
if old_proposal.content.round >= proposal.content.round {
702+
if *self.current_round.get() < old_proposal.content.round {
703+
tracing::warn!(
704+
chain_id = %proposal.content.block.chain_id,
705+
current_round = ?self.current_round.get(),
706+
proposal_round = ?old_proposal.content.round,
707+
"Proposal round is greater than current round. Updating."
708+
);
709+
self.update_current_round(local_time);
710+
return true;
711+
}
702712
return false;
703713
}
704714
}

0 commit comments

Comments
 (0)