Repository navigation
Closed
Labels
kind:bugSomething does not behave as documented
Description
Summary
Two partial holders of the same blob can pull through from each other. A (0, 0) whole-blob header handshake from node A makes partial holder B open its own (0, 0) handshake back to A, and A does the same to B. Each hop holds a serve open until a deadline or the requester's close. The recursion stops only when attempt budgets or deadlines run out, or when per-signer admission refuses (signer_floor_at_cap).
Nothing in the miss path prevents it:
- The requester is not excluded from upstream candidates.
serve_via_window_pull_throughgetsclient_node_id(crates/node/src/handlers/client/window.rs:131), but uses it only for the serve leg.open_pull_leg_bounded(window.rs:935) andNodeOrigin::open_pull_leg(hash, namespace_id, prime)(crates/node/src/node_origin/pull_leg.rs:497) take no peer argument.- Candidate filters are negative cache, wedged provider, active staker and buy ceiling. None of them checks the requester.
- The node's own id is excluded from DHT results only (
dht/lookup.rs, viarequester_id), not from the origin-directory fallback. - The wire has no loop guard.
StreamRequest(crates/protocol/src/client.rs:189) carries no hop count, "via" field, or node-to-node marker. - The fill is claimed only after the handshake (
window.rs:332). A partial holder that is itself mid-handshake therefore looks like it has no fill, and it recurses.
Evidence (testnet, 2026-09-28 ~14:13–14:25 UTC, fleet redeployed 13:32/13:50, CLI aacaf469)
Entry 7cbb4846… (13.5 GiB consolidated.safetensors). bcl holds it whole; fra1 and hel1 hold parts.
- fra1, serving hel1's
(0, 0)request:- traces
8a3991bb99858d7299709acf3faaef64and5a4eea81bd01f005d5d4f1b6e1099f71(50 s each) andd04c345a674336861d7fcc9b0d66c96f(13 s); - in each, fra1 opens
open_progressive_pull peer=hel1 byte_offset=0 byte_len=0, then nothing happens until hel1 closes.
- traces
- fra1 trace
d0a08834b68a785fbe61ecb88b463c16:- fra1's handshake to hel1 returns
delivery refused: NotFound; - fra1 then opens a primed 1 MiB head leg to bcl, but
serve_miss_pullstarts only at +25.1 s; - bcl fails that leg at 10 s with
proof read timed out(trace3bb4f58d4823c1cf48c88a71d775f4ba).
- fra1's handshake to hel1 returns
- hel1, serving fra1's
(0, 0)request:- traces
6bcd8e91…,f333f737…,b4c3b741…,9e74fd9e…,6ad27d9f…,aef21279…andfb2ae625…; - in each, hel1 opens
open_progressive_pull peer=fra1 byte_offset=0 byte_len=0; 620b39a9…is refused withsigner_floor_at_cap.
- traces
decdn_streams_failed_totalper 10 min at 14:23: fra1 112, hel1 137, nbg1 43. The baseline earlier in the day was 1–20.decdn_serve_stream_rejected_signer_floor_at_cap_totalper 10 min: fra1 20, hel1 8.5, against ~0 before.
The client's pull still completes, because it fails over. But the loop burns per-signer admission, holds serves open for tens of seconds, and makes bcl ship unpaid head chunks.
Proposed fix
- Exclude the requesting peer from the upstream candidates: thread
client_node_idintoopen_pull_legand drop it inprobe_and_rankand in the cached-candidate path. This is cheap and breaks every 2-cycle. - Do not pull through for a header-only
(0, 0)request on a partial holder. Answer it from local metadata (the signedtotal_bytesis known), or refuse at once. This also removes the waste in node: a whole-blob header handshake makes a partial holder start a wasted upstream pull #2218. - Longer cycles (A→B→C→A) need either (2) or a hop marker on node-to-node requests. The latter is a wire change, so it needs an ADR first.
Acceptance
- A test: a partial holder that receives a
(0, 0)request from peer P never opens an upstream leg to P. - On testnet during a mistral bundle pull, no
serve_streamhaspeer=Xwhile its ownopen_progressive_pulltargetspeer=X.
Activity
thiras commentedon Sep 28, 2026
The loop widened within minutes. In the 5 minutes to about 14:31 UTC, 93 failed
serve_streams were all(0, 0)header requests between partial holders:So the cycles span 3–4 nodes (nbg1/fra1/hel1/lon1), not only 2. Requester exclusion alone (fix 1) will not stop it. Fix 2, where a partial holder does not pull through for a header-only request, or a hop marker, is needed.
thiras commentedon Sep 28, 2026
Peak scale:
decdn_streams_failed_totalper 10 min at 14:34 UTC was nbg1 377, fra1 316, hel1 201 (bcl 25). It falls back to tens per 10 min between bundle pulls, so the loop is driven by client traffic that makes these nodes proxies.fix(node): give the pull-loop guard its own reason; align signer-auth…