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
SpecMsgKindis the SCALE payload of every channel-stream MMR leaf, insidecrate::message::leaf_hash’sLEAF_TAG ++ LEAF_VERSION ++ payloadframing. It can evolve without aLEAF_VERSIONbump.Registeris 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.
- Window
Grant - 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§
- Spec
MsgKind - The payload of every channel-stream MMR leaf: protocol signalling or userspace data. The
transport acts only on
SignalvsData(window accounting, pallet-internal consumption); demultiplexing withinDatais an upper-layer convention. - Spec
MsgSignal - Sender-side channel lifecycle signal. Frozen core:
OpenChannelmust stay variant 0, since it parses before any version announcement exists. Only variants beyond these three could ever be version-gated.