Repository navigation
docs(adr-003): correct §Admission and Priority to probe-time congestion control (#446) - #756
Conversation
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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_blobsigning andmax_probe_holdsas the congestion gate. - Clarifies that committed voucher rate is a mid-stream ordering signal (not an admission key).
- Aligns ADR 016’s
bondOfconsumer 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) | |
There was a problem hiding this comment.
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.
| - **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. |
There was a problem hiding this comment.
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.
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]>
14cbd0a to
ea6b799
Compare
…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]>
ea6b799 to
1b941ba
Compare
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):
StreamRequestcarries no voucher; the firstVoucherarrives mid-stream, afterStreamResponse{ok:true}(ADR 005). The committed per-MB rate is a mid-stream signal for ordering in-flight streams, not an admission key.StreamResponse{ok:false}after a positive probe is slashable regardless of error code. The on-chain verifier sees only the signedokbool; theerrorfield is unsigned (ADR 014). So it is never a congestion lever.has_blob:true, gated by themax_probe_holdshold 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
mainafter #768 (refactor(contracts): rename stake→bond on CapacityBond surface). The canonical accessor name isbondOf; this PR keeps it and does not alter contract naming — it only reframes the admission/priority semantics. (An earlier revision of this branch briefly renamedbondOf→stakeOfin response to a review comment; #768 madebondOfcanonical, 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;bondOfterminology).adr/016-contract-interactions.md—bondOfconsumer 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