Skip to main content

MultiRoundAggregator

Struct MultiRoundAggregator 

Source
pub struct MultiRoundAggregator { /* private fields */ }
Expand description

最小から最大のラウンドまでのメッセージ。catapult の MultiRoundMessageAggregator

Implementations§

Source§

impl MultiRoundAggregator

Source

pub fn new( parameters: ProofParameters, max_response_size: usize, round: FinalizationRound, previous_finalized: Candidate, ) -> Self

最後にファイナライズしたのが、ラウンド round のブロック previous_finalized。最小も最大も round から始める

Source

pub fn min_round(&self) -> FinalizationRound

Source

pub fn max_round(&self) -> FinalizationRound

Source

pub fn len(&self) -> usize

持っているラウンドの数

Source

pub fn is_empty(&self) -> bool

Source

pub fn set_voting_set(&mut self, epoch: u32, voters: Arc<VotingSet>)

エポック epoch の投票者を教える。そのエポックのメッセージは、教わるまで足せない

Source

pub fn has_voting_set(&self, epoch: u32) -> bool

エポック epoch の投票者を知っているか

Source

pub fn set_max_round(&mut self, round: FinalizationRound)

集める範囲の最大を round にする。

§Panics

最小より前にはできない(catapult も例外にする)

Source

pub fn add( &mut self, message: FinalizationMessage, ) -> Result<Added, MultiRoundError>

メッセージを足す。範囲の中なら、足せなくてもそのラウンドの集計は作る(catapult と同じ)

Source

pub fn round(&self, round: FinalizationRound) -> Option<&RoundContext>

ラウンド round の数え方。まだメッセージがなければ None

Source

pub fn find_estimate(&self, round: FinalizationRound) -> Candidate

round かそれより前のラウンドのうち、いちばん新しい estimate。catapult の findEstimate

Source

pub fn best_precommit(&self) -> Option<BestPrecommit<'_>>

best precommit のある、いちばん新しいラウンド。証明にするメッセージは、そのラウンドの全部 (合わせて max_response_size まで)

Source

pub fn short_hashes(&self) -> Vec<u32>

持っているメッセージ全部の短いハッシュ

Source

pub fn unknown_messages( &self, min: FinalizationRound, max: FinalizationRound, known: &BTreeSet<u32>, ) -> Vec<&FinalizationMessage>

ラウンド min から max までのメッセージのうち、短いハッシュが known にないもの。合わせて max_response_size バイトまで

Source

pub fn prune(&mut self, epoch: u32)

エポック epoch より前のラウンドを捨て、最小をいちばん古く残ったラウンドにする(なければ最大)

Trait Implementations§

Source§

impl Debug for MultiRoundAggregator

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.