Skip to content

docs(adr-003): correct §Admission and Priority to probe-time congestion control (#446) - #756

Merged
thiras merged 1 commit into
mainfrom
feat/446-admission-queueing
Jun 2, 2026
Merged

thiras merged 1 commit into
mainfrom
feat/446-admission-queueing

Conversation

@yigitdot

@yigitdot yigitdot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

What

Corrects ADR 003 §Admission and Priority to align with the protocol's actual congestion semantics. This is the corrected successor to the closed #672, addressing the three protocol-correctness flaws raised in that review (recorded on #446):

  1. No voucher at admission. StreamRequest carries no voucher; the first Voucher arrives mid-stream, after StreamResponse{ok:true} (ADR 005). The committed per-MB rate is a mid-stream signal for ordering in-flight streams, not an admission key.
  2. StreamResponse{ok:false} after a positive probe is slashable regardless of error code. The on-chain verifier sees only the signed ok bool; the error field is unsigned (ADR 014). So it is never a congestion lever.
  3. The protocol-level congestion lever is at probe time — declining to sign has_blob:true, gated by the max_probe_holds hold budget (ADR 005 §Hold budget).

Registered node-bond (CapacityBond.bondOf) is reframed as probe-acceptance prioritization usable only for requesters that are themselves registered operators — practically node-to-node cache-miss probes; end-client probe eligibility must come from reputation/region/allow-list.

Rebase note

Rebased onto current main after #768 (refactor(contracts): rename stake→bond on CapacityBond surface). The canonical accessor name is bondOf; this PR keeps it and does not alter contract naming — it only reframes the admission/priority semantics. (An earlier revision of this branch briefly renamed bondOf→stakeOf in response to a review comment; #768 made bondOf canonical, so that change was dropped.)

Scope

Documentation-only. The worked reference design stays in #446 (per "filed in lieu of an appendix"). Probe-time stake-lane eligibility in the probe handler is tracked as a follow-up in #757.

Files

  • adr/003-payments.md — §Admission and Priority rewritten (signal-note form retained; bondOf terminology).
  • adr/016-contract-interactions.md — bondOf consumer row "Used by" prose aligned to the probe-acceptance framing.

Closes #446 (with the corrected design comment landed on the issue).

🤖 Generated with Claude Code

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the architectural decision records (ADRs) regarding node admission and priority under congestion. Specifically, in adr/003-payments.md, it clarifies that the protocol-level congestion lever operates at probe time via the hold budget and declining to sign has_blob: true. It also refines how committed voucher rates and registered node-stakes are used as signals, noting that stake is only applicable for node-to-node probes. Correspondingly, adr/016-contract-interactions.md is updated to align the description of the bondOf contract call with these changes. There are no review comments, so no additional feedback is provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates ADR documentation to reflect the protocol’s actual congestion-control semantics by moving “congestion lever” reasoning to probe-time behavior and clarifying how voucher rate and stake can (and cannot) be used for prioritization.

Changes:

  • Rewrites ADR 003 §Admission and Priority to emphasize probe-time has_blob signing and max_probe_holds as the congestion gate.
  • Clarifies that committed voucher rate is a mid-stream ordering signal (not an admission key).
  • Aligns ADR 016’s bondOf consumer description with the updated probe-time prioritization framing.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
adr/003-payments.md Reframes admission/priority around probe-time congestion control and mid-stream voucher-rate ordering.
adr/016-contract-interactions.md Updates the bondOf “Used by” row to match the revised probe-time prioritization semantics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

| Off-chain client/node | CapacityBond | `nodeIdOf(address operator) returns (bytes32 nodeId, bool active)` | Bundled per-operator binding + activity lookup; the canonical operator→NodeId step in the on-chain origin-discovery fallback (intersected with `OriginAssignment.getOrigins(...)` and filtered against `ContentBlacklist.isOriginBlacklisted`). Bundles the binding read and active flag to avoid a second RPC. Storage per [ADR 003 § NodeId-to-Ethereum Binding](003-payments.md#nodeid-to-ethereum-binding) | [ADR 003](003-payments.md#nodeid-to-ethereum-binding), [ADR 022](022-content-discovery.md#adr-022--content-discovery-at-scale) |
| Off-chain client/node | CapacityBond | `isActive(address operator) returns (bool)` | Single-purpose per-operator activity check; consumed by `OriginAssignment.proposeAssignment` / `activateAssignment` / default-open allow-list setters per [ADR 011](011-content-takedown.md#adr-011-content-takedown-and-hash-blacklisting) where callers work with operator addresses and don't need the NodeId binding. Equivalent to the `active` field of `nodeIdOf(operator)` | [ADR 003](003-payments.md#nodeid-to-ethereum-binding), [ADR 011](011-content-takedown.md#adr-011-content-takedown-and-hash-blacklisting) |
| Off-chain client/node | CapacityBond | `bondOf(address operator) returns (uint256)` | Current bonded TOKEN for an operator — voluntary bond plus the vested-and-claimed portion of any Genesis Bond Credit per [ADR 026 § Genesis Bond Credits](026-tokenomics.md#genesis-bond-credits). Used by operator dashboards (`decdn_capacity_bond_amount_token` per [appendix-observability § CapacityBond Metrics](appendix-observability.md#capacitybond-metrics)) and by nodes for the higher-priority admission-lane eligibility check per [ADR 003 § Admission and Priority](003-payments.md#admission-and-priority). Unvested `PendingCredit` is read separately via `pendingCredit(operator)`. | [ADR 003 § Admission and Priority](003-payments.md#admission-and-priority), [ADR 026 § Genesis Bond Credits](026-tokenomics.md#genesis-bond-credits) |
| Off-chain client/node | CapacityBond | `bondOf(address operator) returns (uint256)` | Current bonded TOKEN for an operator — voluntary bond plus the vested-and-claimed portion of any Genesis Bond Credit per [ADR 026 § Genesis Bond Credits](026-tokenomics.md#genesis-bond-credits). Used by operator dashboards (`decdn_capacity_bond_amount_token` per [appendix-observability § CapacityBond Metrics](appendix-observability.md#capacitybond-metrics)) and by nodes to prioritize probe-acceptance for registered-operator (node-to-node) requesters per [ADR 003 § Admission and Priority](003-payments.md#admission-and-priority). Unvested `PendingCredit` is read separately via `pendingCredit(operator)`. | [ADR 003 § Admission and Priority](003-payments.md#admission-and-priority), [ADR 026 § Genesis Bond Credits](026-tokenomics.md#genesis-bond-credits) |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid — verified CapacityBond.sol exposes stakeOf(address operator) returns (uint256) (reads activeStake[operator]) and has no bondOf. The bondOf name was used uniformly across the ADRs, so I renamed all four references (003 §Admission and Priority, the 016 row + surface enumeration, and the appendix-observability metric source) to stakeOf for consistency in 14cbd0a.

Comment thread adr/003-payments.md Outdated
- **Committed voucher rate.** The advertised `rate_per_mb` in `ProbeResponse` / `StreamResponse` is a **floor**, not equality — nodes verify `amount_delta / bytes_delta >= rate_per_mb`. Clients MAY commit at higher rates; nodes MAY use the committed rate as a per-stream priority key, with the premium paid directly via [`FeeRouter.routeSettlement`](#feerouter-integration).
- **Registered node-stake.** `CapacityBond.bondOf(address)` is readable on-chain for any registered operator. Nodes MAY treat addresses with `bondOf >= bond_required(declared_capacity)` ([ADR 026 § Operator economics](026-tokenomics.md#operator-economics)) as eligible for a higher-priority admission lane.
- **Committed voucher rate.** The advertised `rate_per_mb` in `ProbeResponse` / `StreamResponse` is a **floor**, not equality — nodes verify `amount_delta / bytes_delta >= rate_per_mb`. Clients MAY commit at higher rates; nodes MAY use the committed rate as a per-stream priority key for **ordering admitted, in-flight streams** — it is a mid-stream signal (the first `Voucher` arrives only after `StreamResponse{ok: true}`), not an admission key — with the premium paid directly via [`FeeRouter.routeSettlement`](#feerouter-integration).
- **Registered node-stake.** `CapacityBond.bondOf(address)` is readable on-chain, but only for requesters that are themselves registered operators — practically, node-to-node cache-miss probes. Nodes MAY prioritize *probe-acceptance* for addresses with `bondOf >= bond_required(declared_capacity)` ([ADR 026 § Operator economics](026-tokenomics.md#operator-economics)). Stake is not a usable signal for end-client probes (clients are not registered); there, lane eligibility must come from reputation, region, or an allow-list.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid — verified CapacityBond.sol exposes stakeOf(address operator) returns (uint256) (reads activeStake[operator]) and has no bondOf. The bondOf name was used uniformly across the ADRs, so I renamed all four references (003 §Admission and Priority, the 016 row + surface enumeration, and the appendix-observability metric source) to stakeOf for consistency in 14cbd0a.

yigitdot added a commit that referenced this pull request Jun 1, 2026
 review)

Copilot review flagged that `CapacityBond.bondOf(...)` does not exist in the
Solidity contract — the implemented view is `stakeOf(address operator) returns
(uint256)` (reads `activeStake[operator]`). The `bondOf` name was used uniformly
across the ADRs (003 §Admission and Priority, 016 bondOf row + surface
enumeration, appendix-observability metric source) and diverged from the shipped
ABI. Rename all four references to `stakeOf` so the docs match the contract and
stay internally consistent.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@yigitdot
yigitdot force-pushed the feat/446-admission-queueing branch from 14cbd0a to ea6b799 Compare June 1, 2026 19:44
@yigitdot
yigitdot requested a review from alpergundogdu June 1, 2026 20:34
…on control (#446)

Reframe ADR 003 §Admission and Priority to match the protocol's actual congestion semantics: congestion control at probe time (declining to sign has_blob:true, gated by max_probe_holds), committed voucher rate as a mid-stream ordering signal (not an admission key), and registered node-bond (CapacityBond.bondOf) as probe-acceptance prioritization usable only for registered-operator node-to-node requesters. Align the ADR 016 bondOf consumer row to the probe-acceptance framing. The worked reference design stays in issue #446.

Rebuilt on current main (post #768 stake→bond rename and #769 accessor-name alignment); keeps the canonical bondOf name.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@yigitdot
yigitdot force-pushed the feat/446-admission-queueing branch from ea6b799 to 1b941ba Compare June 1, 2026 20:42
@thiras
thiras merged commit 61edab7 into main Jun 2, 2026
19 checks passed
@thiras
thiras deleted the feat/446-admission-queueing branch June 2, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implementation guidance: node admission and queueing policy

3 participants