Skip to content

Production governance contracts: Governor + TimelockController + ERC20Votes #340

Closed

Description

@alpergundogdu

Summary

PR #237 ships the production v3 contract surface (StakingRegistry, StablePaymentChannel, SlashJudge, BuybackBurner, ContentBlacklist, WatchtowerEscrow per ADR 016) but does not include the DAO governance plumbing: Governor, TimelockController, and ERC20Votes-extended TOKEN. The contracts that PR #237 lands have parameter setters gated by AccessControl roles that will, in production, be held by TimelockController — but the Timelock contract doesn't exist yet, and neither does the Governor that proposes against it.

This issue tracks the follow-up PR that adds the governance layer, gated on ADR 026 / 029 / 030 stabilizing in #338.

Why poc-blocking

Per ADR 023, the wiring layer in crates/node selects between PoC and production for each contract via #[cfg]-free runtime selectors. The PoC path uses an admin-key holder; the production path needs a deployed Governor + TimelockController to bind to. The selectors cannot be exercised against production without these contracts existing — meaning PoC end-to-end tests of "production wiring path" cannot be authored, and any mainnet-shaped integration test is blocked.

Scope

Per ADR 009 (production governance) + ADR 026 §11 (six FeeRouter shares + boostFloor governable) + ADR 029 (adaptive parameters bounded by §11) + ADR 030 (multisig fast-track caps + standard governance proposal path):

  • TOKEN extended with OZ ERC20Votes so historical voting weight is queryable. Note ADR 026 §9 specifies vote source is VotingEscrow.balanceOfAt, not TOKEN.getPastVotes — but the underlying TOKEN still needs ERC20Votes for downstream wallet/dapp compatibility, even though Governor reads from the escrow.
  • VotingEscrow contract per ADR 026 §4 (non-transferable, max 4y lock, no early exit, balanceOfAt / totalSupplyAt checkpoints). This is where Governor reads voting weight from.
  • DecdnGovernor extending OZ Governor, GovernorSettings, GovernorVotes, GovernorVotesQuorumFraction, GovernorTimelockControl. Vote source: VotingEscrow. Defaults per ADR 026 §9: 7-day vote, 0.1% proposal threshold, 4% quorum, ≈9-day total latency.
  • TimelockController with 48-hour delay per ADR 009. Owns the parameter-setter roles on the v3 contracts. Custodian of the protocol-treasury 5% bucket per ADR 026 §2.
  • SafetyReserve payout authorization wiring per ADR 026 §5 (Governor + emergency-multisig fast-track within hard caps per ADR 030 §1).

Dependencies

Acceptance

  • forge test covers governance lifecycle: propose → vote → queue → execute, against a mock target on each governable parameter listed in ADR 016 §"Governance-Controlled Parameters".
  • Emergency-multisig fast-track paths (per ADR 009 + ADR 026 §5 + ADR 030 §1) are wired with hard-cap reverts when caps are exceeded.
  • Deploy script (per ADR 016 §2 dependency order) deploys the full stack and atomically transfers the parameter-setter roles from deployer to Timelock.
  • The PoC wiring layer in crates/node can select the production governance path in tests (even if the PoC default remains admin-key).

Out of scope

  • Governance UI / proposal dashboard (frontend work).
  • Off-chain proposal-discussion forum.
  • Vote-mirroring policy for SveToken (ADR 028.1) — that's its own deferred ADR.

Related

Activity

  1. added
    kind:feature
    on Apr 30, 2026
  2. added
    status:blocked
    on May 16, 2026
  3. thiras commented on May 28, 2026

    @thiras
    Contributor

    Closing — most of this shipped, and the remaining items have pivoted enough that fresh issues are clearer than reviving this thread.

    What landed:

    • DecdnGovernor (contracts/src/DecdnGovernor.sol) extending Governor, GovernorCountingSimple, GovernorTimelockControl — 7-day vote, 0.1% proposal threshold, 4% quorum, 48h Timelock.
    • TimelockController wired via the OZ stock contract (no subclass needed) through the Governor constructor.
    • SafetyReserve (contracts/src/SafetyReserve.sol) with EMERGENCY_MULTISIG_ROLE, fastTrackAppeal, and MAX_APPEAL_RESTITUTION hard-cap reverts (RestitutionExceedsCap).
    • Bounds-enforcement tests on every governable setter in FeeRouter, CapacityBond, DecdnGovernor, PublisherRegistry, SafetyReserve.

    What changed vs. this issue's scope:

    • VotingEscrow and ERC20Votes are intentionally not used. Per ADR 036, voting weight is derived from FeeRouter.bytesInWindow × age_ramp × per-operator cap, not from per-account checkpoint structures. Governor reads from FeeRouter/CapacityBond directly — see DecdnGovernor.sol:21-23. This supersedes the §9 ve-token model assumed in the original scope.
    • The "PoC wiring layer in crates/node selector for production governance" item is moot. ADR 023 has been demoted to appendix-poc-production-seams.md, and the Rust node consumes FeeRouter/CapacityBond views via crates/incentive — it doesn't bind to Governor. Timelock-holds-GOVERNANCE_ROLE is a deploy-script concern, not a runtime selector.

    Genuinely open work, split off:

    Two smaller verifications worth filing if not already covered:

    • Confirm 12-month sunset on EMERGENCY_MULTISIG_ROLE per ADR 016 line 687 is wired.
    • Confirm ContentBlacklist emergency surface (emergencyAdd/emergencyAddOrigin/suspendRegionalBody) exists with 14-day expiry per ADR 016.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:featurestatus:blocked

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions