Struct solana_gossip::crds_gossip_pull::CrdsGossipPull
source · pub struct CrdsGossipPull {
failed_inserts: RwLock<VecDeque<(Hash, u64)>>,
pub crds_timeout: u64,
pub num_pulls: AtomicUsize,
}
Fields§
§failed_inserts: RwLock<VecDeque<(Hash, u64)>>
§crds_timeout: u64
§num_pulls: AtomicUsize
Implementations§
source§impl CrdsGossipPull
impl CrdsGossipPull
sourcepub(crate) fn new_pull_request(
&self,
thread_pool: &ThreadPool,
crds: &RwLock<Crds>,
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<HashMap<ContactInfo, Vec<CrdsFilter>>, CrdsGossipError>
pub(crate) fn new_pull_request( &self, thread_pool: &ThreadPool, crds: &RwLock<Crds>, 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<HashMap<ContactInfo, Vec<CrdsFilter>>, CrdsGossipError>
Generate a random request
sourcepub(crate) fn process_pull_requests<I>(
crds: &RwLock<Crds>,
callers: I,
now: u64
)where
I: IntoIterator<Item = CrdsValue>,
pub(crate) fn process_pull_requests<I>( crds: &RwLock<Crds>, callers: I, now: u64 )where I: IntoIterator<Item = CrdsValue>,
Process a pull request
sourcepub(crate) fn generate_pull_responses(
thread_pool: &ThreadPool,
crds: &RwLock<Crds>,
requests: &[(CrdsValue, CrdsFilter)],
output_size_limit: usize,
now: u64,
stats: &GossipStats
) -> Vec<Vec<CrdsValue>>
pub(crate) fn generate_pull_responses( thread_pool: &ThreadPool, crds: &RwLock<Crds>, requests: &[(CrdsValue, CrdsFilter)], output_size_limit: usize, now: u64, stats: &GossipStats ) -> Vec<Vec<CrdsValue>>
Create gossip responses to pull requests
pub(crate) fn filter_pull_responses( &self, crds: &RwLock<Crds>, timeouts: &CrdsTimeouts<'_>, responses: Vec<CrdsValue>, now: u64, stats: &mut ProcessPullStats ) -> (Vec<CrdsValue>, Vec<CrdsValue>, Vec<Hash>)
sourcepub(crate) fn process_pull_responses(
&self,
crds: &RwLock<Crds>,
from: &Pubkey,
responses: Vec<CrdsValue>,
responses_expired_timeout: Vec<CrdsValue>,
failed_inserts: Vec<Hash>,
now: u64,
stats: &mut ProcessPullStats
)
pub(crate) fn process_pull_responses( &self, crds: &RwLock<Crds>, from: &Pubkey, responses: Vec<CrdsValue>, responses_expired_timeout: Vec<CrdsValue>, failed_inserts: Vec<Hash>, now: u64, stats: &mut ProcessPullStats )
Process a vec of pull responses
pub(crate) fn purge_failed_inserts(&self, now: u64)
pub(crate) fn failed_inserts_size(&self) -> usize
pub fn build_crds_filters( &self, thread_pool: &ThreadPool, crds: &RwLock<Crds>, bloom_size: usize ) -> Vec<CrdsFilter>
sourcefn filter_crds_values(
thread_pool: &ThreadPool,
crds: &RwLock<Crds>,
filters: &[(CrdsValue, CrdsFilter)],
output_size_limit: usize,
now: u64,
stats: &GossipStats
) -> Vec<Vec<CrdsValue>>
fn filter_crds_values( thread_pool: &ThreadPool, crds: &RwLock<Crds>, filters: &[(CrdsValue, CrdsFilter)], output_size_limit: usize, now: u64, stats: &GossipStats ) -> Vec<Vec<CrdsValue>>
Filter values that fail the bloom filter up to max_bytes
.
pub(crate) fn make_timeouts<'a>( &self, self_pubkey: Pubkey, stakes: &'a HashMap<Pubkey, u64>, epoch_duration: Duration ) -> CrdsTimeouts<'a>
sourcepub(crate) fn purge_active(
thread_pool: &ThreadPool,
crds: &RwLock<Crds>,
now: u64,
timeouts: &CrdsTimeouts<'_>
) -> usize
pub(crate) fn purge_active( thread_pool: &ThreadPool, crds: &RwLock<Crds>, now: u64, timeouts: &CrdsTimeouts<'_> ) -> usize
Purge values from the crds that are older then active_timeout
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for CrdsGossipPull
impl Send for CrdsGossipPull
impl Sync for CrdsGossipPull
impl Unpin for CrdsGossipPull
impl UnwindSafe for CrdsGossipPull
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