Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit d06422b

Browse files
authored
Governance: Readme DAO update (#2257)
* chore: update readme De-emphasize program upgrades and exhibit DAO instead * chore: update readme * chore: update accounts comments * chore: use absolute vote weight source explicitly
1 parent 11ba3fb commit d06422b

File tree

5 files changed

+42
-26
lines changed

5 files changed

+42
-26
lines changed

governance/README.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Governance
22

3-
Governance is a program the chief purpose of which is to control the upgrade of other programs through democratic means.
4-
It can also be used as an authority provider for mints and other forms of access control as well where we may want
5-
a voting population to vote on disbursement of access or funds collectively.
3+
Governance is a program the chief purpose of which is to create Decentralized Autonomous Organizations (DAOs).
4+
It can be used as an authority provider for mints, token accounts and other forms of access control where for example
5+
we may want a voting population to vote on disbursement of funds collectively.
6+
It can also control upgrades of itself and other programs through democratic means.
67

78
## Architecture
89

@@ -49,7 +50,7 @@ from the governed token account.
4950

5051
### How does the authority work?
5152

52-
Governance can handle arbitrary executions of code, but it's real power lies in the power to upgrade programs.
53+
Governance can handle arbitrary executions of code. In the program governance case it can execute program upgrades.
5354
It does this through executing instructions to the bpf-upgradable-loader program.
5455
Bpf-upgradable-loader allows any signer who has Upgrade authority over a Buffer account and the Program account itself
5556
to upgrade it using its Upgrade command.
@@ -65,7 +66,7 @@ mint and transfer instructions for the governed accounts.
6566

6667
### Proposal accounts
6768

68-
A Proposal is an instance of a Governance created to vote on and execute given set of changes.
69+
A Proposal is an instance of a Governance created to vote on and execute given set of instructions.
6970
It is created by someone (Proposal Owner) and tied to a given Governance account
7071
and has a set of executable instructions to it, a name and a description.
7172
It goes through various states (draft, voting, executing, ...) and users can vote on it
@@ -101,17 +102,31 @@ When a Proposal is created and signed by its Signatories voters can start voting
101102
equal to deposited governing tokens into the realm. A vote is tipped once it passes the defined `vote_threshold` of votes
102103
and enters Succeeded or Defeated state. If Succeeded then Proposal instructions can be executed after they hold_up_time passes.
103104

104-
Users can relinquish their vote any time during Proposal lifetime, but once Proposal it decided their vote can't be changed.
105+
Users can relinquish their vote any time during Proposal lifetime, but once Proposal is decided their vote can't be changed.
105106

106107
### Community and Councils governing tokens
107108

108109
Each Governance Realm that gets created has the option to also have a Council mint.
109110
A council mint is simply a separate mint from the Community mint.
110111
What this means is that users can submit Proposals that have a different voting population from a different mint
111-
that can affect the same program. A practical application of this policy may be to have a very large population control
112+
that can affect the same DAO. A practical application of this policy may be to have a very large population control
112113
major version bumps of Solana via normal SOL, for instance, but hot fixes be controlled via Council tokens,
113114
of which there may be only 30, and which may be themselves minted and distributed via proposals by the governing population.
114115

116+
Another important use case is to use the Council for DAO inception. At the beginning of a DAO life
117+
there are lots of risks and unknowns.
118+
For example it's not known whether the community of token holders would engage and participate in DAO votes.
119+
And if it would engage then to what extent. It means it can be difficult for example to decide how many votes are
120+
required for a proposal to be successfully voted on.
121+
This is why in order to avoid traps and potentially irreversible actions the Council can be used as a safety net
122+
in a similar way to Multisig to moderate and supervise the voting process at the DAO inception.
123+
Once the newly born DAO goes through several successful proposal votes and everything is going smoothly
124+
the council can be removed from the DAO through a community vote.
125+
126+
The Council can also be used for protocols and communities which haven't launched their token yet.
127+
In such cases the DAO can be setup with the yet to launch token and the Council which would governed
128+
the DAO until the token is distributed.
129+
115130
### Proposal Workflow
116131

117132
![Proposal Workflow](./resources/governance-workflow.jpg)

governance/program/src/instruction.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ pub enum GovernanceInstruction {
5050
/// 5. `[]` System
5151
/// 6. `[]` SPL Token
5252
/// 7. `[]` Sysvar Rent
53-
54-
/// 9. `[]` Council Token Mint - optional
55-
/// 10. `[writable]` Council Token Holding account - optional unless council is used. PDA seeds: ['governance',realm,council_mint]
53+
/// 8. `[]` Council Token Mint - optional
54+
/// 9. `[writable]` Council Token Holding account - optional unless council is used. PDA seeds: ['governance',realm,council_mint]
5655
/// The account will be created with the Realm PDA as its owner
5756
CreateRealm {
5857
#[allow(dead_code)]
@@ -235,7 +234,7 @@ pub enum GovernanceInstruction {
235234
///
236235
/// 0. `[writable]` Proposal account
237236
/// 1. `[writable]` TokenOwnerRecord account of the Proposal owner
238-
/// 2 `[signer]` Governance Authority (Token Owner or Governance Delegate)
237+
/// 2. `[signer]` Governance Authority (Token Owner or Governance Delegate)
239238
/// 3. `[]` Clock sysvar
240239
CancelProposal,
241240

@@ -290,7 +289,6 @@ pub enum GovernanceInstruction {
290289
/// 2. `[writable]` TokenOwnerRecord account. PDA seeds: ['governance',realm, governing_token_mint, governing_token_owner]
291290
/// 3. `[writable]` Proposal VoteRecord account. PDA seeds: ['governance',proposal,governing_token_owner_record]
292291
/// 4. `[]` Governing Token Mint
293-
294292
/// 5. `[signer]` Optional Governance Authority (Token Owner or Governance Delegate)
295293
/// It's required only when Proposal is still being voted on
296294
/// 6. `[writable]` Optional Beneficiary account which would receive lamports when VoteRecord Account is disposed
@@ -389,12 +387,11 @@ pub enum GovernanceInstruction {
389387
/// Sets realm config
390388
/// 0. `[writable]` Realm account
391389
/// 1. `[signer]` Realm authority
392-
393-
/// 3. `[]` Council Token Mint - optional
390+
/// 2. `[]` Council Token Mint - optional
394391
/// Note: In the current version it's only possible to remove council mint (set it to None)
395392
/// After setting council to None it won't be possible to withdraw the tokens from the Realm any longer
396393
/// If that's required then it must be done before executing this instruction
397-
/// 4. `[writable]` Council Token Holding account - optional unless council is used. PDA seeds: ['governance',realm,council_mint]
394+
/// 3. `[writable]` Council Token Holding account - optional unless council is used. PDA seeds: ['governance',realm,council_mint]
398395
/// The account will be created with the Realm PDA as its owner
399396
SetRealmConfig {
400397
#[allow(dead_code)]

governance/program/src/processor/process_create_program_governance.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ pub fn process_create_program_governance(
3636
let account_info_iter = &mut accounts.iter();
3737

3838
let realm_info = next_account_info(account_info_iter)?; // 0
39-
let program_governance_info = next_account_info(account_info_iter)?; // 0
39+
let program_governance_info = next_account_info(account_info_iter)?; // 1
4040

41-
let governed_program_info = next_account_info(account_info_iter)?; // 1
42-
let governed_program_data_info = next_account_info(account_info_iter)?; // 2
43-
let governed_program_upgrade_authority_info = next_account_info(account_info_iter)?; // 3
41+
let governed_program_info = next_account_info(account_info_iter)?; // 2
42+
let governed_program_data_info = next_account_info(account_info_iter)?; // 3
43+
let governed_program_upgrade_authority_info = next_account_info(account_info_iter)?; // 4
4444

45-
let token_owner_record_info = next_account_info(account_info_iter)?; // 4
45+
let token_owner_record_info = next_account_info(account_info_iter)?; // 5
4646

47-
let payer_info = next_account_info(account_info_iter)?; // 5
48-
let bpf_upgrade_loader_info = next_account_info(account_info_iter)?; // 6
47+
let payer_info = next_account_info(account_info_iter)?; // 6
48+
let bpf_upgrade_loader_info = next_account_info(account_info_iter)?; // 7
4949

50-
let system_info = next_account_info(account_info_iter)?; // 7
50+
let system_info = next_account_info(account_info_iter)?; // 8
5151

52-
let rent_sysvar_info = next_account_info(account_info_iter)?; // 8
52+
let rent_sysvar_info = next_account_info(account_info_iter)?; // 9
5353
let rent = &Rent::from_account_info(rent_sysvar_info)?;
5454

5555
assert_valid_create_governance_args(program_id, &config, realm_info)?;

governance/program/src/state/proposal.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ impl Proposal {
280280

281281
Ok(max_vote_weight.max(total_vote_count))
282282
}
283-
_ => Err(GovernanceError::VoteWeightSourceNotSupported.into()),
283+
MintMaxVoteWeightSource::Absolute(_) => {
284+
Err(GovernanceError::VoteWeightSourceNotSupported.into())
285+
}
284286
}
285287
}
286288

governance/program/src/state/realm.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ pub fn assert_valid_realm_config_args(config_args: &RealmConfigArgs) -> Result<(
211211
return Err(GovernanceError::InvalidMaxVoteWeightSupplyFraction.into());
212212
}
213213
}
214-
_ => return Err(GovernanceError::MintMaxVoteWeightSourceNotSupported.into()),
214+
MintMaxVoteWeightSource::Absolute(_) => {
215+
return Err(GovernanceError::MintMaxVoteWeightSourceNotSupported.into())
216+
}
215217
}
216218

217219
Ok(())

0 commit comments

Comments
 (0)