Skip to content

Commit

Permalink
fix(broadcast): correlate new and old broadcast ids [WEB-575] (#4221)
Browse files Browse the repository at this point in the history
* fix(broadcast): correlate new and old broadcast ids

* rename
  • Loading branch information
acdibble authored and dandanlen committed Nov 9, 2023
1 parent 8aa3248 commit 7b20a2a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions state-chain/pallets/cf-broadcast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ pub mod pallet {
transaction_out_id: TransactionOutIdFor<T, I>,
},
/// A broadcast's threshold signature is invalid, we will attempt to re-sign it.
ThresholdSignatureInvalid { broadcast_id: BroadcastId },
ThresholdSignatureInvalid { broadcast_id: BroadcastId, retry_broadcast_id: BroadcastId },
/// A signature accepted event on the target chain has been witnessed and the callback was
/// executed.
BroadcastCallbackExecuted { broadcast_id: BroadcastId, result: DispatchResult },
Expand Down Expand Up @@ -794,15 +794,18 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
// to retry from the threshold signing stage.
else {
Self::clean_up_broadcast_storage(broadcast_id);
Self::threshold_sign_and_broadcast(
let (retry_broadcast_id, _) = Self::threshold_sign_and_broadcast(
api_call,
RequestCallbacks::<T, I>::get(broadcast_id),
);
log::info!(
"Signature is invalid -> rescheduled threshold signature for broadcast id {}.",
broadcast_id
);
Self::deposit_event(Event::<T, I>::ThresholdSignatureInvalid { broadcast_id });
Self::deposit_event(Event::<T, I>::ThresholdSignatureInvalid {
broadcast_id,
retry_broadcast_id,
});
}
} else {
log::error!("No threshold signature data is available.");
Expand Down

0 comments on commit 7b20a2a

Please sign in to comment.