You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cdn/client/v1: empty (0-byte) blob delivery errors on the bao path #1054
Spun out of CodeRabbit review on #1052 (ADR 038 bao verified-range streaming).
Under ADR 038 the cdn/client/v1 serve and receive paths both route through align_range(byte_offset, byte_len, total_bytes), which rejects byte_offset >= blob_size — so a 0-byte blob (align_range(0, 0, 0)) returns RangeOutOfBounds. The serve (CacheEngine::export_bao_range) and the receiver (decode_verified_range / fetch_inner) therefore both error on an empty blob, whereas the pre-bao get() / export_range path served it as empty bytes. This is a (degenerate) behavior change.
Decide and implement one of:
Support empty blobs. Serve emits Bytes::new() after confirming BlobStatus::Complete { size: 0 }; the receiver verifies hash == blake3::hash(&[]) and returns empty (this is the root-verification CodeRabbit flagged for the empty case — an empty stream must still be proven against the empty root, not accepted for any root); the tee handles it; add a 0-byte round-trip regression test.
Reject cleanly. Replace the confusing RangeOutOfBounds with an explicit "empty-blob delivery unsupported" error on the serve path.
Deferred from #1052 to keep that PR focused on the verified-range change.
Activity
fix(cache): confirm presence before the empty-blob export short-circu…
fix(cache): serve empty (0-byte) blobs on the bao cdn/client/v1 path (#…
fix: bound the requester's fetch loop, and classify what comes back (#…
fix(node): price the deposit gate on the aligned span, stop double-cl…
feat: enforce the seller-side deposit floor before serving, drop the …
refactor(client-pull): dedup empty-claim guard; drop the CLI's ignore…