Repository navigation
Description
Found by the multi-agent review of #1518, which pushed back on a decision made there and was right to.
The gap
The #1516 pre-serve deposit gate refuses without logging, on the reasoning that an exhausted deposit is routine and log-noisy under abuse, so decdn_serve_stream_rejected_insufficient_deposit_total is the signal. The first half holds; the second does not, for two independent reasons.
1. The counter has no operator-facing surface. grep for insufficient_deposit across monitoring/ and docs/ returns nothing — no alert rule, no Grafana panel, no runbook entry. So "the metric is the signal" currently means "an operator who already suspects this specific cause and knows the series name can query it by hand". That is a latent signal, not a signal. (Consistent with the broader monitoring/-is-unvalidated gap.)
2. One unlabeled counter cannot separate causes with opposite remedies. The seller's view of deposit is only raised by the chain watcher observing ChannelToppedUp (crates/node/src/handlers/client/mod.rs). During watcher lag, a client that just topped up is refused pre-serve. On the counter that is indistinguishable from leech abuse, and the remedies are opposite: "ignore it" versus "your event poll interval or RPC is behind and you are turning away paying customers". The node already documents that lag window as real for UnknownChannel (crates/node/src/node_origin.rs).
The wire code is deliberately lossy (InsufficientDeposit collapses to StreamError::NotFound with six other reasons, for privacy), so the server-side counter genuinely is the only place the cause exists — which is exactly why it needs to be reachable.
Also: the top-up recovery signal got weaker
Pre-#1516, an exhausted channel got a mid-stream VoucherRejected { InsufficientDeposit, bundle: Some(_) } — an authenticated watermark the client's ledger reseeds from. Post-#1516 the retry gets a bare NotFound with no bundle, which routes to RefusalVerdict::Transient rather than the deposit-aware arm. That is the correct trade (it stops the resume loop farming free windows — see the tracked_watermark_survives_post_ack_error doc), but it does mean a legitimately-topped-up client recovers more slowly and more quietly.
Proposal
Not a per-refusal warn! — that is farmable, which was the original objection and it stands. Instead:
debug!unconditionally. Costs nothing at default level and is what makes a support ticket answerable.- A rate-limited
warn!— one per channel per N minutes, or one when a channel's refusal rate crosses a threshold. That is the shape that distinguishes "one client ran dry" (ignore) from "I am refusing everyone" (act), which is the actual triage question. - A
monitoring/alert + panel for the counter, so the series an operator is told to watch is one something actually watches. - Optionally, a buyer-side counter for
RefusalVerdict::Transient(node_origin.rs), which today logs atdebugwith no metric — a node whose every upstream pull is refused should be able to see that.
Related, same root
crates/cli/src/commands/fetch.rs annotate_unbound_cache_miss hard-codes one cause for a NotFound ("no client identity binding — set blockchain.capacity_bond_address"). #1516 added a second cause with a different remedy, so an unbound fetch against an underfunded channel now gets pointed at the wrong fix. The signed refusal already carries rate_per_mb and UpstreamRefused::evidence() retains the whole verified response, so the client can compute min_payment(interval_bytes, rate) against its own headroom and say so — using only data already on the wire, and inferring about its own channel, so the privacy collapse is untouched.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
feat(node): make the insufficient-deposit refusal observable
fix: address the multi-agent review of #1519/#1520/#1521
feat(node): make the insufficient-deposit refusal observable
fix: address the multi-agent review of #1519/#1520/#1521
feat(protocol,node,client-pull): tell the proven pool owner its depos…