From 0fe7360ce507a10ab6985db6931a7a438b537a99 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Wed, 14 Aug 2024 15:21:07 -0400 Subject: [PATCH] Further contextualize DkgConfirmer by ValidatorSet Caught by a safety check we wouldn't reuse preprocesses across messages. That raises the question of we were prior reusing preprocesses (reusing keys)? Except that'd have caused a variety of signing failures (suggesting we had some staggered timing avoiding it in practice but yes, this was possible in theory). --- coordinator/src/tributary/signing_protocol.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/coordinator/src/tributary/signing_protocol.rs b/coordinator/src/tributary/signing_protocol.rs index fed1ceae9..af334149b 100644 --- a/coordinator/src/tributary/signing_protocol.rs +++ b/coordinator/src/tributary/signing_protocol.rs @@ -74,7 +74,8 @@ use frost_schnorrkel::Schnorrkel; use scale::Encode; -use serai_client::validator_sets::primitives::{KeyPair, musig_context, set_keys_message}; +#[rustfmt::skip] +use serai_client::validator_sets::primitives::{ValidatorSet, KeyPair, musig_context, set_keys_message}; use serai_db::*; @@ -285,7 +286,8 @@ fn threshold_i_map_to_keys_and_musig_i_map( (participants, map) } -type DkgConfirmerSigningProtocol<'a, T> = SigningProtocol<'a, T, (&'static [u8; 12], u32)>; +type DkgConfirmerSigningProtocol<'a, T> = + SigningProtocol<'a, T, (&'static [u8; 12], ValidatorSet, u32)>; pub(crate) struct DkgConfirmer<'a, T: DbTxn> { key: &'a Zeroizing<::F>, @@ -305,7 +307,7 @@ impl DkgConfirmer<'_, T> { } fn signing_protocol(&mut self) -> DkgConfirmerSigningProtocol<'_, T> { - let context = (b"DkgConfirmer", self.attempt); + let context = (b"DkgConfirmer", self.spec.set(), self.attempt); SigningProtocol { key: self.key, spec: self.spec, txn: self.txn, context } }