pub enum ChainEvent {
Statistics {
peer: PeerId,
statistics: ChainStatistics,
},
Blocks {
peer: PeerId,
from: u64,
count: u32,
blocks: Vec<(Block, Vec<u8>)>,
},
Hashes {
peer: PeerId,
from: u64,
count: u32,
hashes: Vec<[u8; 32]>,
},
Finalized {
peer: PeerId,
header: FinalizedBlockHeader,
},
OwnProof {
epoch: u32,
proof: Vec<u8>,
},
Proof {
peer: PeerId,
epoch: u32,
proof: Option<Vec<u8>>,
},
Failed {
peer: PeerId,
error: String,
malformed: bool,
},
PeerAdded {
peer: PeerId,
},
PeerLost {
peer: PeerId,
},
Wake,
Pushed {
block: Box<Block>,
bytes: Vec<u8>,
from: Option<PublicKey>,
},
Tick,
}Expand description
チェーンの持ち主の受信箱
Variants§
Statistics
Blocks
頼んだ範囲のブロック。前後に依らない確かめは済んでいる。ノードは数を切り詰めることがある
Hashes
頼んだ高さからのブロックのハッシュ
Finalized
ピアの言う最新のファイナライズ(エポック、ポイント、高さ、ハッシュ)
OwnProof
自分で投票を数えて組んだ証明(ファイナライズを見ているとき)。ピアの証明と同じに確かめてしまう
Proof
頼んだエポックの証明。まだなければ None
Failed
頼んだことができなかった。malformed なら、状態を見ない確かめに落ちるもの(形、署名)が返ってきた。
そうでなければ、通信に失敗した
PeerAdded
駆動役が新しいピア peer とやりとりを始めた
PeerLost
駆動役が自分の都合(入れ替えなど)でピア peer を外した
Wake
頼んだ時刻(crate::chain::Action::WakeAt)になった
Pushed
接続してきたピアが押し付けたブロック。前後に依らない確かめは済んでいる。from は押し付けた相手の鍵。
REST(PUT /blocks)で届いたものは None で、弾いても罰さない
Tick
決まった間隔で入れる。ピアに統計を聞き直し、押し付けのまとめを出す
Auto Trait Implementations§
impl Freeze for ChainEvent
impl RefUnwindSafe for ChainEvent
impl Send for ChainEvent
impl Sync for ChainEvent
impl Unpin for ChainEvent
impl UnsafeUnpin for ChainEvent
impl UnwindSafe for ChainEvent
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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