pub enum ReputationChangeKind {
BadMessage,
BadBlock,
BadTransactions,
BadAnnouncement,
AlreadySeenTransaction,
Timeout,
BadProtocol,
FailedToConnect,
Dropped,
Reset,
Other(Reputation),
}
Expand description
Various kinds of reputation changes.
Variants§
BadMessage
Received an unspecific bad message from the peer
BadBlock
Peer sent a bad block.
Note: this will we only used in pre-merge, pow consensus, since after no more block announcements are sent via devp2p: EIP-3675
BadTransactions
Peer sent a bad transaction message. E.g. Transactions which weren’t recoverable.
BadAnnouncement
Peer sent a bad announcement message, e.g. invalid transaction type for the configured network.
AlreadySeenTransaction
Peer sent a message that included a hash or transaction that we already received from the peer.
According to the Eth spec:
A node should never send a transaction back to a peer that it can determine already knows of it (either because it was previously sent or because it was informed from this peer originally). This is usually achieved by remembering a set of transaction hashes recently relayed by the peer.
Timeout
Peer failed to respond in time.
BadProtocol
Peer does not adhere to network protocol rules.
FailedToConnect
Failed to establish a connection to the peer.
Dropped
Connection dropped by peer.
Reset
Reset the reputation to the default value.
Other(Reputation)
Apply a reputation change by value
Implementations§
Source§impl ReputationChangeKind
impl ReputationChangeKind
Sourcepub const fn is_reset(&self) -> bool
pub const fn is_reset(&self) -> bool
Returns true if the reputation change is a ReputationChangeKind::Reset
.
Sourcepub const fn is_dropped(&self) -> bool
pub const fn is_dropped(&self) -> bool
Returns true if the reputation change is ReputationChangeKind::Dropped
.
Trait Implementations§
Source§impl Clone for ReputationChangeKind
impl Clone for ReputationChangeKind
Source§fn clone(&self) -> ReputationChangeKind
fn clone(&self) -> ReputationChangeKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ReputationChangeKind
impl Debug for ReputationChangeKind
Source§impl PartialEq for ReputationChangeKind
impl PartialEq for ReputationChangeKind
impl Copy for ReputationChangeKind
impl Eq for ReputationChangeKind
impl StructuralPartialEq for ReputationChangeKind
Auto Trait Implementations§
impl Freeze for ReputationChangeKind
impl RefUnwindSafe for ReputationChangeKind
impl Send for ReputationChangeKind
impl Sync for ReputationChangeKind
impl Unpin for ReputationChangeKind
impl UnwindSafe for ReputationChangeKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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>
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes
Size for each variant:
BadMessage
: 0 bytesBadBlock
: 0 bytesBadTransactions
: 0 bytesBadAnnouncement
: 0 bytesAlreadySeenTransaction
: 0 bytesTimeout
: 0 bytesBadProtocol
: 0 bytesFailedToConnect
: 0 bytesDropped
: 0 bytesReset
: 0 bytesOther
: 4 bytes