Quorum default behaviour on governors

Hi guys, just wondering why governance quorum is not implemented like the other GovernorSettings to allow updates by default? If I'm not using the GovernorVotesQuorumFraction but instead have an initial value I want to set and want to keep this mutable like the other properties: votingDelay, votingPeriod and proposalThreshold it seems I need to implement function quorum(uint256 blockNumber) myself as well as a write function something like function updateQuorum(uint256 newQuorumValue). I can do that but just feels off with the overall design and wondered if there was a reason for this?

1 Like

I think the reason was that it would conflict with GovernorVotesQuorumFraction.

@Amxx can you confirm this?

A governor takes a few parameters, there is the votingDelay(), the votingPeriod(), the proposalThreshold(), and the quorum(uint256)

I would expect parameters are expected to be fixed in time. The best (most gas effective) way to implement that is by overriding the corresponding function with pure ones that just return a value

function votingDelay() public view override returns (uint256) { return 1; }

This is what I would recommand.

Now there is also the possibility of reading that from storage. Its more expensive (2100gas for a cold sload) but it makes these values updatable (through a governance operation). That is what GovernorSettings is for!

GovernorSettings supports the voting delay, the voting period, and the proposal threshold. It doesn't however support the quorum. The reason for that is that updating the quorum is way more sensitive than updating the other values.

Changing the voting delay (using GovernorSettings.setVotingDelay) will only affect future proposals. However, a naive implementation of updateQuorum would possibly change the outcome of past proposal. Imagine a proposal failled because the quorum was not reached ... and month later you forget about it and decrease the quorum ... suddenly the quorum on that old proposal might be reached, and it may be possible to execute it.

If you want a quorum that can be updated, you have to do it using a history-tracking mechanism, which is what GovernorVotesQuorumFraction does. This is significantly more complexe than what you have in GovernorSettings and we didn't want to merge the two.

Both can be used independently, or together. Just don't implement a updatable quorum by copying the logic that GovernorSettings uses for the other values.