Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timestamp-based Governor #3081

Closed
ericnordelo opened this issue Jan 5, 2022 · 1 comment · Fixed by #3934
Closed

Timestamp-based Governor #3081

ericnordelo opened this issue Jan 5, 2022 · 1 comment · Fixed by #3934
Milestone

Comments

@ericnordelo
Copy link
Member

🧐 Motivation

I'm using your Governance implementation, and I want to check proposal deadlines with Timestamps instead of Block Numbers.

Currently, you have a hardcoded Timer.BlockNumber in the ProposalCore struct inside the Governor contract, and I made some research through your implementation checking how to change this behavior. In this search I found that you have already a Timer for timestamps with the same interface as block numbers in the Timers library, so changing the ProposalCore struct to Timers.Timestamp achieves what I want.

The issue is that in order to change this struct, right now I would need to define another Governor contract and fix the inheritance tree (to redefine the struct), or override a lot of functions to fix the usage of ProposalCore with a new one (struct), I think that is too complicated for the purpose of the library.

So I propose to use a Generic Timer inside the Timer library that allows us to define the behavior depending on some configurations, specifically in a virtual method in Governor called timerType (added to the interface to get the current Timer used on the Governance), which can be easily overridden to select what Timer we want to use, and we could add also a config in the GovernorSettings module to allow swapping between this types in production. I made a PR for this and is linked to this issue.

@ericnordelo
Copy link
Member Author

The PR to be reviewed:

#3080

@frangio frangio changed the title Define ProposalCore Timer type in Governor contract (either BlockNumber or Timestamp) with simple configuration Timestamp-based Governor Feb 1, 2022
@Amxx Amxx added this to the 5.0 milestone Jul 15, 2022
@frangio frangio modified the milestones: 5.0, 4.9 Jan 5, 2023
@Amxx Amxx closed this as completed in #3934 Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants