mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 04:09:23 +00:00
Modify SubstrateBlockAck as needed
Replaces plan IDs with key + ID, letting the coordinator determine the sessions for the plans. Properly scopes which plan IDs are set on which tributaries, and ensures we have the necessary tributaries at time of handling.
This commit is contained in:
@@ -5,7 +5,7 @@ use std::{
|
||||
|
||||
use dkg::{Participant, tests::clone_without};
|
||||
|
||||
use messages::{sign::SignId, SubstrateContext};
|
||||
use messages::{coordinator::PlanMeta, sign::SignId, SubstrateContext};
|
||||
|
||||
use serai_client::{
|
||||
primitives::{BlockHash, crypto::RuntimePublic, PublicKey, SeraiAddress, NetworkId},
|
||||
@@ -155,7 +155,7 @@ pub(crate) async fn sign_batch(
|
||||
pub(crate) async fn substrate_block(
|
||||
coordinator: &mut Coordinator,
|
||||
block: messages::substrate::CoordinatorMessage,
|
||||
) -> Vec<[u8; 32]> {
|
||||
) -> Vec<PlanMeta> {
|
||||
match block.clone() {
|
||||
messages::substrate::CoordinatorMessage::SubstrateBlock {
|
||||
context: _,
|
||||
|
||||
@@ -236,7 +236,7 @@ fn send_test() {
|
||||
let (mut id, mut preprocesses) =
|
||||
recv_sign_preprocesses(&mut coordinators, key_pair.1.to_vec(), 0).await;
|
||||
// TODO: Should this use the Substrate key?
|
||||
assert_eq!(id, SignId { key: key_pair.1.to_vec(), id: plans[0], attempt: 0 });
|
||||
assert_eq!(id, SignId { key: key_pair.1.to_vec(), id: plans[0].id, attempt: 0 });
|
||||
|
||||
// Trigger a random amount of re-attempts
|
||||
for attempt in 1 ..= u32::try_from(OsRng.next_u64() % 4).unwrap() {
|
||||
|
||||
Reference in New Issue
Block a user