Repository navigation
Closed
Labels
design:adrNeeds a new or updated ADR in adr/design:economicsToken economics, pricing, fee split, bond sizingdesign:missing-decisionA decision the ADRs do not record yetkind:docsREADME, docs/, runbook, rustdoc or ADR prose onlyprio:mediumScheduled
Description
Gap
ADR 003 § Client Priority Staking specifies the basic mechanic — clientStake / clientUnstake, no minimum, no slashing, no unbonding period, off-chain enforcement — but leaves several edge cases implicit:
- Mid-session stake changes. A client raises their stake mid-stream. Does the node's priority queue re-evaluate immediately, at the next chunk boundary, or only on next
StreamRequest? Symmetric question for stake reductions. - In-flight behavior on
clientUnstake. The withdraw-anytime semantics implies a stake can drop to zero while a stream is active. Does the node demote in-flight streams, allow them to complete, or is this a node-policy decision (and if so, should the protocol surface that variability)? - Priority granularity. Per-stream, per-session, or per-connection? Affects how nodes compute the priority key and whether multiple parallel streams from the same client share a single priority slot.
- Ephemeral binding interaction. ADR 003 supports clients with no on-chain registration via an ephemeral
BindNodeId(nodeId, nonce=0)inStreamRequest. Are ephemeral-bound clients eligible for priority lookup, or does priority require a persistent registration?
Refs
- ADR 003 — defines the on-chain
clientStake/clientUnstakesurface and ephemeral binding path - ADR 016 —
StakingRegistryclientUnstake()"anytime" without conditions
Why it needs an ADR
These are the kind of unspecified edges where well-meaning implementations diverge silently. A short ADR (or extension to ADR 003) defining the four behaviors above would prevent priority-handling bugs in node implementations.
Origin
Split out from #190 (gap 11) as a standalone tracking issue.
Metadata
Metadata
Assignees
Labels
design:adrNeeds a new or updated ADR in adr/design:economicsToken economics, pricing, fee split, bond sizingdesign:missing-decisionA decision the ADRs do not record yetkind:docsREADME, docs/, runbook, rustdoc or ADR prose onlyprio:mediumScheduled
Type
Fields
Priority
None yet
Activity
alpergundogdu commentedon May 7, 2026
Decision: dissolve, don't extend
After working through the four edge cases, the cleaner answer turned out to be: client priority staking shouldn't be in the protocol at all. The four gaps in this issue dissolve once admission and queueing become an operator-side implementation concern instead of a protocol-normative mechanism.
Rationale
The original mechanism (refundable TOKEN deposit → soft signal during congestion) had three structural weaknesses:
BindNodeId(nodeId, nonce=0)ceremony inStreamRequestwhose only consumer was theclientStakeOflookup.What replaces it
Two signals that already exist in the protocol, repurposed as an operator-side implementation suggestion, not a protocol obligation:
amount_delta / bytes_delta >= rate_per_mb— the advertised rate is a floor, not equality. Clients are free to commit at higher rates today; nodes can sort the admission queue by committed voucher rate desc with zero protocol changes. The cost of priority becomes real per-MB premium paid in USDC, aligned with node revenue.StakingRegistry.stakeOfreads. Nodes that wish to favour staked peers (node-to-node cache pulls, registered "priority client" addresses) can lift them into a higher-priority lane via a single contract read. No new contract surface — the lookup uses the existing node-stake bookkeeping with its 7-day unstake delay (real commitment, not refundable-anytime).Why an appendix and not an ADR
Different operators will run different admission policies — a small home node, a CDN-scale operator, and an enterprise SLA tier all have different appetites for fairness vs. revenue, different concurrent-stream caps, different starvation tolerances. Pinning a single policy as protocol-normative would either (a) freeze a bad default or (b) be ignored. The appendix frames it as a workable design operators MAY adopt, with the four gaps in this issue addressed inline:
clientUnstake: N/A — no client-stake surface, and node-side admission is non-preemptive (already-admitted streams complete normally).StreamRequestindependently.clientStakeOf).Net delta
clientStake/clientUnstake/clientStakeOf+clientStakesstorage +ClientStaked/ClientUnstakedevents from §StakingRegistry Modifications. One-line pointer to the new appendix.adr/appendix-admission-policy.mdcovering voucher-rate-based ordering, optional staked-peer lane, non-preemptive admission with reject-and-rate-hint, and per-client concurrent-stream cap as a SHOULD.client*functions and storage are removed since they had no remaining consumer).NodeInfoschema change, noservesflag.PR incoming.
Generated by Claude Code
docs(adr): clean up admission-policy appendix per review
docs(adr): remove client priority staking surface (#402) (#445)