Repository navigation
docs: client parallelism, download resume, and file manifests (ADR 012 amendment) - #209
Merged
Merged
Conversation
Defines BitTorrent-style parallel blob download across N nodes via --max-channels flag. Covers economic analysis (breakeven ~9 GiB at N=4), range assignment strategy, separate payment channel per node, reassembly from range-N.part files, node failure handling, and streaming incompatibility. PoC caps --max-channels at 1. Updates architecture.md with ADR 024 summary. Closes #206 Co-authored-by: Copilot <[email protected]>
Defines on-disk layout (~/.decdn/downloads/<hash>/), atomic state.json (write-to-temp + rename), 64 MiB flush cadence, voucher nonce persistence, channel reuse on resume, and decdn downloads subcommands for stale cleanup. Updates architecture.md with ADR 025 summary. Closes #207 Co-authored-by: Copilot <[email protected]>
Defines 256 MiB canonical chunk size, postcard-encoded manifest format (Manifest + ChunkEntry + ChunkEncryption structs), two-phase client download (manifest fetch then chunks), per-chunk BLAKE3 verification, blob retention for re-serving, and backward compatibility with raw single-blob downloads. Encrypted files use per-chunk K_blob via ADR 006 epoch key scheme; K_blob excluded from manifest. PoC supports single-chunk manifests only. Updates architecture.md with ADR 026 summary. Closes #208 Co-authored-by: Copilot <[email protected]>
Folds three client improvement topics into ADR 012 (012-client.md) as new sections rather than separate ADRs: - Multi-Node Parallel Download: --max-channels N CLI flag, one channel per node, 256 MiB minimum range, economic breakeven ~10 GiB at N=4, streaming incompatibility, node failure handling. PoC capped at 1. - Download Resume and Crash Recovery: atomic state.json (write-to-temp + rename) under ~/.decdn/downloads/<hash>/, 64 MiB flush cadence, voucher nonce persisted on every send, channel reuse on reconnect, decdn downloads subcommands for stale cleanup. - File Manifests and Reconstruction: 256 MiB chunks, postcard-encoded Manifest struct, two-phase download (manifest then chunks), per-chunk BLAKE3 verification, blob retention for re-serving, per-chunk encryption via ADR 006 epoch keys, backward-compatible with raw blob downloads. PoC: single-chunk manifests only. Removes separate draft ADR 024/025/026 files (content consolidated here). Updates architecture.md ADR 012 summary paragraph. Closes #206, #207, #208 Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request updates ADR 012 to include specifications for multi-node parallel downloads, crash recovery with persistent state, and a chunked file manifest system. The review feedback suggests clarifying the cost-benefit of parallelism, ensuring download ranges align with chunk boundaries for efficiency, and fixing a potential off-by-one error in the resume logic. Additionally, it is recommended to add a magic header to the manifest format to prevent resource exhaustion and improve the reliability of manifest detection.
- Economic threshold: replace misleading "economical" with accurate framing — parallelism trades cost for latency; recommended for >10 GiB to amortize the fixed per-channel overhead - Range assignment: align ranges to 256 MiB chunk boundaries instead of equal division, so chunks are not split across multiple nodes - state.json verified_offset: change semantics to "next byte to fetch" (0 = start of range) to avoid off-by-one when used as StreamRequest byte_offset; remove the -1 sentinel - Manifest struct: add magic: [u8; 8] = b"DECDNMAN" as first field so the client can safely detect manifests without deserialising arbitrary blobs (prevents resource exhaustion from malformed Vec lengths) - Backward compatibility: replace deserialization-failure heuristic with explicit DECDNMAN magic header check Co-authored-by: Copilot <[email protected]>
This was
linked to
issues
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds three client-side features as new sections in ADR 012 (
012-client.md) rather than separate ADR files — these are implementation details of the client, not independent architectural decisions.Multi-Node Parallel Download
--max-channels NCLI flag; default 1 (sequential, existing behaviour)--streamingflag forces sequential)--max-channelscapped at 1Download Resume and Crash Recovery
state.json(write-to-temp + rename) under~/.decdn/downloads/<hash>/decdn downloads list/cleansubcommands; 30-day abandonment thresholddecdn downloadssubcommandsFile Manifests and Reconstruction
Manifeststruct (version, total_bytes, mime_type, chunks)--no-keep-blobs)Closes #206, #207, #208