Repository navigation
Description
Summary
The ADRs cite several CapacityBond accessor names that don't match the shipped Solidity ABI in contracts/src/CapacityBond.sol. PR #756 fixed one instance (bondOf → stakeOf, which has no such function in the contract); a review pass on that PR surfaced more of the same drift on adjacent/unchanged lines. This issue tracks a systematic sweep so the docs match the compiled contract — an implementer/indexer copying these names out of the ADRs would target nonexistent selectors.
Source of truth is the shipped contract; it is named CapacityBond but retains stake-flavored accessor names from its StakingRegistry lineage.
Confirmed mismatches
1. declaredCapacityMbps → declaredMbps
No declaredCapacityMbps accessor exists. The contract exposes the public mapping declaredMbps (CapacityBond.sol:242, auto-getter declaredMbps(address)).
adr/appendix-observability.md:196— metricdecdn_capacity_bond_declared_mbpsSource celladr/016-contract-interactions.md:537—getActiveNodes(...)tuple field name
2. getFirstBondedAt(...) returns (uint256) → firstBondedAt(...) returns (uint64)
No getFirstBondedAt exists; the contract and interface implement firstBondedAt(address operator) returns (uint64) (CapacityBond.sol:1448, interfaces/ICapacityBond.sol:21). Both the name (get prefix) and the return type (uint256 vs uint64) are wrong.
adr/003-payments.md:681— interface block:function getFirstBondedAt(address ethAddress) external view returns (uint256);adr/016-contract-interactions.md:511— off-chain read API rowadr/008-reputation.md:240— prose:CapacityBond.getFirstBondedAt(operator)
3. CapacityBond surface enumeration (adr/016-contract-interactions.md:239)
The list reads (register, unbond, slash, capacityAt, firstBondedAt, stakeOf, slashedAtEpoch, recordSettlement, bindNodeId / reclaimNodeId, isActive). Spot checks: register → contract exposes registerNode (CapacityBond.sol:861); no function unbond or function capacityAt was found (only setUnbondingPeriod, plus recordSettlement/pendingCredit/stakeOf/firstBondedAt/isActive/slashedAtEpoch). These entries need reconciliation against the actual entrypoints.
Scope
- Sweep every ADR-cited
CapacityBond(ideally all-contract) accessor name + return type against the shipped ABI; correct the docs to match. - Apply the CONTRIBUTING § ADR cross-reference checklist (grep each renamed term repo-wide) so fixes stay internally consistent — same discipline used for
bondOf→stakeOfin docs(adr-003): correct §Admission and Priority to probe-time congestion control (#446) #756. - Documentation-only; no contract changes (unless governance prefers adding aliases — a separate decision).
References
- docs(adr-003): correct §Admission and Priority to probe-time congestion control (#446) #756 — fixed
bondOf→stakeOf(the precedent / first instance) contracts/src/CapacityBond.sol,contracts/src/interfaces/ICapacityBond.sol— source of truth
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
github-actions commentedon Jun 1, 2026
🎯 Triage report
ADR documentation has drifted from the shipped
CapacityBondSolidity ABI — three confirmed mismatch classes across 6+ file locations: wrong accessor names (declaredCapacityMbps,getFirstBondedAt,register,unbond,capacityAt) and a wrong return type (uint256vsuint64). The precedent fix is #756 (bondOf→stakeOf); this is a systematic follow-up sweep. Scope is documentation-only; source of truth iscontracts/src/CapacityBond.sol+interfaces/ICapacityBond.sol.📊 Assessment
consistency,ADRaddedbug,documentation,critical,technical; addedconsistency(name drift across ADR set) andADR(directly modifies ADR files)🔗 Similar issues
💡 Notes and suggestions
Suggested sub-task checklist:
declaredCapacityMbps→declaredMbpsadr/appendix-observability.md:196— update Source cell in metric tableadr/016-contract-interactions.md:537— updategetActiveNodes(...)tuple field namedeclaredCapacityMbpsto catch any additional occurrencesgetFirstBondedAt→firstBondedAt,uint256→uint64adr/003-payments.md:681— fix interface block function signature (name + return type)adr/016-contract-interactions.md:511— fix off-chain read API rowadr/008-reputation.md:240— fix prose referencegetFirstBondedAtanduint256in context offirstBondedAtrepo-wideCapacityBondsurface enumeration atadr/016-contract-interactions.md:239register→registerNodeunbond(no such function; onlysetUnbondingPeriod)capacityAt(no such function)bindNodeId/reclaimNodeIdagainst contract ABIforge inspect CapacityBond abi | jq '[.[].name] | sort'Workflow tip: Per CONTRIBUTING §ADR cross-reference checklist, grep each renamed term repo-wide before filing the PR to catch any occurrences in appendices, architecture.md, or other ADRs not yet listed above. The
bondOf→stakeOffix in #756 is the established precedent for the PR structure.ABI extraction command to generate ground truth:
Add this agentic workflows to your repo
To install this agentic workflow, run
yigitdot commentedon Jun 1, 2026
Correction — the
bondOfframing in this issue is superseded by #768.#768 (
refactor(contracts): rename stake→bond on CapacityBond surface) renamed the contract accessorstakeOf→bondOf. On current main,CapacityBond.bondOf(address)exists (contracts/src/CapacityBond.sol:1433) and is the canonical name. So the premise here ("bondOfdoesn't exist") and the #756 precedent (bondOf→stakeOf) are both inverted —bondOfis correct, and the #756 rename was reverted. Please disregard the bond/stake-naming portion of this issue.The two independent findings still stand on current main (re-verified post-#768):
declaredCapacityMbps→declaredMbps. NodeclaredCapacityMbpsaccessor; the contract exposes the public mappingdeclaredMbps(CapacityBond.sol:242). Refs:adr/appendix-observability.md,adr/016-contract-interactions.md(getActiveNodestuple field).getFirstBondedAt(...) returns (uint256)→firstBondedAt(...) returns (uint64). NogetFirstBondedAt; the contract/interface implementfirstBondedAt(address) returns (uint64)(CapacityBond.sol:1448,interfaces/ICapacityBond.sol). Refs:adr/003-payments.md,adr/016-contract-interactions.md,adr/008-reputation.md.Narrowing this issue to those two (plus a general ADR-vs-ABI accessor sweep). Line numbers above predate any post-#768 shifts — re-grep before editing.
docs(adr): align CapacityBond accessor names with shipped ABI (#765) (#…