-
Notifications
You must be signed in to change notification settings - Fork 96
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
[Feature] minimum commission rate upgrade #47
Conversation
…mum rate and implement ante handler to check MsgCreateValidator and MsgEditValidator commission rate
Codecov Report
@@ Coverage Diff @@
## main #47 +/- ##
==========================================
- Coverage 73.70% 70.84% -2.87%
==========================================
Files 7 17 +10
Lines 658 830 +172
==========================================
+ Hits 485 588 +103
- Misses 148 209 +61
- Partials 25 33 +8
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job, looks like you covered all the cases:
- if val_commission < minimum, upgrade it
- don't allow val to create at under minimum
- don't allow val to edit to below minimum
- DO allow to edit above minimum
- DO allow to create above minimum
The only case I see missing is creating with the minimum commission.
Just seen this PR; nice! |
…re/minimum-commission
|
||
if msg.CommissionRate.LT(minimumCommission) { | ||
return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, | ||
fmt.Sprintf("commission can't be lower than %s%%", minimumCommission.String()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Sprintf("commission can't be lower than %s%%", minimumCommission.String()),
it shows 0.1%
, %
should be removed
app/ante/min_commission.go
Outdated
switch msg := m.(type) { | ||
case *stakingtypes.MsgCreateValidator: | ||
// prevent new validators joining the set with | ||
// commission set below 5% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10%, not 5%
Summary of changes
This PR is still under consensus and need governance proposal to be reflected on chain.
What're Changed
ante.MinimumCommissionEnforced
.MinimumCommission
./terra/ante/v2/params
introduced./terra/ante/v2/minimum_commission
introduced.terrad query ante params
introduced.terrad query ante minimum-commission
introduced./terra.ante.v2.MinimumCommissionUpdateProposal
addedterrad tx gov submit-proposal minimum-commission-update
Default
ante.Params
Default
ante.GenesisState