Expand description
The fetch protocol: off-chain wire types and their verifier.
The relay chain decodes none of this; it only matches the StreamsRoot commitments in the UMP
signals. The two ends of the fetch protocol are different chains’ collators, so the encodings
and error variant indices are normative for interoperability.
MessagesRequest/MessagesResponseandFetchErrorare the single request/response pair for all off-chain reads: ordered channel consumption, lossy head reads (start: None), range reads, gap leaves and proofs-only lift material (max_bytes: 0).verify_messagesauthenticates aMessagesResponseagainst itsMessagesRequest.
Structs§
- Messages
Request - The fetch protocol’s request. Every off-chain read (channel consumption, register and event head reads, range reads, gap leaves, lift material) uses this request with different parameters.
- Messages
Response - Response: the frontier before the first served leaf, the payloads from
frontier.leaf_count()on, and the proofs binding them to the requestedStreamsRoot. Nothing is trusted.
Enums§
- Fetch
Error - Typed refusal returned by the fetch server when it cannot serve a
MessagesRequest. - Verify
Error - Why verifying a
MessagesResponsefailed.RootMismatchis benign when a peer served under a different root; the rest indicate a malformed or forged response.
Constants§
- MAX_
MESSAGES_ PER_ RESPONSE - Maximum payloads in one
MessagesResponse, enforced at decode. The byte budget does not bound the count: an empty payload costs one wire byte and no budget, yet is hashed into a leaf, so without this bound one response could carry millions. A consumer fetches the rest under a later request. - MAX_
SPECULATIVE_ MESSAGE_ LEN - Maximum size in bytes of a single speculative message payload.
Functions§
- verify_
channel_ messages - Verify a
MessagesResponsefor an inbound channel stream against itsMessagesRequestand the receiver’s local stored frontier (fromconsumed_streams()). - verify_
messages - Verify a
MessagesResponseagainst itsMessagesRequest: the requested start or head, the byte budget, and the proofs up toreq.under.
Type Aliases§
- Fetch
Response - What the fetch server sends back for one
MessagesRequest.