Coordinator

Trait Coordinator 

Source
pub trait Coordinator:
    Clone
    + Debug
    + PartialEq
    + StateMachine<State, Error> {
Show 14 methods // Required methods fn new(config: Config) -> Self; fn load(state: &SavedState) -> Self; fn save(&self) -> SavedState; fn get_config(&self) -> Config; fn set_coordinator_public_key(&mut self, key: Option<PublicKey>); fn set_key_and_party_polynomials( &mut self, aggregate_key: Point, party_polynomials: Vec<(u32, PolyCommitment)>, ) -> Result<(), Error>; fn process( &mut self, packet: &Packet, ) -> Result<(Option<Packet>, Option<OperationResult>), Error>; fn get_aggregate_public_key(&self) -> Option<Point>; fn set_aggregate_public_key(&mut self, aggregate_public_key: Option<Point>); fn get_message(&self) -> Vec<u8> ; fn get_state(&self) -> State; fn start_dkg_round(&mut self, dkg_id: Option<u64>) -> Result<Packet, Error>; fn start_signing_round( &mut self, message: &[u8], signature_type: SignatureType, sign_id: Option<u64>, ) -> Result<Packet, Error>; fn reset(&mut self);
}
Expand description

Coordinator trait for handling the coordination of DKG and sign messages

Required Methods§

Source

fn new(config: Config) -> Self

Create a new Coordinator

Source

fn load(state: &SavedState) -> Self

Load a coordinator from the previously saved state

Source

fn save(&self) -> SavedState

Save the state required to reconstruct the coordinator

Source

fn get_config(&self) -> Config

Retrieve the config

Source

fn set_coordinator_public_key(&mut self, key: Option<PublicKey>)

Set the coordinator public key

Source

fn set_key_and_party_polynomials( &mut self, aggregate_key: Point, party_polynomials: Vec<(u32, PolyCommitment)>, ) -> Result<(), Error>

Initialize Coordinator from partial saved state

Source

fn process( &mut self, packet: &Packet, ) -> Result<(Option<Packet>, Option<OperationResult>), Error>

Process any timeouts, and if none of them fire then process the passed packet If a timeout does fire, then the coordinator state has changed; this means the packet is now stale and must be dropped

Source

fn get_aggregate_public_key(&self) -> Option<Point>

Retrieve the aggregate public key

Source

fn set_aggregate_public_key(&mut self, aggregate_public_key: Option<Point>)

Set the aggregate public key

Source

fn get_message(&self) -> Vec<u8>

Retrieve the current message bytes being signed

Source

fn get_state(&self) -> State

Retrive the current state

Source

fn start_dkg_round(&mut self, dkg_id: Option<u64>) -> Result<Packet, Error>

Trigger a DKG round, with an optional dkg_id

Source

fn start_signing_round( &mut self, message: &[u8], signature_type: SignatureType, sign_id: Option<u64>, ) -> Result<Packet, Error>

Trigger a signing round

Source

fn reset(&mut self)

Reset internal state

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Aggregator: AggregatorTrait> Coordinator for wsts::state_machine::coordinator::fire::Coordinator<Aggregator>

Source§

impl<Aggregator: AggregatorTrait> Coordinator for wsts::state_machine::coordinator::frost::Coordinator<Aggregator>