pub struct Tower {
pub node_pubkey: Pubkey,
pub last_switch_threshold_check: Option<(Slot, SwitchForkDecision)>,
/* private fields */
}Fields§
§node_pubkey: Pubkey§last_switch_threshold_check: Option<(Slot, SwitchForkDecision)>Implementations§
Source§impl Tower
impl Tower
pub fn new( node_pubkey: &Pubkey, vote_account_pubkey: &Pubkey, root: Slot, bank: &Bank, ) -> Self
pub fn new_from_bankforks( bank_forks: &BankForks, node_pubkey: &Pubkey, vote_account: &Pubkey, ) -> Self
pub fn tower_slots(&self) -> Vec<Slot>
pub fn refresh_last_vote_timestamp(&mut self, heaviest_slot_on_same_fork: Slot)
pub fn refresh_last_vote_tx_blockhash(&mut self, new_vote_tx_blockhash: Hash)
pub fn last_voted_slot_in_bank( bank: &Bank, vote_account_pubkey: &Pubkey, ) -> Option<Slot>
pub fn record_bank_vote(&mut self, bank: &Bank) -> Option<Slot>
Sourcepub fn increase_lockout(&mut self, confirmation_count_increase: u32)
pub fn increase_lockout(&mut self, confirmation_count_increase: u32)
Used for tests
pub fn last_voted_slot(&self) -> Option<Slot>
pub fn last_voted_slot_hash(&self) -> Option<(Slot, Hash)>
pub fn stray_restored_slot(&self) -> Option<Slot>
pub fn last_vote(&self) -> VoteTransaction
pub fn root(&self) -> Slot
pub fn is_recent(&self, slot: Slot) -> bool
pub fn has_voted(&self, slot: Slot) -> bool
pub fn is_locked_out(&self, slot: Slot, ancestors: &HashSet<Slot>) -> bool
Sourcepub fn check_vote_stake_thresholds(
&self,
slot: Slot,
voted_stakes: &VotedStakes,
total_stake: Stake,
) -> Vec<ThresholdDecision>
pub fn check_vote_stake_thresholds( &self, slot: Slot, voted_stakes: &VotedStakes, total_stake: Stake, ) -> Vec<ThresholdDecision>
Performs vote threshold checks for slot
pub fn is_stray_last_vote(&self) -> bool
pub fn adjust_lockouts_after_replay( self, replayed_root: Slot, slot_history: &SlotHistory, ) -> Result<Self>
pub fn save( &self, tower_storage: &dyn TowerStorage, node_keypair: &Keypair, ) -> Result<()>
pub fn restore( tower_storage: &dyn TowerStorage, node_pubkey: &Pubkey, ) -> Result<Self>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tower
impl<'de> Deserialize<'de> for Tower
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Tower
Auto Trait Implementations§
impl Freeze for Tower
impl RefUnwindSafe for Tower
impl Send for Tower
impl Sync for Tower
impl Unpin for Tower
impl UnwindSafe for Tower
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request