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

Remove governance_penalty #3758

Merged
merged 1 commit into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ CLI flag.

### SDK

* \#3753 Remove no-longer-used governance penalty parameter
* \#3679 Consistent operators across Coins, DecCoins, Int, Dec
replaced: Minus->Sub Plus->Add Div->Quo
* [\#3665] Overhaul sdk.Uint type in preparation for Coins Int -> Uint migration.
Expand Down
5 changes: 2 additions & 3 deletions cmd/gaia/app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,8 @@ func appStateRandomizedFn(r *rand.Rand, accs []simulation.Account, genesisTimest
VotingPeriod: vp,
},
TallyParams: gov.TallyParams{
Threshold: sdk.NewDecWithPrec(5, 1),
Veto: sdk.NewDecWithPrec(334, 3),
GovernancePenalty: sdk.NewDecWithPrec(1, 2),
Threshold: sdk.NewDecWithPrec(5, 1),
Veto: sdk.NewDecWithPrec(334, 3),
},
}
fmt.Printf("Selected randomly generated governance parameters:\n\t%+v\n", govGenesis)
Expand Down
15 changes: 1 addition & 14 deletions docs/spec/governance/01_concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,7 @@ If a delegator does not vote, it will inherit its validator vote.

### Validator’s punishment for non-voting

Validators are required to vote on all proposals to ensure that results have
legitimacy. Voting is part of validators' directives and failure to do it will
result in a penalty.

If a validator’s address is not in the list of addresses that voted on a
proposal and the vote is closed (i.e. `MinDeposit` was reached and `Voting
period` is over), then the validator will automatically be partially slashed by
`GovernancePenalty`.

*Note: Need to define values for `GovernancePenalty`*

**Exception:** If a proposal is accepted via the special condition of having a ratio of `Yes` votes to `InitTotalVotingPower` that exceeds 2:3, validators cannot be punished for not having voted on it.
That is because the proposal will close as soon as the ratio exceeds 2:3,
making it mechanically impossible for some validators to vote on it.
At present, validators are not punished for failing to vote.

### Governance address

Expand Down
1 change: 0 additions & 1 deletion docs/spec/governance/02_state.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ type TallyParams struct {
Quorum sdk.Dec // Minimum percentage of stake that needs to vote for a proposal to be considered valid
Threshold sdk.Dec // Minimum proportion of Yes votes for proposal to pass. Initial value: 0.5
Veto sdk.Dec // Minimum proportion of Veto votes to Total votes ratio for proposal to be vetoed. Initial value: 1/3
GovernancePenalty sdk.Dec // Penalty if validator does not vote
}
```

Expand Down
13 changes: 3 additions & 10 deletions x/gov/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@ func DefaultGenesisState() GenesisState {
VotingPeriod: DefaultPeriod,
},
TallyParams: TallyParams{
Quorum: sdk.NewDecWithPrec(334, 3),
Threshold: sdk.NewDecWithPrec(5, 1),
Veto: sdk.NewDecWithPrec(334, 3),
GovernancePenalty: sdk.NewDecWithPrec(1, 2),
Quorum: sdk.NewDecWithPrec(334, 3),
Threshold: sdk.NewDecWithPrec(5, 1),
Veto: sdk.NewDecWithPrec(334, 3),
},
}
}
Expand Down Expand Up @@ -93,12 +92,6 @@ func ValidateGenesis(data GenesisState) error {
veto.String())
}

govPenalty := data.TallyParams.GovernancePenalty
if govPenalty.IsNegative() || govPenalty.GT(sdk.OneDec()) {
return fmt.Errorf("Governance vote veto threshold should be positive and less or equal to one, is %s",
govPenalty.String())
}

if data.DepositParams.MaxDepositPeriod > data.VotingParams.VotingPeriod {
return fmt.Errorf("Governance deposit period should be less than or equal to the voting period (%ds), is %ds",
data.VotingParams.VotingPeriod, data.DepositParams.MaxDepositPeriod)
Expand Down
12 changes: 5 additions & 7 deletions x/gov/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,17 @@ func (dp DepositParams) Equal(dp2 DepositParams) bool {

// Param around Tallying votes in governance
type TallyParams struct {
Quorum sdk.Dec `json:"quorum"` // Minimum percentage of total stake needed to vote for a result to be considered valid
Threshold sdk.Dec `json:"threshold"` // Minimum propotion of Yes votes for proposal to pass. Initial value: 0.5
Veto sdk.Dec `json:"veto"` // Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Initial value: 1/3
GovernancePenalty sdk.Dec `json:"governance_penalty"` // Penalty if validator does not vote
Quorum sdk.Dec `json:"quorum"` // Minimum percentage of total stake needed to vote for a result to be considered valid
Threshold sdk.Dec `json:"threshold"` // Minimum propotion of Yes votes for proposal to pass. Initial value: 0.5
Veto sdk.Dec `json:"veto"` // Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Initial value: 1/3
}

func (tp TallyParams) String() string {
return fmt.Sprintf(`Tally Params:
Quorum: %s
Threshold: %s
Veto: %s
Governance Penalty: %s`, tp.Quorum,
tp.Threshold, tp.Veto, tp.GovernancePenalty)
Veto: %s`,
tp.Quorum, tp.Threshold, tp.Veto)
}

// Param around Voting in governance
Expand Down