Governance
Terra's Governance module inherits from Cosmos SDK's gov
module. This document is a stub, and mainly covers important Terra-specific notes on how it is used.
The Terra protocol is a decentralized public blockchain governed by community members. Governance is the democratic process that allows users and validators to make changes to the Terra protocol. Community members submit, vote, and implement proposals.
The governance module maintains the logic for all governance activity.
If you are an advanced user and want to learn about submitting or voting on proposals using Terrad, visit the Governance section of the Terrad Reference.
Concepts
The following concepts describe the governance proposal procedure.
Drafting and submission
Proposals start as ideas within the community on Terra's Agora forum. After gaining support and feedback from the community, a proposer drafts and submits a proposal alongside an initial deposit.
To learn more about the different types of proposals, see the Proposal types section below.
Deposit period
After a proposal is submitted, it enters the deposit period, where it must reach a total minimum deposit of 512 Luna within 7 days from the time of its submission. The deposit threshold is reached when the sum of the initial deposit (from the proposer) and the deposits from all other interested network participants meet or exceed 512 Luna.
Deposits protect against unnecessary proposals and spam.
Deposit refunds
If a proposal fails to meet the minimum deposit amount within the deposit period, the proposal will not enter the voting period, and the deposit will be refunded.
Proposals that meet the minimum deposit requirement and make it to the voting period will be refunded under any vote outcome except NoWithVeto
. If the number of NoWithVeto
votes is above 33.4% of the total vote, the deposit will be burned. Deposits will be refunded under any other condition.
Voting period
If the minimum deposit has been reached before the end of the deposit period, then the proposal goes into a one-week voting period. While the proposal is in voting, holders of staked Luna can cast votes for the proposal.
Voting options
The 4 voting options available are:
Yes
: in favor.No
: not in favor.NoWithVeto
: not in favor, and the creator should lose their deposit.Abstain
: neither for or against. An abstain vote counts toward meeting quorum but does not count toward thethreshold
.
Delegators vote using their staked Luna. One staked Luna equals one vote.
If a delegator does not specify a vote with their staked Luna, their vote defaults to the vote cast by the validator their Luna is staked to. Delegators can override a validator's vote at any time during the voting period by voting with their staked Luna.
Tallying
The logic for tallying votes can be found in the tally.go
file of the Cosmos SDK.
For a proposal to pass, the following conditions must be met.
- Voter participation must be at least
quorum
(). The currentquorum
value is 30% of all staked Luna.
- The ratio of
NoWithVeto
votes must be less thanveto
(). The currentveto
value is 33%.
- The ratio of
Yes
votes must be greater thanthreshold
(). The currentthreshold
value is 50%. Abstain votes are not included in thethreshold
tally.
If a proposal meets all of the previous conditions, it passes. If a proposal fails to meet any of the previous conditions, it fails. Proposals that get rejected with veto do not get their deposits refunded. The parameters quorum
, veto
, and threshold
exist as blockchain parameters in the Governance module.
Deposits will not be refunded for proposals that are rejected with veto. Non-refunded deposits are burned.
Proposal Implementation
Once a governance proposal passes, the changes described are put into effect by the proposal handler. Generic proposals such as a TextProposal
must be reviewed by Terra protocol developers and the community for decisions on how to manually implement them.
Although parameter changes get updated immediately, they generally are not put into effect until the next epoch operation. Epochs occur every 100800 blocks or roughly every 7.7 days, given a 6.6-second block time.
Data
Proposal
A Proposal
is a data structure representing a petition for a change that is submitted to the blockchain alongside a deposit. Once its deposit reaches a certain MinDeposit
, the proposal is confirmed and voting opens. Bonded Luna holders can then send TxGovVote
transactions to vote on the proposal. Terra currently follows a simple voting scheme of 1 Bonded Luna = 1 Vote.
The Content
of a proposal is the interface that contains the information about the Proposal
, such as the title
, description
, and any notable changes. A Content
type can be implemented by any module. The ProposalRoute
of the Content
returns a string that must be used to route the handler of the Content
in the Governance keeper. This process allows the governance keeper to execute proposal logic implemented by any module. If a proposal passes, the handler is executed. Only if the handler is successful does the state get persisted and the proposal finally pass. Otherwise, the proposal is rejected.
Message Types
MsgSubmitProposal
MsgDeposit
MsgVote
Proposal types
Text Proposal
Text Proposals are used to create general-purpose petitions, such as asking core developers or community members to implement a specific feature. The community can reference a passed Text Proposal to the core developers or community members to indicate that a feature that potentially requires a soft or hard fork is in significant demand.
Parameter Change Proposals
Parameter Change Proposals are a special type of proposal which, once passed, will automatically go into effect by directly altering the network's specified parameter.
Software Upgrade Proposals
This type of proposal requires validators to update their node software to a new version at a specified block height.
Software upgrade proposals can be difficult to execute. Exercise caution when using this proposal type, as you may lose your deposit due to an incorrect proposal.
Transitions
End-Block
This section was taken from the official Cosmos SDK docs and placed here for your convenience to understand the Governance process.
The ProposalProcessingQueue
contains all the ProposalID
s of proposals that reach their MinDeposit
, denoted as queue[proposalID]
. At the end of each block, all the proposals that have reached the end of their voting period are processed. To process a finished proposal, the application tallies the votes, computes the votes of each validator, and checks if every validator in the validator set has voted. If the proposal is accepted, deposits are refunded. Finally, the proposal content Handler
is executed.
Parameters
The subspace for the Governance module is gov
.
MinDeposit
- type:
Coins
- denom:
uluna
- amount:
512000000
The minimum deposit amount for a proposal to enter a voting period. Currently 512 Luna.
MaxDepositPeriod
- type:
time.Duration
(seconds) "max_deposit_period": "604800s"
The maximum period of time for a proposal to meet the minimum deposit. Currently 1 week.
Quorum
- type:
Dec
"quorum": "0.300000000000000000",
The minimum number of votes needed for a proposal to be valid. As of Terra governance prop 3547, 30% of all staked Luna must vote to reach Quorum
.
Threshold
- type:
Dec
- value: 50%
The minimum number of Yes
votes needed for a proposal to pass. Currently, 50% of all votes must be Yes
. Abstain
votes are excluded from this tally.
Veto
- type:
Dec
- value:
0.334
The minimum value of NoWithVeto
votes needed for a proposal to be vetoed. If 33.4% or more of the total votes cast are NoWithVeto
, the proposal fails, and the creator's deposit is not returned.
VotingPeriod
- type:
time.Duration
(seconds) "voting_period": "604800s"
The length of the voting period. Currently one week.