fix: prevent skipping one view when proposing a block in unhappy path (#199)

This commit is contained in:
Youngjoon Lee 2023-06-20 00:09:33 +09:00 committed by GitHub
parent 2db493c753
commit 6061ba3f3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -434,10 +434,10 @@ where
participating_nodes: carnot.root_committee(), participating_nodes: carnot.root_committee(),
}; };
let (new_carnot, out) = carnot.approve_new_view(timeout_qc.clone(), new_views); let (new_carnot, out) = carnot.approve_new_view(timeout_qc.clone(), new_views);
let next_view = timeout_qc.view + 2; let new_view = timeout_qc.view + 1;
if carnot.is_next_leader() { if carnot.is_next_leader() {
let high_qc = carnot.high_qc(); let high_qc = carnot.high_qc();
task_manager.push(timeout_qc.view + 1, async move { task_manager.push(new_view, async move {
let _votes = Self::gather_new_views( let _votes = Self::gather_new_views(
adapter, adapter,
leader_committee, leader_committee,
@ -448,7 +448,7 @@ where
Event::ProposeBlock { Event::ProposeBlock {
qc: Qc::Aggregated(AggregateQc { qc: Qc::Aggregated(AggregateQc {
high_qc, high_qc,
view: next_view, view: new_view,
}), }),
} }
}); });