referrerpolicy=no-referrer-when-downgrade

Module fetch

Module fetch 

Source
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.

Structs§

MessagesRequest
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.
MessagesResponse
Response: the frontier before the first served leaf, the payloads from frontier.leaf_count() on, and the proofs binding them to the requested StreamsRoot. Nothing is trusted.

Enums§

FetchError
Typed refusal returned by the fetch server when it cannot serve a MessagesRequest.
VerifyError
Why verifying a MessagesResponse failed. RootMismatch is 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 MessagesResponse for an inbound channel stream against its MessagesRequest and the receiver’s local stored frontier (from consumed_streams()).
verify_messages
Verify a MessagesResponse against its MessagesRequest: the requested start or head, the byte budget, and the proofs up to req.under.

Type Aliases§

FetchResponse
What the fetch server sends back for one MessagesRequest.