Struct solana_core::crds_gossip::CrdsGossip [−][src]
Fields
crds: Crds
id: Pubkey
shred_version: u16
push: CrdsGossipPush
pull: CrdsGossipPull
Implementations
impl CrdsGossip
[src]
pub fn set_self(&mut self, id: &Pubkey)
[src]
pub fn set_shred_version(&mut self, shred_version: u16)
[src]
pub fn process_push_message(
&mut self,
from: &Pubkey,
values: Vec<CrdsValue>,
now: u64
) -> Vec<VersionedCrdsValue>
[src]
&mut self,
from: &Pubkey,
values: Vec<CrdsValue>,
now: u64
) -> Vec<VersionedCrdsValue>
process a push message to the network
pub fn prune_received_cache(
&mut self,
labels: Vec<CrdsValueLabel>,
stakes: &HashMap<Pubkey, u64>
) -> HashMap<Pubkey, HashSet<Pubkey>>
[src]
&mut self,
labels: Vec<CrdsValueLabel>,
stakes: &HashMap<Pubkey, u64>
) -> HashMap<Pubkey, HashSet<Pubkey>>
remove redundant paths in the network
pub fn process_push_messages(
&mut self,
pending_push_messages: Vec<(CrdsValue, u64)>
)
[src]
&mut self,
pending_push_messages: Vec<(CrdsValue, u64)>
)
pub fn new_push_messages(
&mut self,
pending_push_messages: Vec<(CrdsValue, u64)>,
now: u64
) -> (Pubkey, HashMap<Pubkey, Vec<CrdsValue>>)
[src]
&mut self,
pending_push_messages: Vec<(CrdsValue, u64)>,
now: u64
) -> (Pubkey, HashMap<Pubkey, Vec<CrdsValue>>)
pub fn process_prune_msg(
&self,
peer: &Pubkey,
destination: &Pubkey,
origin: &[Pubkey],
wallclock: u64,
now: u64
) -> Result<(), CrdsGossipError>
[src]
&self,
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,
stakes: &HashMap<Pubkey, u64>,
gossip_validators: Option<&HashSet<Pubkey>>
)
[src]
&mut self,
stakes: &HashMap<Pubkey, u64>,
gossip_validators: Option<&HashSet<Pubkey>>
)
refresh the push active set
- ratio - number of actives to rotate
pub fn new_pull_request(
&self,
thread_pool: &ThreadPool,
now: u64,
gossip_validators: Option<&HashSet<Pubkey>>,
stakes: &HashMap<Pubkey, u64>,
bloom_size: usize
) -> Result<(Pubkey, Vec<CrdsFilter>, CrdsValue), CrdsGossipError>
[src]
&self,
thread_pool: &ThreadPool,
now: u64,
gossip_validators: Option<&HashSet<Pubkey>>,
stakes: &HashMap<Pubkey, u64>,
bloom_size: usize
) -> Result<(Pubkey, Vec<CrdsFilter>, CrdsValue), CrdsGossipError>
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 process_pull_requests<I>(&mut self, callers: I, now: u64) where
I: IntoIterator<Item = CrdsValue>,
[src]
I: IntoIterator<Item = CrdsValue>,
process a pull request and create a response
pub fn generate_pull_responses(
&self,
filters: &[(CrdsValue, CrdsFilter)],
output_size_limit: usize,
now: u64
) -> Vec<Vec<CrdsValue>>
[src]
&self,
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<VersionedCrdsValue>, Vec<VersionedCrdsValue>, Vec<Hash>)
[src]
&self,
timeouts: &HashMap<Pubkey, u64>,
response: Vec<CrdsValue>,
now: u64,
process_pull_stats: &mut ProcessPullStats
) -> (Vec<VersionedCrdsValue>, Vec<VersionedCrdsValue>, Vec<Hash>)
pub fn process_pull_responses(
&mut self,
from: &Pubkey,
responses: Vec<VersionedCrdsValue>,
responses_expired_timeout: Vec<VersionedCrdsValue>,
failed_inserts: Vec<Hash>,
now: u64,
process_pull_stats: &mut ProcessPullStats
)
[src]
&mut self,
from: &Pubkey,
responses: Vec<VersionedCrdsValue>,
responses_expired_timeout: Vec<VersionedCrdsValue>,
failed_inserts: Vec<Hash>,
now: u64,
process_pull_stats: &mut ProcessPullStats
)
process a pull response
pub fn make_timeouts_test(&self) -> HashMap<Pubkey, u64>
[src]
pub fn make_timeouts(
&self,
stakes: &HashMap<Pubkey, u64>,
epoch_ms: u64
) -> HashMap<Pubkey, u64>
[src]
&self,
stakes: &HashMap<Pubkey, u64>,
epoch_ms: u64
) -> HashMap<Pubkey, u64>
pub fn purge(
&mut self,
thread_pool: &ThreadPool,
now: u64,
timeouts: &HashMap<Pubkey, u64>
) -> usize
[src]
&mut self,
thread_pool: &ThreadPool,
now: u64,
timeouts: &HashMap<Pubkey, u64>
) -> usize
Trait Implementations
impl Default for CrdsGossip
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoRequest<T> for T
[src]
pub fn into_request(self) -> Request<T>
[src]
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,