pub enum EthMessage<N: NetworkPrimitives = EthNetworkPrimitives> {
Show 26 variants
Status(StatusMessage),
NewBlockHashes(NewBlockHashes),
NewBlock(Box<N::NewBlockPayload>),
Transactions(Transactions<N::BroadcastedTransaction>),
NewPooledTransactionHashes66(NewPooledTransactionHashes66),
NewPooledTransactionHashes68(NewPooledTransactionHashes68),
NewPooledTransactionHashes72(NewPooledTransactionHashes72),
GetBlockHeaders(RequestPair<GetBlockHeaders>),
BlockHeaders(RequestPair<BlockHeaders<N::BlockHeader>>),
GetBlockBodies(RequestPair<GetBlockBodies>),
BlockBodies(RequestPair<BlockBodies<N::BlockBody>>),
GetPooledTransactions(RequestPair<GetPooledTransactions>),
PooledTransactions(RequestPair<PooledTransactions<N::PooledTransaction>>),
GetNodeData(RequestPair<GetNodeData>),
NodeData(RequestPair<NodeData>),
GetReceipts(RequestPair<GetReceipts>),
GetReceipts70(RequestPair<GetReceipts70>),
GetBlockAccessLists(RequestPair<GetBlockAccessLists>),
Receipts(RequestPair<Receipts<N::Receipt>>),
Receipts69(RequestPair<Receipts69<N::Receipt>>),
Receipts70(RequestPair<Receipts70<N::Receipt>>),
BlockAccessLists(RequestPair<BlockAccessLists>),
Cells(RequestPair<Cells>),
GetCells(RequestPair<GetCells>),
BlockRangeUpdate(BlockRangeUpdate),
Other(RawCapabilityMessage),
}Expand description
Represents a message in the eth wire protocol, versions 66, 67, 68 and 69.
The ethereum wire protocol is a set of messages that are broadcast to the network in two styles:
- A request message sent by a peer (such as
GetPooledTransactions), and an associated response message (such asPooledTransactions). - A message that is broadcast to the network, without a corresponding request.
The newer eth/66 is an efficiency upgrade on top of eth/65, introducing a request id to
correlate request-response message pairs. This allows for request multiplexing.
The eth/67 is based on eth/66 but only removes two messages, GetNodeData and
NodeData.
The eth/68 changes only NewPooledTransactionHashes to include types and sized. For
it, NewPooledTransactionHashes is renamed as NewPooledTransactionHashes66 and
NewPooledTransactionHashes68 is defined.
The eth/69 announces the historical block range served by the node. Removes total difficulty
information. And removes the Bloom field from receipts transferred over the protocol.
The eth/70 (EIP-7975) keeps the eth/69 status format and introduces partial receipts.
requests/responses.
The eth/71 draft extends eth/70 with block access list request/response messages.
Variants§
Status(StatusMessage)
Represents a Status message required for the protocol handshake.
NewBlockHashes(NewBlockHashes)
Represents a NewBlockHashes message broadcast to the network.
NewBlock(Box<N::NewBlockPayload>)
Represents a NewBlock message broadcast to the network.
Transactions(Transactions<N::BroadcastedTransaction>)
Represents a Transactions message broadcast to the network.
NewPooledTransactionHashes66(NewPooledTransactionHashes66)
Represents a NewPooledTransactionHashes message for eth/66 version.
NewPooledTransactionHashes68(NewPooledTransactionHashes68)
Represents a NewPooledTransactionHashes message for eth/68 version.
NewPooledTransactionHashes72(NewPooledTransactionHashes72)
Represents a NewPooledTransactionHashes message for eth/72 version.
GetBlockHeaders(RequestPair<GetBlockHeaders>)
Represents a GetBlockHeaders request-response pair.
BlockHeaders(RequestPair<BlockHeaders<N::BlockHeader>>)
Represents a BlockHeaders request-response pair.
GetBlockBodies(RequestPair<GetBlockBodies>)
Represents a GetBlockBodies request-response pair.
BlockBodies(RequestPair<BlockBodies<N::BlockBody>>)
Represents a BlockBodies request-response pair.
GetPooledTransactions(RequestPair<GetPooledTransactions>)
Represents a GetPooledTransactions request-response pair.
PooledTransactions(RequestPair<PooledTransactions<N::PooledTransaction>>)
Represents a PooledTransactions request-response pair.
GetNodeData(RequestPair<GetNodeData>)
Represents a GetNodeData request-response pair.
NodeData(RequestPair<NodeData>)
Represents a NodeData request-response pair.
GetReceipts(RequestPair<GetReceipts>)
Represents a GetReceipts request-response pair.
GetReceipts70(RequestPair<GetReceipts70>)
Represents a GetReceipts request for eth/70.
Note: Unlike earlier protocol versions, the eth/70 encoding for
GetReceipts in EIP-7975 inlines the request id. The type still wraps
a RequestPair, but with a custom inline encoding.
GetBlockAccessLists(RequestPair<GetBlockAccessLists>)
Represents a GetBlockAccessLists request-response pair for eth/71.
Receipts(RequestPair<Receipts<N::Receipt>>)
Represents a Receipts request-response pair.
Receipts69(RequestPair<Receipts69<N::Receipt>>)
Represents a Receipts request-response pair for eth/69.
Receipts70(RequestPair<Receipts70<N::Receipt>>)
Represents a Receipts request-response pair for eth/70.
Note: The eth/70 encoding for Receipts in EIP-7975 inlines the
request id. The type still wraps a RequestPair, but with a custom
inline encoding.
BlockAccessLists(RequestPair<BlockAccessLists>)
Represents a BlockAccessLists request-response pair for eth/71.
Cells(RequestPair<Cells>)
Represents a Cells request-response pair for eth/72.
GetCells(RequestPair<GetCells>)
Represents a GetCells request-response pair for eth/72.
BlockRangeUpdate(BlockRangeUpdate)
Represents a BlockRangeUpdate message broadcast to the network.
Other(RawCapabilityMessage)
Represents an encoded message that doesn’t match any other variant
Implementations§
Source§impl<N: NetworkPrimitives> EthMessage<N>
impl<N: NetworkPrimitives> EthMessage<N>
Sourcepub const fn message_id(&self) -> EthMessageID
pub const fn message_id(&self) -> EthMessageID
Returns the message’s ID.
Sourcepub const fn is_request(&self) -> bool
pub const fn is_request(&self) -> bool
Returns true if the message variant is a request.
Sourcepub const fn is_response(&self) -> bool
pub const fn is_response(&self) -> bool
Returns true if the message variant is a response to a request.
Trait Implementations§
Source§impl<N: Clone + NetworkPrimitives> Clone for EthMessage<N>where
N::NewBlockPayload: Clone,
N::BroadcastedTransaction: Clone,
N::BlockHeader: Clone,
N::BlockBody: Clone,
N::PooledTransaction: Clone,
N::Receipt: Clone,
impl<N: Clone + NetworkPrimitives> Clone for EthMessage<N>where
N::NewBlockPayload: Clone,
N::BroadcastedTransaction: Clone,
N::BlockHeader: Clone,
N::BlockBody: Clone,
N::PooledTransaction: Clone,
N::Receipt: Clone,
Source§impl<N: Debug + NetworkPrimitives> Debug for EthMessage<N>where
N::NewBlockPayload: Debug,
N::BroadcastedTransaction: Debug,
N::BlockHeader: Debug,
N::BlockBody: Debug,
N::PooledTransaction: Debug,
N::Receipt: Debug,
impl<N: Debug + NetworkPrimitives> Debug for EthMessage<N>where
N::NewBlockPayload: Debug,
N::BroadcastedTransaction: Debug,
N::BlockHeader: Debug,
N::BlockBody: Debug,
N::PooledTransaction: Debug,
N::Receipt: Debug,
Source§impl<'de, N: NetworkPrimitives> Deserialize<'de> for EthMessage<N>where
N::NewBlockPayload: Serialize + DeserializeOwned,
N::BroadcastedTransaction: Serialize + DeserializeOwned,
N::BlockHeader: Serialize + DeserializeOwned,
N::BlockBody: Serialize + DeserializeOwned,
N::PooledTransaction: Serialize + DeserializeOwned,
N::Receipt: Serialize + DeserializeOwned,
Available on crate feature serde only.
impl<'de, N: NetworkPrimitives> Deserialize<'de> for EthMessage<N>where
N::NewBlockPayload: Serialize + DeserializeOwned,
N::BroadcastedTransaction: Serialize + DeserializeOwned,
N::BlockHeader: Serialize + DeserializeOwned,
N::BlockBody: Serialize + DeserializeOwned,
N::PooledTransaction: Serialize + DeserializeOwned,
N::Receipt: Serialize + DeserializeOwned,
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<N: NetworkPrimitives> Encodable for EthMessage<N>
impl<N: NetworkPrimitives> Encodable for EthMessage<N>
impl<N: Eq + NetworkPrimitives> Eq for EthMessage<N>where
N::NewBlockPayload: Eq,
N::BroadcastedTransaction: Eq,
N::BlockHeader: Eq,
N::BlockBody: Eq,
N::PooledTransaction: Eq,
N::Receipt: Eq,
Source§impl<N: NetworkPrimitives> From<EthMessage<N>> for ProtocolMessage<N>
impl<N: NetworkPrimitives> From<EthMessage<N>> for ProtocolMessage<N>
Source§fn from(message: EthMessage<N>) -> Self
fn from(message: EthMessage<N>) -> Self
Source§impl<N: NetworkPrimitives> From<NewPooledTransactionHashes> for EthMessage<N>
impl<N: NetworkPrimitives> From<NewPooledTransactionHashes> for EthMessage<N>
Source§fn from(value: NewPooledTransactionHashes) -> Self
fn from(value: NewPooledTransactionHashes) -> Self
Source§impl<N: PartialEq + NetworkPrimitives> PartialEq for EthMessage<N>where
N::NewBlockPayload: PartialEq,
N::BroadcastedTransaction: PartialEq,
N::BlockHeader: PartialEq,
N::BlockBody: PartialEq,
N::PooledTransaction: PartialEq,
N::Receipt: PartialEq,
impl<N: PartialEq + NetworkPrimitives> PartialEq for EthMessage<N>where
N::NewBlockPayload: PartialEq,
N::BroadcastedTransaction: PartialEq,
N::BlockHeader: PartialEq,
N::BlockBody: PartialEq,
N::PooledTransaction: PartialEq,
N::Receipt: PartialEq,
Source§impl<N: NetworkPrimitives> Serialize for EthMessage<N>where
N::NewBlockPayload: Serialize + DeserializeOwned,
N::BroadcastedTransaction: Serialize + DeserializeOwned,
N::BlockHeader: Serialize + DeserializeOwned,
N::BlockBody: Serialize + DeserializeOwned,
N::PooledTransaction: Serialize + DeserializeOwned,
N::Receipt: Serialize + DeserializeOwned,
Available on crate feature serde only.
impl<N: NetworkPrimitives> Serialize for EthMessage<N>where
N::NewBlockPayload: Serialize + DeserializeOwned,
N::BroadcastedTransaction: Serialize + DeserializeOwned,
N::BlockHeader: Serialize + DeserializeOwned,
N::BlockBody: Serialize + DeserializeOwned,
N::PooledTransaction: Serialize + DeserializeOwned,
N::Receipt: Serialize + DeserializeOwned,
serde only.impl<N: PartialEq + NetworkPrimitives> StructuralPartialEq for EthMessage<N>where
N::NewBlockPayload: PartialEq,
N::BroadcastedTransaction: PartialEq,
N::BlockHeader: PartialEq,
N::BlockBody: PartialEq,
N::PooledTransaction: PartialEq,
N::Receipt: PartialEq,
Auto Trait Implementations§
impl<N = BasicNetworkPrimitives<EthPrimitives, EthereumTxEnvelope<TxEip4844WithSidecar>>> !Freeze for EthMessage<N>
impl<N> RefUnwindSafe for EthMessage<N>where
Box<<N as NetworkPrimitives>::NewBlockPayload>: RefUnwindSafe,
Transactions<<N as NetworkPrimitives>::BroadcastedTransaction>: RefUnwindSafe,
RequestPair<BlockHeaders<<N as NetworkPrimitives>::BlockHeader>>: RefUnwindSafe,
RequestPair<BlockBodies<<N as NetworkPrimitives>::BlockBody>>: RefUnwindSafe,
RequestPair<PooledTransactions<<N as NetworkPrimitives>::PooledTransaction>>: RefUnwindSafe,
RequestPair<Receipts<<N as NetworkPrimitives>::Receipt>>: RefUnwindSafe,
RequestPair<Receipts69<<N as NetworkPrimitives>::Receipt>>: RefUnwindSafe,
RequestPair<Receipts70<<N as NetworkPrimitives>::Receipt>>: RefUnwindSafe,
impl<N> Send for EthMessage<N>where
Box<<N as NetworkPrimitives>::NewBlockPayload>: Send,
Transactions<<N as NetworkPrimitives>::BroadcastedTransaction>: Send,
RequestPair<BlockHeaders<<N as NetworkPrimitives>::BlockHeader>>: Send,
RequestPair<BlockBodies<<N as NetworkPrimitives>::BlockBody>>: Send,
RequestPair<PooledTransactions<<N as NetworkPrimitives>::PooledTransaction>>: Send,
RequestPair<Receipts<<N as NetworkPrimitives>::Receipt>>: Send,
RequestPair<Receipts69<<N as NetworkPrimitives>::Receipt>>: Send,
RequestPair<Receipts70<<N as NetworkPrimitives>::Receipt>>: Send,
impl<N> Sync for EthMessage<N>where
Box<<N as NetworkPrimitives>::NewBlockPayload>: Sync,
Transactions<<N as NetworkPrimitives>::BroadcastedTransaction>: Sync,
RequestPair<BlockHeaders<<N as NetworkPrimitives>::BlockHeader>>: Sync,
RequestPair<BlockBodies<<N as NetworkPrimitives>::BlockBody>>: Sync,
RequestPair<PooledTransactions<<N as NetworkPrimitives>::PooledTransaction>>: Sync,
RequestPair<Receipts<<N as NetworkPrimitives>::Receipt>>: Sync,
RequestPair<Receipts69<<N as NetworkPrimitives>::Receipt>>: Sync,
RequestPair<Receipts70<<N as NetworkPrimitives>::Receipt>>: Sync,
impl<N> Unpin for EthMessage<N>where
Box<<N as NetworkPrimitives>::NewBlockPayload>: Unpin,
Transactions<<N as NetworkPrimitives>::BroadcastedTransaction>: Unpin,
RequestPair<BlockHeaders<<N as NetworkPrimitives>::BlockHeader>>: Unpin,
RequestPair<BlockBodies<<N as NetworkPrimitives>::BlockBody>>: Unpin,
RequestPair<PooledTransactions<<N as NetworkPrimitives>::PooledTransaction>>: Unpin,
RequestPair<Receipts<<N as NetworkPrimitives>::Receipt>>: Unpin,
RequestPair<Receipts69<<N as NetworkPrimitives>::Receipt>>: Unpin,
RequestPair<Receipts70<<N as NetworkPrimitives>::Receipt>>: Unpin,
impl<N> UnsafeUnpin for EthMessage<N>where
Box<<N as NetworkPrimitives>::NewBlockPayload>: UnsafeUnpin,
Transactions<<N as NetworkPrimitives>::BroadcastedTransaction>: UnsafeUnpin,
RequestPair<BlockHeaders<<N as NetworkPrimitives>::BlockHeader>>: UnsafeUnpin,
RequestPair<BlockBodies<<N as NetworkPrimitives>::BlockBody>>: UnsafeUnpin,
RequestPair<PooledTransactions<<N as NetworkPrimitives>::PooledTransaction>>: UnsafeUnpin,
RequestPair<Receipts<<N as NetworkPrimitives>::Receipt>>: UnsafeUnpin,
RequestPair<Receipts69<<N as NetworkPrimitives>::Receipt>>: UnsafeUnpin,
RequestPair<Receipts70<<N as NetworkPrimitives>::Receipt>>: UnsafeUnpin,
impl<N> UnwindSafe for EthMessage<N>where
Box<<N as NetworkPrimitives>::NewBlockPayload>: UnwindSafe,
Transactions<<N as NetworkPrimitives>::BroadcastedTransaction>: UnwindSafe,
RequestPair<BlockHeaders<<N as NetworkPrimitives>::BlockHeader>>: UnwindSafe,
RequestPair<BlockBodies<<N as NetworkPrimitives>::BlockBody>>: UnwindSafe,
RequestPair<PooledTransactions<<N as NetworkPrimitives>::PooledTransaction>>: UnwindSafe,
RequestPair<Receipts<<N as NetworkPrimitives>::Receipt>>: UnwindSafe,
RequestPair<Receipts69<<N as NetworkPrimitives>::Receipt>>: UnwindSafe,
RequestPair<Receipts70<<N as NetworkPrimitives>::Receipt>>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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<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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreimpl<T> MaybeSerde for Twhere
T: Serialize + for<'de> Deserialize<'de>,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§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> ⓘ
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: 136 bytes
Size for each variant:
Status: 136 bytesNewBlockHashes: 32 bytesNewBlock: 16 bytesTransactions: 32 bytesNewPooledTransactionHashes66: 32 bytesNewPooledTransactionHashes68: 80 bytesNewPooledTransactionHashes72: 104 bytesGetBlockHeaders: 72 bytesBlockHeaders: 40 bytesGetBlockBodies: 40 bytesBlockBodies: 40 bytesGetPooledTransactions: 40 bytesPooledTransactions: 40 bytesGetNodeData: 40 bytesNodeData: 40 bytesGetReceipts: 40 bytesGetReceipts70: 48 bytesGetBlockAccessLists: 40 bytesReceipts: 40 bytesReceipts69: 40 bytesReceipts70: 48 bytesBlockAccessLists: 40 bytesCells: 80 bytesGetCells: 56 bytesBlockRangeUpdate: 56 bytesOther: 48 bytes