Move serai-client off serai-runtime, MIT licensing it

Uses a full-fledged serai-abi to do so.

Removes use of UncheckedExtrinsic as a pointlessly (for us) length-prefixed
block with a more complicated signing algorithm than advantageous.

In the future, we should considering consolidating the various primitives
crates. I'm not convinced we benefit from one primitives crate per pallet.
This commit is contained in:
Luke Parker
2023-12-07 02:30:09 -05:00
parent 6416e0079b
commit c511a54d18
38 changed files with 484 additions and 378 deletions

View File

@@ -19,7 +19,7 @@ use frost::{
use frost_schnorrkel::Schnorrkel;
use serai_client::{
Public,
Public, SeraiAddress,
validator_sets::primitives::{musig_context, remove_participant_message},
};
@@ -190,7 +190,7 @@ impl DkgRemoval {
preprocesses: HashMap<Participant, Vec<u8>>,
removed: [u8; 32],
mut shares: HashMap<Participant, Vec<u8>>,
) -> Result<(Vec<Public>, [u8; 64]), Participant> {
) -> Result<(Vec<SeraiAddress>, [u8; 64]), Participant> {
// TODO: Remove this ugly blob
let shares = {
let mut shares_participants = shares.keys().cloned().collect::<Vec<_>>();
@@ -213,7 +213,7 @@ impl DkgRemoval {
new_shares
};
let mut signers = shares.keys().cloned().map(Public).collect::<Vec<_>>();
let mut signers = shares.keys().cloned().map(SeraiAddress).collect::<Vec<_>>();
signers.sort();
let machine = Self::share_internal(spec, key, attempt, preprocesses, removed)

View File

@@ -10,7 +10,7 @@ use frost::dkg::Participant;
use scale::{Encode, Decode};
use serai_client::{
Public, Signature,
Public, SeraiAddress, Signature,
validator_sets::primitives::{ValidatorSet, KeyPair},
SeraiValidatorSets,
};
@@ -174,7 +174,7 @@ pub(crate) async fn handle_application_tx<
D: Db,
Pro: Processors,
FPst: Future<Output = ()>,
PST: Clone + Fn(ValidatorSet, PstTxType, Vec<u8>) -> FPst,
PST: Clone + Fn(ValidatorSet, PstTxType, serai_client::Transaction) -> FPst,
FPtt: Future<Output = ()>,
PTT: Clone + Fn(Transaction) -> FPtt,
FRid: Future<Output = ()>,
@@ -734,7 +734,7 @@ pub(crate) async fn handle_application_tx<
let tx = serai_client::SeraiValidatorSets::remove_participant(
spec.set().network,
Public(data.plan),
SeraiAddress(data.plan),
signers,
Signature(signature),
);

View File

@@ -55,7 +55,7 @@ async fn handle_block<
D: Db,
Pro: Processors,
FPst: Future<Output = ()>,
PST: Clone + Fn(ValidatorSet, PstTxType, Vec<u8>) -> FPst,
PST: Clone + Fn(ValidatorSet, PstTxType, serai_client::Transaction) -> FPst,
FPtt: Future<Output = ()>,
PTT: Clone + Fn(Transaction) -> FPtt,
FRid: Future<Output = ()>,
@@ -148,7 +148,7 @@ pub(crate) async fn handle_new_blocks<
D: Db,
Pro: Processors,
FPst: Future<Output = ()>,
PST: Clone + Fn(ValidatorSet, PstTxType, Vec<u8>) -> FPst,
PST: Clone + Fn(ValidatorSet, PstTxType, serai_client::Transaction) -> FPst,
FPtt: Future<Output = ()>,
PTT: Clone + Fn(Transaction) -> FPtt,
FRid: Future<Output = ()>,