[][src]Struct solana_core::crds_gossip_pull::CrdsGossipPull

pub struct CrdsGossipPull {
    pub pull_request_time: HashMap<Pubkey, u64>,
    pub crds_timeout: u64,
    pub msg_timeout: u64,
    // some fields omitted
}

Fields

pull_request_time: HashMap<Pubkey, u64>

timestamp of last request

crds_timeout: u64msg_timeout: u64

Methods

impl CrdsGossipPull[src]

pub fn new_pull_request(
    &self,
    crds: &Crds,
    self_id: &Pubkey,
    now: u64,
    stakes: &HashMap<Pubkey, u64>,
    bloom_size: usize
) -> Result<(Pubkey, Vec<CrdsFilter>, CrdsValue), CrdsGossipError>
[src]

generate a random request

pub fn mark_pull_request_creation_time(&mut self, from: &Pubkey, now: u64)[src]

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 record_old_hash(&mut self, hash: Hash, timestamp: u64)[src]

Store an old hash in the purged values set

pub fn process_pull_requests(
    &mut self,
    crds: &mut Crds,
    requests: Vec<(CrdsValue, CrdsFilter)>,
    now: u64
) -> Vec<Vec<CrdsValue>>
[src]

process a pull request and create a response

pub fn process_pull_response(
    &mut self,
    crds: &mut Crds,
    from: &Pubkey,
    timeouts: &HashMap<Pubkey, u64>,
    response: Vec<CrdsValue>,
    now: u64
) -> usize
[src]

process a pull response

pub fn build_crds_filters(
    &self,
    crds: &Crds,
    bloom_size: usize
) -> Vec<CrdsFilter>
[src]

pub fn make_timeouts_def(
    &self,
    self_id: &Pubkey,
    stakes: &HashMap<Pubkey, u64>,
    epoch_ms: u64,
    min_ts: u64
) -> HashMap<Pubkey, u64>
[src]

pub fn make_timeouts(
    &self,
    self_id: &Pubkey,
    stakes: &HashMap<Pubkey, u64>,
    epoch_ms: u64
) -> HashMap<Pubkey, u64>
[src]

pub fn purge_active(
    &mut self,
    crds: &mut Crds,
    now: u64,
    timeouts: &HashMap<Pubkey, u64>
) -> usize
[src]

Purge values from the crds that are older then active_timeout The value_hash of an active item is put into self.purged_values queue

pub fn purge_purged(&mut self, min_ts: u64)[src]

Purge values from the self.purged_values queue that are older then purge_timeout

Trait Implementations

impl Clone for CrdsGossipPull[src]

impl Default for CrdsGossipPull[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized

impl<T> From<T> for T[src]

impl<T> InitializableFromZeroed for T where
    T: Default

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,