Skip to content

Buyer estimate of an upstream's refundable floor M: decide between estimate, signed refusal reason, or advertised M #2013

Closed

Description

@thiras

Follow-up from #2010 (#1893).

Context

A serving node refuses a new stream once the pool's on-chain remaining − M cannot cover a credit window, where M is its refundable floor (ADR 003 § Pool solvency). It reports that refusal as NotFound on purpose (#1520), alongside real misses, so a prober cannot map pool balances.

#2010 works around this on the buyer side. BudgetPacer tops up while remaining_deposit < next_voucher_cost + seller_reserve. The node sets seller_reserve to its own pool_min_remaining_deposit_micro_usdc, on the assumption that an upstream running the same software keeps the same default.

Gap

M is node policy, not a protocol constant. An upstream configured with a larger M than the buyer still refuses the buyer's re-opens while the buyer's remaining deposit is between the buyer's estimate and the upstream's real floor. The buyer sees NotFound, reassigns the range, and the pull fails with "held by no reachable provider".

Options (decision needed)

  1. Keep the estimate and document the residual. This is the cheapest option; the failure only occurs with a heterogeneous M.
  2. Tell the authenticated pool owner the refusal reason. The requester has already proven ownership of the lane with its client binding, and on-chain remaining is public. So a signed InsufficientDeposit sent only to that owner may leak nothing a prober cannot already read, and the existing reactive top-up path would handle it without guessing. This is a wire and privacy decision against the serve: the InsufficientDeposit refusal is unobservable in practice — no log, no alert, no dashboard #1520 rationale.
  3. Advertise M in the signed StreamResponse / probe, so buyers size the reserve exactly. This is a wire change.

Run the options through decdn-spec-discipline before choosing. ADR 003 would need an update for option 2 or 3.

Activity

  1. added
    design:missing-decision
    area:payments
    on Sep 14, 2026
  2. alpergundogdu commented on Sep 16, 2026

    @alpergundogdu
    Contributor

    Recommendation: Option 2 (signed refusal reason to the authenticated pool owner)

    Ran the three options through decdn-spec-discipline. Option 2 is the pick. Reasoning below, then the placement and residual it needs to carry.

    The options against the gates

    Option 1 — keep the estimate, document the residual.
    VERDICT: viable fallback. It adds nothing (default posture), and the failure it leaves is narrow — only a heterogeneous M where the buyer under-guessed. But it leaves a silent dead-end: the buyer sees NotFound, reassigns the range, and the pull dies as "held by no reachable provider" even when the buyer could afford the real floor. The information to recover exists; option 1 just refuses to surface it. Acceptable only if we decide the heterogeneous-M case is rare enough to ignore.

    Option 3 — advertise M in the signed StreamResponse.
    VERDICT: keep out. FAILS gate 2 (attacker binding / trustless axiom). M advertised as a raw number is a self-declared counterparty value. If any buyer ever lets it size its own reserve without a client-side clamp, a node advertising a huge M griefs the buyer into parking a large (refundable, but locked) deposit — a capital-lockup lever pointed at the client. It's not theft, but it's the textbook "trust the number the other side sends you" anti-pattern.

    Option 2 — signed InsufficientDeposit, sent only to the authenticated lane owner.
    VERDICT: keep. It passes the axiom because it ships no number for the client to over-trust — just the fact "your pool is short." The buyer still sizes every top-up against its own working_deposit ceiling (pacer.rs clamps additional = working_deposit − remaining), so a lying node can decline you but can never inflate your float. Protection stays on the side that benefits from it.

    Why the current NotFound collapse is right to narrow, not remove

    The open-time NotFound collapse (#1520, ADR 003 §Pool solvency) is an anti-enumeration defense: an unauthenticated prober must not be able to tell "no such content" from "this pool can't pay," or it could sweep pools and map balances/solvency off the wire. That property is real and worth keeping — against a prober.

    But the collapse is applied categorically, and the prober is the only audience that justifies the opacity. The authenticated lane owner is not a prober: it proved ownership via its client binding, and its on-chain remaining is already public. Silencing that party leaks nothing it couldn't compute, while costing the one actor with both the right to know and the ability to act (top up). So option 2 isn't "stop collapsing" — it's "collapse for probers, speak to owners." NotFound stays for everyone unauthenticated.

    How it recovers (funding is already built)

    The driver already has a fund-and-retry-same-lane loop for mid-stream reactive ceilings (driver.rs TopUp arm): top_up → credit the shared deposit → awaiting_settle (bounded settle-wait for the node's watcher) → re-open at the paid frontier. Option 2 feeds that loop from a new source. Instead of NotFound → reassign → dead-end, the owner gets a signed InsufficientDeposit, the driver routes it to a TopUp, funds past the node's real M, waits out settle, and re-opens — now clearing the node's remaining − M ≥ window gate.

    Outcomes:

    • Buyer under-guessed but can afford the real floor (the case this issue is about): recovers.
    • Reactive top-up disabled or budget exhausted: terminal — same as today, no worse.
    • Buyer's own working_deposit ceiling is below real M + window: it tops up to its ceiling, re-opens, still refused — but now the refusal is again a signed reason, so it fails over (or aborts) truthfully instead of silently reassigning into "held by no reachable provider." Strictly better terminal.

    The last case is the correct economic outcome, and worth stating plainly in the ADR update: below real M is a collateral wall, not a price wall. M is refundable float, not spend — the buyer that can't post it isn't overpaying, it just can't meet this node's liquidity bar, and cleanly moves to a lower-M node. Node-level decline is fine; the only thing to keep in view is the network-level case where every reachable node holds a high M and raises the liquidity floor for small clients — which is exactly why option 2 (no advertised number, client sizes against its own ceiling) beats option 3.

    Placement — StreamResponse

    This is a cdn/client/v1 StreamResponse change. The verdict is meaningful only where the request carries the lane binding — the stream open is what lets a node evaluate remaining − M for a specific pool, address the refusal to the proven owner, and route it into the top-up loop.

    What option 2 actually costs (not free, but small)

    1. A new signed admission-refusal variant on the stream-open response, addressed to the authenticated lane owner. This is the wire + privacy decision against serve: the InsufficientDeposit refusal is unobservable in practice — no log, no alert, no dashboard #1520 — the ADR 003 update makes the owner-scoped carve-out explicit.
    2. retry_disposition needs a branch: an admission-time InsufficientDeposit must mean retry-after-topup, not the terminal that PoolExhausted/Refuse currently map to, becoming terminal only once top-up budget/ceiling is spent.
    3. Recovery is gated on the existing bounded settle-wait (default 30 × 500 ms) so the node's watcher observes the top-up before the re-open — already handled, just not instant.

    Residual to write into ADR 003 (don't claim "leaks nothing")

    InsufficientDeposit reveals that remaining − M < window is true. The owner knows remaining (public), so it learns an inequality bound on the node's M, and by topping up and re-probing could binary-search toward M over several rounds. It never learns M outright (that would be option 3). This probe costs the owner real deposits and is available only to a paying pool owner, not a free enumerator — a slim, owner-only, self-funded leak. Acceptable, but state it as the known residual rather than papering over it.


    Bottom line: Option 2. Keep NotFound for probers; send the proven lane owner a signed InsufficientDeposit on StreamResponse that carries the fact but no number; let the existing reactive top-up loop recover it. Update ADR 003 with the owner-scoped carve-out to #1520 and the binary-search residual. Option 1 is the acceptable do-less fallback; option 3 stays out on the trustless axiom.

  3. moved this from Backlog to In progress in deCDNon Sep 21, 2026
  4. moved this from In progress to Done in deCDNon Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:paymentsdesign:missing-decision

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions