Skip to content

Commit

Permalink
chore(consensus): all tasks must be awaited to propogate panics (star…
Browse files Browse the repository at this point in the history
  • Loading branch information
matan-starkware authored Dec 27, 2024
1 parent 989236a commit dfbe41f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ impl ConsensusContext for SequencerConsensusContext {
self.cende_ambassador.write_prev_height_blob(proposal_init.height);
// Handles interrupting an active proposal from a previous height/round
self.set_height_and_round(proposal_init.height, proposal_init.round).await;

let (fin_sender, fin_receiver) = oneshot::channel();
let batcher = Arc::clone(&self.batcher);
let valid_proposals = Arc::clone(&self.valid_proposals);
Expand All @@ -187,7 +188,7 @@ impl ConsensusContext for SequencerConsensusContext {
.await
.expect("Failed to send proposal receiver");

tokio::spawn(
let handle = tokio::spawn(
async move {
build_proposal(
timeout,
Expand All @@ -203,6 +204,9 @@ impl ConsensusContext for SequencerConsensusContext {
}
.instrument(debug_span!("consensus_build_proposal")),
);
assert!(self.active_proposal.is_none());
// The cancellation token is unused by the spawned build.
self.active_proposal = Some((CancellationToken::new(), handle));

fin_receiver
}
Expand Down

0 comments on commit dfbe41f

Please sign in to comment.