Repository navigation
docs(adr): align CapacityBond accessor names with shipped ABI (#765) - #769
Conversation
Sweep every ADR-cited CapacityBond accessor/setter/event/return-type
against the shipped contract surface (contracts/src/CapacityBond.sol +
interfaces/ICapacityBond.sol), which is the source of truth for the ABI.
Renames / reconciliations (all verified absent/present via
`forge inspect CapacityBond abi`):
- declaredCapacityMbps -> declaredMbps (mapping getter)
- getFirstBondedAt(...)uint256 -> firstBondedAt(...)uint64
- capacityAt(operator[, ts]) -> declaredMbps(operator) (no such fn)
- register(declaredMbps) -> bond(...) + declareMbps(...) ;
registerNode(...) is a separate NodeId binding
- CapacityClaimed event -> Bonded + MbpsDeclared
- lastSettlementAt mapping -> event-sourced SettlementRecorded(operator)
(recordSettlement only emits; no SSTORE);
getActiveNodes tuple corrected to real NodeInfo fields
- setAlpha/setK/setAgeRampMonths -> removed (bond-curve/age-ramp not
on-chain-tunable in this revision)
- setMaxCapacityPerOperator -> setMaxCapacityMbps
- totalVotingWeightAt(ts) -> removed (never shipped; totals are FeeRouter-derived)
Documentation-only; no contract changes. Files: adr/003, 008, 016, 019,
024, 026, 036, appendix-{observability,l2-deployment,operator-key-rotation}.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request updates several Architecture Decision Records (ADRs) to reflect changes in the CapacityBond contract interface. Specifically, the single register(declaredMbps) function has been split into separate bond(amount) and declareMbps(mbps) steps, and the lastSettlementAt state variable has been replaced by an event-sourced SettlementRecorded event. Additionally, capacityAt has been renamed to declaredMbps, and getFirstBondedAt has been renamed to firstBondedAt returning a uint64. The review feedback suggests updating the documentation and class diagrams to correctly reflect the two-step unbonding process involving requestUnbond and unbond.
|
Filed the flagged bond-curve tunability gap as #770. Scope correction discovered while filing: |
There was a problem hiding this comment.
Pull request overview
This PR updates ADR documentation to match the shipped CapacityBond Solidity ABI (accessor/setter/event names and relevant return types), avoiding references to selectors that do not exist on-chain.
Changes:
- Renames ADR references from drifted
CapacityBondaccessors/events to the canonical shipped names (e.g.,declaredMbps,firstBondedAt). - Reconciles registration flow docs from
register(declaredMbps)to the shippedbond(...)+declareMbps(...)pattern (docs-only). - Updates settlement-recency documentation to reflect
recordSettlementas an event emit (SettlementRecorded) rather than an on-chain timestamp mapping.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| adr/appendix-operator-key-rotation.md | Updates rebonding procedure to use bond(...) + declareMbps(...) instead of a nonexistent register(...). |
| adr/appendix-observability.md | Fixes metric source accessor from declaredCapacityMbps to shipped declaredMbps. |
| adr/appendix-l2-deployment.md | Corrects settlement overhead description to reflect SettlementRecorded event-only behavior. |
| adr/036-served-bytes-voting-weight.md | Removes references to nonexistent totalVotingWeightAt(ts) and aligns declared-capacity wording to declaredMbps. |
| adr/026-tokenomics.md | Updates bond lifecycle docs to the shipped bond(...) + declareMbps(...) entrypoints and emitted events. |
| adr/024-account-abstraction.md | Updates operator bond-management bullet to new entrypoints (but needs a small correction re: unbonding flow). |
| adr/019-node-onboarding.md | Updates onboarding step to bond(...) + declareMbps(...) (but “deposit/refund” wording needs correction). |
| adr/016-contract-interactions.md | Sweeps contract inventory/call-graph/read-API references to shipped names and settlement event sourcing (but reentrancy table misses requestUnbond). |
| adr/008-reputation.md | Updates cold-start bonus check to use shipped firstBondedAt. |
| adr/003-payments.md | Updates ICapacityBond excerpt to firstBondedAt(address) returns (uint64). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… review) Address review feedback (gemini-code-assist, Copilot) on the CapacityBond surface docs: - requestUnbond(amount) starts the 14-day window; unbond() only reclaims after it elapses. Fix 024 bond-management bullet and 016 class diagram (add requestUnbond), and clarify the 016 external-call table's unbond() row. - 016 external-call table claimed completeness but omitted requestUnbond, which makes external calls (token.burn / safeTransfer via _forfeitUnvestedCredit). Add the row. - 019: drop the atomic "deposit/refund" wording — the shipped surface has no register-style refund; tier change is declareMbps + bond / requestUnbond+unbond (bond reduction is subject to the unbonding window). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…rift (PR #769 review) Address review findings (comment-analyzer, code-reviewer): - 016: the Governor→CapacityBond row wrongly claimed age_ramp months is not on-chain-tunable. It is governable via DecdnGovernor.setAgeRampMonths (not CapacityBond). Corrected; only k/α are un-tunable in this revision (#770). - 026: drop the residual atomic "deposit/refund" tier-change sentence that contradicted the 019 fix and the bond()+declareMbps bullet above it. - 016: two bare `register` references the earlier sweep missed (fund-flow inflow row, deployment-atomicity note) -> bond(amount) / bond+registerNode. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Ran a multi-agent review (doc-accuracy + general). Two findings were defects this PR introduced/left adjacent to its edits — fixed in ad710e9:
The reviewers also surfaced a separate pre-existing drift cluster (genesis-credit interface block: phantom |
…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]>
…on control (#446) (#756) 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]>
Closes #765.
Systematic sweep of every ADR-cited
CapacityBondaccessor/setter/event/return-type against the shipped Solidity surface (contracts/src/CapacityBond.sol+interfaces/ICapacityBond.sol), which is the source of truth for the ABI. Follows the precedent of #756 (bondOf→stakeOf). Documentation-only; no contract changes.Verified against
forge inspect CapacityBond abi— every name introduced exists in the compiled ABI; every name removed is genuinely absent.Rename / reconciliation map
declaredCapacityMbps(operator)declaredMbps(operator)getFirstBondedAt(addr) returns (uint256)firstBondedAt(addr) returns (uint64)capacityAt(operator[, ts])declaredMbps(operator)register(declaredMbps)bond(...)+declareMbps(...)registerNode(...)is a separate NodeId-binding call (ADR 019/024/026/key-rotation)CapacityClaimedeventBonded+MbpsDeclaredlastSettlementAt[operator]mappingSettlementRecorded(operator)eventrecordSettlementonly emits (no SSTORE);getActiveNodestuple corrected to the realNodeInfofieldssetAlpha,setK,setAgeRampMonthssetMaxCapacityPerOperatorsetMaxCapacityMbpstotalVotingWeightAt(ts)totalBytesInWindow)Two stale premises in the issue (corrected here)
bondOf→stakeOfframing is inverted — PR refactor(contracts): rename stake→bond on CapacityBond surface #768 (8caa4ee) renamed stake→bond after the issue was filed, so the contract exposesbondOfand the existingbondOfADR references are already correct. NostakeOfwork.unbond()does exist (CapacityBond.sol:671) — the issue's claim that it's missing is wrong; left in place.The bond-curve coefficients (
k,α) andage_rampmonths are not on-chain-tunable in the shipped contract (thedeclareMbpscomment states the bond-curve coupling "is not enforced at the contract layer in this revision"). This PR removes the phantomsetAlpha/setK/setAgeRampMonthssetters from the docs; whether to add that governance is a separate contract/ADR decision.Verification
cd contracts && forge inspect CapacityBond abi— all remaining ADR names ∈ ABI ✅adr/_history/) ✅pre-commit run --all-filesclean (markdownlint + ADR reference hygiene) ✅🤖 Generated with Claude Code