Skip to content

perf(cli): start a cold fetch 250 ms after the first answer - #2300

Merged
alpergundogdu merged 7 commits into
mainfrom
claude/cold-blob-cutoff
Oct 2, 2026
Merged

alpergundogdu merged 7 commits into
mainfrom
claude/cold-blob-cutoff

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Stacked on #2298 (itself on #2297); merge the three together.

Summary

A probe round with no holder waited for every probe, so one slow connect held a cold fetch for up to the 5 s probe timeout. A cold fetch is the normal state for a blob's first fetch. Now a streamed round with no holder in hand ends PROBE_SETTLE_AFTER_HOLDER (250 ms) after its first verified answer, and starts on the non-holders it has as pull-through targets (#1911).

  • Holders still take priority. A holder that answers inside the window ends the round at once, as it would with no window.
  • Late holders still join. A holder that answers later joins the running fetch through SourceProvider::arrivals (feat(client,cli): start a fetch on its first holder and join late holders as they answer #2298).
  • Only a verified answer opens the window. A failed probe does not.
  • Rediscovery (ProbeRound::Settle) is unchanged. It still waits for every probe when no holder answers.
  • Late non-holders don't join a cold start. The warming rule needs a holder to compare against.

Measurement

--rediscover fetches of the empty blob, which no node reports holding, on the testnet.

probe round (ms) total (ms)
#2298 1825, 1781 (slow-connect node sampled), 340 2239, 2179, 637
this branch 317, 295, 319, 294 805, 664, 710, 612

Test plan

  • Cutoff tests on a paused clock (settle_probes):
    • the cold cutoff returns the non-holders in hand, with the late holder left in the tail;
    • a holder inside the window ends the round at once;
    • failed probes don't open the window;
    • with no cold cutoff, the round waits for every probe.
  • cargo clippy --workspace --all-targets --all-features
  • cargo nextest run -p decdn-cli (891 tests)
  • RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-items
  • Manual --rediscover fetches against the testnet

🤖 Generated with Claude Code

alpergundogdu and others added 6 commits October 2, 2026 11:09
probe_and_order waited for every probe with join_all, so one slow
connect held the fetch for up to the 5 s probe timeout. On the testnet
one node's first connect takes about 1.7 s while two holders answer
within 170 ms.

Each probe now verifies and classifies its own answer, and the round
ends 250 ms after the first verified holder answers, or when every probe
has answered. A round with no holder still waits for every probe, so a
cold blob sees every reachable pull-through target. A dropped holder
stays reachable through the fetch's later discovery.

Each probe's outcome and elapsed time log at debug.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…st as they answer

The first probe round of a fetch, and of each bundle-pull entry, returns
at the first verified holder with any answers already in, and keeps its
pending probes as a tail. CliSources pushes each late holder through
SourceProvider::arrivals, and each late non-holder the proxy-warming
rule picks against the best holder known so far. Rediscovery keeps the
250 ms cutoff and drops its tail. A round with no holder still waits for
every probe.

fetch timings reports holders_start and holders_joined.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ode per operator

A task drives a streamed round's pending probes from the end of the
round, so a slow signer unlock or pool open between the round and the
fetch neither times them out nor inflates their RTT. Their answers wait
in a channel, and the task stops when the tail is dropped.

A late node of an operator the set already has never replaces the node
the set already has.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A streamed probe round with no holder in hand ends 250 ms after its first
verified answer and starts on the non-holders it has as pull-through
targets (#1911). A holder that answers inside the window ends the round
at once, and one that answers later joins the running fetch through its
arrivals. A rediscovery still waits for every probe when no holder
answers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alpergundogdu
alpergundogdu added this pull request to stack #2301 October 2, 2026 12:20
Base automatically changed from claude/growable-source-set to main October 2, 2026 13:07
…utoff

# Conflicts:
#	crates/cli/src/commands/fetch.rs
@alpergundogdu
alpergundogdu merged commit 87916de into main Oct 2, 2026
29 checks passed
@alpergundogdu
alpergundogdu deleted the claude/cold-blob-cutoff branch October 2, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant