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: MultiChoice type Weighted #3721

Merged
merged 16 commits into from
Apr 12, 2023

Conversation

ochaloup
Copy link
Contributor

@ochaloup ochaloup commented Oct 17, 2022

Summary

Implementation of Weighted multi choice vote type. The implementation makes the MultiChoice VoteType to be of either Approval type (existing behaviour) or Weighted that makes possible to vote with percentage of the full vote weight.

Backward compatibility notes

The change is not backward compatible for multi choice proposals. However the option has never been exposed in the UI and hence hasn't been used. In case there is an unknown instance of spl-gov which uses it it would only affect historical proposals which couldn't be loaded

@ochaloup
Copy link
Contributor Author

The PR was updated to not mixing changes of the new VoteType and removing limit of the max permitted options for the proposal.

Copy link
Contributor Author

@ochaloup ochaloup left a comment

Choose a reason for hiding this comment

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

@SebastianBor I adjusted the PR and verified the math as discussed.
I hope the PR would be fine for full review round.

governance/program/src/state/proposal.rs Outdated Show resolved Hide resolved
governance/program/src/state/proposal.rs Outdated Show resolved Hide resolved
@ochaloup ochaloup changed the title Governance: Adding weighted choice for the VoteType Governance: MultiChoice type Weighted Feb 15, 2023
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Really great work overall! Just a few small things to iron out, then this will be ready to go

Cargo.lock Outdated Show resolved Hide resolved
governance/program/src/state/proposal.rs Outdated Show resolved Hide resolved
governance/program/src/state/proposal.rs Outdated Show resolved Hide resolved
governance/program/src/state/proposal.rs Show resolved Hide resolved
governance/program/src/state/proposal.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks great!

@SebastianBor SebastianBor added this pull request to the merge queue Apr 12, 2023
Merged via the queue into solana-labs:master with commit 9587db4 Apr 12, 2023
@SebastianBor SebastianBor deleted the weighted-choice branch April 12, 2023 16:00
HaoranYi pushed a commit to HaoranYi/solana-program-library that referenced this pull request Jul 19, 2023
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Sebastian.Bor <sebastian_bor@hotmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants