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

Governance: time to vote eneded calculates with cool off time #579

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ochaloup
Copy link

@ochaloup ochaloup commented Mar 1, 2023

The contract of SPL Gov works with cool off time to assert if it's time to finalize vote.
https://github.com/solana-labs/solana-program-library/blob/master/governance/program/src/state/proposal.rs#L340 While there is the greater than not with 'equal' in comparision.

The contract of SPL Gov works with cool off time to assert if it's time
to finalize vote.
https://github.com/solana-labs/solana-program-library/blob/master/governance/program/src/state/proposal.rs#L340
While there is the greater than not with 'equal' in comparision.
@vercel
Copy link

vercel bot commented Mar 1, 2023

@ochaloup is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@@ -946,12 +946,13 @@ export class Proposal {
return this.isPreVotingState()
? governance.config.maxVotingTime
: (this.votingAt?.toNumber() ?? 0) +
governance.config.maxVotingTime -
governance.config.maxVotingTime +
governance.config.votingCoolOffTime -
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

votingCoolOffTime should be applied in both cases.
A better way to do this would be to rename maxVotingTime to baseVotingTime and then have a function for maxVotingTime -> baseVotingTime + votingCoolOffTime

@ochaloup
Copy link
Author

@SebastianBor thanks for the review. I updated the pull request trying to follow your point. Please take a look.

  • I'm not sure about maxVotingTime setter for backwards compatibility reasons. Decided to not to add but not sure.

@ochaloup
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants