pub struct MultiRoundAggregator { /* private fields */ }Expand description
最小から最大のラウンドまでのメッセージ。catapult の MultiRoundMessageAggregator
Implementations§
Source§impl MultiRoundAggregator
impl MultiRoundAggregator
Sourcepub fn new(
parameters: ProofParameters,
max_response_size: usize,
round: FinalizationRound,
previous_finalized: Candidate,
) -> Self
pub fn new( parameters: ProofParameters, max_response_size: usize, round: FinalizationRound, previous_finalized: Candidate, ) -> Self
最後にファイナライズしたのが、ラウンド round のブロック previous_finalized。最小も最大も round から始める
pub fn min_round(&self) -> FinalizationRound
pub fn max_round(&self) -> FinalizationRound
pub fn is_empty(&self) -> bool
Sourcepub fn set_voting_set(&mut self, epoch: u32, voters: Arc<VotingSet>)
pub fn set_voting_set(&mut self, epoch: u32, voters: Arc<VotingSet>)
エポック epoch の投票者を教える。そのエポックのメッセージは、教わるまで足せない
Sourcepub fn has_voting_set(&self, epoch: u32) -> bool
pub fn has_voting_set(&self, epoch: u32) -> bool
エポック epoch の投票者を知っているか
Sourcepub fn set_max_round(&mut self, round: FinalizationRound)
pub fn set_max_round(&mut self, round: FinalizationRound)
Sourcepub fn add(
&mut self,
message: FinalizationMessage,
) -> Result<Added, MultiRoundError>
pub fn add( &mut self, message: FinalizationMessage, ) -> Result<Added, MultiRoundError>
メッセージを足す。範囲の中なら、足せなくてもそのラウンドの集計は作る(catapult と同じ)
Sourcepub fn round(&self, round: FinalizationRound) -> Option<&RoundContext>
pub fn round(&self, round: FinalizationRound) -> Option<&RoundContext>
ラウンド round の数え方。まだメッセージがなければ None
Sourcepub fn find_estimate(&self, round: FinalizationRound) -> Candidate
pub fn find_estimate(&self, round: FinalizationRound) -> Candidate
round かそれより前のラウンドのうち、いちばん新しい estimate。catapult の findEstimate
Sourcepub fn best_precommit(&self) -> Option<BestPrecommit<'_>>
pub fn best_precommit(&self) -> Option<BestPrecommit<'_>>
best precommit のある、いちばん新しいラウンド。証明にするメッセージは、そのラウンドの全部
(合わせて max_response_size まで)
Sourcepub fn short_hashes(&self) -> Vec<u32>
pub fn short_hashes(&self) -> Vec<u32>
持っているメッセージ全部の短いハッシュ
Sourcepub fn unknown_messages(
&self,
min: FinalizationRound,
max: FinalizationRound,
known: &BTreeSet<u32>,
) -> Vec<&FinalizationMessage>
pub fn unknown_messages( &self, min: FinalizationRound, max: FinalizationRound, known: &BTreeSet<u32>, ) -> Vec<&FinalizationMessage>
ラウンド min から max までのメッセージのうち、短いハッシュが known にないもの。合わせて
max_response_size バイトまで
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MultiRoundAggregator
impl RefUnwindSafe for MultiRoundAggregator
impl Send for MultiRoundAggregator
impl Sync for MultiRoundAggregator
impl Unpin for MultiRoundAggregator
impl UnsafeUnpin for MultiRoundAggregator
impl UnwindSafe for MultiRoundAggregator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more