Skip to main content

Module state

Module state 

Source
Expand description

Per-link, per-direction PEX state (SPEC §5, §9).

PEX on a link is two independent half-conversations (SPEC §5.1). LinkState holds both for one link, keyed in the engine by the transport peer_id (never a wire field — SPEC §5.4, §10):

  • the sender (outgoing) direction — whether we’ve sent our handshake + snapshot, the per-link told-state (“what I’ve told you”, SPEC §9.1: peer_id → advertised-content fingerprint), the send-cadence bookkeeping, and our own (possibly backed-off) declared interval;
  • the receiver (incoming) direction — the RecvPhase state machine, the remote’s declared interval, the last data-message arrival time (for the SPEC §6.4 floor), the strike count + mute flag, and the set of peer_ids this link has told us (for dropped attribution, SPEC §8.3).

All of this dies with the link (SPEC §5.5): a fresh connection restarts from RecvPhase::AwaitingHandshake with an empty told-state.

Structs§

LinkState
All PEX state for one link (both directions). Created on link_up / first inbound message and discarded on link_down (SPEC §5.5).

Enums§

RecvPhase
The receiver-side state machine for one direction (SPEC §5.3).