mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Start moving Coordinator to a multi-Tributary model
Prior, we only supported a single Tributary per network, and spawned a task to handled Processor messages per Tributary. Now, we handle Processor messages per network, yet we still only supported a single Tributary in that handling function. Now, when we handle a message, we load the Tributary which is relevant. Once we know it, we ensure we have it (preventing race conditions), and then proceed. We do need work to check if we should have a Tributary, or if we're not participating. We also need to check if a Tributary has been retired, meaning we shouldn't handle any transactions related to them, and to clean up retired Tributaries.
This commit is contained in:
@@ -4,6 +4,7 @@ use std::collections::{VecDeque, HashMap};
|
||||
use rand_core::OsRng;
|
||||
|
||||
use transcript::{Transcript, RecommendedTranscript};
|
||||
use ciphersuite::group::GroupEncoding;
|
||||
use frost::{
|
||||
curve::Ristretto,
|
||||
ThresholdKeys,
|
||||
@@ -177,9 +178,7 @@ impl<D: Db> SubstrateSigner<D> {
|
||||
// Update the attempt number
|
||||
self.attempt.insert(id, attempt);
|
||||
|
||||
// Doesn't set key since there's only one key active at a time
|
||||
// TODO: BatchSignId
|
||||
let id = SignId { key: vec![], id, attempt };
|
||||
let id = SignId { key: self.keys.group_key().to_bytes().to_vec(), id, attempt };
|
||||
info!("signing batch {} #{}", hex::encode(id.id), id.attempt);
|
||||
|
||||
// If we reboot mid-sign, the current design has us abort all signs and wait for latter
|
||||
|
||||
@@ -26,7 +26,11 @@ async fn test_substrate_signer() {
|
||||
|
||||
let id: u32 = 5;
|
||||
let block = BlockHash([0xaa; 32]);
|
||||
let mut actual_id = SignId { key: vec![], id: [0; 32], attempt: 0 };
|
||||
let mut actual_id = SignId {
|
||||
key: keys.values().next().unwrap().group_key().to_bytes().to_vec(),
|
||||
id: [0; 32],
|
||||
attempt: 0,
|
||||
};
|
||||
|
||||
let batch = Batch {
|
||||
network: NetworkId::Monero,
|
||||
|
||||
Reference in New Issue
Block a user