referrerpolicy=no-referrer-when-downgrade

Module flow_control

Module flow_control 

Source
Expand description

Channel flow-control types: the sender’s channel-stream leaf payload (SpecMsgKind / SpecMsgSignal) and the receiver’s out-of-band confirmation Register with its advisory WindowGrant. The pallet owns the logic: windowing, version enforcement, channel storage, the accept extrinsic.

§Consensus surface

  • SpecMsgKind is the SCALE payload of every channel-stream MMR leaf, inside crate::message::leaf_hash’s LEAF_TAG ++ LEAF_VERSION ++ payload framing. It can evolve without a LEAF_VERSION bump.
  • Register is the SCALE payload of every ack-stream leaf: the receiver’s whole channel state, lossy and latest-wins, read out-of-band by the sender.

§Frozen core

These must parse at every protocol version: OpenChannel (variant 0, so it decodes before any version is announced), CloseChannel, Upgrade, and the Register format. The tests pin their bytes. Versioning is by monotonic per-side announcements (sender in-band, receiver via Register::version); the effective version is the lower of the two.

Structs§

Register
The receiver’s whole channel state as the sender sees it. Frozen core. Published as the ack-stream’s lossy, latest-wins leaf payload and read out-of-band by the sender via an inclusion proof. The first publish is the channel acceptance.
WindowGrant
Advisory send-window credit a receiver grants a sender beyond the confirmed watermark. Not enforced: registers are lossy and read late, and on an ordered stream the receiver cannot reject without stalling. The hard bound is the sender STF’s message-size constant. A grant may shrink between publishes.

Enums§

SpecMsgKind
The payload of every channel-stream MMR leaf: protocol signalling or userspace data. The transport acts only on Signal vs Data (window accounting, pallet-internal consumption); demultiplexing within Data is an upper-layer convention.
SpecMsgSignal
Sender-side channel lifecycle signal. Frozen core: OpenChannel must stay variant 0, since it parses before any version announcement exists. Only variants beyond these three could ever be version-gated.