Struct jormungandr::topology::ReportRecords
source · pub struct ReportRecords {
report_duration: Duration,
report_whitelist: HashSet<Address>,
report_grace: LruCache<NodeId, ()>,
report_records: LruCache<NodeId, ReportRecord>,
}
Expand description
Forgive nodes we demoted after some time
Fields§
§report_duration: Duration
A report will be lifted after ‘report_duration’
report_whitelist: HashSet<Address>
§report_grace: LruCache<NodeId, ()>
To avoid cycling down nodes back and and forth(and as such prevent them from being evicted from the lru cache), do not report again nodes that were recently lifted from a report.
A peer is inserted in the grace list after the report is lifted and is removed from that list after we receive a new gossip about it.
report_records: LruCache<NodeId, ReportRecord>
Implementations§
source§impl ReportRecords
impl ReportRecords
pub fn from_config(config: QuarantineConfig) -> Self
sourcepub fn report_node(
&mut self,
topology: &mut Topology,
node: Peer
) -> ReportNodeStatus
pub fn report_node( &mut self, topology: &mut Topology, node: Peer ) -> ReportNodeStatus
Returns whether the node has been quarantined or not.
pub fn reported_nodes(&self) -> Vec<PeerInfo>
pub fn record_new_gossip(&mut self, node: &NodeId)
pub fn lift_reports(&mut self) -> Vec<PeerInfo>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for ReportRecords
impl Send for ReportRecords
impl Sync for ReportRecords
impl Unpin for ReportRecords
impl UnwindSafe for ReportRecords
Blanket Implementations§
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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
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