Skip to content

ADR 016: align CapacityBond genesis-credit surface + economics tables with shipped contract #771

Closed

Description

@thiras

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

  1. accrueGenesisVest(address operator) does not exist (interface block ~L275; class diagram L64; "vest accrues via accrueGenesisVest" comments ~L252/L271-274). Vesting is computed on-demand — the shipped reads are curveVested(operator) and claimableCredit(operator) (plus internal _curveVested), with no public accrueGenesisVest entrypoint.
  2. claimVestedCredit wrong arity — documented as claimVestedCredit(address operator) (interface block ~L282; class diagram L65; reentrancy table L708). Shipped signature is claimVestedCredit() external (CapacityBond.sol:795) — always acts on msg.sender.
  3. PendingCredit struct 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 stored vested (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.
  4. bondedAmount is not a shipped field (~L278, L286). The storage mapping is activeBond (CapacityBond.sol:218), surfaced via bondOf(operator).

Economics / deployment tables

  1. Deploy-params row (~L337) lists MAX_CAPACITY_PER_OPERATOR (200 Gbps), age_ramp_months (6), and k/α as CapacityBond constructor params. The shipped constructor (CapacityBond.sol:541-551) takes none of these; capacity bounds are storage minCapacityMbps/maxCapacityMbps, there is no k/α storage, and age_ramp lives on DecdnGovernor.
  2. Tunable-Economics table (~L663-666) lists α, k, MAX_CAPACITY_PER_OPERATOR, age_ramp_months as 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_months is governed by DecdnGovernor.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.)
  3. Governor self-governance setters undocumented. DecdnGovernor.setVoteCapBps (:243) and setAgeRampMonths (: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

  1. Capacity-band constant names — ADR 019/026 describe the band as [MIN_CAPACITY_PER_OPERATOR, MAX_CAPACITY_PER_OPERATOR]; the shipped names are minCapacityMbps/maxCapacityMbps (CapacityBond.sol:250-251). Used consistently, lower priority.

Scope notes

References

Activity

  1. added
    kind:docs
    design:consistency
    design:adr
    on Jun 1, 2026
  2. self-assigned this
    on Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

design:adrdesign:consistencykind:docs

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions