feat(v4/upgrade): add migration to fix validators commission to 5%#300
feat(v4/upgrade): add migration to fix validators commission to 5%#300
Conversation
| if err != nil { | ||
| return err | ||
| } | ||
| for _, validator := range validators { |
There was a problem hiding this comment.
This migration sets every validator's commission rate to 5%, but leaves MaxRate unchanged. If any existing validator has max_rate < 0.05, the upgrade writes an invalid commission config (rate > max_rate). Can we either fail fast on that case or migrate the validator-level commission bounds together with the rate?
| for _, validator := range validators { | |
| for _, validator := range validators { | |
| // leaving MaxRate and MaxChangeRate unchanged as validator-defined values. | |
| validator.Commission.Rate = fivePercent |
There was a problem hiding this comment.
shouldn't the commission change fail? I don't understand
There was a problem hiding this comment.
oh ok I see now, I can upgrade the maxRate if is less than 5%, but only in that case
There was a problem hiding this comment.
Good catch Danilo, this makes me realize that if an MsgUpdateParams passes and there is changes in the commission rate range, this should affect the validators as well, just like in this migration.
WDYT? (not asking to do this change here, but if you're agree I'll create a separate issue)
There was a problem hiding this comment.
makes sense to me yes
There was a problem hiding this comment.
OK created the issue there atomone-hub/cosmos-sdk#75
Closes #288