mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-14 15:09:23 +00:00
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).
This commit is contained in:
@@ -74,7 +74,8 @@ use frost_schnorrkel::Schnorrkel;
|
|||||||
|
|
||||||
use scale::Encode;
|
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::*;
|
use serai_db::*;
|
||||||
|
|
||||||
@@ -285,7 +286,8 @@ fn threshold_i_map_to_keys_and_musig_i_map(
|
|||||||
(participants, 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> {
|
pub(crate) struct DkgConfirmer<'a, T: DbTxn> {
|
||||||
key: &'a Zeroizing<<Ristretto as Ciphersuite>::F>,
|
key: &'a Zeroizing<<Ristretto as Ciphersuite>::F>,
|
||||||
@@ -305,7 +307,7 @@ impl<T: DbTxn> DkgConfirmer<'_, T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn signing_protocol(&mut self) -> DkgConfirmerSigningProtocol<'_, 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 }
|
SigningProtocol { key: self.key, spec: self.spec, txn: self.txn, context }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user