Struct solana_gossip::crds_gossip::CrdsGossip [−][src]
pub struct CrdsGossip {
pub crds: Crds,
pub push: CrdsGossipPush,
pub pull: CrdsGossipPull,
}
Fields
crds: 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>(
&mut 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>(
&mut 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(
&mut 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(
&mut 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(
&mut 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
- ratio - number of actives to rotate
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>(&mut self, callers: I, now: u64) where
I: IntoIterator<Item = CrdsValue>,
pub fn process_pull_requests<I>(&mut 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(
&mut 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(
&mut 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
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