Skip to main content

Module origin_range

Module origin_range 

Source
Expand description

Windowed origin range pulls (#2065): the requested span is fetched in bounded windows of RANGE_PULL_WINDOW_BYTES against an {H}.obao4 outboard that the engine caches per hash, so a range pull holds O(window + outboard) bytes whatever its length. Each origin read runs under a time budget (see crate::CacheEngine::set_origin_read_budget).

crate::CacheEngine::origin_range_wire (the own-origin serve-miss spine’s pull leg) builds on the OriginRangeCursor here. It needs ONE coherent header-less wire for the whole draw — joined per-window encodings would repeat the shared parent nodes — so it runs a single bao_tree::io::fsm::encode_ranges_validated over an OriginWindowReader that pulls the cursor’s windows in order, and streams the output through a bounded channel (OriginRangeWire).

Structs§

OriginRangeWire
The header-less interleaved bao wire (ADR 038) for one range of a blob, verified against the root H and produced window by window out of an origin. Returned by crate::CacheEngine::origin_range_wire.

Constants§

MAX_CONCURRENT_RANGE_PULLS
crate::CacheEngine::origin_range_wire draws that run at once. A caller past the bound waits for a permit rather than degrading, because the degrade is a whole-blob origin pull — more egress, not less.
RANGE_PULL_WINDOW_BYTES
Largest data span one Origin::fetch_range_data call fetches. A multiple of the 16 KiB chunk group, and windows start on the group-aligned fetch_start, so no bao leaf straddles two windows. A range pull holds about two windows (the fetched span and its encoding) plus the outboard, whatever the requested length.