Cosmos-sdk: Register validation function for governance parameter set changes

Created on 1 Feb 2019  路  4Comments  路  Source: cosmos/cosmos-sdk

CC @sunnya97

we need a way to register a function which validates whether a parameter changes is within the accepted constraints and reject parameter set change transactions which are outside of that range. To change the range of a parameter would mean a fork.

gov params

Most helpful comment

Not really @fedekunze.

What the parameter change proposal process currently does is validates that the given parameter changes are _valid_ (e.g. correct type, correct key, etc)...it does not verify them (i.e. changing MaxValidators from 100 to 1000).

Currently, the process documents that these should be carefully evaluated by the proposer and stake holders. We're counting on the governance process to ensure this at the time being. In other words, no one would deposit or vote on a proposal that changes a param to some extreme value. However, what @rigelrozanski is stating is that this verification should reside _on chain_.

To do this, the param store would need to be modified such that when you register a param and its type, _you also have to provide a validation function_. This shouldn't be terribly difficult but it's also not super pressing for the reasons I described above.

I can assign this to myself or guide someone through this.

All 4 comments

maybe actually belongs as a part of the params store?

is this already implemented cc: @alexanderbez ? if so can we close it ?

Not really @fedekunze.

What the parameter change proposal process currently does is validates that the given parameter changes are _valid_ (e.g. correct type, correct key, etc)...it does not verify them (i.e. changing MaxValidators from 100 to 1000).

Currently, the process documents that these should be carefully evaluated by the proposer and stake holders. We're counting on the governance process to ensure this at the time being. In other words, no one would deposit or vote on a proposal that changes a param to some extreme value. However, what @rigelrozanski is stating is that this verification should reside _on chain_.

To do this, the param store would need to be modified such that when you register a param and its type, _you also have to provide a validation function_. This shouldn't be terribly difficult but it's also not super pressing for the reasons I described above.

I can assign this to myself or guide someone through this.

Solution to this is outlined in: https://github.com/cosmos/cosmos-sdk/issues/4069

Was this page helpful?
0 / 5 - 0 ratings