Struct narwhal_config::Committee
source · [−]Fields
The authorities of epoch.
epoch: Epoch
The epoch number of this committee
Implementations
sourceimpl Committee
impl Committee
sourcepub fn keys(&self) -> Vec<&PublicKey>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn keys(&self) -> Vec<&PublicKey>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Returns the keys in the committee
sourcepub fn quorum_threshold(&self) -> Stake
pub fn quorum_threshold(&self) -> Stake
Returns the stake required to reach a quorum (2f+1).
sourcepub fn validity_threshold(&self) -> Stake
pub fn validity_threshold(&self) -> Stake
Returns the stake required to reach availability (f+1).
sourcepub fn leader(&self, seed: u64) -> PublicKey
pub fn leader(&self, seed: u64) -> PublicKey
Returns a leader node as a weighted choice seeded by the provided integer
sourcepub fn primary(&self, to: &PublicKey) -> Result<Multiaddr, ConfigError>
pub fn primary(&self, to: &PublicKey) -> Result<Multiaddr, ConfigError>
Returns the primary address of the target primary.
pub fn network_key(
&self,
pk: &PublicKey
) -> Result<NetworkPublicKey, ConfigError>
sourcepub fn others_primaries(
&self,
myself: &PublicKey
) -> Vec<(PublicKey, Multiaddr, NetworkPublicKey)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn others_primaries(
&self,
myself: &PublicKey
) -> Vec<(PublicKey, Multiaddr, NetworkPublicKey)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Return all the network addresses in the committee.
sourcepub fn network_diff<'a>(&'a self, other: &'a Self) -> HashSet<&'_ Multiaddr>
pub fn network_diff<'a>(&'a self, other: &'a Self) -> HashSet<&'_ Multiaddr>
Return the network addresses that are present in the current committee but that are absent from the new committee (provided as argument).
sourcepub fn update_primary_network_info(
&mut self,
new_info: BTreeMap<PublicKey, (Stake, Multiaddr)>
) -> Result<(), Vec<CommitteeUpdateError>>
pub fn update_primary_network_info(
&mut self,
new_info: BTreeMap<PublicKey, (Stake, Multiaddr)>
) -> Result<(), Vec<CommitteeUpdateError>>
Update the networking information of some of the primaries. The arguments are a full vector of authorities which Public key and Stake must match the one stored in the current Committee. Any discrepancy will generate no update and return a vector of errors.