pokt-network / pocket-core

Official implementation of the Pocket Network Protocol
http://www.pokt.network
MIT License
211 stars 103 forks source link

ChangeParam tx doesn't reject an invalid value #1617

Open msmania opened 2 weeks ago

msmania commented 2 weeks ago

If a new param is an invalid JSON string, or the type doesn't match the define one, the protocol just accepts without changing the state. The bug is this line doesn't respect the returned error.

https://github.com/pokt-network/pocket-core/blob/003a9593047ad625b000fb85eb1fb7c10904bf73/x/gov/keeper/subspace.go#L216

Ideally we should fix this on protocol side. Given that this product is maintenance mode, however, my suggestion is to add some check on client side to prevent it from submitting a tx with an invalid param value.

Olshansk commented 2 weeks ago

To provide some additional context, this is a consensus-breaking change that needs to be backwards compatible. To do so:

  1. Add a new governance parameter
  2. Add all the boilerplate around enabling / disabling it at the right height
  3. Upgrade the network
  4. Enable this field