Skip to content

fix(node): batch fix for RPC URL redaction, signer-auth fallback, pull-through loop, watcher flapping - #2270

Merged
thiras merged 8 commits into
mainfrom
fix/node-batch-2264-2220-2224-2253
Oct 1, 2026
Merged

thiras merged 8 commits into
mainfrom
fix/node-batch-2264-2220-2224-2253

Conversation

@thiras

@thiras thiras commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

What

Four node bugs from testnet triage, one commit each.

Closes #2264, Closes #2220, Closes #2224, Closes #2253

Reviewer notes

Verification

  • cargo fmt -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings (exit 0)
  • cargo nextest run -p decdn-node -p decdn-common -p decdn-client -p decdn-cli: 3371 passed
  • RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-items (exit 0)
  • New tests fail with their fix reverted: a_chain_read_warning_does_not_log_the_rpc_url, a_whole_blob_request_from_a_node_is_refused_while_its_upstream_open_runs, an_origin_directory_entry_for_this_node_is_not_a_candidate
  • User-visible change: CHANGELOG.md entries added
  • Design change: ADR 037 and adr/appendix-observability.md updated

🤖 Generated with Claude Code

thiras and others added 4 commits October 1, 2026 20:28
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]>
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]>
…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]>
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]>
Copilot AI balanced review requested due to automatic review settings October 1, 2026 18:04
@thiras thiras self-assigned this Oct 1, 2026
@github-code-quality

github-code-quality Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

The overall line coverage in commit 1fc2294 in the fix/node-batch-2264-... branch remains at 87%, unchanged from commit cb83e28 in the main branch.

Show a line coverage summary of the most impacted files.
File main cb83e28 fix/node-batch-2264-... 1fc2294 +/-
crates/node/src...t_settlement.rs 84% 84% 0%
crates/node/src...lexed_poller.rs 93% 93% 0%
crates/client/src/lib.rs 92% 92% 0%
crates/node/src...e_origin/mod.rs 91% 91% 0%
crates/node/src...uyer_channel.rs 74% 74% 0%
crates/node/src/runtime/mod.rs 52% 52% 0%
crates/node/src...gin/pull_leg.rs 90% 91% +1%
crates/cli/src/...ommands/node.rs 78% 79% +1%
crates/node/src...ent/dispatch.rs 82% 83% +1%
crates/node/src...lient/window.rs 75% 76% +1%

Updated October 01, 2026 18:59 UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Stale unregistered authorization can fail open, and sparse poller progress can mask unbounded watcher lag.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Fixes four testnet issues involving RPC secrecy, signer authorization, pull-through loops, and chain-watcher stability.

Changes:

  • Redacts RPC URLs across node, client, and CLI logs.
  • Adds stale signer authorization fallback and pull-loop prevention.
  • Defers transient eth_getLogs failures with new metrics and documentation.
File Description
monitoring/​prometheus-alerts.yml Documents deferred windows.
monitoring/​dashboard-chain.json Charts deferred-window rate.
docs/​runbook.md Adds deferral troubleshooting.
crates/​node/​tests/​node_origin_pull.rs Tests loop and self-candidate guards.
crates/​node/​src/​runtime/​mod.rs Wires the deferral metric.
crates/​node/​src/​pool_view.rs Updates authorization semantics.
crates/​node/​src/​payment_settlement.rs Adds stale authorization fallback.
crates/​node/​src/​node_origin/​pull_leg.rs Tracks pending upstream opens.
crates/​node/​src/​node_origin/​mod.rs Implements pending-open and self-filter logic.
crates/​node/​src/​metrics.rs Exports the deferral counter.
crates/​node/​src/​handlers/​client/​window.rs Refuses loop-closing requests.
crates/​node/​src/​handlers/​client/​mod.rs Clarifies rejection reasons.
crates/​node/​src/​handlers/​client/​dispatch.rs Separates unconfirmed and exhausted signers.
crates/​node/​src/​chain_events/​multiplexed_poller.rs Implements deferred-window handling.
crates/​node/​src/​buyer_channel.rs Sanitizes RPC errors.
crates/​node/​src/​binding_check.rs Redacts binding-check errors.
crates/​client/​src/​source_set.rs Sanitizes discovery errors.
crates/​client/​src/​scheduler.rs Sanitizes lane-build errors.
crates/​client/​src/​first_open.rs Sanitizes first-open errors.
crates/​cli/​src/​commands/​fetch.rs Sanitizes holder-resolution warnings.
CHANGELOG.md Records user-visible fixes.
adr/​appendix-observability.md Documents deferral observability.
adr/​037-regional-proxy-warming.md Specifies the pull-loop guard.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/node/src/payment_settlement.rs Resolved
thiras and others added 4 commits October 1, 2026 21:27
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]>
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]>
… 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]>
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]>
@thiras
thiras merged commit 6a66769 into main Oct 1, 2026
30 checks passed
@thiras
thiras deleted the fix/node-batch-2264-2220-2224-2253 branch October 1, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants