pub struct HeaviestSubtreeForkChoice { /* private fields */ }
Implementations
sourceimpl HeaviestSubtreeForkChoice
impl HeaviestSubtreeForkChoice
pub fn new(root: SlotHashKey) -> Self
pub fn new_from_frozen_banks(
root: SlotHashKey,
frozen_banks: &[Arc<Bank>]
) -> Self
pub fn new_from_bank_forks(bank_forks: &BankForks) -> Self
pub fn contains_block(&self, key: &SlotHashKey) -> bool
pub fn best_slot(&self, key: &SlotHashKey) -> Option<SlotHashKey>
pub fn best_overall_slot(&self) -> SlotHashKey
pub fn stake_voted_subtree(&self, key: &SlotHashKey) -> Option<u64>
pub fn root(&self) -> SlotHashKey
pub fn max_by_weight(&self, slot1: SlotHashKey, slot2: SlotHashKey) -> Ordering
pub fn add_votes<'a, 'b>(
&'a mut self,
pubkey_votes: impl Iterator<Item = impl Borrow<(Pubkey, SlotHashKey)> + 'b>,
epoch_stakes: &HashMap<Epoch, EpochStakes>,
epoch_schedule: &EpochSchedule
) -> SlotHashKey
pub fn set_root(&mut self, new_root: SlotHashKey)
pub fn add_root_parent(&mut self, root_parent: SlotHashKey)
pub fn add_new_leaf_slot(
&mut self,
slot_hash_key: SlotHashKey,
parent: Option<SlotHashKey>
)
pub fn all_slots_stake_voted_subtree(
&self
) -> impl Iterator<Item = (&SlotHashKey, u64)>
pub fn merge(
&mut self,
other: HeaviestSubtreeForkChoice,
merge_leaf: &SlotHashKey,
epoch_stakes: &HashMap<Epoch, EpochStakes>,
epoch_schedule: &EpochSchedule
)
pub fn stake_voted_at(&self, slot: &SlotHashKey) -> Option<u64>
pub fn latest_invalid_ancestor(
&self,
slot_hash_key: &SlotHashKey
) -> Option<Slot>
pub fn is_duplicate_confirmed(
&self,
slot_hash_key: &SlotHashKey
) -> Option<bool>
sourcepub fn is_unconfirmed_duplicate(
&self,
slot_hash_key: &SlotHashKey
) -> Option<bool>
pub fn is_unconfirmed_duplicate(
&self,
slot_hash_key: &SlotHashKey
) -> Option<bool>
Returns if the exact node with the specified key has been explicitly marked as a duplicate slot (doesn’t count ancestors being marked as duplicate).
sourcepub fn is_candidate(&self, slot_hash_key: &SlotHashKey) -> Option<bool>
pub fn is_candidate(&self, slot_hash_key: &SlotHashKey) -> Option<bool>
Returns false if the node or any of its ancestors have been marked as duplicate
sourcepub fn is_strict_ancestor(
&self,
maybe_ancestor_key: &SlotHashKey,
node_key: &SlotHashKey
) -> bool
pub fn is_strict_ancestor(
&self,
maybe_ancestor_key: &SlotHashKey,
node_key: &SlotHashKey
) -> bool
Returns if a node with slot maybe_ancestor_slot
is an ancestor of the node with
key node_key
Trait Implementations
sourceimpl ForkChoice for HeaviestSubtreeForkChoice
impl ForkChoice for HeaviestSubtreeForkChoice
type ForkChoiceKey = SlotHashKey
fn compute_bank_stats(
&mut self,
bank: &Bank,
_tower: &Tower,
latest_validator_votes_for_frozen_banks: &mut LatestValidatorVotesForFrozenBanks
)
fn select_forks(
&self,
_frozen_banks: &[Arc<Bank>],
tower: &Tower,
_progress: &ProgressMap,
_ancestors: &HashMap<u64, HashSet<u64>>,
bank_forks: &RwLock<BankForks>
) -> (Arc<Bank>, Option<Arc<Bank>>)
fn mark_fork_invalid_candidate(&mut self, invalid_slot_hash_key: &SlotHashKey)
sourcefn mark_fork_valid_candidate(
&mut self,
valid_slot_hash_key: &SlotHashKey
) -> Vec<SlotHashKey>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn mark_fork_valid_candidate(
&mut self,
valid_slot_hash_key: &SlotHashKey
) -> Vec<SlotHashKey>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns any newly duplicate confirmed ancestors of valid_slot
up to and including
valid_slot
itself Read more
sourceimpl TreeDiff for HeaviestSubtreeForkChoice
impl TreeDiff for HeaviestSubtreeForkChoice
type TreeKey = SlotHashKey
fn contains_slot(&self, slot_hash_key: &SlotHashKey) -> bool
fn children(&self, slot_hash_key: &SlotHashKey) -> Option<&[SlotHashKey]>
fn subtree_diff(
&self,
root1: Self::TreeKey,
root2: Self::TreeKey
) -> HashSet<Self::TreeKey>
Auto Trait Implementations
impl RefUnwindSafe for HeaviestSubtreeForkChoice
impl Send for HeaviestSubtreeForkChoice
impl Sync for HeaviestSubtreeForkChoice
impl Unpin for HeaviestSubtreeForkChoice
impl UnwindSafe for HeaviestSubtreeForkChoice
Blanket Implementations
sourceimpl<T> AbiExample for T
impl<T> AbiExample for T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> TupleTree<T, ()> for T
impl<T> TupleTree<T, ()> for T
const SIZE: Size
fn descendants(_indirect_level: usize) -> usize
fn height() -> usize
fn preorder(self, f: &mut impl FnMut(Visit<T>))
fn preorder_with_size_hint(self, f: &mut impl FnMut(Visit<T>, Size))
fn postorder(self, f: &mut impl FnMut(Visit<T>))
fn postorder_with_size_hint(self, f: &mut impl FnMut(Visit<T>, Size))
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more