pub enum PeerRequest<N: NetworkPrimitives = EthNetworkPrimitives> {
GetBlockHeaders {
request: GetBlockHeaders,
response: Sender<RequestResult<BlockHeaders<N::BlockHeader>>>,
},
GetBlockBodies {
request: GetBlockBodies,
response: Sender<RequestResult<BlockBodies<N::BlockBody>>>,
},
GetPooledTransactions {
request: GetPooledTransactions,
response: Sender<RequestResult<PooledTransactions<N::PooledTransaction>>>,
},
GetNodeData {
request: GetNodeData,
response: Sender<RequestResult<NodeData>>,
},
GetReceipts {
request: GetReceipts,
response: Sender<RequestResult<Receipts<N::Receipt>>>,
},
GetReceipts69 {
request: GetReceipts,
response: Sender<RequestResult<Receipts69<N::Receipt>>>,
},
GetReceipts70 {
request: GetReceipts70,
response: Sender<RequestResult<Receipts70<N::Receipt>>>,
},
GetBlockAccessLists {
request: GetBlockAccessLists,
response: Sender<RequestResult<BlockAccessLists>>,
},
GetCells {
request: GetCells,
response: Sender<RequestResult<Cells>>,
},
GetSnap {
request: SnapProtocolMessage,
response: Sender<RequestResult<SnapResponse>>,
},
}Expand description
Protocol related request messages that expect a response
Variants§
GetBlockHeaders
Requests block headers from the peer.
The response should be sent through the channel.
Fields
request: GetBlockHeadersThe request for block headers.
response: Sender<RequestResult<BlockHeaders<N::BlockHeader>>>The channel to send the response for block headers.
GetBlockBodies
Requests block bodies from the peer.
The response should be sent through the channel.
Fields
request: GetBlockBodiesThe request for block bodies.
response: Sender<RequestResult<BlockBodies<N::BlockBody>>>The channel to send the response for block bodies.
GetPooledTransactions
Requests pooled transactions from the peer.
The response should be sent through the channel.
Fields
request: GetPooledTransactionsThe request for pooled transactions.
response: Sender<RequestResult<PooledTransactions<N::PooledTransaction>>>The channel to send the response for pooled transactions.
GetNodeData
Requests NodeData from the peer.
The response should be sent through the channel.
Fields
request: GetNodeDataThe request for NodeData.
response: Sender<RequestResult<NodeData>>The channel to send the response for NodeData.
GetReceipts
Requests receipts from the peer.
Only supported on sessions older than eth/69.
The response should be sent through the channel.
Fields
request: GetReceiptsThe request for receipts.
response: Sender<RequestResult<Receipts<N::Receipt>>>The channel to send the response for receipts.
GetReceipts69
Requests receipts from the peer without bloom filter.
Only supported on eth/69 sessions.
The response should be sent through the channel.
Fields
request: GetReceiptsThe request for receipts.
response: Sender<RequestResult<Receipts69<N::Receipt>>>The channel to send the response for receipts.
GetReceipts70
Requests receipts from the peer using eth/70 (supports firstBlockReceiptIndex).
Only supported on eth/70 and newer sessions.
The response should be sent through the channel.
Fields
request: GetReceipts70The request for receipts.
response: Sender<RequestResult<Receipts70<N::Receipt>>>The channel to send the response for receipts.
GetBlockAccessLists
Requests block access lists from the peer.
The response should be sent through the channel.
Fields
request: GetBlockAccessListsThe request for block access lists.
response: Sender<RequestResult<BlockAccessLists>>The channel to send the response for block access lists.
GetCells
Requests cells from the peer.
The response should be sent through the channel.
Fields
request: GetCellsThe request for cells.
response: Sender<RequestResult<Cells>>The channel to send the response for cells.
GetSnap
Requests a snap/2 (EIP-8189) message from the peer.
The response should be sent through the channel.
Implementations§
Source§impl<N: NetworkPrimitives> PeerRequest<N>
impl<N: NetworkPrimitives> PeerRequest<N>
Sourcepub fn send_bad_response(self)
pub fn send_bad_response(self)
Invoked if we received a response which does not match the request
Sourcepub fn send_err_response(self, err: RequestError)
pub fn send_err_response(self, err: RequestError)
Send an error back to the receiver.
Sourcepub fn is_supported_by_eth_version(&self, version: EthVersion) -> bool
pub fn is_supported_by_eth_version(&self, version: EthVersion) -> bool
Returns true if this request is supported for the negotiated eth protocol version.
Sourcepub fn create_request_message(&self, request_id: u64) -> RequestMessage<N>
pub fn create_request_message(&self, request_id: u64) -> RequestMessage<N>
Returns the RequestMessage for this type.
Sourcepub fn into_get_pooled_transactions(self) -> Option<GetPooledTransactions>
pub fn into_get_pooled_transactions(self) -> Option<GetPooledTransactions>
Consumes the type and returns the inner [GetPooledTransactions] variant.
Trait Implementations§
Auto Trait Implementations§
impl<N = BasicNetworkPrimitives<EthPrimitives, EthereumTxEnvelope<TxEip4844WithSidecar>>> !RefUnwindSafe for PeerRequest<N>
impl<N = BasicNetworkPrimitives<EthPrimitives, EthereumTxEnvelope<TxEip4844WithSidecar>>> !UnwindSafe for PeerRequest<N>
impl<N> Freeze for PeerRequest<N>where
Sender<Result<BlockHeaders<<N as NetworkPrimitives>::BlockHeader>, RequestError>>: Freeze,
Sender<Result<BlockBodies<<N as NetworkPrimitives>::BlockBody>, RequestError>>: Freeze,
Sender<Result<PooledTransactions<<N as NetworkPrimitives>::PooledTransaction>, RequestError>>: Freeze,
Sender<Result<Receipts<<N as NetworkPrimitives>::Receipt>, RequestError>>: Freeze,
Sender<Result<Receipts69<<N as NetworkPrimitives>::Receipt>, RequestError>>: Freeze,
Sender<Result<Receipts70<<N as NetworkPrimitives>::Receipt>, RequestError>>: Freeze,
impl<N> Send for PeerRequest<N>where
Sender<Result<BlockHeaders<<N as NetworkPrimitives>::BlockHeader>, RequestError>>: Send,
Sender<Result<BlockBodies<<N as NetworkPrimitives>::BlockBody>, RequestError>>: Send,
Sender<Result<PooledTransactions<<N as NetworkPrimitives>::PooledTransaction>, RequestError>>: Send,
Sender<Result<Receipts<<N as NetworkPrimitives>::Receipt>, RequestError>>: Send,
Sender<Result<Receipts69<<N as NetworkPrimitives>::Receipt>, RequestError>>: Send,
Sender<Result<Receipts70<<N as NetworkPrimitives>::Receipt>, RequestError>>: Send,
impl<N> Sync for PeerRequest<N>where
Sender<Result<BlockHeaders<<N as NetworkPrimitives>::BlockHeader>, RequestError>>: Sync,
Sender<Result<BlockBodies<<N as NetworkPrimitives>::BlockBody>, RequestError>>: Sync,
Sender<Result<PooledTransactions<<N as NetworkPrimitives>::PooledTransaction>, RequestError>>: Sync,
Sender<Result<Receipts<<N as NetworkPrimitives>::Receipt>, RequestError>>: Sync,
Sender<Result<Receipts69<<N as NetworkPrimitives>::Receipt>, RequestError>>: Sync,
Sender<Result<Receipts70<<N as NetworkPrimitives>::Receipt>, RequestError>>: Sync,
impl<N> Unpin for PeerRequest<N>where
Sender<Result<BlockHeaders<<N as NetworkPrimitives>::BlockHeader>, RequestError>>: Unpin,
Sender<Result<BlockBodies<<N as NetworkPrimitives>::BlockBody>, RequestError>>: Unpin,
Sender<Result<PooledTransactions<<N as NetworkPrimitives>::PooledTransaction>, RequestError>>: Unpin,
Sender<Result<Receipts<<N as NetworkPrimitives>::Receipt>, RequestError>>: Unpin,
Sender<Result<Receipts69<<N as NetworkPrimitives>::Receipt>, RequestError>>: Unpin,
Sender<Result<Receipts70<<N as NetworkPrimitives>::Receipt>, RequestError>>: Unpin,
impl<N> UnsafeUnpin for PeerRequest<N>where
Sender<Result<BlockHeaders<<N as NetworkPrimitives>::BlockHeader>, RequestError>>: UnsafeUnpin,
Sender<Result<BlockBodies<<N as NetworkPrimitives>::BlockBody>, RequestError>>: UnsafeUnpin,
Sender<Result<PooledTransactions<<N as NetworkPrimitives>::PooledTransaction>, RequestError>>: UnsafeUnpin,
Sender<Result<Receipts<<N as NetworkPrimitives>::Receipt>, RequestError>>: UnsafeUnpin,
Sender<Result<Receipts69<<N as NetworkPrimitives>::Receipt>, RequestError>>: UnsafeUnpin,
Sender<Result<Receipts70<<N as NetworkPrimitives>::Receipt>, RequestError>>: UnsafeUnpin,
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
§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> MaybeDebug for Twhere
T: Debug,
§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: 152 bytes
Size for each variant:
GetBlockHeaders: 72 bytesGetBlockBodies: 40 bytesGetPooledTransactions: 40 bytesGetNodeData: 40 bytesGetReceipts: 40 bytesGetReceipts69: 40 bytesGetReceipts70: 48 bytesGetBlockAccessLists: 40 bytesGetCells: 56 bytesGetSnap: 152 bytes