fix: prevent skipping one view when proposing a block in unhappy path (#166)
This commit is contained in:
parent
d864fecd07
commit
a055c2524a
|
@ -300,23 +300,24 @@ where
|
||||||
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);
|
||||||
carnot = new_carnot;
|
carnot = new_carnot;
|
||||||
output = Some(Output::Send(out));
|
output = Some(Output::Send(out));
|
||||||
let next_view = timeout_qc.view + 2;
|
let new_view = timeout_qc.view + 1;
|
||||||
|
let next_view = new_view + 1;
|
||||||
if carnot.is_leader_for_view(next_view) {
|
if carnot.is_leader_for_view(next_view) {
|
||||||
let high_qc = carnot.high_qc();
|
let high_qc = carnot.high_qc();
|
||||||
events.push(Box::pin(view_cancel_cache.cancelable_event_future(
|
events.push(Box::pin(view_cancel_cache.cancelable_event_future(
|
||||||
timeout_qc.view + 1,
|
new_view,
|
||||||
async move {
|
async move {
|
||||||
let _votes = Self::gather_new_views(
|
let _votes = Self::gather_new_views(
|
||||||
adapter,
|
adapter,
|
||||||
leader_committee,
|
leader_committee,
|
||||||
timeout_qc,
|
timeout_qc.clone(),
|
||||||
leader_tally_settings.clone(),
|
leader_tally_settings.clone(),
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
Event::ProposeBlock {
|
Event::ProposeBlock {
|
||||||
qc: Qc::Aggregated(AggregateQc {
|
qc: Qc::Aggregated(AggregateQc {
|
||||||
high_qc,
|
high_qc,
|
||||||
view: next_view,
|
view: new_view,
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue