Backport minimum commission staking parameter from the cosmos-sdk #8
Conversation
This reverts commit f289d4e.
This reverts commit 6ae217b.
This reverts commit c4a482e.
This reverts commit f289d4e.
* Evan/backported min commish (#3) * try out new update * add scripts to test the update * try without loading empty bytes * register services to the same configurator * replace cosmos-sdk with pomifer fork * udpate go mod to new cosmos-sdk version * go mod tidy
| set -o errexit -o nounset | ||
|
|
||
| CHAINID="test" | ||
|
|
||
| # Build genesis file incl account for passed address | ||
| coins="100000000000stake,100000000000samoleans" | ||
| chihuahuad init $CHAINID --chain-id $CHAINID | ||
|
|
||
| # modify the gov params to be super short | ||
| sed -i 's#"max_deposit_period": "172800s"#"max_deposit_period": "1s"#g' ~/.chihuahua/config/genesis.json | ||
| sed -i 's#"voting_period": "172800s"#"voting_period": "30s"#g' ~/.chihuahua/config/genesis.json | ||
|
|
||
| chihuahuad keys add validator --keyring-backend="test" | ||
| chihuahuad add-genesis-account $(chihuahuad keys show validator -a --keyring-backend="test") $coins | ||
| chihuahuad gentx validator 5000000000stake --keyring-backend="test" --chain-id $CHAINID --commission-rate "0.01" | ||
| chihuahuad collect-gentxs | ||
|
|
||
| # Set proper defaults and change ports | ||
| sed -i 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' ~/.chihuahua/config/config.toml | ||
| sed -i 's/timeout_commit = "5s"/timeout_commit = "1s"/g' ~/.chihuahua/config/config.toml | ||
| sed -i 's/timeout_propose = "3s"/timeout_propose = "1s"/g' ~/.chihuahua/config/config.toml | ||
| sed -i 's/index_all_keys = false/index_all_keys = true/g' ~/.chihuahua/config/config.toml | ||
|
|
||
| # Start the chihuahua | ||
| chihuahuad start No newline at end of file |
There was a problem hiding this comment.
we're happy to remove these scripts, but wanted to provide them for anyone wanting to test a local testnet upgrade
| // RegisterUpgradeHandlers returns upgrade handlers | ||
| func (app *App) RegisterUpgradeHandlers(cfg module.Configurator) { | ||
| app.UpgradeKeeper.SetUpgradeHandler(v1UpgradeName, func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
| minCommissionRate := sdk.NewDecWithPrec(5, 2) |
There was a problem hiding this comment.
we didn't move the 5 out as a constant here, as we would just delete it later. To change in the future, we only have to change the staking parameter.
|
to preface this, this won't bump everyones commission to 5% this still needs to be added to the sdk. |
I think we included this in the upgrade handler, it seemed to bump the commission up on our local testnet edit: and the most recent testnet |
|
Hey, will validators need to upgrade or will the chain continue as is? |
Validators will need to upgrade at a specific tbd height, as this upgrade is consensus breaking |
evan-forbes
left a comment
There was a problem hiding this comment.
testnet was successful!
I think we can merge this PR and create a tagged version after we address any lingering nit picks or questions
This PR is a combination of reverting the code we had previously merged into Chihuahua from Juno, and adding some code from the sdk.
We give credit to @marbar3778 and Binary Holdings for being crucial in this PR.
Key changes
Testing in place