Skip to main content

decdn_cache/
range_pull.rs

1//! Bao verified-range helpers — re-exported from the iroh-blobs-free
2//! [`decdn_bao_range`] leaf crate (#578) so `decdn-client` can share the
3//! exact same alignment / encoded-size / verify logic without linking
4//! iroh-blobs. The serve (`engine::export_bao_range`), origin range encode
5//! (`engine::origin_range_wire`), and client-receive paths therefore all agree
6//! by construction. See [ADR 038 §Wire format](../../../adr/038-bao-verified-range-streaming.md).
7//!
8//! The block size [`IROH_BLOCK_SIZE`] is declared in the leaf crate from the
9//! `bao-tree` primitive; the lock-step test below asserts it stays byte-identical
10//! to `iroh_blobs::store::IROH_BLOCK_SIZE`, so an iroh-blobs bump that changed the
11//! canonical block size — a protocol-contract change under ADR 038 — fails here.
12
13pub use decdn_bao_range::{
14    AlignedRange, IROH_BLOCK_SIZE, RangeVerifyError, align_range, align_range_clamped,
15    bao_encoded_size, encode_verified_range,
16};
17
18#[cfg(test)]
19mod lock_step;