Repository navigation
fix(node): stop partial holders pulling a blob from each other in a loop - #2227
Merged
Merged
Conversation
A serve-miss read the blob size by opening the whole blob (offset 0, len 0) at its top-ranked candidate whenever that candidate did not cover the pull's first block, partial holders included. The holder treated the open as a miss and started its own pull, often from another partial holder or from the node that asked it, and nobody in that ring held the missing bytes. On the testnet fra1, hel1, nbg1 and lon1 asked each other for a Mistral shard at up to 166 failed streams per node per 5 minutes (Tempo trace 520eeaf646811fae1571c3ec8de252f7). - The size handshake opens one chunk group of the first block the candidate advertises; the whole blob only when no trusted size is known. - open_pull_leg takes the requesting node and drops it from the probe cache, the discovered providers and the ranked candidates. - ADR 037 states both rules under its "never chains through a non-holding proxy" invariant. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
A new test helper (spawn_block_holder) has unchecked arithmetic that can panic (overflow/underflow) on invalid block indices and should return a structured error instead.
Review effort: Lite
Findings: 1
What changed in this PR
Fixes a node-origin pull-through failure mode where partial holders could trigger whole-blob “size handshake” pulls against each other (or back to the requester), creating self-sustaining miss loops and stalled streams. This aligns the implementation with ADR 037’s invariant that a proxy pull targets actual holders and avoids chaining through non-holding proxies.
Changes:
- Make the size/header handshake open only a single chunk group within a block the candidate explicitly advertised (instead of whole-blob open at offset 0, len 0 when a size hint exists).
- Thread the requesting node ID into
open_pull_legand filter it out from probe-cache candidates, discovered providers, and ranked candidates to prevent pulling back from the requester. - Add/extend integration tests and fixtures to model real partial holders and assert both invariants (handshake stays within advertised coverage; requester is never selected upstream).
| File | Description |
|---|---|
| crates/node/tests/node_origin_pull.rs | Adds partial-holder fixture that holds only selected blocks and new RED→GREEN tests for handshake coverage + requester filtering. |
| crates/node/src/node_origin/pull_leg.rs | Implements coverage-scoped handshake range selection and removes requester from all candidate sources. |
| crates/node/src/handlers/client/window.rs | Passes requester node ID into NodeOrigin::open_pull_leg from the serve-miss path. |
| CHANGELOG.md | Documents the production symptom and the behavioral fix. |
| adr/037-regional-proxy-warming.md | Makes the “no proxy chaining / requester exclusion / coverage-respecting opens” invariant explicit in the ADR text. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Sep 29, 2026
7 tasks done
thiras
added a commit
that referenced
this pull request
Oct 1, 2026
…l-through loop, watcher flapping (#2270) * fix(node,client,cli): redact RPC URLs in chain-read logs Chain-read warnings logged raw alloy errors, whose Display can carry the reqwest URL and so a provider API key. Route them through sanitize_rpc_display / sanitize_err_chain, and pin it with a test that logs an owned-pool read fault whose URL holds a key. Closes #2264 Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(node): fall back to the cached signer authorization on a read fault A getAuthorization RPC fault at admission returned None, and the admit gate refused it as SignerCapExhausted, so a paying client was refused and the cap-exhausted counter blamed the signer. On a fault the view now answers with the last cached read whatever its age (spent raised to the projection's fold); with no earlier read the gate refuses as PoolUnconfirmed instead. Closes #2220 Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(node): refuse a node's whole-blob request while this node's open runs #2227 excludes the requester and sends ranged handshakes when a size hint exists, but without a hint the handshake is still (0, 0), and three or more partial holders can pull a blob from each other in a loop: the fill is claimed only after the open, so a node mid-open looks like it has no fill and recurses. NodeOrigin now marks each upstream open in progress, and the window pull-through path refuses a whole-blob request for that hash from an active staker as a miss (NotFound) while one runs. Ranged requests and clients are never refused for this reason. The origin-directory candidates also drop this node's own id, as the DHT lookup already does. ADR 037 states the guard. Closes #2224 Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(node): defer an exhausted getLogs window instead of failing the tick dRPC code-19 failures cluster in time, so a window that fails its two in-tick retries often fails again seconds later, and each such tick marked every route down and bumped all five *_watcher_restarts_total counters, keeping DecdnChainWatcherFlapping firing fleet-wide while no event was lost. A window that fails every retry now ends the tick early: earlier windows keep their progress and the next tick resumes at the deferred window. A tick fails only when no window has completed for GET_LOGS_STALL_BUDGET (2 min, below the 180 s stalled alerts); a deferred tick that completed no window fires no hook. New counter decdn_chain_get_logs_deferred_total, wired, documented and plotted. Closes #2253 Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(node): trust only a cached registration on a getAuthorization fault A cached Unregistered read is not safe to reuse after its TTL: any provider's next redemption registers the signer, possibly with its cap already spent, so admitting on the old read fails open. The fault fallback now answers only with a cached Registered read (cap and expiry are write-once); otherwise the signer is refused as unconfirmed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(node): run the getLogs stall clock until a tick reaches head Clearing the stall clock on any completed window let ticks that each complete one window and then defer the next fall behind head without bound while still stamping every watcher healthy. The clock now clears only on a tick that reaches head, and the budget applies to every deferral, with or without progress. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(node): give the pull-loop guard its own reason; align signer-auth docs The #2224 guard refused through FillOutcome::miss_reason(fault_seen), so after an earlier tier's backend fault it answered InternalError, which feeds the internal-error alert and makes the requester score this node degraded for a deliberate loop guard. It now refuses as ServeRejectReason::PullLoopGuard: always wire NotFound, counted in the new decdn_serve_stream_rejected_pull_loop_guard_total (listed in INBOUND_FAILURE_REASONS and both dashboards), with the requester in the debug line. The integration test also pins that a staker with no open in progress and a staker's ranged request are served. PendingOpen is now private and #[must_use]. For #2220, the pool_unconfirmed and signer_cap_exhausted metric docs no longer describe a getAuthorization fault as a cap-exhausted refusal, ADR 003 states the read-fault rule, and a test pins that the stale fallback takes the larger of the cached and projection-folded spent. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(node): correct the poller deferral docs and pin post-stall recovery The module doc still said a long tick succeeds only if every window does, listed the stall failure as pre-route-loop, and the stall budget doc overstated its margin to the stalled alerts. Extend the stall test past the first failure: the next deferral fails at once and a tick that reaches head clears the stall and recovers every route. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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
pull_leg.rs): the size handshake opens one chunk group of the first block the candidate advertised, so any holder answers it from what it holds. The whole blob is opened only when no trusted size is known (no probe hint, or the primed open just proved the hint wrong).pull_leg.rs,window.rs):open_pull_legtakes the requesting node and drops it from the probe-cache list, the discovered providers, and the ranked candidates (which covers the origin-directory supplement). A node never pulls a blob back from the node that asked for it.Evidence (testnet, 2026-09-28)
7cbb…while outside clients pulled it; failed node-to-node streams reached 93–166 per node per 5 min. Example: Tempo trace520eeaf646811fae1571c3ec8de252f7(fra1 asked by hel1, opens nbg1 →NotFound, then opens hel1 itself, idle 88 s).Test plan
a_serve_miss_asks_a_partial_holder_only_for_blocks_it_holds. A real partial holder (holds only block 1) ranks first; before the fix it refused 1 miss (the whole-blob handshake), after it refuses none.a_serve_miss_never_pulls_from_its_requester. The leaf is itself a holder and ranks first; before the fix S pulled the whole blob from it (the full holder served nothing), after it pulls from the other holder only.spawn_block_holdertest helper: a holder whose cache holds only the given blocks (shared body withspawn_partial_holder).cargo nextest run --workspace: 4218/4218 passed.cargo clippy --workspace --all-targets --all-features,cargo fmt --check,RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-itemsclean.cargo test --no-run -p decdn-e2e --features anvil-e2ebuilds.🤖 Generated with Claude Code