Struct solana_gossip::crds_gossip_push::CrdsGossipPush
source · pub struct CrdsGossipPush {
max_bytes: usize,
active_set: RwLock<PushActiveSet>,
crds_cursor: Mutex<Cursor>,
received_cache: Mutex<ReceivedCache>,
push_fanout: usize,
pub(crate) msg_timeout: u64,
pub prune_timeout: u64,
pub num_total: AtomicUsize,
pub num_old: AtomicUsize,
pub num_pushes: AtomicUsize,
}
Fields§
§max_bytes: usize
Max bytes per message
active_set: RwLock<PushActiveSet>
Active set of validators for push
crds_cursor: Mutex<Cursor>
Cursor into the crds table for values to push.
received_cache: Mutex<ReceivedCache>
Cache that tracks which validators a message was received from
This cache represents a lagging view of which validators
currently have this node in their active_set
push_fanout: usize
§msg_timeout: u64
§prune_timeout: u64
§num_total: AtomicUsize
§num_old: AtomicUsize
§num_pushes: AtomicUsize
Implementations§
source§impl CrdsGossipPush
impl CrdsGossipPush
pub fn num_pending(&self, crds: &RwLock<Crds>) -> usize
pub(crate) fn prune_received_cache<I>( &self, self_pubkey: &Pubkey, origins: I, stakes: &HashMap<Pubkey, u64> ) -> HashMap<Pubkey, Vec<Pubkey>>where I: IntoIterator<Item = Pubkey>,
fn wallclock_window(&self, now: u64) -> impl RangeBounds<u64>
sourcepub(crate) fn process_push_message(
&self,
crds: &RwLock<Crds>,
messages: Vec<(Pubkey, Vec<CrdsValue>)>,
now: u64
) -> HashSet<Pubkey>
pub(crate) fn process_push_message( &self, crds: &RwLock<Crds>, messages: Vec<(Pubkey, Vec<CrdsValue>)>, now: u64 ) -> HashSet<Pubkey>
Process a push message to the network.
Returns origins’ pubkeys of upserted values.
sourcepub(crate) fn new_push_messages(
&self,
pubkey: &Pubkey,
crds: &RwLock<Crds>,
now: u64,
stakes: &HashMap<Pubkey, u64>
) -> (HashMap<Pubkey, Vec<CrdsValue>>, usize, usize)
pub(crate) fn new_push_messages( &self, pubkey: &Pubkey, crds: &RwLock<Crds>, now: u64, stakes: &HashMap<Pubkey, u64> ) -> (HashMap<Pubkey, Vec<CrdsValue>>, usize, usize)
New push message to broadcast to peers.
Returns a list of Pubkeys for the selected peers and a list of values to send to all the peers. The list of push messages is created such that all the randomly selected peers have not pruned the source addresses.
sourcepub(crate) fn process_prune_msg(
&self,
self_pubkey: &Pubkey,
peer: &Pubkey,
origins: &[Pubkey],
stakes: &HashMap<Pubkey, u64>
)
pub(crate) fn process_prune_msg( &self, self_pubkey: &Pubkey, peer: &Pubkey, origins: &[Pubkey], stakes: &HashMap<Pubkey, u64> )
Add the from
to the peer’s filter of nodes.
sourcepub(crate) fn refresh_push_active_set(
&self,
crds: &RwLock<Crds>,
stakes: &HashMap<Pubkey, u64>,
gossip_validators: Option<&HashSet<Pubkey>>,
self_keypair: &Keypair,
self_shred_version: u16,
ping_cache: &Mutex<PingCache>,
pings: &mut Vec<(SocketAddr, Ping<[u8; 32]>)>,
socket_addr_space: &SocketAddrSpace
)
pub(crate) fn refresh_push_active_set( &self, crds: &RwLock<Crds>, stakes: &HashMap<Pubkey, u64>, gossip_validators: Option<&HashSet<Pubkey>>, self_keypair: &Keypair, self_shred_version: u16, ping_cache: &Mutex<PingCache>, pings: &mut Vec<(SocketAddr, Ping<[u8; 32]>)>, socket_addr_space: &SocketAddrSpace )
Refresh the push active set.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for CrdsGossipPush
impl Send for CrdsGossipPush
impl Sync for CrdsGossipPush
impl Unpin for CrdsGossipPush
impl UnwindSafe for CrdsGossipPush
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§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> 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