Repository navigation
Closed
Labels
design:adrNeeds a new or updated ADR in adr/design:consistencyADRs, code or contracts disagree with each otherkind:docsREADME, docs/, runbook, rustdoc or ADR prose only
Description
Summary
Follow-up from PR #769 (the #765 accessor-name sweep). Two automated reviewers (comment-analyzer, code-reviewer) flagged a distinct cluster of stale CapacityBond-surface claims in adr/016-contract-interactions.md that were outside #765's accessor scope and so were deliberately not touched in #769. They are pre-existing drift, not regressions, but they make the genesis-credit interface block and the economics tables contradict the shipped contract.
Source of truth: contracts/src/CapacityBond.sol, contracts/src/interfaces/ICapacityBond.sol, contracts/src/DecdnGovernor.sol. Verify names via cd contracts && forge inspect CapacityBond abi.
Confirmed mismatches (all in adr/016-contract-interactions.md)
Genesis-credit interface block
accrueGenesisVest(address operator)does not exist (interface block ~L275; class diagram L64; "vest accrues viaaccrueGenesisVest" comments ~L252/L271-274). Vesting is computed on-demand — the shipped reads arecurveVested(operator)andclaimableCredit(operator)(plus internal_curveVested), with no publicaccrueGenesisVestentrypoint.claimVestedCreditwrong arity — documented asclaimVestedCredit(address operator)(interface block ~L282; class diagram L65; reentrancy table L708). Shipped signature isclaimVestedCredit() external(CapacityBond.sol:795) — always acts onmsg.sender.PendingCreditstruct fields wrong (~L256-258). ADR:{ uint128 total; uint128 vested; uint64 grantedAt; }. Shipped (CapacityBond.sol:306-310):{ uint128 originalGrant; uint128 claimed; uint64 grantedAt; }. There is no storedvested(it is the derived curve value). Ripples: L267 (pendingCredit(op).total == 0) and L286 (pendingCredit[op].total - pendingCredit[op].vested) inherit the stale field names.bondedAmountis not a shipped field (~L278, L286). The storage mapping isactiveBond(CapacityBond.sol:218), surfaced viabondOf(operator).
Economics / deployment tables
- Deploy-params row (~L337) lists
MAX_CAPACITY_PER_OPERATOR (200 Gbps),age_ramp_months (6), andk/αas CapacityBond constructor params. The shipped constructor (CapacityBond.sol:541-551) takes none of these; capacity bounds are storageminCapacityMbps/maxCapacityMbps, there is nok/αstorage, andage_ramplives onDecdnGovernor. - Tunable-Economics table (~L663-666) lists
α,k,MAX_CAPACITY_PER_OPERATOR,age_ramp_monthsas CapacityBond-governed.k/αare not on-chain-tunable at all (see CapacityBond bond-curve (bond = k × Mbps^α) is unenforced and ungovernable on-chain — decide enforce-vs-document #770);age_ramp_monthsis governed byDecdnGovernor.setAgeRampMonths(:253), not CapacityBond. (PR docs(adr): align CapacityBond accessor names with shipped ABI (#765) #769 already corrected the Governor→CapacityBond setter row at L489 to say so.) - Governor self-governance setters undocumented.
DecdnGovernor.setVoteCapBps(:243) andsetAgeRampMonths(:253) — checkpointed, with events — have no row in ADR 016's Cross-Contract Call Graph / GOVERNANCE_ROLE tables. (Also noted in CapacityBond bond-curve (bond = k × Mbps^α) is unenforced and ungovernable on-chain — decide enforce-vs-document #770.)
Minor / terminology
- Capacity-band constant names — ADR 019/026 describe the band as
[MIN_CAPACITY_PER_OPERATOR, MAX_CAPACITY_PER_OPERATOR]; the shipped names areminCapacityMbps/maxCapacityMbps(CapacityBond.sol:250-251). Used consistently, lower priority.
Scope notes
- Documentation-only; no contract changes. Source of truth is the shipped contract.
- Items 6-7 overlap CapacityBond bond-curve (bond = k × Mbps^α) is unenforced and ungovernable on-chain — decide enforce-vs-document #770 (bond-curve governability + undocumented Governor setters); coordinate so the two PRs don't collide on the same tables.
- Fixing item 3 (struct fields) has a semantic ripple into the slashing-applies-to sentence (L286) — verify the "slashing applies to both X and unvested credit" wording still reads correctly with
originalGrant/claimed.
References
- docs(adr): align CapacityBond accessor names with shipped ABI (#765) #769 (accessor sweep), Sweep ADR contract-accessor names against shipped CapacityBond ABI #765 (originating issue), CapacityBond bond-curve (bond = k × Mbps^α) is unenforced and ungovernable on-chain — decide enforce-vs-document #770 (bond-curve gap)
contracts/src/CapacityBond.sol,interfaces/ICapacityBond.sol,contracts/src/DecdnGovernor.sol
Reacted by github-actions
Metadata
Metadata
Assignees
Labels
design:adrNeeds a new or updated ADR in adr/design:consistencyADRs, code or contracts disagree with each otherkind:docsREADME, docs/, runbook, rustdoc or ADR prose only
Type
Fields
Priority
None yet
Activity
docs(adr): align ADR 016 CapacityBond genesis-credit surface with shi…