Cosmos-sdk: MsgCreateValidator.ValidateBasic does not validate commission

Created on 11 Mar 2019  路  3Comments  路  Source: cosmos/cosmos-sdk

MsgCreateValidator's validate commission does not call validate commission. Its not clear to me if its ever checked on the MsgCreateValidator codepath. If its not, that would allow for max commission rates greater than 1.

Commission.Validate is only called (v Validator) SetInitialCommission, so it seems as though you can update your comission to invalid values?

/cc @cwgoes @sunnya97
Does this need another point release pre-launch?

good first issue staking

Most helpful comment

Ah your right, thanks! This still should be called in MsgCreateValidator's validate basic though.

All 3 comments

Commission has the Validate and ValidateNewRate methods. Validate is called during SetInitialCommission which is called during the validator creation process. The latter is called during UpdateValidatorCommission which is called during the edit validator handler. So you cannot update your commission to invalid values.

Do you still see a problem/bug?

Ah your right, thanks! This still should be called in MsgCreateValidator's validate basic though.

Well, SetInitialCommission still has to be called in the handler because it needs the BFT block time. Validate basic can still perform lazy validation (i.e. just validate the rates) though!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rigelrozanski picture rigelrozanski  路  3Comments

rigelrozanski picture rigelrozanski  路  3Comments

rigelrozanski picture rigelrozanski  路  3Comments

jackzampolin picture jackzampolin  路  3Comments

fedekunze picture fedekunze  路  3Comments