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 program #1635

Merged
merged 25 commits into from May 17, 2021
Merged

Governance program #1635

merged 25 commits into from May 17, 2021

Conversation

SebastianBor
Copy link
Contributor

@SebastianBor SebastianBor commented Apr 26, 2021

Summary:

Governance is a program the chief purpose of which is to control the upgrade of other programs through democratic means.
It can also be used as an authority provider for mints and other forms of access control as well where we may want
a voting population to vote on disbursement of access or funds collectively.

Governance can handle arbitrary executions of code, but it's real power lies in the power to upgrade programs. It does this through executing commands to the bpf-upgradable-loader program.
Bpf-upgradable-loader allows any signer who has Upgrade authority over a Buffer account and the Program account itself
to upgrade it using its Upgrade command.

Governance accounts:

governance-accounts

Proposal workflow:

governance-workflow

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.

This is starting to look really clear, still a few questions about those extra mints and how to handle some of the larger types

governance/program/src/instruction.rs Outdated Show resolved Hide resolved
Cargo.lock Outdated Show resolved Hide resolved
governance/program/src/instruction.rs Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
@SebastianBor SebastianBor marked this pull request as ready for review May 1, 2021 22:16
Copy link
Member

@mvines mvines left a comment

Choose a reason for hiding this comment

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

I made some initial comments but I'm still a little confused overall TBH and trying to orient myself. It feels like we're trying to do shoot for something very generic but at the same time specializing parts of the interface for program upgrades, which I find unsettling design wise.

I don't fully grok the Council yet and why we need it.

Cargo.toml Outdated Show resolved Hide resolved
governance/program/src/instruction.rs Outdated Show resolved Hide resolved
governance/program/src/instruction.rs Outdated Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
governance/program/src/instruction.rs Outdated Show resolved Hide resolved
governance/program/src/instruction.rs Show resolved Hide resolved
governance/program/src/instruction.rs Show resolved Hide resolved
@SebastianBor
Copy link
Contributor Author

I made some initial comments but I'm still a little confused overall TBH and trying to orient myself. It feels like we're trying to do shoot for something very generic but at the same time specializing parts of the interface for program upgrades, which I find unsettling design wise.

You are right we are aiming to create all purpose governance program but the prototype was focused on program upgrades. Given that I think we should specialise the parts of the api where it targets program upgrades explicitly. I'm thinking about the following structure:
Governance - Top level account aggregating governances for given governance tokens (for example MNGO or COMP)
ProgramGovernance - Governance account for program upgrades. Governance could have multiple of those for each program within the protocol and also other none program governances in future versions.

Please let me know what you think

@SebastianBor
Copy link
Contributor Author

I don't fully grok the Council yet and why we need it.

Council is a way to define an optional voting population which is different from the community of main token holders

A practical application of this policy may be to have a very large population controlling
major version upgrades of Solana via normal SOL, for instance, but hot fixes be controlled via Council tokens,
of which there may be only 30, and which may be themselves minted and distributed via proposals by the governing population.

@mvines
Copy link
Member

mvines commented May 5, 2021

I don't fully grok the Council yet and why we need it.

Council is a way to define an optional voting population which is different from the community of main token holders

A practical application of this policy may be to have a very large population controlling
major version upgrades of Solana via normal SOL, for instance, but hot fixes be controlled via Council tokens,
of which there may be only 30, and which may be themselves minted and distributed via proposals by the governing population.

Thanks! The hard coding of a Governance mint and a Council mint doesn't sit well with me yet. For example what if a 3rd body is needed for some applications, or a Council isn't needed. Instead a Governance could just have 1 or more mints associated with it, and the mint that is used as the Governance mint vs Council mint is determining when a Proposal is created for that Governance account.

governance/README.md Outdated Show resolved Hide resolved
@SebastianBor
Copy link
Contributor Author

I don't fully grok the Council yet and why we need it.

Council is a way to define an optional voting population which is different from the community of main token holders
A practical application of this policy may be to have a very large population controlling
major version upgrades of Solana via normal SOL, for instance, but hot fixes be controlled via Council tokens,
of which there may be only 30, and which may be themselves minted and distributed via proposals by the governing population.

Thanks! The hard coding of a Governance mint and a Council mint doesn't sit well with me yet. For example what if a 3rd body is needed for some applications, or a Council isn't needed. Instead a Governance could just have 1 or more mints associated with it, and the mint that is used as the Governance mint vs Council mint is determining when a Proposal is created for that Governance account.

It's in fact like that. Both Governance and Council mints are provided externally when Governance is created with the Council being optional. So it's simplified version where you can have 1 or 2 mints and then when you crate a Proposal you decide which mint votes. I'm not sure if there is any value in making it 1 or N at the moment.

governance/program/Cargo.toml Outdated Show resolved Hide resolved
governance/program/src/instruction.rs Outdated Show resolved Hide resolved
governance/program/src/instruction.rs Outdated Show resolved Hide resolved
governance/program/src/instruction.rs Outdated Show resolved Hide resolved
governance/program/src/instruction.rs Outdated Show resolved Hide resolved
governance/program/src/instruction.rs Outdated Show resolved Hide resolved
governance/program/src/instruction.rs Outdated Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
governance/program/src/instruction.rs Show resolved Hide resolved
Copy link
Member

@mvines mvines left a comment

Choose a reason for hiding this comment

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

I like the changes since last time! Beyond the comments I have here, some of which are final nits, looks good to me.

governance/program/src/state.rs Outdated Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
governance/program/src/instruction.rs Outdated Show resolved Hide resolved
governance/program/src/instruction.rs Outdated Show resolved Hide resolved
governance/program/src/state.rs Outdated Show resolved Hide resolved
mvines
mvines previously approved these changes May 16, 2021
@mergify mergify bot dismissed mvines’s stale review May 16, 2021 22:48

Pull request has been modified.

@SebastianBor SebastianBor merged commit e5af52d into solana-labs:master May 17, 2021
@christian-2017
Copy link

christian-2017 commented May 17, 2021

Hey, love the work on governance. I have a few thoughts that I was wondering if you would consider.

For every proposal. Users vote both with their wallet(1 vote) and with their sol(1 vote per sol). Both 66% of sol in the voting wallets have to vote yes for a proposal and 66% of the number of wallets voting have to vote yes for a proposal go through. THIS HELPS WITH PEOPLE WHO HAVE STAKE GETTING MORE OF A SAY, WHILE MAINTAINING PURE DEMOCRACY AS WELL

Additionally, for a proposal to go through, there must be a certain percentage of total SOL/wallets that vote for an improvement proposal in total.

Additionally, I think voting should be able to happen without taking your SOL out of staking, so possibly a vote token could be minted when you stake.

I also think an election every few years for a handful of devs to a council would be a good way to establish some checks and balances! Then this council also has to vote 66% for a proposal for it to go through.

In my opinion, with governance, we should try to mimic the democratized governments of the world with the added twist that SOL and wallet number should have value in the voting system. Checks and balances are key!

Let me know what you think! I have never commented on github before, but believe I have some good ideas about a democratized and sustainable governance system.

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.

None yet

5 participants