Skip to main content

Module devp2p

Module devp2p 

Source
Expand description

devp2p dialler. Connects to a node named by its enode URL, runs the RLPx handshake as the initiator and the Hello exchange (the server’s session::establish), then hands the session to a task that asks the model for this node’s Status and carries out its requests.

connect() returns once Hello is done; the model is never consulted inside it, so a parked manual answer cannot stall the client’s creation.

The Status exchange: go-ethereum and reth send their Status as soon as Hello is done. The session waits STATUS_WAIT for it, then raises eth_status either way — with the peer’s Status, or with peer_status: null when the peer is waiting for ours (another NetGet node does). Requests the model gives alongside its Status go out once both are exchanged.

Failing closed: no usable answer to eth_status → Disconnect subprotocol_error; an answer without eth_send_status → Disconnect useless_peer; a peer request still unanswered after the model’s turn → Disconnect subprotocol_error. A follow-up chain (an answer prompting a request whose answer prompts another) stops at MAX_FOLLOWUP_DEPTH.

Re-exports§

pub use actions::Devp2pClientProtocol;

Modules§

actions
What the model can do as a devp2p dialler: choose this node’s Status, ask the peer for headers, bodies and pooled transactions, answer the peer’s requests, and disconnect.

Constants§

CONNECT_TIMEOUT
TCP connect.
MAX_FOLLOWUP_DEPTH
How many model turns may follow from one another.
STATUS_WAIT
How long to wait for the peer’s Status before asking the model to speak first.

Functions§

connect