Skip to content

fix(node): bound admit-path chain reads and keep the RPC failure class in logs - #2278

Merged
thiras merged 7 commits into
mainfrom
fix/2271-admit-rpc-timeouts
Oct 5, 2026
Merged

thiras merged 7 commits into
mainfrom
fix/2271-admit-rpc-timeouts

Conversation

@yigitdot

@yigitdot yigitdot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The admit-path getPool and getAuthorization reads in ResolvingPoolView had no timeout, and the alloy HTTP provider has none of its own, so a hanging RPC stalled admission with no log line and the stale-registration fallback (fix(node): batch fix for RPC URL redaction, signer-auth fallback, pull-through loop, watcher flapping #2270) never ran. Both reads now go through chain_events::timed (default 10 s): a hang becomes a fault and takes the existing path — a negative-cached refusal for getPool, the cached-registration fallback or a refusal for getAuthorization. The getPool WARN names the negative-cache window it starts.
  • New redact::sanitize_error_sources walks a typed error's source() chain, strips URLs from each layer before the join (so a URL token cannot swallow the : separator), and skips a layer only when the previous layer's message ends with it at a non-alphanumeric boundary — the shape of a "{0}" or "transport: {0}" wrapper. A short cause such as timeout that merely appears inside an earlier message is still printed. A stripped reqwest error therefore keeps its class (timeout / connection refused / DNS / TLS).
  • sanitize_err_chain delegates to sanitize_error_sources, so anyhow errors (including every timed result) get the same dedupe and per-layer strip instead of alloy's doubled transport text.
  • anyhow errors in the settlement path (plan_lane, post-redeem getAuthorizations, pre-redeem getWatermarks) were logged with sanitize_rpc_display, which prints only the outer context; they now use sanitize_err_chain. Typed alloy, reqwest, store and iroh relay errors across crates/node/src log through sanitize_error_sources. The redact module doc names which helper keeps the class.
  • Follow-ups: the same switch for the decdn CLI and decdn-client sites is cli, client: log typed RPC errors through sanitize_error_sources so the failure class survives #2277 (client/src/discovery.rs is in flight in fix(client,cli): keep the bundle task polled while records and fsyncs run #2274); a shorter negative-cache TTL for a getPool fault than for an absent/closed verdict is node: a getPool fault negative-caches a live pool for the full 60 s verdict TTL #2318.

Test plan

  • admit_getpool_hang_refuses_within_the_bound: elapsed equals DEFAULT_RPC_CALL_TIMEOUT; a second request is refused from the negative cache with no further wait and no second WARN; the WARN carries admit getPool timed out after 10s and suppressed_for=60s
  • admit_getauthorization_hang_falls_back_to_the_cached_registration: the fallback leaves the entry's age; the WARN carries the timeout
  • admit_getauthorization_hang_with_no_cached_read_refuses: caches nothing; the WARN carries the timeout
  • All three use a hanging provider and a paused clock, and each fails without its timed wrap. The WARN checks capture tracing output with a local writer (no new dependency).
  • preflight_transient_keeps_the_class_and_drops_the_url: a real reqwest connection-refused error keeps connect and drops the rpc_url secret
  • sanitize_error_sources / sanitize_err_chain unit tests in decdn-common, including a repeated-wrapper chain and a cause that only appears inside the outer message
  • cargo nextest run -p decdn-node, -p decdn-common
  • cargo clippy --workspace --all-targets -- -D warnings, cargo fmt -- --check, cargo doc with -D warnings

Closes #2271

🤖 Generated with Claude Code

…s in logs

The admit-path getPool and getAuthorization reads in ResolvingPoolView now
run under chain_events::timed, so a hung RPC times out and takes the fault
path (negative-cached refusal, or the cached-registration fallback).

Add redact::sanitize_error_sources, which walks a typed error's source()
chain so a URL-stripped transport error keeps its failure class. Log typed
alloy errors in crates/node/src through it, and anyhow errors through
sanitize_err_chain.

Closes #2271

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 1, 2026 21:44

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

@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 b79a7fa in the fix/2271-admit-rpc-t... branch remains at 87%, unchanged from commit 9fddf9a in the main branch.

Show a line coverage summary of the most impacted files.
File main 9fddf9a fix/2271-admit-rpc-t... b79a7fa +/-
crates/node/src...nt/serve_leg.rs 93% 91% -2%
crates/client/s...c/connection.rs 98% 97% -1%
crates/node/src/dht/publish.rs 92% 92% 0%
crates/client/src/lib.rs 92% 92% 0%
crates/client/src/streamer.rs 91% 91% 0%
crates/node/src...s/client/mod.rs 95% 95% 0%
crates/cache/src/engine.rs 94% 94% 0%
crates/protocol/src/framing.rs 97% 97% 0%
crates/node/src...t_settlement.rs 88% 89% +1%
crates/node/src/runtime/mod.rs 52% 53% +1%

Updated October 05, 2026 14:20 UTC

yigitdot and others added 3 commits October 5, 2026 12:54
… pin admit-cache invariants

sanitize_err_chain now walks the chain through sanitize_error_sources, so
alloy's repeated transport layers print once and each layer is stripped
before the join. The relay last_error warning logs its source chain. The
admit getPool WARN names the negative-cache window. Tests pin that a
timed-out getAuthorization caches nothing and does not refresh a stale
entry, that the admit bound is the default, and that the RPC probe keeps
the failure class of a real reqwest error without the URL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…meouts

# Conflicts:
#	crates/node/src/payment_settlement.rs
…meouts

# Conflicts:
#	crates/node/src/buyer_channel.rs
yigitdot and others added 3 commits October 5, 2026 16:30
…with it

sanitize_error_sources skipped any layer whose text appeared anywhere in
the text built so far, so a short cause such as "timeout" under "request
timeout exceeded" was dropped. A layer is now skipped only when the
previous non-empty layer's raw Display ends with it at a non-alphanumeric
boundary, which is the shape of a "{0}" or "transport: {0}" wrapper.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The getPool hang test makes a second request and asserts it is refused
from the negative cache without another read or wait. All three admit
hang tests capture tracing output and assert the WARN carries the
timeout and, for getPool, the suppression window.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
.config/nextest.toml terminates a decdn-node test after 180s and retries
it twice; the doc said the repo had no nextest config.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@yigitdot
yigitdot requested review from thiras and removed request for alpergundogdu October 5, 2026 14:15
@thiras
thiras enabled auto-merge (squash) October 5, 2026 14:17
@thiras
thiras merged commit e2413d7 into main Oct 5, 2026
30 checks passed
@thiras
thiras deleted the fix/2271-admit-rpc-timeouts branch October 5, 2026 14:27
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.

node: admit-path chain reads have no timeout, so a hanging RPC skips the getAuthorization fallback

3 participants