Skip to main content

Module actions

Module actions 

Source
Expand description

What the model decides on a devp2p node: whether to admit a peer and with what Status, how to answer its eth requests, and what to ask it for.

Rust owns everything under that — the RLPx handshake and frame encryption, Snappy, RLP, the Hello exchange, Ping/Pong, block hashes. The model writes headers as the JSON fields eth_getBlockByNumber returns and never a byte of RLP; Rust encodes them, hashes them, and refuses an answer whose headers are not the ones the peer asked for (wrong numbers, a first hash that is not the requested one, a header whose parentHash is not the previous header’s hash, or a hash field the fields do not produce).

The action definitions here are shared with the client (src/client/devp2p/actions.rs): once the handshake is done both sides of a devp2p session speak the same protocol.

Structs§

CommonConfig
Parsed startup configuration shared by both roles.
Devp2pProtocol

Statics§

ANNOUNCED_EVENT
BODIES_RECEIVED_EVENT
BODIES_REQUESTED_EVENT
HEADERS_RECEIVED_EVENT
HEADERS_REQUESTED_EVENT
POOLED_RECEIVED_EVENT
POOLED_REQUESTED_EVENT
REQUEST_TIMEOUT_EVENT
STATUS_EVENT

Functions§

all_actions
Every action, in the order the model sees them.
common_config
common_startup_parameters
The startup parameters both roles share: identity and the Status defaults.
default_client_id
The client id NetGet sends in Hello unless configured otherwise.
disconnect_action
event_types
example_header
A complete, valid header for examples: block 1 of an empty post-Cancun chain.
p
request_bodies_action
request_headers_action
request_pooled_action
send_bodies_action
send_headers_action
send_pooled_action
send_status_action