Repository navigation
Description
Summary
DecdnGovernor.t.sol is explicit in its header (L17-18) that it skips the full propose → vote → queue → execute dance and only exercises vote-weight snapshot semantics. The 11 tests there are read-only views or direct setter-bounds called under vm.prank(governance). We have no end-to-end coverage that the production governance path — proposal threshold check, voting window, quorum, Timelock queue, Timelock delay, execute, parameter actually changes on the target contract — works for any of our governable parameters.
This means a regression in Governor wiring (wrong vote source, wrong quorum denominator, missing _executor() override, wrong Timelock binding) could ship undetected.
Why prod-blocking
Mainnet/Sepolia readiness requires confidence the on-chain governance loop actually closes. Bounds checks alone don't catch:
- Governor reading vote weight from the wrong source at the wrong timepoint.
_executor()returning the wrong address (proposals execute from Governor, not Timelock).proposalNeedsQueuing/state()transitions misbehaving with the served-bytes weight source.- Cross-contract
GOVERNANCE_ROLEnot actually held by Timelock at deploy.
Scope
One new contracts/test/GovernanceLifecycle.t.sol with table-driven cases covering every governable setter listed in ADR 016 §Governance-Controlled Parameters:
FeeRouter (5): setShares, setSafetyReserve, setBuybackBurner, setTreasury, setWindowEpochs
CapacityBond (5): setAlpha, setK, setMaxCapacityPerOperator, setAgeRampMonths, setUnbondingPeriod
DecdnGovernor self-params (2): setVoteCapBps, setAgeRampMonths
ContentBlacklist (5): addHash, removeHash, addOrigin, removeOrigin, registerRegionalBody
SafetyReserve (1): setMaxAppealRestitution
PublisherRegistry (2): setMaxNamespacesPerPublisher, setNamespaceTransferTimelock
For each parameter, two test paths:
- Happy path: seed
FeeRouter.bytesPerEpochso a test proposer crosses the 0.1% threshold;propose()→ fast-forward pastVOTING_DELAY→castVote(For)from accounts whose summed weight crosses 4% quorum → fast-forward pastVOTING_PERIOD→queue()→ fast-forward past Timelock 48h delay →execute()→ assert new value on target. - Out-of-bounds revert path: same flow with a value outside the ADR-bounded range; assert
execute()reverts withParamOutOfBounds(or contract-specific error) and target state is unchanged.
Acceptance
- New
GovernanceLifecycle.t.solexercises propose → vote → queue → execute against every parameter above. - Each parameter has both a happy-path test (new value lands on target) and an out-of-bounds revert test.
GOVERNANCE_ROLEon each target is held by Timelock in test setup, mirroring production deploy ordering (this anticipates issue Production DeployProtocol.s.sol with atomic deployer→Timelock role handoff #694 but can be set up manually for now).forge coverageforDecdnGovernor.soland each target's setter functions reaches 100% line + branch coverage on the lifecycle paths.
Out of scope
- Emergency-multisig fast-track lifecycle (separate flow; tested in
SafetyReserve.t.soland can stay there). - Governance UI / off-chain proposal indexers.
- Vote-source unit tests —
DecdnGovernor.t.solalready covers those.
Related
- ADR 009 (governance model)
- ADR 016 §Governance-Controlled Parameters
- ADR 036 (served-bytes voting weight)
- Production governance contracts: Governor + TimelockController + ERC20Votes #340 (parent — closed)
- Production DeployProtocol.s.sol with atomic deployer→Timelock role handoff #694 (deploy script — supplies the Timelock role-handoff this test suite assumes)
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
github-actions commentedon May 28, 2026
🎯 Triage report
This issue requests a new
GovernanceLifecycle.t.solFoundry test suite that covers the full propose → vote → queue → execute flow for all 20 governable parameters acrossFeeRouter,CapacityBond,DecdnGovernor,ContentBlacklist,SafetyReserve, andPublisherRegistry. ExistingDecdnGovernor.t.solexplicitly skips this lifecycle, leaving wiring regressions (wrong vote source, bad_executor(), Timelock misrouting) undetectable. Markedprod-blockingas this directly gates Mainnet/Sepolia readiness.📊 Assessment
enhancement,technical,testing,prod-blocking(already applied)highpriority label would also fit given explicit prod-blocking statuscontracts/test/.🔗 Similar issues
💡 Notes and suggestions
Key implementation risks to address:
_executor()wiring —DecdnGovernormust override_executor()to return the Governor itself (not Timelock) forGovernorTimelockControl. A bug here causesexecute()to revert silently or execute from the wrong address. The test should assertgovernor.timelock() == address(timelockController)and thatexecute()succeeds only when called by the Governor.Vote weight snapshot timing — ADR 036 uses
FeeRouter.bytesPerEpochas the vote-weight source. The test must callvm.roll()or equivalent to advance past theVOTING_DELAYsnapshot point after seedingbytesPerEpoch, or proposals will see zero weight. Usegovernor.proposalSnapshot(id)to confirm the correct block.Quorum denominator —
GovernorVotesQuorumFractionusestoken.getPastTotalSupply(snapshot)as denominator. If the test fixture doesn't mint enough tokens to a voting account, the 4% quorum will never be met. Seed multiple voter accounts totalling > 4% of total supply.Timelock role setup — Each target contract's
GOVERNANCE_ROLEmust be granted toaddress(timelockController)insetUp(), not toaddress(governor). This mirrors the production deploy ordering described in ADR 016 §2 and is the exact prerequisite Production DeployProtocol.s.sol with atomic deployer→Timelock role handoff #694 formalizes.Out-of-bounds revert path — When
execute()triggers a reverting call, the Governor will catch and bubble the revert. Assert withvm.expectRevert(abi.encodeWithSelector(ParamOutOfBounds.selector, ...))before callingexecute(), not before the inner setter.Suggested sub-task checklist:
_proposeVoteQueueExecute(address target, bytes calldata callData)helper to avoid 40× duplicated boilerplatesetUp()— deploy full stack (Token, FeeRouter, CapacityBond, Governor, Timelock, SafetyReserve, ContentBlacklist, PublisherRegistry), grant roles, seedbytesPerEpochforge coveragegate — confirm 100% line+branch on lifecycle pathsDependency note: #694 (deploy script with Timelock role-handoff) is a soft dependency. The issue says roles can be set up manually in
setUp()for now, so #693 is not blocked.Add this agentic workflows to your repo
To install this agentic workflow, run
test(contracts): add governance lifecycle suite (closes #693) (#695)