Skip to content

serve: the InsufficientDeposit refusal is unobservable in practice — no log, no alert, no dashboard #1520

Closed

Description

@thiras

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:

  1. debug! unconditionally. Costs nothing at default level and is what makes a support ticket answerable.
  2. 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.
  3. A monitoring/ alert + panel for the counter, so the series an operator is told to watch is one something actually watches.
  4. Optionally, a buyer-side counter for RefusalVerdict::Transient (node_origin.rs), which today logs at debug with 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.

Activity

  1. added
    kind:feature
    rust
    on Jul 29, 2026
  2. self-assigned this
    on Jul 30, 2026
  3. added 4 commits that reference this issue on Jul 30, 2026
    d69d1c6
    1084585
    bd29d34
    b1a5962
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:featurerust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions