Skip to content

CapacityBond bond-curve (bond = k × Mbps^α) is unenforced and ungovernable on-chain — decide enforce-vs-document #770

Closed

Description

@thiras

Summary

The capacity-bond curve bond_required(Mbps) = k × Mbps^α is documented as a governable economic mechanism, but the shipped CapacityBond neither stores its parameters, enforces the coupling, nor exposes setters for it. This is a design-vs-implementation gap surfaced while sweeping accessor names for #765 (PR #769); it was deliberately left out of that documentation-only PR.

Evidence (shipped contract is the source of truth)

  • contracts/src/CapacityBond.sol:50 — comment: the bond-curve coupling bond = k × Mbps^α is "a future enforcement PR."
  • contracts/src/CapacityBond.sol:239 — comment: the coupling activeBond ≥ k × Mbps^α is not enforced at the contract layer in this revision.
  • bond(uint256 amount) accepts any amount (amount > 0); the only capacity-related on-chain checks are activeBond ≥ minBond (at registerNode) and the [minCapacityMbps, maxCapacityMbps] band (at declareMbps).
  • No k / α storage, no setAlpha / setK, and no on-chain bondRequired(mbps) view exist anywhere in contracts/src/. bond_required(...) is purely an off-chain/conceptual computation.

Why this matters (the contradiction)

  • ADR 026 § Capacity-bond curve specifies the curve and treats both coefficients as governable:
    • bond_required(Mbps) = k × Mbps^α (026:127)
    • α (exponent): default 1.2, governable range [1.0, 1.8] (026:132)
    • k (bond constant): default 12.6, bounded (026:133)
    • "α-tuning is the lever" for the supply-lockup design tension (026:168)
  • CLAUDE.md (repo root): "the on-chain surface ships at full production shape with governance-tunable economics from day one" → [ADR 016 § Tunable Economics].

So the canonical tokenomics ADR and the project's stated production-shape guarantee both assume α/k are on-chain, enforced, and governance-tunable. The shipped contract makes them off-chain advisory and immutable. An operator can bond far less than bond_required(declaredMbps) for a high tier, and governance has no lever to retune the curve.

Decision needed (pick one; either resolves the contradiction)

A. Implement + make governable on-chain. Add fixed-point k/α storage, a bondRequired(mbps) view (likely in BondMath to limit CapacityBond bytecode), enforce activeBond ≥ bondRequired(declaredMbps) at registerNode / declareMbps, and add setAlpha/setK (GOVERNANCE_ROLE) with the ADR-026 bounds. Restores "governance-tunable from day one."

  • ⚠️ EIP-170 constraint: CapacityBond.sol is already near the 24,576-byte limit (see project memory / --sizes CI gate). Pow/exp math + storage + setters add bytecode — favor a BondMath library and/or trimming elsewhere.

B. Formally scope it as off-chain/advisory for this revision. Amend ADR 026 § Capacity-bond curve and the CLAUDE.md "governance-tunable from day one" claim to state that, in the shipped revision, the curve is an off-chain advisory for operator bond-sizing; on-chain enforcement is limited to minBond + the capacity band, with curve enforcement + α/k governance deferred to a named future ADR/PR.

Adjacent doc cleanup (small, discovered in #769)

DecdnGovernor does ship governable setVoteCapBps (DecdnGovernor.sol:243) and setAgeRampMonths (:253) — checkpointed, with AgeRampMonthsUpdated events. (PR #769 corrected ADR 016, which had wrongly attributed setAgeRampMonths to CapacityBond.) These Governor self-governance setters are not documented in ADR 016's Cross-Contract Call Graph / GOVERNANCE_ROLE tables. Whichever option above is chosen, add a Governor self-setter row to ADR 016 so the vote-weight tunables (voteCapBps, ageRampMonths, windowEpochs) are surfaced.

Note: age_ramp itself is not part of the gap — it is fully implemented and governable on DecdnGovernor. Only the capacity-bond curve (k, α) is unenforced/ungovernable.

References

Activity

  1. self-assigned this
    on Jun 1, 2026
  2. added
    kind:docs
    design:adr
    on Jun 1, 2026
  3. added
    design:consistency
    design:economics
    prio:high
    design:missing-decision
    on Jun 1, 2026
  4. github-actions commented on Jun 1, 2026

    @github-actions

    🎯 Triage report

    This issue documents a concrete design-vs-implementation gap: ADR 026 and CLAUDE.md both promise governance-tunable capacity-bond curve parameters (k, α) from day one, but the shipped CapacityBond contract accepts any amount > 0 — there is no on-chain bondRequired(mbps) view, no storage for k/α, and no governance setters. The issue is well-evidenced with contract line references and a binary decision framing (implement on-chain vs. formally defer). The adjacent ADR 016 doc gap (Governor self-setter rows for voteCapBps / ageRampMonths / windowEpochs) is a small, separable cleanup.

    📊 Assessment

    Dimension Value Reasoning
    Type Task Requires either a contract implementation or an ADR amendment — a bounded, decidable unit of work
    Labels economics, consistency, missing-decision, high (added) Core tokenomics invariant broken; ADR/implementation inconsistency; decision not yet recorded; high priority given the "governance-tunable from day one" project guarantee
    Coding agent Needs more info A maintainer must first pick Option A or B. Option B (ADR amendment only) would then be suitable for a coding agent. Option A (on-chain enforcement) is high-complexity — EIP-170 headroom on CapacityBond, fixed-point pow/exp in BondMath, governance plumbing — and should be reviewed by a human before delegation.

    🔗 Similar issues

    💡 Notes and suggestions

    Decision gate first. This issue cannot be started until a maintainer chooses Option A or B. A comment or label (e.g. decision: option-a) on this issue would unblock any coding agent assignment.

    If Option A (on-chain enforcement):

    • Run FOUNDRY_PROFILE=ci forge build --sizes before and after to track bytecode delta on CapacityBond. The CI --deny warnings gate will fail if the contract crosses 24,576 bytes.
    • Fixed-point exponentiation (Mbps^α with α ∈ [1.0, 1.8]) in Solidity requires care — consider a lookup table or integer approximation in BondMath rather than a full exp/log implementation, to minimize bytecode and gas.
    • setAlpha/setK setters must validate inputs against the ADR 026 bounds (α ∈ [1.0, 1.8], k bounded) before storing; emit events for off-chain indexers.
    • bondRequired(mbps) as a pure/view on BondMath keeps CapacityBond lean and is already the pattern the issue author recommends.
    • Enforcement sites: registerNode (initial) and declareMbps (on capacity change); consider whether a grace period is needed for existing operators on the upgrade path.

    If Option B (document as off-chain advisory):

    • Amend ADR 026 § Capacity-bond curve with explicit "shipped revision" scoping — state that k/α are off-chain advisory for operator bond-sizing, on-chain enforcement limited to minBond + capacity band, curve enforcement deferred to a named future ADR.
    • Update CLAUDE.md's "governance-tunable from day one" language (or add a footnote) so the claim is accurate for the shipped surface.
    • Add the Governor self-setter rows (voteCapBps, ageRampMonths, windowEpochs) to ADR 016 Cross-Contract Call Graph as a small adjacent cleanup (could be a single PR with the ADR 026 amendment).

    Sub-tasks checklist (applies to either option):

    • Maintainer records decision (Option A or B) in this issue
    • ADR 026 § Capacity-bond curve updated to reflect chosen approach
    • ADR 016 Governor self-setter rows added (voteCapBps, ageRampMonths, windowEpochs)
    • (Option A only) BondMath gains bondRequired(uint256 mbps) view with fixed-point k/α
    • (Option A only) CapacityBond gains k/α storage + setAlpha/setK (GOVERNANCE_ROLE)
    • (Option A only) registerNode / declareMbps enforce activeBond ≥ bondRequired(declaredMbps)
    • (Option A only) forge build --sizes passes under FOUNDRY_PROFILE=ci

    Generated by Agentic Triage for issue #770 · sonnet46 524.8K · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

design:adrdesign:consistencydesign:economicsdesign:missing-decisionkind:docsprio:high

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions