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

Governor: Use smaller integers for timing parameters

Open cygnusv opened this issue 3 years ago • 5 comments

Some voting timing parameters are expressed as uint256, like votingDelay and votingPeriod inGovernorSettings, while the newly introduce GovernorPreventLateQuorum has a votingExtension parameter with type uint64. These should be consistent.

cygnusv avatar Feb 21 '22 10:02 cygnusv

Hello @cygnusv, and thank you for raising that issue.

I'll check what we can do, but please note that we want to move the votingDelay and votingPeriod to uint64

Amxx avatar Feb 21 '22 14:02 Amxx

Right, either way works 👍

cygnusv avatar Feb 21 '22 15:02 cygnusv

fixed in https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3224

AtlasPilotPuppy avatar Feb 27 '22 10:02 AtlasPilotPuppy

Sorry folks the getters that return uint256 were inherited from GovernorBravo and we defined them that way for compatibility with that contract. That hasn't changed so I think we should keep them this way.

frangio avatar Mar 01 '22 23:03 frangio

Following up on my previous comment. While the external getters should continue to return uint256, we can change the storage variables to use uint64 in order to more efficiently pack storage.

This is a breaking change that would be scheduled for 5.0.

frangio avatar Sep 16 '22 20:09 frangio