Skip to content

decdn fetch shows no progress during blob delivery #1118

Closed

Description

@alpergundogdu

Problem

decdn fetch prints nothing between "opening/reusing channel" and the final fetched N bytes -> <path> line. For a large blob over a slow link the command looks hung — there is no indication of how many bytes have arrived or how much is left.

Why it's fixable cleanly

The delivery already knows the total up front and counts bytes as they arrive, but neither is surfaced to the CLI:

  • The signed StreamResponse carries total_bytes before the first chunk, from which fetch_inner computes expected_wire (the aligned bao wire length) — a known denominator. See crates/client-pull/src/lib.rs (fetch_inner, ~L554).
  • The receive loop receive_and_pay (crates/client-pull/src/lib.rs, ~L631) tracks cumulative wire bytes against expected_wire_bytes on every ChunkData.

There is simply no hook to report (cumulative, expected_wire) outward — the only out-param is the VoucherProgress payment watermark. fetch_blob awaits the whole Vec<u8> and sees nothing in between.

Proposed fix

Thread an optional progress callback (wire_bytes_received, wire_bytes_expected) from receive_and_pay up through fetch_inner, exposed via a new stream_fetch_tracked_with_progress wrapper so the existing payment-critical stream_fetch_tracked signature and all its callers/tests stay unchanged. Render a TTY-only progress bar in decdn fetch (silent when stderr is piped/CI). The node-side pull path (node_origin) and bundle pull pass None and are unaffected.

Scope: single-blob decdn fetch path only. Multi-entry progress for bundle pull is a possible follow-up.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions