governance-program-library
governance-program-library copied to clipboard
Feature/quadratic
A simple quadratic voting plugin, that takes a predecessor vote (and max vote) and applies a quadratic function to them. This has the effect of amplifying smaller votes and dampening larger ones.
Notes:
- This plugin can be composed with any other plugins, but should be used in association with a plugin that guarantees the uniqueness of the voters, in order to avoid sybil attacks.
- This PR adds rich JS clients for the Gateway and Quadratic plugins, allowing integrators to make calls such as
client.updateVoterWeightRecord(realm, mint, voter)
, and the client handles wiring up the predecessor accounts. - This PR updates solana to v1.17. Accordingly Soteria audit has been removed because it doesn't appear to support this version (it expects bpf-toolchain rather than sbf-toolchain). Please reinstate if possible.
- Finally, the PR includes a couple of scripts for testing or debugging the gateway and quadratic plugins
@dankelleher Thanks a lot for the PR. I am also interested in this, do you know if there is any plan in merging this PR? Anyone already using this plugin?
@dankelleher Thanks a lot for the PR. I am also interested in this, do you know if there is any plan in merging this PR? Anyone already using this plugin?
Not that I know of - merging is down to @SebastianBor . It has been a while since I delved into this tbh but IIRC it needed just a little refactoring and maybe testing and then it's good to go. I'm happy to help and advise where needed!
Just to point out, this is a very simple form of QV where there are no "multiple-choice" voting options yet. Supporting multiple choice proposals should probably be a separate PR.
@dankelleher Thanks a lot for the PR. I am also interested in this, do you know if there is any plan in merging this PR? Anyone already using this plugin?
Not that I know of - merging is down to @SebastianBor . It has been a while since I delved into this tbh but IIRC it needed just a little refactoring and maybe testing and then it's good to go. I'm happy to help and advise where needed!
Just to point out, this is a very simple form of QV where there are no "multiple-choice" voting options yet. Supporting multiple choice proposals should probably be a separate PR.
It's a great example of stacked plugin implementation (and I want to keep it for that reason) but I think the solution is too complex for quadratic voting. A better solution would be to implement it directly in spl-gov
. We could introduce a flag which would determine how voter_weight
is applied.
However the most important thing would be to use the Civic
gateway plugin with proof of uniqueness to prevent Sibyl attacks