Enum lumina_node::events::NodeEvent

source ·
#[non_exhaustive]
pub enum NodeEvent {
Show 17 variants ConnectingToBootnodes, PeerConnected { id: PeerId, trusted: bool, }, PeerDisconnected { id: PeerId, trusted: bool, }, SamplingStarted { height: u64, square_width: u16, shares: Vec<(u16, u16)>, }, ShareSamplingResult { height: u64, square_width: u16, row: u16, column: u16, accepted: bool, }, SamplingFinished { height: u64, accepted: bool, took: Duration, }, FatalDaserError { error: String, }, AddedHeaderFromHeaderSub { height: u64, }, FetchingHeadHeaderStarted, FetchingHeadHeaderFinished { height: u64, took: Duration, }, FetchingHeadersStarted { from_height: u64, to_height: u64, }, FetchingHeadersFinished { from_height: u64, to_height: u64, took: Duration, }, FetchingHeadersFailed { from_height: u64, to_height: u64, error: String, took: Duration, }, FatalSyncerError { error: String, }, PrunedHeaders { to_height: u64, }, FatalPrunerError { error: String, }, NetworkCompromised,
}
Expand description

The events that Node can generate.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ConnectingToBootnodes

Node is connecting to bootnodes

§

PeerConnected

Peer just connected

Fields

§id: PeerId

The ID of the peer.

§trusted: bool

Whether peer was in the trusted list or not.

§

PeerDisconnected

Peer just disconnected

Fields

§id: PeerId

The ID of the peer.

§trusted: bool

Whether peer was in the trusted list or not.

§

SamplingStarted

Sampling just started.

Fields

§height: u64

The block height that will be sampled.

§square_width: u16

The square width of the block.

§shares: Vec<(u16, u16)>

The coordinates of the shares that will be sampled.

§

ShareSamplingResult

A share was sampled.

Fields

§height: u64

The block height of the share.

§square_width: u16

The square width of the block.

§row: u16

The row of the share.

§column: u16

The column of the share.

§accepted: bool

The result of the sampling of the share.

§

SamplingFinished

Sampling just finished.

Fields

§height: u64

The block height that was sampled.

§accepted: bool

The overall result of the sampling.

§took: Duration

How much time sampling took.

§

FatalDaserError

Data sampling fatal error.

Fields

§error: String

A human readable error.

§

AddedHeaderFromHeaderSub

A new header was added from HeaderSub.

Fields

§height: u64

The height of the header.

§

FetchingHeadHeaderStarted

Fetching header of network head just started.

§

FetchingHeadHeaderFinished

Fetching header of network head just finished.

Fields

§height: u64

The height of the network head.

§took: Duration

How much time fetching took.

§

FetchingHeadersStarted

Fetching headers of a specific block range just started.

Fields

§from_height: u64

Start of the range.

§to_height: u64

End of the range (included).

§

FetchingHeadersFinished

Fetching headers of a specific block range just finished.

Fields

§from_height: u64

Start of the range.

§to_height: u64

End of the range (included).

§took: Duration

How much time fetching took.

§

FetchingHeadersFailed

Fetching headers of a specific block range just failed.

Fields

§from_height: u64

Start of the range.

§to_height: u64

End of the range (included).

§error: String

A human readable error.

§took: Duration

How much time fetching took.

§

FatalSyncerError

Header syncing fatal error.

Fields

§error: String

A human readable error.

§

PrunedHeaders

Pruned headers up to and including specified height.

Fields

§to_height: u64

Last header height that was pruned

§

FatalPrunerError

Pruning fatal error.

Fields

§error: String

A human readable error.

§

NetworkCompromised

Network was compromised.

This happens when a valid bad encoding fraud proof is received. Ideally it would never happen, but protection needs to exist. In case of compromised network, syncing and data sampling will stop immediately.

Implementations§

source§

impl NodeEvent

source

pub fn is_error(&self) -> bool

Returns true if the event indicates an error.

Trait Implementations§

source§

impl Clone for NodeEvent

source§

fn clone(&self) -> NodeEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NodeEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for NodeEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Serialize for NodeEvent

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<S> CondSend for S
where S: Send,

source§

impl<S> CondSync for S
where S: Send + Sync,