Expand description
Implementation of the eth
wire protocol.
§Feature Flags
serde
(default): Enable serde supportarbitrary
: Addsproptest
andarbitrary
support for wire types.
Modules§
- Implements the
GetBlockHeaders
,GetBlockBodies
,BlockHeaders
, andBlockBodies
message types. - Types for broadcasting new data.
- All capability related types
RLPx
disconnect reason sent to/received from peer- Error types for stream variants
- Header types.
- Implements Ethereum wire protocol for versions 66, 67, and 68. Defines structs/enums for messages, request-response pairs, and broadcasts. Handles compatibility with
EthVersion
. - Rlpx protocol multiplexer and satellite stream
- Abstraction over primitive types in network messages.
- A Protocol defines a P2P subprotocol in a
RLPx
connection - Implements the
GetReceipts
andReceipts
message types. - Implements the
GetNodeData
andNodeData
message types. - Implements the
GetPooledTransactions
andPooledTransactions
message types. - Support for representing the version of the
eth
Structs§
- The response to
GetBlockBodies
, containing the block bodies that the peer knows about if any were found. - A block hash and a block number.
- The response to
GetBlockHeaders
, containing headers if any headers were found. - Represents all capabilities of a node.
- A message indicating a supported capability and capability version.
- Network primitive types used by Ethereum networks.
- An
EthStream
wraps over anyStream
that yields bytes and makes it compatible with eth-networking protocol messages, which get RLP encoded/decoded. - A request for a peer to return block bodies for the given block hashes.
- A request for a peer to return block headers starting at the requested block. The peer must return at most
limit
headers. If thereverse
field istrue
, the headers will be returned starting atstart_block
, traversing towards the genesis block. Otherwise, headers will be returned starting atstart_block
, traversing towards the latest block. - A request for state tree nodes corresponding to the given hashes. This message was removed in
eth/67
, only clients runningeth/66
or earlier will respond to this message. - A list of transaction hashes that the peer would like transaction bodies for.
- A request for transaction receipts from the given block hashes.
- Raw rlpx protocol message used in the
p2p
handshake, containing information about the supported RLPx protocol version and capabilities. - Builder for
HelloMessageWithProtocols
- This is a superset of
HelloMessage
that provides additional protocol Protocol information about the number of messages used by each capability in order to do proper message ID multiplexing. - A new block with the current total difficulty, which includes the difficulty of the returned block.
- This informs peers of new blocks that have appeared on the network.
- This informs peers of transaction hashes for transactions that have appeared on the network, but have not been included in a block.
- Same as
NewPooledTransactionHashes66
but extends that beside the transaction hashes, the node sends the transaction types and their sizes (as defined in EIP-2718) as well. - The response to
GetNodeData
, containing the state tree nodes or contract bytecode corresponding to the requested hashes. - A P2PStream wraps over any
Stream
that yields bytes and makes it compatible withp2p
protocol messages. - Data that has passed an initial validation pass that is not specific to any mempool message type.
- The response to
GetPooledTransactions
, containing the transaction bodies associated with the requested hashes. - An
eth
protocol message, containing a message ID and payload. - The response to
GetReceipts
, containing receipt lists that correspond to each block requested. - Hashes to request from a peer.
- Same as
Transactions
but this is intended as egress message send from local to many peers. - The status message is used in the eth protocol handshake to ensure that peers are on the same network and are following the same fork.
- Builder for
Status
messages. - This informs peers of transactions that have appeared on the network and are not yet included in a block.
- This represents an unknown disconnect reason with the given code.
- Partially validated data from an announcement or a
PooledTransactions
response.
Enums§
- RLPx disconnect reason.
- Represents a message in the eth wire protocol, versions 66, 67 and 68.
- Represents message IDs for eth protocol messages.
- The
eth
protocol version. - Represents the direction for a headers request depending on the
reverse
field of the request. - A wrapper type for all different new pooled transaction types
- This represents only the reserved
p2p
subprotocol messages. - Message IDs for
p2p
subprotocol messages. - RLPx
p2p
protocol version
Constants§
MAX_MESSAGE_SIZE
is the maximum cap on the size of a protocol message.MAX_RESERVED_MESSAGE_ID
is the maximum message ID reserved for thep2p
subprotocol. If there are any incoming messages with an ID greater than this, they are subprotocol messages.
Traits§
- This trait is meant to allow higher level protocols like
eth
to disconnect from a peer, using lower-level disconnect functions (such as those that exist in thep2p
protocol) if the underlying stream supports it. - Validation pass that checks for unique transaction hashes.
- Gracefully disconnects the connection by sending a disconnect message and stop reading new messages.
- Interface for handling mempool message data. Used in various filters in pipelines in
TransactionsManager
and in queries toTransactionPool
. - Extension of
HandleMempoolData
interface, for mempool messages that are versioned. - This is a helper trait for use in bounds, where some of the
NetworkPrimitives
associated types must be the same as the [NodePrimitives
] associated types. - Abstraction over primitive types which might appear in network messages. See
crate::EthMessage
for more context.
Type Aliases§
- Value in
PartiallyValidData
map obtained from an announcement.