Struct solana_gossip::crds_gossip::CrdsGossip [−][src]
pub struct CrdsGossip {
pub crds: RwLock<Crds>,
pub push: CrdsGossipPush,
pub pull: CrdsGossipPull,
}
Fields
crds: RwLock<Crds>
push: CrdsGossipPush
pull: CrdsGossipPull
Implementations
Process a push message to the network.
Returns unique origins’ pubkeys of upserted values.
pub fn prune_received_cache<I>(
&self,
self_pubkey: &Pubkey,
origins: I,
stakes: &HashMap<Pubkey, u64>
) -> HashMap<Pubkey, Vec<Pubkey>> where
I: IntoIterator<Item = Pubkey>,
pub fn prune_received_cache<I>(
&self,
self_pubkey: &Pubkey,
origins: I,
stakes: &HashMap<Pubkey, u64>
) -> HashMap<Pubkey, Vec<Pubkey>> where
I: IntoIterator<Item = Pubkey>,
Remove redundant paths in the network.
pub fn new_push_messages(
&self,
pending_push_messages: Vec<CrdsValue>,
now: u64
) -> HashMap<Pubkey, Vec<CrdsValue>>
pub fn process_prune_msg(
&self,
self_pubkey: &Pubkey,
peer: &Pubkey,
destination: &Pubkey,
origin: &[Pubkey],
wallclock: u64,
now: u64
) -> Result<(), CrdsGossipError>
pub fn process_prune_msg(
&self,
self_pubkey: &Pubkey,
peer: &Pubkey,
destination: &Pubkey,
origin: &[Pubkey],
wallclock: u64,
now: u64
) -> Result<(), CrdsGossipError>
Add the from
to the peer’s filter of nodes.
pub fn refresh_push_active_set(
&self,
self_pubkey: &Pubkey,
self_shred_version: u16,
stakes: &HashMap<Pubkey, u64>,
gossip_validators: Option<&HashSet<Pubkey>>,
socket_addr_space: &SocketAddrSpace
)
pub fn refresh_push_active_set(
&self,
self_pubkey: &Pubkey,
self_shred_version: u16,
stakes: &HashMap<Pubkey, u64>,
gossip_validators: Option<&HashSet<Pubkey>>,
socket_addr_space: &SocketAddrSpace
)
Refresh the push active set.
pub fn new_pull_request(
&self,
thread_pool: &ThreadPool,
self_keypair: &Keypair,
self_shred_version: u16,
now: u64,
gossip_validators: Option<&HashSet<Pubkey>>,
stakes: &HashMap<Pubkey, u64>,
bloom_size: usize,
ping_cache: &Mutex<PingCache>,
pings: &mut Vec<(SocketAddr, Ping<[u8; 32]>)>,
socket_addr_space: &SocketAddrSpace
) -> Result<(ContactInfo, Vec<CrdsFilter>), CrdsGossipError>
pub fn new_pull_request(
&self,
thread_pool: &ThreadPool,
self_keypair: &Keypair,
self_shred_version: u16,
now: u64,
gossip_validators: Option<&HashSet<Pubkey>>,
stakes: &HashMap<Pubkey, u64>,
bloom_size: usize,
ping_cache: &Mutex<PingCache>,
pings: &mut Vec<(SocketAddr, Ping<[u8; 32]>)>,
socket_addr_space: &SocketAddrSpace
) -> Result<(ContactInfo, Vec<CrdsFilter>), CrdsGossipError>
Generate a random request.
Time when a request to from
was initiated.
This is used for weighted random selection during new_pull_request
It’s important to use the local nodes request creation time as the weight
instead of the response received time otherwise failed nodes will increase their weight.
pub fn process_pull_requests<I>(&self, callers: I, now: u64) where
I: IntoIterator<Item = CrdsValue>,
pub fn process_pull_requests<I>(&self, callers: I, now: u64) where
I: IntoIterator<Item = CrdsValue>,
Process a pull request and create a response.
pub fn generate_pull_responses(
&self,
thread_pool: &ThreadPool,
filters: &[(CrdsValue, CrdsFilter)],
output_size_limit: usize,
now: u64
) -> Vec<Vec<CrdsValue>>ⓘ
pub fn filter_pull_responses(
&self,
timeouts: &HashMap<Pubkey, u64>,
response: Vec<CrdsValue>,
now: u64,
process_pull_stats: &mut ProcessPullStats
) -> (Vec<CrdsValue>, Vec<CrdsValue>, Vec<Hash>)
pub fn process_pull_responses(
&self,
from: &Pubkey,
responses: Vec<CrdsValue>,
responses_expired_timeout: Vec<CrdsValue>,
failed_inserts: Vec<Hash>,
now: u64,
process_pull_stats: &mut ProcessPullStats
)
pub fn process_pull_responses(
&self,
from: &Pubkey,
responses: Vec<CrdsValue>,
responses_expired_timeout: Vec<CrdsValue>,
failed_inserts: Vec<Hash>,
now: u64,
process_pull_stats: &mut ProcessPullStats
)
Process a pull response.
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for CrdsGossip
impl Send for CrdsGossip
impl Sync for CrdsGossip
impl Unpin for CrdsGossip
impl UnwindSafe for CrdsGossip
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T
in a tonic::Request
impl<T> TupleTree<T, ()> for T
impl<T> TupleTree<T, ()> for T
pub const SIZE: Size
pub fn descendants(_indirect_level: usize) -> usize
pub fn preorder_with_size_hint(self, f: &mut impl FnMut(Visit<T>, Size))
pub fn postorder_with_size_hint(self, f: &mut impl FnMut(Visit<T>, Size))
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more