Struct solana_core::consensus::Tower
source · 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 last_vote_tx_blockhash(&self) -> Option<Hash>
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
) -> ThresholdDecision
pub fn check_vote_stake_thresholds( &self, slot: Slot, voted_stakes: &VotedStakes, total_stake: Stake ) -> 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
source§impl PartialEq for Tower
impl PartialEq for Tower
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<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, digester: &mut AbiDigester ) -> Result<AbiDigester, DigestError>
source§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, _digester: &mut AbiDigester ) -> Result<AbiDigester, DigestError>
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> 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