Expand description
Unified peer table for both discv4 and discv5 discovery protocols.
This module provides a protocol-agnostic peer table that stores contact
information discovered through either discv4 or discv5. The key abstraction
is using Bytes for ping identifiers:
- discv4: converts H256 ping hash to Bytes
- discv5: already uses Bytes for req_id
Each contact is tagged with the protocol that discovered it, allowing protocol-specific lookups to only query compatible contacts.
Re-exports§
pub use crate::discv5::session::Session;
Modules§
Structs§
- Contact
- KBucket
- A single k-bucket in the Kademlia routing table. Each bucket stores contacts at a specific XOR distance range from the local node.
- Peer
Data - Peer
Diagnostics - Diagnostic snapshot of a peer’s state, used by admin RPC endpoints.
- Peer
Table Server - Request
Permit - Reservation handle for a peer request slot.
Enums§
- Contact
Validation - Result of contact validation.
- Discovery
Protocol - Identifies which discovery protocol was used to find a contact. This allows protocol-specific lookups to only query compatible contacts.
Constants§
- MAX_
NODES_ PER_ BUCKET - Maximum number of contacts per k-bucket (Kademlia k parameter).
- TARGET_
PEERS - The target number of RLPx connections to reach.
Traits§
Type Aliases§
- Peer
Table - Peer
Table Server Ref - Type-erased reference to any actor implementing
PeerTableServerProtocol.