Correct processor flow to have the coordinator decide signing set/re-attempts

The signing set should be the first group to submit preprocesses to Tributary.
Re-attempts shouldn't be once every 30s, yet n blocks since the last relevant
message.

Removes the use of an async task/channel in the signer (and Substrate signer).
Also removes the need to be able to get the time from a coin's block, which was
a fragile system marked with a TODO already.
This commit is contained in:
Luke Parker
2023-04-15 23:01:07 -04:00
parent e21fc5ff3c
commit e2571a43aa
17 changed files with 446 additions and 711 deletions

View File

@@ -1,8 +1,4 @@
use std::{
time::{SystemTime, Duration},
io,
collections::HashMap,
};
use std::{time::Duration, io, collections::HashMap};
use async_trait::async_trait;
@@ -201,9 +197,6 @@ impl BlockTrait<Bitcoin> for Block {
hash.reverse();
hash
}
fn time(&self) -> SystemTime {
SystemTime::UNIX_EPOCH + Duration::from_secs(self.header.time.into())
}
fn median_fee(&self) -> Fee {
// TODO
Fee(20)

View File

@@ -1,5 +1,5 @@
use core::fmt::Debug;
use std::{time::SystemTime, io, collections::HashMap};
use std::{io, collections::HashMap};
use async_trait::async_trait;
use thiserror::Error;
@@ -175,7 +175,6 @@ pub trait Block<C: Coin>: Send + Sync + Sized + Clone + Debug {
// This is currently bounded to being 32-bytes.
type Id: 'static + Id;
fn id(&self) -> Self::Id;
fn time(&self) -> SystemTime;
fn median_fee(&self) -> C::Fee;
}

View File

@@ -1,8 +1,4 @@
use std::{
time::{SystemTime, Duration},
collections::HashMap,
io,
};
use std::{time::Duration, collections::HashMap, io};
use async_trait::async_trait;
@@ -146,10 +142,6 @@ impl BlockTrait<Monero> for Block {
self.0
}
fn time(&self) -> SystemTime {
SystemTime::UNIX_EPOCH + Duration::from_secs(self.1.header.timestamp)
}
fn median_fee(&self) -> Fee {
// TODO
Fee { per_weight: 80000, mask: 10000 }