[−][src]Struct rhododendron::accumulator::Accumulator
Accumulates messages for a given round of BFT consensus.
This isn't tied to the "view" of a single authority. It keeps accurate track of the state of the BFT consensus based on all messages imported.
Fields
round_number: u32
The round this accumulator is currently on
threshold: usize
Threshold of prepare messages required to make progress
round_proposer: AuthorityId
Current proposer/authority for this round
Methods
impl<Candidate, Digest, AuthorityId, Signature> Accumulator<Candidate, Digest, AuthorityId, Signature> where
Candidate: Eq + Clone,
Digest: Hash + Eq + Clone,
AuthorityId: Hash + Eq + Clone,
Signature: Eq + Clone,
[src]
Candidate: Eq + Clone,
Digest: Hash + Eq + Clone,
AuthorityId: Hash + Eq + Clone,
Signature: Eq + Clone,
pub fn new(
round_number: u32,
threshold: usize,
round_proposer: AuthorityId
) -> Self
[src]
round_number: u32,
threshold: usize,
round_proposer: AuthorityId
) -> Self
Create a new state accumulator.
pub fn advance_votes(&self) -> usize
[src]
How advance votes we have seen.
pub fn round_number(&self) -> u32
[src]
Get the round number.
pub fn round_proposer(&self) -> AuthorityId
[src]
Get the round proposer.
pub fn proposal(&self) -> Option<&Candidate>
[src]
pub fn participants(&self) -> HashSet<&AuthorityId>
[src]
Returns a HashSet of AuthorityIds we've seen participating at any step in this round
pub fn voters(&self) -> HashSet<&AuthorityId>
[src]
Returns a HashSet of AuthorityIds we've seen voting at any step in this round.
Does not include those who we've only seen broadcast AdvanceRound
.
pub fn state(&self) -> &State<Candidate, Digest, Signature>
[src]
Inspect the current consensus state.
pub fn import_message(
&mut self,
message: LocalizedMessage<Candidate, Digest, AuthorityId, Signature>
) -> Result<(), Misbehavior<Digest, Signature>>
[src]
&mut self,
message: LocalizedMessage<Candidate, Digest, AuthorityId, Signature>
) -> Result<(), Misbehavior<Digest, Signature>>
Import a message. Importing duplicates is fine, but the signature and authorization should have already been checked.
Trait Implementations
impl<Candidate: Debug, Digest: Debug, AuthorityId: Debug, Signature: Debug> Debug for Accumulator<Candidate, Digest, AuthorityId, Signature> where
Candidate: Eq + Clone,
Digest: Hash + Eq + Clone,
AuthorityId: Hash + Eq + Clone,
Signature: Eq + Clone,
[src]
Candidate: Eq + Clone,
Digest: Hash + Eq + Clone,
AuthorityId: Hash + Eq + Clone,
Signature: Eq + Clone,
Auto Trait Implementations
impl<Candidate, Digest, AuthorityId, Signature> Sync for Accumulator<Candidate, Digest, AuthorityId, Signature> where
AuthorityId: Sync,
Candidate: Sync,
Digest: Sync,
Signature: Sync,
AuthorityId: Sync,
Candidate: Sync,
Digest: Sync,
Signature: Sync,
impl<Candidate, Digest, AuthorityId, Signature> Send for Accumulator<Candidate, Digest, AuthorityId, Signature> where
AuthorityId: Send,
Candidate: Send,
Digest: Send,
Signature: Send,
AuthorityId: Send,
Candidate: Send,
Digest: Send,
Signature: Send,
impl<Candidate, Digest, AuthorityId, Signature> Unpin for Accumulator<Candidate, Digest, AuthorityId, Signature> where
AuthorityId: Unpin,
Candidate: Unpin,
Digest: Unpin,
Signature: Unpin,
AuthorityId: Unpin,
Candidate: Unpin,
Digest: Unpin,
Signature: Unpin,
impl<Candidate, Digest, AuthorityId, Signature> RefUnwindSafe for Accumulator<Candidate, Digest, AuthorityId, Signature> where
AuthorityId: RefUnwindSafe,
Candidate: RefUnwindSafe,
Digest: RefUnwindSafe,
Signature: RefUnwindSafe,
AuthorityId: RefUnwindSafe,
Candidate: RefUnwindSafe,
Digest: RefUnwindSafe,
Signature: RefUnwindSafe,
impl<Candidate, Digest, AuthorityId, Signature> UnwindSafe for Accumulator<Candidate, Digest, AuthorityId, Signature> where
AuthorityId: UnwindSafe,
Candidate: UnwindSafe,
Digest: UnwindSafe,
Signature: UnwindSafe,
AuthorityId: UnwindSafe,
Candidate: UnwindSafe,
Digest: UnwindSafe,
Signature: UnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,