Merge PR #3758: Remove governance_penalty
This commit is contained in:
parent
c3e69c9d36
commit
e2baa3806a
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -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),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue