Expand description
Requires-lift and consumption-record primitives.
Blocks never emit Requires and never see a StreamsRoot. Processing the messaging inherent
writes a ConsumptionRecord: which streams the block touched and the Interval consumed on
each. The validate_block wrapper then synthesizes the candidate’s Requires set from the
records plus PoV-carried lifts (RequiresLift), one per recorded stream, binding that
stream’s consumption to a current committed StreamsRoot. The relay chain sees only entries it
can match.
The invariant build_requires enforces, per stream and candidate: the recorded intervals form
a proven forward chain (each block continues where the previous ended, or a PoV proof shows the
gap is a forward extension, see stitch), and one lift binds the chain’s endpoint to a
committed root, which binds everything consumed.
The record is STF output and trusted; the lifts are PoV data and verified here.
Structs§
- Consumption
Record - Written per block: the streams this block touched and the interval consumed on each, grouped by source. The API view of a flat, host-append-only outbox vec.
- Interval
- Per stream and block: consumption entered the block at
startand left it atend. - Lifts
BySource - The candidate’s lifts, grouped per source: the PoV transport form.
Decodeenforces strictly increasingParaIds and bounds the source count at [MAX_COMMITMENT_ENTRIES], so more sources than aRequiresSetcan hold are rejected before any lift is verified.TryFrom<BTreeMap>is canonical by construction.build_requireszips these against the record’s sources by position. - Requires
Lift - One lift, carried in the PoV. Matched by position to a source’s
StreamId-sorted record streams.
Enums§
- Lift
Error - Why requires synthesis failed. All are deterministic in the records and PoV, so every validator reaches the same verdict.
Functions§
- build_
requires - Synthesize the candidate’s [
RequiresSet] from the per-block records, in bundle order, and the PoV lifts. Sources must match exactly; a recorded source without lifts, or lifts for an unrecorded source, invalidates the candidate. - build_
requires_ entry - Lift one source’s streams to a single committed
StreamsRoot: stitch each stream’s intervals into an endpoint, extend it to the stream’s current root, walk the tree to theStreamsRoot, and require all of the source’s streams to reach the same root.streamsiterates inStreamIdorder;liftsmatches it by position. - stitch
- Stitch one stream’s intervals, in bundle order, into its endpoint frontier.
advancesmust hold exactly one extension per gap (astartthat is not the previousend’s root), in gap order. Gaps are proven forward, so within a candidate verified states cannot regress; across candidates that is the STF’s to hold.
Type Aliases§
- Source
Streams - One source’s streams with their intervals across a bundle, in block order.
build_requiresmerges the per-block records into this andbuild_requires_entrylifts it.