Skip to content

Commit

Permalink
handle panics in pipelining tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
mmtftr committed Jan 31, 2025
1 parent 080a555 commit d624edd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/src/rpc/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ impl ClementineAggregator for Aggregator {
// Join the nonce aggregation handle to get the movetx agg nonce.
let movetx_agg_nonce = nonce_agg_handle
.await
.expect("cancelled task or panic in task")?;
.map_err(|_| Status::internal("panic when aggregating nonces"))??;

// Start the deposit finalization pipe.
let sig_dist_handle = tokio::spawn(signature_distributor(
Expand All @@ -694,16 +694,16 @@ impl ClementineAggregator for Aggregator {
// Wait for all pipeline tasks to complete
nonce_dist_handle
.await
.expect("cancelled task or panic in task")?;
.map_err(|_| Status::internal("panic when distributing nonces"))??;
sig_agg_handle
.await
.expect("cancelled task or panic in task")?;
.map_err(|_| Status::internal("panic when aggregating signatures"))??;
sig_dist_handle
.await
.expect("cancelled task or panic in task")?;
.map_err(|_| Status::internal("panic when aggregating nonces"))??;
let operator_sigs = operator_sigs_fut
.await
.expect("cancelled task or panic in task")?;
.map_err(|_| Status::internal("panic when collecting operator signatures"))??;

// send operators sigs to verifiers after all verifiers have signed
let send_operator_sigs: Vec<_> = deposit_finalize_sender
Expand Down

0 comments on commit d624edd

Please sign in to comment.