Skip to content

Refuse-to-serve / stop-serving policy (economic, margin-based) #1755

Closed

Description

@alpergundogdu

Refuse-to-serve / stop-serving policy (economic, margin-based)

Sibling axis to admission (#1754). Where admission asks "is this worth storing?", this asks "is this worth serving at the price I'm paid?" — a per-request economic decision, mostly heuristic.

The decision

On a miss the node must buy the bytes (pass-through from some route/origin) to sell them to the client. If no route is cheap enough to clear a margin at the client's price, the node should re-route or stop serving rather than serve at a loss. The core knob is a maximum buy price ("the most we'd pay for this").

Economics (illustrative — exact constants TBD)

  • Assume a ~40% protocol fee skim, so net revenue per serve ≈ 0.6 × sell_price.
  • One-hit-wonder floor: a single serve clears iff buy_price ≤ 0.6 × sell_price — i.e. we can buy ~40% cheaper than we sell.
  • Amortization: buy once, serve N times → the one-time buy cost spreads across serves. A high one-time buy can clear if the blob is served enough times (e.g. buying at $0.20/GB is recovered by ~20 serves at $0.01/GB before fees; more once the skim is included). So the max buy price is a function of sell_price, the fee skim, and the expected re-serve count.
  • The frequency/heat signal (the same estimator behind Pluggable cache admission & eviction policies (ADR 040) #1754) is what feeds "expected re-serves" — a hot blob justifies a higher buy price; a cold one only clears on a genuine cheap buy.

Signals

Candidate-route buy prices, the client's sell price, the fee skim, frequency/heat (expected re-serves), and latency.

Open question — where does this live?

It's an economic decision, not a cache-engine one — "the cache/engine signalling this back sounds odd." It's closely related to AdmissionPolicy (both gate "should I take this on") but keys on price, not storage. It likely belongs in a pricing/serve-economics layer that can read both the payment/route signals and the heat signal. Needs a proper home.

No penalty for refusing

Refusing is not slashable — the client simply re-routes with no penalty other than latency. This is a local profit optimization, not a protocol obligation, which is exactly what a trustless network needs: nodes serve when it pays and decline when it doesn't.

Related: #1754 (admission & eviction), load-shedding (separate issue).

Activity

  1. added
    kind:feature
    design:economics
    rust
    prio:medium
    on Aug 20, 2026
  2. moved this from Backlog to In progress in deCDNon Aug 20, 2026
  3. moved this from In progress to Done in deCDNon Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

design:economicskind:featureprio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions