2 Commits

Author SHA1 Message Date
Luke Parker
0fe7360ce5 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).
2024-08-14 15:21:10 -04:00
Luke Parker
756db823df Correct construction of signature_participants in serai-client tests
Fault identified by akil.
2024-08-11 22:27:06 -04:00
2 changed files with 6 additions and 4 deletions

View File

@@ -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<<Ristretto as Ciphersuite>::F>,
@@ -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 }
}

View File

@@ -70,7 +70,7 @@ pub async fn set_keys(
&SeraiValidatorSets::set_keys(
set.network,
key_pair.clone(),
vec![1; musig_keys.len()].try_into().unwrap(),
bitvec::bitvec!(u8, bitvec::prelude::Lsb0; 1; musig_keys.len()),
Signature(sig.to_bytes()),
),
)