Skip to content

Commit

Permalink
Further contextualize DkgConfirmer by ValidatorSet
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
kayabaNerve committed Aug 14, 2024
1 parent 756db82 commit 0fe7360
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions coordinator/src/tributary/signing_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;

Expand Down Expand Up @@ -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<<Ristretto as Ciphersuite>::F>,
Expand All @@ -305,7 +307,7 @@ impl<T: DbTxn> 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 }
}

Expand Down

0 comments on commit 0fe7360

Please sign in to comment.