Skip to content

Commit

Permalink
log emit view change earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
bfish713 committed Oct 24, 2024
1 parent 8b3ad20 commit 7e3db10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
17 changes: 6 additions & 11 deletions crates/task-impls/src/quorum_proposal_recv/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ pub(crate) async fn handle_quorum_proposal_recv<
consensus.metrics.invalid_qc.update(1);
bail!("Invalid justify_qc in proposal for view {}", *view_number);
}

broadcast_event(
Arc::new(HotShotEvent::ViewChange(view_number + 1)),
event_sender,
)
.await;
broadcast_event(
Arc::new(HotShotEvent::QuorumProposalPreliminarilyValidated(
proposal.clone(),
Expand Down Expand Up @@ -221,11 +225,7 @@ pub(crate) async fn handle_quorum_proposal_recv<
justify_qc.data.leaf_commit
);
validate_proposal_liveness(proposal, event_sender, &task_state).await?;
broadcast_event(
Arc::new(HotShotEvent::ViewChange(view_number + 1)),
event_sender,
)
.await;

return Ok(());
};

Expand All @@ -238,11 +238,6 @@ pub(crate) async fn handle_quorum_proposal_recv<
quorum_proposal_sender_key,
)
.await?;
broadcast_event(
Arc::new(HotShotEvent::ViewChange(view_number + 1)),
event_sender,
)
.await;

Ok(())
}
1 change: 1 addition & 0 deletions crates/task-impls/src/quorum_proposal_recv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions>
if self.consensus.read().await.cur_view() > proposal.data.view_number()
|| self.cur_view > proposal.data.view_number()
{
tracing::error!("Throwing away old proposal");
return;
}
let validation_info = ValidationInfo::<TYPES, I, V> {
Expand Down

0 comments on commit 7e3db10

Please sign in to comment.