Skip to content

ADR 025: Client crash recovery and download resume #207

Closed

Description

@alpergundogdu

Context

ADR 005 defines byte_offset in StreamRequest for seek and resume, but no ADR specifies the client-side persistence layer that enables crash recovery: how downloaded bytes are stored on disk, how payment channel state is persisted, and how a client resumes from the exact point of a crash or abort.

Refs: ADR 003 (payment channels, voucher nonce), ADR 005 (byte_offset, StreamRequest), ADR 012 (client state under ~/.decdn/)

Gap

No design exists for:

  • Stable on-disk structure for in-progress downloads (chunked temp files vs. sparse file vs. separate chunk dir)
  • Persisting payment channel IDs and latest voucher nonces across restarts
  • Determining the resume byte offset after a crash (last BLAKE3-verified byte)
  • Handling the case where a node has a voucher the client did not persist (potential overpayment)
  • Atomic state updates to avoid corruption from a crash during the persistence write itself
  • Interaction with parallel downloads (ADR 024)

Why it needs an ADR

Without this, clients re-download from byte 0 after any crash, paying twice for already-delivered bytes and wasting bandwidth. Especially painful for large blobs (AI models, datasets).

Expected outcome

ADR 025 defining the on-disk layout for in-progress downloads, the state persistence format (channel IDs, voucher nonces, verified byte ranges), resume semantics, and atomic update guarantees.

Activity

  1. added
    kind:docs
    design:missing-decision
    design:adr
    on Apr 10, 2026
  2. added 2 commits that reference this issue on Apr 10, 2026
    98716b4
    acadcf1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

design:adrdesign:missing-decisionkind:docs

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions