Expand description
Range-keyed block coverage bitmap (ADR 039-adjacent partial-holder discovery).
A blob is divided into fixed-size DISCOVERY_BLOCK_BYTES “discovery
blocks” (64 MiB each); Coverage is a bitmap over those block indices
recording which blocks a holder can serve. This is the wire-level
granularity partial-holder discovery advertises and queries at — coarse
enough that a 64 MiB blob (this codebase’s common case, #1164) still fits
in one bit, fine enough that a multi-GB blob’s holders can be told apart
by which slice they actually hold.
Coverage itself only carries the bitmap; deriving one from a node’s
actual cache state (or from origin capability) is the caller’s job — see
decdn_cache::CacheEngine::coverage for the cached-block derivation.
Structs§
- Coverage
- A bitmap over discovery-block indices: bit
irecords whether blocki(bytes[i * DISCOVERY_BLOCK_BYTES, (i + 1) * DISCOVERY_BLOCK_BYTES)) is covered.
Constants§
- DISCOVERY_
BLOCK_ BYTES - Size of one discovery block: 64 MiB.
- MAX_
COVERAGE_ BYTES - Upper bound, in bytes, on a
Coveragebitmap decoded from untrusted wire. - MAX_
DISCOVERABLE_ BLOB_ BYTES - Largest blob the discovery layer describes on the wire: 100 GiB.
Functions§
- discovery_
block_ bytes - The active discovery-block size in bytes.
- num_
blocks - Number of
discovery_block_bytesblocks a blob oftotal_bytesspans.