When a module limits what governance can do with it, a cap on what a treasury pays out per week or a list of addresses a reserve is allowed to pay, the easy place for that limit is the module’s params. The authority for MsgUpdateParams is then the same gov account the limit is meant to hold back.
That came up in the Luggom thread here in October, and the fix was in their repo the same day. I think it’s general enough for its own topic, because it’s easy to miss when you read the module on its own.
What x/gov does when a proposal passes
In SDK v0.53.8, the version Gaia v29 runs, the gov EndBlocker tallies the vote and, if it passed, opens one cached context and runs the proposal’s messages in the order they were submitted (abci.go L166-L217). Every message sees what the ones before it wrote. If one fails, nothing is written and the proposal is marked failed.
So a proposal with a MsgUpdateParams that adds a payee or raises the cap, followed by the spend, passes the module’s check in the same block. Nothing runs before the vote either. At submission SubmitProposal runs each message’s ValidateBasic, checks that its only signer is the gov account and that the router knows the type (proposal.go L46-L69), and that’s it.
Voters do see both messages, if they open the proposal and read them. The summary is free text.
Two proposals don’t fix it
Splitting it into a params proposal and a spend proposal looks safer, but both can be in voting at the same time. If the params one ends first, the spend passes when it executes. Voters get two votes on the same thing and that’s all.
x/gov works the same way with its own params. Tally reads quorum and threshold when the vote ends, not when it started (tally.go L170), so a passed proposal that lowers the threshold already counts for proposals that are still in voting.
Loosen later, tighten now
I’d make any change that loosens a limit wait, and let a change that tightens it apply right away. Store the new value with the time it becomes active, and have the check read whatever is active now. The spend in the same proposal still hits the old limit, and if the change was a bad idea there’s time for a second proposal that reverts it, which doesn’t wait for anything because tightening is immediate.
The wait has to cover a counter-proposal getting through deposit and voting. On the Hub today that’s max_deposit_period of 14 days plus voting_period of 7, so 21 days. Read both from x/gov when the check runs instead of hard-coding them, since gov can change those too. Luggom’s version is max_deposit_period + voting_period + 1 day with a 7 day floor (reserve_spend.go).
Expedited proposals don’t make it shorter. On the Hub an expedited vote ends after 3 days and needs 66.7%, and if it misses that, x/gov turns it into a normal proposal that ends 7 days after voting started. So the counter-proposal has to plan for the normal length.
For a limit that should never move fast, there’s also the option of taking it out of params and keeping it in code. Then changing it means a software upgrade, and validators have to run the new binary before it applies.
Which limits on governance does your chain keep in params today, and has anyone checked what one proposal with the change and the spend together would do?