openzeppelin-contracts icon indicating copy to clipboard operation
openzeppelin-contracts copied to clipboard

maxBatchSize() parameter for Governance and Governance settings

Open Codys12 opened this issue 3 years ago • 2 comments

🧐 Motivation Having a maxBatchSize parameter that is checked by the Governor contract would limit proposals to a specific number of operations.

📝 Details This parameter could be defined in GovernorSettings and settable by the governance system itself. It would need to be checked that it is set to > 1.

Codys12 avatar Jun 01 '22 12:06 Codys12

Hello @Codys12

GovernorSettings is an extension we propose to have easy support for all the parameters that are mandatory. IMO a maxBatchSize should probably not be included by default.

Any dev is free to enforce such a restriction by overriding the propose function, and I would personally leave it that way.

Amxx avatar Jun 02 '22 13:06 Amxx

Why do you think a maxBatchSize is an important feature to have?

Amxx avatar Jun 06 '22 15:06 Amxx

I imagine this parameter is proposed as a way to catch, before it is proposed, a proposal that will be too big to execute. However, a proposal might be too big even with just one operation, if that operation is very expensive, so this check would be ineffective in that case. The number of operations is not really relevant and imposing an arbitrary limit may force a proposal to be unnecessarily split in two, imposing greater voting overhead.

The Governor needs to be resilient to a proposal that can't be executed. It should not and does not prevent the rest of the governance protocol from continuing to operate.

A DAO should simulate proposals before creation in order to ensure that they are executable and produce the desired effects. A proposal that has too many operations should be caught at that stage.

If there is another reason to include this parameter please let us know.

frangio avatar Sep 16 '22 20:09 frangio