Skip to content

Commit

Permalink
chore(consensus): all tasks must be awaited to propogate panics
Browse files Browse the repository at this point in the history
  • Loading branch information
matan-starkware committed Dec 25, 2024
1 parent 3ee72d1 commit 8783230
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,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 @@ -181,7 +182,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 @@ -197,6 +198,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 8783230

Please sign in to comment.