diff --git a/.gitignore b/.gitignore index ac1b3fb..c03054e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,14 @@ -# local chain data -data +# v5.0.0 +v5.0.0/data +v5.0.0/exported_genesis_with_height_6659211_sorted_origin.json +v5.0.0/genesis.json -# genesis files -exported_genesis_with_height_6659211_sorted_origin.json -genesis.json +# v5.0.5 +v5.0.5/data +v5.0.5/exported_genesis_with_height_7304500_sorted.json +v5.0.5/genesis.json + +# v6.0.0 +v6.0.0/data +v6.0.0/exported_genesis_with_height_7304500_sorted.json +v6.0.0/genesis.json diff --git a/README.md b/README.md index 4dabd80..2c80d4d 100644 --- a/README.md +++ b/README.md @@ -1,959 +1,29 @@ -# Gravity-DEX Upgrade Test +# Gravity-DEX Upgrade Simulation Test -This repository describes procedures and contains results of upgrade test for the `Gravity-DEX` on the exported state of `cosmoshub-4` chain. +This repository contains procedures and results from simulating upgrade tests for the liquidity module `Gravity-DEX` on the exported state of Cosmos Hub mainnet chain `cosmoshub-4`. To get more context, we recommend you to read through all the related links below for each upgrade. -To get more context about this repo, please reference the following [issue](https://github.com/tendermint/liquidity/issues/403) and [pull request](https://github.com/cosmos/gaia/pull/859). +## Upgrade Test Records -# Version +### (2021.11.08) Vega Upgrade with [v6.0.0-rc2](v6.0.0-rc2) -- Build this [gaia v4.2.1](https://github.com/cosmos/gaia/releases/tag/v4.2.1) that is used in `cosmoshub-4` +- [Vega Upgrade](https://github.com/cosmos/gaia/blob/main/docs/roadmap/cosmos-hub-roadmap-2.0.md#vega-upgrade-expected-q3-2021) +- [Issue](https://github.com/tendermint/liquidity/issues/447) +- [Pull Request: N/A]() +- [Cosmos SDK v0.44.2](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.2) +- [Gaia v5.0.5](https://github.com/cosmos/gaia/releases/tag/v5.0.5) +- [Gaia v6.0.0-rc2](https://github.com/cosmos/gaia/tree/v6.0.0-rc2) +- [Liquidity module v1.4.1](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.4.1) +- [Reference about last upgrade simulation test](https://github.com/b-harvest/gravity-dex-upgrade-test/pull/4) -- This [gaia v5.0.0](https://github.com/cosmos/gaia/releases/tag/v5.0.0) is used for `Gravity-DEX` upgrade +### (2021.08.23) Delta Upgrade with [v5.0.5](v5.0.5) -# Genesis configuration +- [Issue](https://github.com/tendermint/liquidity/issues/403) +- [Pull Request](https://github.com/cosmos/gaia/pull/859) +- [Cosmos SDK v0.43.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.43.0) +- [Gaia v5.0.5](https://github.com/cosmos/gaia/releases/tag/v5.0.5) +- [Forked Gaia that includes liquidity module v1.4.0](https://github.com/b-harvest/gravity-dex/tree/upgrade-liquidity-module-based-sdk-43) +- [Liquidity module v1.4.0](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.4.0) -- This `exported_genesis_with_height_6659211_sorted_origin.json` zip file is prepared in this repository. It is exported using `gaiad export` command on block height `6659211` from `cosmoshub-4` network. Unzip the attached genesis file to proceed the next steps in this guide. +### (2021.07.07) Delta Upgrade with [v5.0.0](v5.0.0) -- This `genesis.json.tar.bz2` zip file is the filw that already proceeded all the modifications and is ready to be used right away. You can skip the next steps and use this to proceed the upgrade test. - -## Unzip the tar files and verify the hashes - -As stated above, skip the below steps if you decide to use `genesis.json.tar.bz2`. - -### 1. Verify the hash and copy exported state file - -```bash -# unzip the file -tar xvzf exported_genesis_with_height_6659211_sorted_origin.json.tar.bz2 - -# verify the hash -# it should return a955b5752f2f0e5384a1e99323ad2ca6c9db58c7b605123bb5896693882136f4 -cat exported_genesis_with_height_6659211_sorted_origin.json | shasum -a 256 - -# change the name to genesis.json -cp exported_genesis_with_height_6659211_sorted_origin.json genesis.json -``` - -### 2. Substitue validator keys and accounts - -In this step, we're swapping two validators and add two different accounts. Also, we're going to modify some parameters for test efficiency. - -The following files and mnemonics for the two different accounts are already provided: - -- `priv_validator_key_val1.json`: validator1's consensus key - -- `priv_validator_key_val2.json`: validator2's consensus key - -- `guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host`: The mnemonic for account1. This account is used for validator1 - -- `friend excite rough reopen cover wheel spoon convince island path clean monkey play snow number walnut pull lock shoot hurry dream divide concert discover`: The mnemonic for account2. This account is used to test some cli interfaces for the liquidity module. - -- `render hire dirt bulk huge goat jungle number wear method check during menu goat accident scan noise nerve below target resource digital column flee`: This account is `user1` that is used for sending governance proposal and voting the proposal. - -- `junk appear guide guess bar reject vendor illegal script sting shock afraid detect ginger other theory relief dress develop core pull across hen float`: This account is `user2` that is used to test some cli interfaces for the liquidity module. - -```bash -# configure variables -export EXPORTED_GENESIS=genesis.json -export BINARY=gaiad -export CHAIN_ID=cosmoshub-4-upgrade-testnet-1001 -export CHAIN_DIR=./data - -sed -i '' 's%"chain_id": "cosmoshub-4",%"chain_id": "cosmoshub-4-upgrade-testnet-1001",%g' $EXPORTED_GENESIS - -# substitue validator1 -sed -i '' 's%cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM=%qwiUMxz3llsy45fPvM0a8+XQeAJLvrX3QAEJmRMEEoU=%g' $EXPORTED_GENESIS -sed -i '' 's%B00A6323737F321EB0B8D59C6FD497A14B60938A%D5AB5E458FD9F9964EF50A80451B6F3922E6A4AA%g' $EXPORTED_GENESIS -sed -i '' 's%cosmosvalcons1kq9xxgmn0uepav9c6kwxl4yh599kpyu28e7ee6%cosmosvalcons16k44u3v0m8uevnh4p2qy2xm08y3wdf92xsc3ve%g' $EXPORTED_GENESIS - -# substitue validator2 -sed -i '' 's%W459Kbdx+LJQ7dLVASW6sAfdqWqNRSXnvc53r9aOx/o=%oi55Dw+JjLQc4u1WlAS3FsGwh5fd5/N5cP3VOLnZ/H0=%g' $EXPORTED_GENESIS -sed -i '' 's%83F47D7747B0F633A6BA0DF49B7DCF61F90AA1B0%7CB07B94FD743E2A8520C2B50DA4B03740643BF5%g' $EXPORTED_GENESIS -sed -i '' 's%cosmosvalcons1s0686a68krmr8f46ph6fklw0v8us4gdsm7nhz3%cosmosvalcons10jc8h98awslz4pfqc26smf9sxaqxgwl4vxpcrp%g' $EXPORTED_GENESIS - -# substitute user1 account -# cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl --> cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6 -# Am5HzAWtsyvoQy49DyM4Q1sZiZL6UvTgKSJW4ERAhCR8 --> AsM0d7NDJ/oFn+/WkeQKO2QIWE3SNBccoRLkrCK14T/i -sed -i '' 's%cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl%cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6%g' $EXPORTED_GENESIS -sed -i '' 's%Am5HzAWtsyvoQy49DyM4Q1sZiZL6UvTgKSJW4ERAhCR8%AsM0d7NDJ/oFn+/WkeQKO2QIWE3SNBccoRLkrCK14T/i%g' $EXPORTED_GENESIS - -# substitute user2 account -# cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx --> cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 -# A6apc7iThbRkwboKqPy6eXxxQvTH+0lNkXZvugDM9V4g --> ApDOUyfcamDmnbEO7O4YKnKQQqQ93+gquLfGf7h5clX7 -sed -i '' 's%cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx%cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9%g' $EXPORTED_GENESIS -sed -i '' 's%A6apc7iThbRkwboKqPy6eXxxQvTH+0lNkXZvugDM9V4g%ApDOUyfcamDmnbEO7O4YKnKQQqQ93+gquLfGf7h5clX7%g' $EXPORTED_GENESIS -``` - -### 3. Change voting power and staking delegation to over 67% - -```bash -# fix a delegation amount for over 67% -sed -i '' 's%"25390741.000000000000000000"%"6000000025390741.000000000000000000"%g' $EXPORTED_GENESIS - -# fix power of the validator -sed -i '' 's%13488360679504%6013488360679504%g' $EXPORTED_GENESIS -sed -i '' 's%"power": "13488360"%"power": "6013488360"%g' $EXPORTED_GENESIS - -# fix last_total_power -sed -i '' 's%"191488844"%"6191488844"%g' $EXPORTED_GENESIS - - -#sed -i '' 's%274699904554428%6274699904554428%g' $EXPORTED_GENESIS -# missed this modification on public testnet genesis - -# fix total supply of uatom -sed -i '' 's%274699904554428%1006274699904554428%g' $EXPORTED_GENESIS - -# fix balance of bonded_tokens_pool module account -sed -i '' 's%191488904896901%6191488904896901%g' $EXPORTED_GENESIS - -# fix the balance of a account to use as a faucet on testnet -sed -i '' 's%"amount": "107120822"%"amount": "1000000000107120822"%g' $EXPORTED_GENESIS - -``` -### 4. Modify some gov parameters for test efficiency - -The following parameters are needed to be modified: - -- minimum deposit amount -- quorum -- threshold -- voting_period - -```bash -sed -i '' 's%"amount": "64000000",%"amount": "1",%g' $EXPORTED_GENESIS -sed -i '' 's%"quorum": "0.400000000000000000",%"quorum": "0.000000000000000001",%g' $EXPORTED_GENESIS -sed -i '' 's%"threshold": "0.500000000000000000",%"threshold": "0.000000000000000001",%g' $EXPORTED_GENESIS -sed -i '' 's%"voting_period": "1209600s"%"voting_period": "60s"%g' $EXPORTED_GENESIS -``` -### 5. Initialize local chain - -```bash -export EXPORTED_GENESIS=genesis.json -export BINARY=gaiad -export CHAIN_ID=cosmoshub-4-upgrade-testnet -export CHAIN_DIR=./data - -export VAL_1_CHAIN_DIR=$CHAIN_DIR/$CHAIN_ID/val1 -export VAL_1_MNEMONIC="guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host" -export VAL_1_KEY_NAME="val1" -export VAL_1_MONIKER="Validator One" - -export VAL_2_CHAIN_DIR=$CHAIN_DIR/$CHAIN_ID/val2 -export VAL_2_MNEMONIC="friend excite rough reopen cover wheel spoon convince island path clean monkey play snow number walnut pull lock shoot hurry dream divide concert discover" -export VAL_2_KEY_NAME="val2" -export VAL_2_MONIKER="Validator Two" - -# Validator 1 -echo "Initializing $CHAIN_ID..." -$BINARY init test --home $VAL_1_CHAIN_DIR --chain-id=$CHAIN_ID - -echo "Adding genesis accounts..." -echo $VAL_1_MNEMONIC | $BINARY --home $VAL_1_CHAIN_DIR keys add $VAL_1_KEY_NAME --recover --keyring-backend=test - -# Validator 2 -echo "Initializing $CHAIN_ID..." -$BINARY --home $VAL_2_CHAIN_DIR init test --chain-id=$CHAIN_ID - -echo "Adding genesis accounts..." -echo $VAL_2_MNEMONIC | $BINARY --home $VAL_2_CHAIN_DIR keys add $VAL_2_KEY_NAME --recover --keyring-backend=test - -# Account 1 -export USER_1_CHAIN_DIR=$CHAIN_DIR/$CHAIN_ID/val2 -export USER_1_MNEMONIC="render hire dirt bulk huge goat jungle number wear method check during menu goat accident scan noise nerve below target resource digital column flee" -export USER_1_KEY_NAME="user1" - -#- name: user1 -# type: local -# address: cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6 -# pubkey: cosmospub1addwnpepqtpngaangvnl5pvlaltfreq28djqskzd6g6pw89pztj2cg44uyl7y6xgev8 - -# Account 2 -export USER_2_CHAIN_DIR=$CHAIN_DIR/$CHAIN_ID/val2 -export USER_2_MNEMONIC="junk appear guide guess bar reject vendor illegal script sting shock afraid detect ginger other theory relief dress develop core pull across hen float" -export USER_2_KEY_NAME="user2" - -#- name: user2 -# type: local -# address: cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 -# pubkey: cosmospub1addwnpepq2gvu5e8m34xpe5aky8wemsc9fefqs4y8h07s24cklr8lwrewf2lklysaen - -echo $USER_1_MNEMONIC | $BINARY --home $USER_1_CHAIN_DIR keys add $USER_1_KEY_NAME --recover --keyring-backend=test -echo $USER_2_MNEMONIC | $BINARY --home $USER_2_CHAIN_DIR keys add $USER_2_KEY_NAME --recover --keyring-backend=test -``` - -### 6. Copy exported genesis file and configure `config.toml` and `app.toml` - -```bash -# copy genesis file -cp genesis.json $VAL_1_CHAIN_DIR/config/genesis.json -cp genesis.json $VAL_2_CHAIN_DIR/config/genesis.json - -# copy validator keys -cp priv_validator_key_val1.json $VAL_1_CHAIN_DIR/config/priv_validator_key.json -cp priv_validator_key_val2.json $VAL_2_CHAIN_DIR/config/priv_validator_key.json - -# configure config and app toml -export VAL_1_P2P_PORT=26656 -export VAL_2_P2P_PORT=36656 -export VAL_2_RPC_PORT=36657 -export VAL_2_API_PORT=1327 -export VAL_2_GRPC_PORT=9080 -export VAL_2_PPROF_PORT=6061 -sed -i '' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:'"$VAL_2_RPC_PORT"'"#g' $VAL_2_CHAIN_DIR/config/config.toml -sed -i '' 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:'"$VAL_2_P2P_PORT"'"#g' $VAL_2_CHAIN_DIR/config/config.toml -sed -i '' 's#"tcp://0.0.0.0:1317"#"tcp://0.0.0.0:'"$VAL_2_API_PORT"'"#g' $VAL_2_CHAIN_DIR/config/app.toml -sed -i '' 's#"0.0.0.0:9090"#"0.0.0.0:'"$VAL_2_GRPC_PORT"'"#g' $VAL_2_CHAIN_DIR/config/app.toml -sed -i '' 's/enable = false/enable = true/g' $VAL_2_CHAIN_DIR/config/app.toml -sed -i '' 's/swagger = false/swagger = true/g' $VAL_2_CHAIN_DIR/config/app.toml - -# configure peers -export VAL_1_NODE_ID=$($BINARY tendermint --home $VAL_1_CHAIN_DIR show-node-id) -export VAL_2_NODE_ID=$($BINARY tendermint --home $VAL_2_CHAIN_DIR show-node-id) -sed -i '' 's/persistent_peers = ""/persistent_peers = "'$VAL_2_NODE_ID'@'localhost':'$VAL_2_P2P_PORT'"/g' $VAL_1_CHAIN_DIR/config/config.toml -sed -i '' 's/persistent_peers = ""/persistent_peers = "'$VAL_1_NODE_ID'@'localhost':'$VAL_1_P2P_PORT'"/g' $VAL_2_CHAIN_DIR/config/config.toml -sed -i '' 's/unconditional_peer_ids = ""/unconditional_peer_ids = "'$VAL_1_NODE_ID'"/g' $VAL_2_CHAIN_DIR/config/config.toml -sed -i '' 's/unconditional_peer_ids = ""/unconditional_peer_ids = "'$VAL_2_NODE_ID'"/g' $VAL_1_CHAIN_DIR/config/config.toml -sed -i '' 's/pprof_laddr = "localhost:6060"/pprof_laddr = "localhost:'$VAL_2_PPROF_PORT'"/g' $VAL_2_CHAIN_DIR/config/config.toml -sed -i '' 's/addr_book_strict = true/addr_book_strict = false/g' $VAL_2_CHAIN_DIR/config/config.toml -sed -i '' 's/addr_book_strict = true/addr_book_strict = false/g' $VAL_1_CHAIN_DIR/config/config.toml -``` -verify genesis hash after modification - -`cat genesis.json | shasum -a 256` - -> `e0143b053719f78d43a2487e1de5a8d2daeb3e51694812e313edaf743f799c71` - - - -### 7. Let's start chain - -```bash -# start validator nodes -export HOME1=./data/cosmoshub-4/val1 -export HOME2=./data/cosmoshub-4/val2 - -# use terminal 1 -$BINARY start --home $HOME1 --x-crisis-skip-assert-invariants - -# use terminal 2 -$BINARY start --home $HOME2 --x-crisis-skip-assert-invariants -``` -### 8. Upgrade test - -```bash -# v4.2.1 -gaiad version - -# submit upgrade proposal -# make sure upgrade-height has enough time for the proposal to pass -gaiad tx gov submit-proposal software-upgrade Gravity-DEX \ ---deposit 1000uatom \ ---title Gravity-DEX \ ---upgrade-height {your target height, ex) 6910000} \ ---upgrade-info "v5.0.0-4760cf1f1266accec7a107f440d46d9724c6fd08" \ ---description "This on-chain upgrade governance proposal is to adopt the Gravity DEX protocol on the Cosmos Hub. By voting YES to this proposal, you approve of adding the Gravity DEX protocol on the Cosmos Hub.\\n\\n### Background\\n\\nIn July 2020, the Iqlusion team developed ATOM 2021 to drive the direction of the Cosmos Hub after the completion of the Cosmos whitepaper and IBC. It became clear that providing liquidity to new IBC connected zones was core the Hub's mission. \\n\\nTendermint ([https://tendermint.com](https://tendermint.com/)) and B-Harvest ([https://bharvest.io](https://bharvest.io/)) joined forces to produce and develop a Liquidity Module ([https://github.com/tendermint/liquidity](https://github.com/tendermint/liquidity)). In 2021 March, they submitted a signal governance proposal to ask the Atom delegator community about Gravity DEX (Liquidity Module) adoption on the Cosmos Hub. Prop38 was very well approved by the community ([https://www.mintscan.io/cosmos/proposals/38](https://www.mintscan.io/cosmos/proposals/38)).\\n\\nThis proposal completes the first leg of ATOM 2021 and achieves the goals of the signaling proposal by bringing an IBC compatible DEX to the Hub.\\n\\n### Ready for Production\\n\\nWith continuous quality improvement of the codebase, very wide test coverage, a codebase audit from Least Authority and Simply VC, and subsequent follow-up codebase strengthening, along with extensive simulation processes, we are now very confident to be ready for production utilization of the Gravity DEX (Liquidity Module) on the Cosmos Hub. The Gaia branch for the new release with Gravity DEX feature can be found [here](https://github.com/cosmos/gaia/releases/tag/v5.0.0)). Please also check out the [github repository](https://github.com/b-harvest/gravity-dex-upgrade-test) for the launch testing of Gaia with Gravity DEX.\\n\\n### On-Chain Upgrade Process\\n\\nWhen the network reaches the halt height, the state machine program of the Cosmos Hub will be halted. And then, all validators and node operators have to substitute the existing state machine binary to the new binary with the Gravity DEX feature. Because it is an onchain upgrade process, the blockchain will be continued with all the accumulated history with continuous block height.\\n\\n### Potential Risk Factors\\n\\nAlthough Tendermint executed very extensive testing and simulation, and conducted in-depth audits, and followed up with the corresponding codebase improvement, there always still exists a risk that the Cosmos Hub might experience problems due to potential bugs or errors from the new Gravity DEX feature. In the case of serious problems, validators should stop operating the network immediately, and use the fixed state machine program provided by Tendermint." \ ---gas 400000 \ ---from user1 \ ---keyring-backend test \ ---chain-id cosmoshub-4-upgrade-testnet-1001 \ ---home data/cosmoshub-4/val2 \ ---node tcp://localhost:36657 - -# vote yes for the proposal -# note that voting period, quorum, and threshold params are modified -gaiad tx gov vote 50 yes -y \ ---from user1 \ ---keyring-backend test \ ---chain-id cosmoshub-4-upgrade-testnet-1001 \ ---home data/cosmoshub-4/val2 \ ---node tcp://127.0.0.1:36657 - -# query the proposal to check if it is passed -# the status should be PROPOSAL_STATUS_PASSED -gaiad query gov proposal 50 \ ---chain-id cosmoshub-4-upgrade-testnet-1001 \ ---home data/cosmoshub-4/val2 \ ---node tcp://127.0.0.1:36657 -``` - -```json -// result of the proposal -content: - '@type': /cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - description: This on-chain upgrade governance proposal is to adopt the Gravity DEX - protocol on the Cosmos Hub. By voting YES to this proposal, you approve of adding - the Gravity DEX protocol on the Cosmos Hub.\n\n### Background\n\nIn July 2020, - the Iqlusion team developed ATOM 2021 to drive the direction of the Cosmos Hub - after the completion of the Cosmos whitepaper and IBC. It became clear that providing - liquidity to new IBC connected zones was core the Hub's mission. \n\nTendermint - ([https://tendermint.com](https://tendermint.com/)) and B-Harvest ([https://bharvest.io](https://bharvest.io/)) joined - forces to produce and develop a Liquidity Module ([https://github.com/tendermint/liquidity](https://github.com/tendermint/liquidity)). - In 2021 March, they submitted a signal governance proposal to ask the Atom delegator - community about Gravity DEX (Liquidity Module) adoption on the Cosmos Hub. Prop38 - was very well approved by the community ([https://www.mintscan.io/cosmos/proposals/38](https://www.mintscan.io/cosmos/proposals/38)).\n\nThis - proposal completes the first leg of ATOM 2021 and achieves the goals of the signaling - proposal by bringing an IBC compatible DEX to the Hub.\n\n### Ready for Production\n\nWith - continuous quality improvement of the codebase, very wide test coverage, a codebase - audit from Least Authority and Simply VC, and subsequent follow-up codebase strengthening, - along with extensive simulation processes, we are now very confident to be ready - for production utilization of the Gravity DEX (Liquidity Module) on the Cosmos - Hub. The Gaia branch for the new release with Gravity DEX feature can be found - [here](https://github.com/cosmos/gaia/releases/tag/v5.0.0)). Please also check - out the [github repository](https://github.com/b-harvest/gravity-dex-upgrade-test) - for the launch testing of Gaia with Gravity DEX.\n\n### On-Chain Upgrade Process\n\nWhen - the network reaches the halt height, the state machine program of the Cosmos Hub - will be halted. And then, all validators and node operators have to substitute - the existing state machine binary to the new binary with the Gravity DEX feature. - Because it is an onchain upgrade process, the blockchain will be continued with - all the accumulated history with continuous block height.\n\n### Potential Risk - Factors\n\nAlthough Tendermint executed very extensive testing and simulation, - and conducted in-depth audits, and followed up with the corresponding codebase - improvement, there always still exists a risk that the Cosmos Hub might experience - problems due to potential bugs or errors from the new Gravity DEX feature. In - the case of serious problems, validators should stop operating the network immediately, - and use the fixed state machine program provided by Tendermint. - plan: - height: "6659310" - info: v5.0.0-4760cf1f1266accec7a107f440d46d9724c6fd08 - name: Gravity-DEX - time: "0001-01-01T00:00:00Z" - upgraded_client_state: null - title: Gravity-DEX -deposit_end_time: "2021-07-12T15:44:27.561917Z" -final_tally_result: - abstain: "0" - "no": "0" - no_with_veto: "0" - "yes": "72642221" -proposal_id: "50" -status: PROPOSAL_STATUS_PASSED -submit_time: "2021-06-28T15:44:27.561917Z" -total_deposit: -- amount: "1000" - denom: uatom -voting_end_time: "2021-06-28T15:45:27.561917Z" -voting_start_time: "2021-06-28T15:44:27.561917Z" -``` -### 9. Restart node using new gaiad gravity-dex version, - -The proposal has passed and it is all good to go. When `upgrade-height` is reached, the node must be halted for upgrade. - -> ERR UPGRADE "Gravity-DEX" NEEDED at height: 6659975: v4.3.0-testhash -> ERR CONSENSUS FAILURE!!! err="UPGRADE \"Gravity-DEX\" NEEDED at height: 6659975: v4.3.0-testhash" module=consensus stack="goroutine 496414... - -```bash -# gaia version that includes gravity-dex module -# https://github.com/b-harvest/gravity-dex/releases/tag/v1.0.4 -# latest add-liquidity-module-to-gaia branch -gaiad version --> v5.0.0 - -gaiad start --home $HOME1 --x-crisis-skip-assert-invariants -gaiad start --home $HOME2 --x-crisis-skip-assert-invariants -``` -### 10. Test liquidity module - -```bash -# query liquidity parameters -gaiad query liquidity params \ ---node tcp://127.0.0.1:36657 - -# create liquidity pool -gaiad tx liquidity create-pool 1 1000000ibc/1BE91D67775723D3230A9A5AC54BB29B92A5A51B4B8F20BBA37DF1CFA602297C,1000000uatom \ ---from user2 --keyring-backend test \ ---home data/cosmoshub-4/val2 \ ---chain-id cosmoshub-4-upgrade-testnet-1001 \ ---gas 300000 \ ---node tcp://127.0.0.1:36657 - -# query liquidity pool -gaiad query liquidity pools \ ---node tcp://127.0.0.1:36657 - -# swap request -gaiad tx liquidity swap 1 1 100000uatom ibc/1BE91D67775723D3230A9A5AC54BB29B92A5A51B4B8F20BBA37DF1CFA602297C 0.019 0.003 \ ---from user2 --keyring-backend test \ ---home data/cosmoshub-4/val2 \ ---chain-id cosmoshub-4-upgrade-testnet-1001 \ ---node tcp://127.0.0.1:36657 - -gaiad query auth account cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6 \ ---node tcp://127.0.0.1:36657 - -gaiad query auth account cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 \ ---node tcp://127.0.0.1:36657 - -# withdraw request -gaiad tx liquidity withdraw 1 1000pool024B000726712F1093C7D24EC329DE498EBB85B4B2D37C59D4F37BC542020151 \ ---from user2 --keyring-backend test \ ---home data/cosmoshub-4/val2 \ ---chain-id cosmoshub-4-upgrade-testnet-1001 \ ---node tcp://127.0.0.1:36657 - -# query balance after swap transacted -gaiad query bank balances cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 \ ---node tcp://127.0.0.1:36657 - -``` - -```json -// result of liquidity module params -circuit_breaker_enabled: false -init_pool_coin_mint_amount: "1000000" -max_order_amount_ratio: "0.100000000000000000" -max_reserve_coin_amount: "0" -min_init_deposit_amount: "1000000" -pool_creation_fee: -- amount: "100000000" - denom: uatom -pool_types: -- description: "" - id: 1 - max_reserve_coin_num: 2 - min_reserve_coin_num: 2 - name: DefaultPoolType -swap_fee_rate: "0.003000000000000000" -unit_batch_height: 1 -withdraw_fee_rate: "0.003000000000000000" -``` - -```json -// result of created liquidity pool -pagination: - next_key: null - total: "1" -pools: -- id: "1" - pool_coin_denom: pool024B000726712F1093C7D24EC329DE498EBB85B4B2D37C59D4F37BC542020151 - reserve_account_address: cosmos1qf9sqpexwyh3py786f8vx2w7fx8thpd5wz79sf - reserve_coin_denoms: - - ibc/1BE91D67775723D3230A9A5AC54BB29B92A5A51B4B8F20BBA37DF1CFA602297C - - uatom - type_id: 1 -``` - - -# Public Testnet info - -### Join Validator - -If you want to participate in the testnet as a validator, you can use the same account, validator key of the cosmoshub-4, or if you request an issue like [this](https://github.com/b-harvest/gravity-dex-upgrade-test/issues/1), we will send you some coins for the delegation manually. - - -### Chain-ID - -⚠️ Latest testnet:`cosmoshub-4-upgrade-testnet-1001`⚠️ July 6, 2021 2:00 GMT - -### Update History - -#### July 6, 2021 2:00 GMT - cosmoshub-4-upgrade-testnet-1001 - -`cosmoshub-4-upgrade-testnet` was updated to `cosmoshub-4-upgrade-testnet-1001` for fixing invariant errors - - -### Genesis - -Download the genesis here: [genesis.json.tar.bz2](https://github.com/b-harvest/gravity-dex-upgrade-test/blob/master/genesis.json.tar.bz2) of latest testnet:`cosmoshub-4-upgrade-testnet-1001`⚠️ July 6, 2021 2:00 GMT - -`tar xvzf genesis.json.tar.bz2` - -`cat genesis.json | shasum -a 256` - -> e0143b053719f78d43a2487e1de5a8d2daeb3e51694812e313edaf743f799c71 - - - -### Binary - -The testnet was started based on [gaia v4.2.1](https://github.com/cosmos/gaia/releases/tag/v4.2.1) and upgraded to [gaia v5.0.0](https://github.com/cosmos/gaia/releases/tag/v5.0.0) on `6659381` Height by `SoftwareUpgradeProposal` [#50](http://49.247.196.44:1317/cosmos/gov/v1beta1/proposals/50). - -So when you start to sync your node, you have to use the [gaia v4.2.1](https://github.com/cosmos/gaia/releases/tag/v4.2.1), And when it stops at the `6659381` height with the below panic, you should restart using [gaia v5.0.0](https://github.com/cosmos/gaia/releases/tag/v5.0.0). - -```bash -ERR UPGRADE "Gravity-DEX" NEEDED at height: 6659381: v5.0.0-4760cf1f1266accec7a107f440d46d9724c6fd08 -panic: UPGRADE "Gravity-DEX" NEEDED at height: 6659381: v5.0.0-4760cf1f1266accec7a107f440d46d9724c6fd08 -``` - - - -### P2P - -`791dd7d0d217e8a761261ab7a2d8105326f46604@49.247.196.44:26656` - -`74ca644dd1cce437aed792000066d2752aa69904@49.247.196.46:26656` - - - -### Endpoint - -`49.247.196.44:1317` - -`49.247.196.44:26657` - -`49.247.196.44:9090` - - - -`49.247.196.46:1317` - -`49.247.196.46:26657` - -`49.247.196.46:9090` - - - -min gas = 0 - -p2p peers = 200 - - - - - -# (Research) Modified `genesis.json` - -`diff exported_genesis_with_height_6659211_sorted_origin.json genesis.json -u` - -```diff ---- exported_genesis_with_height_6659211_sorted_origin.json 2021-06-21 18:15:44.000000000 +0900 -+++ genesis.json 2021-07-06 11:13:39.000000000 +0900 -@@ -194199,10 +194199,10 @@ - { - "@type": "/cosmos.auth.v1beta1.BaseAccount", - "account_number": "27720", -- "address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "pub_key": { - "@type": "/cosmos.crypto.secp256k1.PubKey", -- "key": "A6apc7iThbRkwboKqPy6eXxxQvTH+0lNkXZvugDM9V4g" -+ "key": "ApDOUyfcamDmnbEO7O4YKnKQQqQ93+gquLfGf7h5clX7" - }, - "sequence": "203" - }, -@@ -1223676,10 +1223676,10 @@ - { - "@type": "/cosmos.auth.v1beta1.BaseAccount", - "account_number": "10668", -- "address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", -+ "address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", - "pub_key": { - "@type": "/cosmos.crypto.secp256k1.PubKey", -- "key": "Am5HzAWtsyvoQy49DyM4Q1sZiZL6UvTgKSJW4ERAhCR8" -+ "key": "AsM0d7NDJ/oFn+/WkeQKO2QIWE3SNBccoRLkrCK14T/i" - }, - "sequence": "15" - }, -@@ -2999974,7 +2999974,7 @@ - ] - }, - { -- "address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "coins": [ - { - "amount": "10000000", -@@ -2999993,7 +2999993,7 @@ - "denom": "ibc/EC4B5D87917DD5668D9998146F82D70FDF86652DB333D04CE29D1EB18E296AF5" - }, - { -- "amount": "107120822", -+ "amount": "1000000000107120822", - "denom": "uatom" - } - ] -@@ -3425455,7 +3425455,7 @@ - "address": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh", - "coins": [ - { -- "amount": "191488904896901", -+ "amount": "6191488904896901", - "denom": "uatom" - } - ] -@@ -3621122,7 +3621122,7 @@ - "coins": [] - }, - { -- "address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", -+ "address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", - "coins": [ - { - "amount": "1462406", -@@ -4626926,7 +4626926,7 @@ - "denom": "ibc/FEE3FB19682DAAAB02A0328A2B84A80E7DDFE5BA48F7D2C8C30AAC649B8DD519" - }, - { -- "amount": "274699904554428", -+ "amount": "1006274699904554428", - "denom": "uatom" - } - ] -@@ -4715562,7 +4715562,7 @@ - "validator_address": "cosmosvaloper1pjmngrwcsatsuyy8m3qrunaun67sr9x7z5r2qs" - }, - { -- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "starting_info": { - "height": "6655951", - "previous_period": "616", -@@ -4888785,7 +4888785,7 @@ - "validator_address": "cosmosvaloper1tflk30mq5vgqjdly92kkhhq3raev2hnz6eete3" - }, - { -- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "starting_info": { - "height": "6655951", - "previous_period": "392907", -@@ -5277153,7 +5277153,7 @@ - "validator_address": "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0" - }, - { -- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", -+ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", - "starting_info": { - "height": "6391150", - "previous_period": "71961", -@@ -5301687,7 +5301687,7 @@ - "validator_address": "cosmosvaloper1jlr62guqwrwkdt4m3y00zh2rrsamhjf9num5xr" - }, - { -- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "starting_info": { - "height": "6655951", - "previous_period": "1457", -@@ -5325366,7 +5325366,7 @@ - "validator_address": "cosmosvaloper1n229vhepft6wnkt5tjpwmxdmcnfz55jv3vp77d" - }, - { -- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", -+ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", - "starting_info": { - "height": "6391163", - "previous_period": "26989", -@@ -5390427,7 +5390427,7 @@ - "validator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" - }, - { -- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", -+ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", - "starting_info": { - "height": "6391150", - "previous_period": "100085", -@@ -5433190,7 +5433190,7 @@ - "starting_info": { - "height": "0", - "previous_period": "27294", -- "stake": "25390741.000000000000000000" -+ "stake": "6000000025390741.000000000000000000" - }, - "validator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" - }, -@@ -5449242,7 +5449242,7 @@ - "validator_address": "cosmosvaloper14l0fp639yudfl46zauvv8rkzjgd4u0zk2aseys" - }, - { -- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "starting_info": { - "height": "6655951", - "previous_period": "23914", -@@ -5481786,7 +5481786,7 @@ - "validator_address": "cosmosvaloper1hjct6q7npsspsg3dgvzk3sdf89spmlpfdn6m9d" - }, - { -- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "starting_info": { - "height": "6655951", - "previous_period": "5048", -@@ -5562516,7 +5562516,7 @@ - "validator_address": "cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn" - }, - { -- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "starting_info": { - "height": "6655951", - "previous_period": "71384", -@@ -5573739,7 +5573739,7 @@ - "validator_address": "cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn" - }, - { -- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", -+ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", - "starting_info": { - "height": "6391150", - "previous_period": "68153", -@@ -5602728,7 +5602728,7 @@ - "validator_address": "cosmosvaloper1ey69r37gfxvxg62sh4r0ktpuc46pzjrm873ae8" - }, - { -- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "starting_info": { - "height": "6655951", - "previous_period": "252870", -@@ -5752803,7 +5752803,7 @@ - "validator_address": "cosmosvaloper1et77usu8q2hargvyusl4qzryev8x8t9wwqkxfs" - }, - { -- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "starting_info": { - "height": "6655951", - "previous_period": "3996", -@@ -7470242,7 +7470242,7 @@ - "max_deposit_period": "1209600s", - "min_deposit": [ - { -- "amount": "64000000", -+ "amount": "1", - "denom": "uatom" - } - ] -@@ -7471209,7 +7471209,7 @@ - "submit_time": "2021-06-02T17:30:15.614131648Z", - "total_deposit": [ - { -- "amount": "64000000", -+ "amount": "1", - "denom": "uatom" - } - ], -@@ -7471244,8 +7471244,8 @@ - ], - "starting_proposal_id": "50", - "tally_params": { -- "quorum": "0.400000000000000000", -- "threshold": "0.500000000000000000", -+ "quorum": "0.000000000000000001", -+ "threshold": "0.000000000000000001", - "veto_threshold": "0.334000000000000000" - }, - "votes": [ -@@ -7476031,7 +7476031,7 @@ - } - ], - "voting_params": { -- "voting_period": "1209600s" -+ "voting_period": "60s" - } - }, - "ibc": { -@@ -9342270,7 +9342270,7 @@ - ] - }, - { -- "address": "cosmosvalcons1s0686a68krmr8f46ph6fklw0v8us4gdsm7nhz3", -+ "address": "cosmosvalcons10jc8h98awslz4pfqc26smf9sxaqxgwl4vxpcrp", - "missed_blocks": [ - { - "index": "10", -@@ -9827071,7 +9827071,7 @@ - ] - }, - { -- "address": "cosmosvalcons1kq9xxgmn0uepav9c6kwxl4yh599kpyu28e7ee6", -+ "address": "cosmosvalcons16k44u3v0m8uevnh4p2qy2xm08y3wdf92xsc3ve", - "missed_blocks": [ - { - "index": "0", -@@ -10797296,7 +10797296,7 @@ - } - }, - { -- "address": "cosmosvalcons1s0686a68krmr8f46ph6fklw0v8us4gdsm7nhz3", -+ "address": "cosmosvalcons10jc8h98awslz4pfqc26smf9sxaqxgwl4vxpcrp", - "validator_signing_info": { - "address": "", - "index_offset": "6827172", -@@ -10797747,7 +10797747,7 @@ - } - }, - { -- "address": "cosmosvalcons1kq9xxgmn0uepav9c6kwxl4yh599kpyu28e7ee6", -+ "address": "cosmosvalcons16k44u3v0m8uevnh4p2qy2xm08y3wdf92xsc3ve", - "validator_signing_info": { - "address": "", - "index_offset": "10061206", -@@ -10842841,42 +10842841,42 @@ - "validator_address": "cosmosvaloper1tflk30mq5vgqjdly92kkhhq3raev2hnz6eete3" - }, - { -- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "shares": "3000000.000000000000000000", - "validator_address": "cosmosvaloper1pjmngrwcsatsuyy8m3qrunaun67sr9x7z5r2qs" - }, - { -- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "shares": "5000000.000000000000000000", - "validator_address": "cosmosvaloper1tflk30mq5vgqjdly92kkhhq3raev2hnz6eete3" - }, - { -- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "shares": "16100000.000000000000000000", - "validator_address": "cosmosvaloper1jlr62guqwrwkdt4m3y00zh2rrsamhjf9num5xr" - }, - { -- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "shares": "1000000.000000000000000000", - "validator_address": "cosmosvaloper14l0fp639yudfl46zauvv8rkzjgd4u0zk2aseys" - }, - { -- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "shares": "1000000.000000000000000000", - "validator_address": "cosmosvaloper1hjct6q7npsspsg3dgvzk3sdf89spmlpfdn6m9d" - }, - { -- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "shares": "3000000.000000000000000000", - "validator_address": "cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn" - }, - { -- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "shares": "999999.999433247914197563", - "validator_address": "cosmosvaloper1ey69r37gfxvxg62sh4r0ktpuc46pzjrm873ae8" - }, - { -- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", -+ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", - "shares": "2000000.000000000000000000", - "validator_address": "cosmosvaloper1et77usu8q2hargvyusl4qzryev8x8t9wwqkxfs" - }, -@@ -11073821,22 +11073821,22 @@ - "validator_address": "cosmosvaloper196ax4vc0lwpxndu9dyhvca7jhxp70rmcvrj90c" - }, - { -- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", -+ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", - "shares": "5717570.000000000000000000", - "validator_address": "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0" - }, - { -- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", -+ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", - "shares": "845084.506445134833187816", - "validator_address": "cosmosvaloper1n229vhepft6wnkt5tjpwmxdmcnfz55jv3vp77d" - }, - { -- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", -+ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", - "shares": "10238742.000000000000000000", - "validator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" - }, - { -- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", -+ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", - "shares": "55840909.000000000000000000", - "validator_address": "cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn" - }, -@@ -11445277,7 +11445277,7 @@ - }, - { - "delegator_address": "cosmos1ll705078lwg6yksn3flktpvzpe56gwvh7xmynw", -- "shares": "25390741.000000000000000000", -+ "shares": "6000000025390741.000000000000000000", - "validator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" - }, - { -@@ -11445342,7 +11445342,7 @@ - } - ], - "exported": true, -- "last_total_power": "191488844", -+ "last_total_power": "6191488844", - "last_validator_powers": [ - { - "address": "cosmosvaloper1qwl879nx9t6kef4supyazayf7vjhennyh568ys", -@@ -11445658,7 +11445658,7 @@ - }, - { - "address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf", -- "power": "13488360" -+ "power": "6013488360" - }, - { - "address": "cosmosvaloper15urq2dtp9qce4fyc85m6upwm9xul3049e02707", -@@ -11518421,7 +11518421,7 @@ - }, - "consensus_pubkey": { - "@type": "/cosmos.crypto.ed25519.PubKey", -- "key": "cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM=" -+ "key": "qwiUMxz3llsy45fPvM0a8+XQeAJLvrX3QAEJmRMEEoU=" - }, - "delegator_shares": "2792532348046.000000000000000000", - "description": { -@@ -11523612,9 +11523612,9 @@ - }, - "consensus_pubkey": { - "@type": "/cosmos.crypto.ed25519.PubKey", -- "key": "W459Kbdx+LJQ7dLVASW6sAfdqWqNRSXnvc53r9aOx/o=" -+ "key": "oi55Dw+JjLQc4u1WlAS3FsGwh5fd5/N5cP3VOLnZ/H0=" - }, -- "delegator_shares": "13488360679504.000000000000000000", -+ "delegator_shares": "6013488360679504.000000000000000000", - "description": { - "details": "Exchange the world", - "identity": "", -@@ -11523626,7 +11523626,7 @@ - "min_self_delegation": "1", - "operator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf", - "status": "BOND_STATUS_BONDED", -- "tokens": "13488360679504", -+ "tokens": "6013488360679504", - "unbonding_height": "0", - "unbonding_time": "1970-01-01T00:00:00Z" - }, -@@ -11526724,7 +11526724,7 @@ - "upgrade": {}, - "vesting": {} - }, -- "chain_id": "cosmoshub-4", -+ "chain_id": "cosmoshub-4-upgrade-testnet-1001", - "consensus_params": { - "block": { - "max_bytes": "200000", -@@ -11526747,12 +11526747,12 @@ - "initial_height": "6659211", - "validators": [ - { -- "address": "B00A6323737F321EB0B8D59C6FD497A14B60938A", -+ "address": "D5AB5E458FD9F9964EF50A80451B6F3922E6A4AA", - "name": "Certus One", - "power": "2792532", - "pub_key": { - "type": "tendermint/PubKeyEd25519", -- "value": "cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM=" -+ "value": "qwiUMxz3llsy45fPvM0a8+XQeAJLvrX3QAEJmRMEEoU=" - } - }, - { -@@ -11527449,12 +11527449,12 @@ - } - }, - { -- "address": "83F47D7747B0F633A6BA0DF49B7DCF61F90AA1B0", -+ "address": "7CB07B94FD743E2A8520C2B50DA4B03740643BF5", - "name": "Binance Staking", -- "power": "13488360", -+ "power": "6013488360", - "pub_key": { - "type": "tendermint/PubKeyEd25519", -- "value": "W459Kbdx+LJQ7dLVASW6sAfdqWqNRSXnvc53r9aOx/o=" -+ "value": "oi55Dw+JjLQc4u1WlAS3FsGwh5fd5/N5cP3VOLnZ/H0=" - } - }, - { - -``` +- [Delta Upgrade](https://github.com/cosmos/gaia/blob/main/docs/roadmap/cosmos-hub-roadmap-2.0.md#delta-upgrade-completed-july-12-2021) \ No newline at end of file diff --git a/exported_genesis_with_height_6659211_sorted_origin.json.tar.bz2 b/data/exported_genesis_with_height_6659211_sorted_origin.json.tar.bz2 similarity index 100% rename from exported_genesis_with_height_6659211_sorted_origin.json.tar.bz2 rename to data/exported_genesis_with_height_6659211_sorted_origin.json.tar.bz2 diff --git a/data/exported_genesis_with_height_7304500_sorted.json.tar.bz2 b/data/exported_genesis_with_height_7304500_sorted.json.tar.bz2 new file mode 100644 index 0000000..459bdab Binary files /dev/null and b/data/exported_genesis_with_height_7304500_sorted.json.tar.bz2 differ diff --git a/priv_validator_key_val1.json b/data/priv_validator_key_val1.json similarity index 100% rename from priv_validator_key_val1.json rename to data/priv_validator_key_val1.json diff --git a/priv_validator_key_val2.json b/data/priv_validator_key_val2.json similarity index 100% rename from priv_validator_key_val2.json rename to data/priv_validator_key_val2.json diff --git a/v5.0.0/README.md b/v5.0.0/README.md new file mode 100644 index 0000000..07628ef --- /dev/null +++ b/v5.0.0/README.md @@ -0,0 +1,959 @@ +# Gravity-DEX Upgrade Test + +This repository describes procedures and contains results of upgrade test for the `Gravity-DEX` on the exported state of `cosmoshub-4` chain. + +To get more context about this repo, please reference the following [issue](https://github.com/tendermint/liquidity/issues/403) and [pull request](https://github.com/cosmos/gaia/pull/859). + +# Version + +- Build this [gaia v4.2.1](https://github.com/cosmos/gaia/releases/tag/v4.2.1) that is used in `cosmoshub-4` + +- This [gaia v5.0.0](https://github.com/cosmos/gaia/releases/tag/v5.0.0) is used for `Gravity-DEX` upgrade + +# Genesis configuration + +- This `exported_genesis_with_height_6659211_sorted_origin.json` zip file is prepared in this repository. It is exported using `gaiad export` command on block height `6659211` from `cosmoshub-4` network. Unzip the attached genesis file to proceed the next steps in this guide. + +- This `genesis.json.tar.bz2` zip file is the filw that already proceeded all the modifications and is ready to be used right away. You can skip the next steps and use this to proceed the upgrade test. + +## Unzip the tar files and verify the hashes + +As stated above, skip the below steps if you decide to use `genesis.json.tar.bz2`. + +### 1. Verify the hash and copy exported state file + +```bash +# unzip the file +tar xvzf exported_genesis_with_height_6659211_sorted_origin.json.tar.bz2 + +# verify the hash +# it should return a955b5752f2f0e5384a1e99323ad2ca6c9db58c7b605123bb5896693882136f4 +cat exported_genesis_with_height_6659211_sorted_origin.json | shasum -a 256 + +# change the name to genesis.json +cp exported_genesis_with_height_6659211_sorted_origin.json genesis.json +``` + +### 2. Substitue validator keys and accounts + +In this step, we're swapping two validators and add two different accounts. Also, we're going to modify some parameters for test efficiency. + +The following files and mnemonics for the two different accounts are already provided: + +- `priv_validator_key_val1.json`: validator1's consensus key + +- `priv_validator_key_val2.json`: validator2's consensus key + +- `guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host`: The mnemonic for account1. This account is used for validator1 + +- `friend excite rough reopen cover wheel spoon convince island path clean monkey play snow number walnut pull lock shoot hurry dream divide concert discover`: The mnemonic for account2. This account is used to test some cli interfaces for the liquidity module. + +- `render hire dirt bulk huge goat jungle number wear method check during menu goat accident scan noise nerve below target resource digital column flee`: This account is `user1` that is used for sending governance proposal and voting the proposal. + +- `junk appear guide guess bar reject vendor illegal script sting shock afraid detect ginger other theory relief dress develop core pull across hen float`: This account is `user2` that is used to test some cli interfaces for the liquidity module. + +```bash +# configure variables +export EXPORTED_GENESIS=genesis.json +export BINARY=gaiad +export CHAIN_ID=cosmoshub-4-upgrade-testnet-1001 +export CHAIN_DIR=./data + +sed -i '' 's%"chain_id": "cosmoshub-4",%"chain_id": "cosmoshub-4-upgrade-testnet-1001",%g' $EXPORTED_GENESIS + +# substitue validator1 +sed -i '' 's%cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM=%qwiUMxz3llsy45fPvM0a8+XQeAJLvrX3QAEJmRMEEoU=%g' $EXPORTED_GENESIS +sed -i '' 's%B00A6323737F321EB0B8D59C6FD497A14B60938A%D5AB5E458FD9F9964EF50A80451B6F3922E6A4AA%g' $EXPORTED_GENESIS +sed -i '' 's%cosmosvalcons1kq9xxgmn0uepav9c6kwxl4yh599kpyu28e7ee6%cosmosvalcons16k44u3v0m8uevnh4p2qy2xm08y3wdf92xsc3ve%g' $EXPORTED_GENESIS + +# substitue validator2 +sed -i '' 's%W459Kbdx+LJQ7dLVASW6sAfdqWqNRSXnvc53r9aOx/o=%oi55Dw+JjLQc4u1WlAS3FsGwh5fd5/N5cP3VOLnZ/H0=%g' $EXPORTED_GENESIS +sed -i '' 's%83F47D7747B0F633A6BA0DF49B7DCF61F90AA1B0%7CB07B94FD743E2A8520C2B50DA4B03740643BF5%g' $EXPORTED_GENESIS +sed -i '' 's%cosmosvalcons1s0686a68krmr8f46ph6fklw0v8us4gdsm7nhz3%cosmosvalcons10jc8h98awslz4pfqc26smf9sxaqxgwl4vxpcrp%g' $EXPORTED_GENESIS + +# substitute user1 account +# cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl --> cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6 +# Am5HzAWtsyvoQy49DyM4Q1sZiZL6UvTgKSJW4ERAhCR8 --> AsM0d7NDJ/oFn+/WkeQKO2QIWE3SNBccoRLkrCK14T/i +sed -i '' 's%cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl%cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6%g' $EXPORTED_GENESIS +sed -i '' 's%Am5HzAWtsyvoQy49DyM4Q1sZiZL6UvTgKSJW4ERAhCR8%AsM0d7NDJ/oFn+/WkeQKO2QIWE3SNBccoRLkrCK14T/i%g' $EXPORTED_GENESIS + +# substitute user2 account +# cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx --> cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 +# A6apc7iThbRkwboKqPy6eXxxQvTH+0lNkXZvugDM9V4g --> ApDOUyfcamDmnbEO7O4YKnKQQqQ93+gquLfGf7h5clX7 +sed -i '' 's%cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx%cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9%g' $EXPORTED_GENESIS +sed -i '' 's%A6apc7iThbRkwboKqPy6eXxxQvTH+0lNkXZvugDM9V4g%ApDOUyfcamDmnbEO7O4YKnKQQqQ93+gquLfGf7h5clX7%g' $EXPORTED_GENESIS +``` + +### 3. Change voting power and staking delegation to over 67% + +```bash +# fix a delegation amount for over 67% +sed -i '' 's%"25390741.000000000000000000"%"6000000025390741.000000000000000000"%g' $EXPORTED_GENESIS + +# fix power of the validator +sed -i '' 's%13488360679504%6013488360679504%g' $EXPORTED_GENESIS +sed -i '' 's%"power": "13488360"%"power": "6013488360"%g' $EXPORTED_GENESIS + +# fix last_total_power +sed -i '' 's%"191488844"%"6191488844"%g' $EXPORTED_GENESIS + + +#sed -i '' 's%274699904554428%6274699904554428%g' $EXPORTED_GENESIS +# missed this modification on public testnet genesis + +# fix total supply of uatom +sed -i '' 's%274699904554428%1006274699904554428%g' $EXPORTED_GENESIS + +# fix balance of bonded_tokens_pool module account +sed -i '' 's%191488904896901%6191488904896901%g' $EXPORTED_GENESIS + +# fix the balance of a account to use as a faucet on testnet +sed -i '' 's%"amount": "107120822"%"amount": "1000000000107120822"%g' $EXPORTED_GENESIS + +``` +### 4. Modify some gov parameters for test efficiency + +The following parameters are needed to be modified: + +- minimum deposit amount +- quorum +- threshold +- voting_period + +```bash +sed -i '' 's%"amount": "64000000",%"amount": "1",%g' $EXPORTED_GENESIS +sed -i '' 's%"quorum": "0.400000000000000000",%"quorum": "0.000000000000000001",%g' $EXPORTED_GENESIS +sed -i '' 's%"threshold": "0.500000000000000000",%"threshold": "0.000000000000000001",%g' $EXPORTED_GENESIS +sed -i '' 's%"voting_period": "1209600s"%"voting_period": "60s"%g' $EXPORTED_GENESIS +``` +### 5. Initialize local chain + +```bash +export EXPORTED_GENESIS=genesis.json +export BINARY=gaiad +export CHAIN_ID=cosmoshub-4-upgrade-testnet +export CHAIN_DIR=./data + +export VAL_1_CHAIN_DIR=$CHAIN_DIR/$CHAIN_ID/val1 +export VAL_1_MNEMONIC="guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host" +export VAL_1_KEY_NAME="val1" +export VAL_1_MONIKER="Validator One" + +export VAL_2_CHAIN_DIR=$CHAIN_DIR/$CHAIN_ID/val2 +export VAL_2_MNEMONIC="friend excite rough reopen cover wheel spoon convince island path clean monkey play snow number walnut pull lock shoot hurry dream divide concert discover" +export VAL_2_KEY_NAME="val2" +export VAL_2_MONIKER="Validator Two" + +# Validator 1 +echo "Initializing $CHAIN_ID..." +$BINARY init test --home $VAL_1_CHAIN_DIR --chain-id=$CHAIN_ID + +echo "Adding genesis accounts..." +echo $VAL_1_MNEMONIC | $BINARY --home $VAL_1_CHAIN_DIR keys add $VAL_1_KEY_NAME --recover --keyring-backend=test + +# Validator 2 +echo "Initializing $CHAIN_ID..." +$BINARY --home $VAL_2_CHAIN_DIR init test --chain-id=$CHAIN_ID + +echo "Adding genesis accounts..." +echo $VAL_2_MNEMONIC | $BINARY --home $VAL_2_CHAIN_DIR keys add $VAL_2_KEY_NAME --recover --keyring-backend=test + +# Account 1 +export USER_1_CHAIN_DIR=$CHAIN_DIR/$CHAIN_ID/val2 +export USER_1_MNEMONIC="render hire dirt bulk huge goat jungle number wear method check during menu goat accident scan noise nerve below target resource digital column flee" +export USER_1_KEY_NAME="user1" + +#- name: user1 +# type: local +# address: cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6 +# pubkey: cosmospub1addwnpepqtpngaangvnl5pvlaltfreq28djqskzd6g6pw89pztj2cg44uyl7y6xgev8 + +# Account 2 +export USER_2_CHAIN_DIR=$CHAIN_DIR/$CHAIN_ID/val2 +export USER_2_MNEMONIC="junk appear guide guess bar reject vendor illegal script sting shock afraid detect ginger other theory relief dress develop core pull across hen float" +export USER_2_KEY_NAME="user2" + +#- name: user2 +# type: local +# address: cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 +# pubkey: cosmospub1addwnpepq2gvu5e8m34xpe5aky8wemsc9fefqs4y8h07s24cklr8lwrewf2lklysaen + +echo $USER_1_MNEMONIC | $BINARY --home $USER_1_CHAIN_DIR keys add $USER_1_KEY_NAME --recover --keyring-backend=test +echo $USER_2_MNEMONIC | $BINARY --home $USER_2_CHAIN_DIR keys add $USER_2_KEY_NAME --recover --keyring-backend=test +``` + +### 6. Copy exported genesis file and configure `config.toml` and `app.toml` + +```bash +# copy genesis file +cp genesis.json $VAL_1_CHAIN_DIR/config/genesis.json +cp genesis.json $VAL_2_CHAIN_DIR/config/genesis.json + +# copy validator keys +cp ./data/priv_validator_key_val1.json $VAL_1_CHAIN_DIR/config/priv_validator_key.json +cp ./data/priv_validator_key_val2.json $VAL_2_CHAIN_DIR/config/priv_validator_key.json + +# configure config and app toml +export VAL_1_P2P_PORT=26656 +export VAL_2_P2P_PORT=36656 +export VAL_2_RPC_PORT=36657 +export VAL_2_API_PORT=1327 +export VAL_2_GRPC_PORT=9080 +export VAL_2_PPROF_PORT=6061 +sed -i '' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:'"$VAL_2_RPC_PORT"'"#g' $VAL_2_CHAIN_DIR/config/config.toml +sed -i '' 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:'"$VAL_2_P2P_PORT"'"#g' $VAL_2_CHAIN_DIR/config/config.toml +sed -i '' 's#"tcp://0.0.0.0:1317"#"tcp://0.0.0.0:'"$VAL_2_API_PORT"'"#g' $VAL_2_CHAIN_DIR/config/app.toml +sed -i '' 's#"0.0.0.0:9090"#"0.0.0.0:'"$VAL_2_GRPC_PORT"'"#g' $VAL_2_CHAIN_DIR/config/app.toml +sed -i '' 's/enable = false/enable = true/g' $VAL_2_CHAIN_DIR/config/app.toml +sed -i '' 's/swagger = false/swagger = true/g' $VAL_2_CHAIN_DIR/config/app.toml + +# configure peers +export VAL_1_NODE_ID=$($BINARY tendermint --home $VAL_1_CHAIN_DIR show-node-id) +export VAL_2_NODE_ID=$($BINARY tendermint --home $VAL_2_CHAIN_DIR show-node-id) +sed -i '' 's/persistent_peers = ""/persistent_peers = "'$VAL_2_NODE_ID'@'localhost':'$VAL_2_P2P_PORT'"/g' $VAL_1_CHAIN_DIR/config/config.toml +sed -i '' 's/persistent_peers = ""/persistent_peers = "'$VAL_1_NODE_ID'@'localhost':'$VAL_1_P2P_PORT'"/g' $VAL_2_CHAIN_DIR/config/config.toml +sed -i '' 's/unconditional_peer_ids = ""/unconditional_peer_ids = "'$VAL_1_NODE_ID'"/g' $VAL_2_CHAIN_DIR/config/config.toml +sed -i '' 's/unconditional_peer_ids = ""/unconditional_peer_ids = "'$VAL_2_NODE_ID'"/g' $VAL_1_CHAIN_DIR/config/config.toml +sed -i '' 's/pprof_laddr = "localhost:6060"/pprof_laddr = "localhost:'$VAL_2_PPROF_PORT'"/g' $VAL_2_CHAIN_DIR/config/config.toml +sed -i '' 's/addr_book_strict = true/addr_book_strict = false/g' $VAL_2_CHAIN_DIR/config/config.toml +sed -i '' 's/addr_book_strict = true/addr_book_strict = false/g' $VAL_1_CHAIN_DIR/config/config.toml +``` +verify genesis hash after modification + +`cat genesis.json | shasum -a 256` + +> `e0143b053719f78d43a2487e1de5a8d2daeb3e51694812e313edaf743f799c71` + + + +### 7. Let's start chain + +```bash +# start validator nodes +export HOME1=./data/cosmoshub-4/val1 +export HOME2=./data/cosmoshub-4/val2 + +# use terminal 1 +$BINARY start --home $HOME1 --x-crisis-skip-assert-invariants + +# use terminal 2 +$BINARY start --home $HOME2 --x-crisis-skip-assert-invariants +``` +### 8. Upgrade test + +```bash +# v4.2.1 +gaiad version + +# submit upgrade proposal +# make sure upgrade-height has enough time for the proposal to pass +gaiad tx gov submit-proposal software-upgrade Gravity-DEX \ +--deposit 1000uatom \ +--title Gravity-DEX \ +--upgrade-height {your target height, ex) 6910000} \ +--upgrade-info "v5.0.0-4760cf1f1266accec7a107f440d46d9724c6fd08" \ +--description "This on-chain upgrade governance proposal is to adopt the Gravity DEX protocol on the Cosmos Hub. By voting YES to this proposal, you approve of adding the Gravity DEX protocol on the Cosmos Hub.\\n\\n### Background\\n\\nIn July 2020, the Iqlusion team developed ATOM 2021 to drive the direction of the Cosmos Hub after the completion of the Cosmos whitepaper and IBC. It became clear that providing liquidity to new IBC connected zones was core the Hub's mission. \\n\\nTendermint ([https://tendermint.com](https://tendermint.com/)) and B-Harvest ([https://bharvest.io](https://bharvest.io/)) joined forces to produce and develop a Liquidity Module ([https://github.com/tendermint/liquidity](https://github.com/tendermint/liquidity)). In 2021 March, they submitted a signal governance proposal to ask the Atom delegator community about Gravity DEX (Liquidity Module) adoption on the Cosmos Hub. Prop38 was very well approved by the community ([https://www.mintscan.io/cosmos/proposals/38](https://www.mintscan.io/cosmos/proposals/38)).\\n\\nThis proposal completes the first leg of ATOM 2021 and achieves the goals of the signaling proposal by bringing an IBC compatible DEX to the Hub.\\n\\n### Ready for Production\\n\\nWith continuous quality improvement of the codebase, very wide test coverage, a codebase audit from Least Authority and Simply VC, and subsequent follow-up codebase strengthening, along with extensive simulation processes, we are now very confident to be ready for production utilization of the Gravity DEX (Liquidity Module) on the Cosmos Hub. The Gaia branch for the new release with Gravity DEX feature can be found [here](https://github.com/cosmos/gaia/releases/tag/v5.0.0)). Please also check out the [github repository](https://github.com/b-harvest/gravity-dex-upgrade-test) for the launch testing of Gaia with Gravity DEX.\\n\\n### On-Chain Upgrade Process\\n\\nWhen the network reaches the halt height, the state machine program of the Cosmos Hub will be halted. And then, all validators and node operators have to substitute the existing state machine binary to the new binary with the Gravity DEX feature. Because it is an onchain upgrade process, the blockchain will be continued with all the accumulated history with continuous block height.\\n\\n### Potential Risk Factors\\n\\nAlthough Tendermint executed very extensive testing and simulation, and conducted in-depth audits, and followed up with the corresponding codebase improvement, there always still exists a risk that the Cosmos Hub might experience problems due to potential bugs or errors from the new Gravity DEX feature. In the case of serious problems, validators should stop operating the network immediately, and use the fixed state machine program provided by Tendermint." \ +--gas 400000 \ +--from user1 \ +--keyring-backend test \ +--chain-id cosmoshub-4-upgrade-testnet-1001 \ +--home data/cosmoshub-4/val2 \ +--node tcp://localhost:36657 + +# vote yes for the proposal +# note that voting period, quorum, and threshold params are modified +gaiad tx gov vote 50 yes -y \ +--from user1 \ +--keyring-backend test \ +--chain-id cosmoshub-4-upgrade-testnet-1001 \ +--home data/cosmoshub-4/val2 \ +--node tcp://127.0.0.1:36657 + +# query the proposal to check if it is passed +# the status should be PROPOSAL_STATUS_PASSED +gaiad query gov proposal 50 \ +--chain-id cosmoshub-4-upgrade-testnet-1001 \ +--home data/cosmoshub-4/val2 \ +--node tcp://127.0.0.1:36657 +``` + +```json +// result of the proposal +content: + '@type': /cosmos.upgrade.v1beta1.SoftwareUpgradeProposal + description: This on-chain upgrade governance proposal is to adopt the Gravity DEX + protocol on the Cosmos Hub. By voting YES to this proposal, you approve of adding + the Gravity DEX protocol on the Cosmos Hub.\n\n### Background\n\nIn July 2020, + the Iqlusion team developed ATOM 2021 to drive the direction of the Cosmos Hub + after the completion of the Cosmos whitepaper and IBC. It became clear that providing + liquidity to new IBC connected zones was core the Hub's mission. \n\nTendermint + ([https://tendermint.com](https://tendermint.com/)) and B-Harvest ([https://bharvest.io](https://bharvest.io/)) joined + forces to produce and develop a Liquidity Module ([https://github.com/tendermint/liquidity](https://github.com/tendermint/liquidity)). + In 2021 March, they submitted a signal governance proposal to ask the Atom delegator + community about Gravity DEX (Liquidity Module) adoption on the Cosmos Hub. Prop38 + was very well approved by the community ([https://www.mintscan.io/cosmos/proposals/38](https://www.mintscan.io/cosmos/proposals/38)).\n\nThis + proposal completes the first leg of ATOM 2021 and achieves the goals of the signaling + proposal by bringing an IBC compatible DEX to the Hub.\n\n### Ready for Production\n\nWith + continuous quality improvement of the codebase, very wide test coverage, a codebase + audit from Least Authority and Simply VC, and subsequent follow-up codebase strengthening, + along with extensive simulation processes, we are now very confident to be ready + for production utilization of the Gravity DEX (Liquidity Module) on the Cosmos + Hub. The Gaia branch for the new release with Gravity DEX feature can be found + [here](https://github.com/cosmos/gaia/releases/tag/v5.0.0)). Please also check + out the [github repository](https://github.com/b-harvest/gravity-dex-upgrade-test) + for the launch testing of Gaia with Gravity DEX.\n\n### On-Chain Upgrade Process\n\nWhen + the network reaches the halt height, the state machine program of the Cosmos Hub + will be halted. And then, all validators and node operators have to substitute + the existing state machine binary to the new binary with the Gravity DEX feature. + Because it is an onchain upgrade process, the blockchain will be continued with + all the accumulated history with continuous block height.\n\n### Potential Risk + Factors\n\nAlthough Tendermint executed very extensive testing and simulation, + and conducted in-depth audits, and followed up with the corresponding codebase + improvement, there always still exists a risk that the Cosmos Hub might experience + problems due to potential bugs or errors from the new Gravity DEX feature. In + the case of serious problems, validators should stop operating the network immediately, + and use the fixed state machine program provided by Tendermint. + plan: + height: "6659310" + info: v5.0.0-4760cf1f1266accec7a107f440d46d9724c6fd08 + name: Gravity-DEX + time: "0001-01-01T00:00:00Z" + upgraded_client_state: null + title: Gravity-DEX +deposit_end_time: "2021-07-12T15:44:27.561917Z" +final_tally_result: + abstain: "0" + "no": "0" + no_with_veto: "0" + "yes": "72642221" +proposal_id: "50" +status: PROPOSAL_STATUS_PASSED +submit_time: "2021-06-28T15:44:27.561917Z" +total_deposit: +- amount: "1000" + denom: uatom +voting_end_time: "2021-06-28T15:45:27.561917Z" +voting_start_time: "2021-06-28T15:44:27.561917Z" +``` +### 9. Restart node using new gaiad gravity-dex version, + +The proposal has passed and it is all good to go. When `upgrade-height` is reached, the node must be halted for upgrade. + +> ERR UPGRADE "Gravity-DEX" NEEDED at height: 6659975: v4.3.0-testhash +> ERR CONSENSUS FAILURE!!! err="UPGRADE \"Gravity-DEX\" NEEDED at height: 6659975: v4.3.0-testhash" module=consensus stack="goroutine 496414... + +```bash +# gaia version that includes gravity-dex module +# https://github.com/b-harvest/gravity-dex/releases/tag/v1.0.4 +# latest add-liquidity-module-to-gaia branch +gaiad version +-> v5.0.0 + +gaiad start --home $HOME1 --x-crisis-skip-assert-invariants +gaiad start --home $HOME2 --x-crisis-skip-assert-invariants +``` +### 10. Test liquidity module + +```bash +# query liquidity parameters +gaiad query liquidity params \ +--node tcp://127.0.0.1:36657 + +# create liquidity pool +gaiad tx liquidity create-pool 1 1000000ibc/1BE91D67775723D3230A9A5AC54BB29B92A5A51B4B8F20BBA37DF1CFA602297C,1000000uatom \ +--from user2 --keyring-backend test \ +--home data/cosmoshub-4/val2 \ +--chain-id cosmoshub-4-upgrade-testnet-1001 \ +--gas 300000 \ +--node tcp://127.0.0.1:36657 + +# query liquidity pool +gaiad query liquidity pools \ +--node tcp://127.0.0.1:36657 + +# swap request +gaiad tx liquidity swap 1 1 100000uatom ibc/1BE91D67775723D3230A9A5AC54BB29B92A5A51B4B8F20BBA37DF1CFA602297C 0.019 0.003 \ +--from user2 --keyring-backend test \ +--home data/cosmoshub-4/val2 \ +--chain-id cosmoshub-4-upgrade-testnet-1001 \ +--node tcp://127.0.0.1:36657 + +gaiad query auth account cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6 \ +--node tcp://127.0.0.1:36657 + +gaiad query auth account cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 \ +--node tcp://127.0.0.1:36657 + +# withdraw request +gaiad tx liquidity withdraw 1 1000pool024B000726712F1093C7D24EC329DE498EBB85B4B2D37C59D4F37BC542020151 \ +--from user2 --keyring-backend test \ +--home data/cosmoshub-4/val2 \ +--chain-id cosmoshub-4-upgrade-testnet-1001 \ +--node tcp://127.0.0.1:36657 + +# query balance after swap transacted +gaiad query bank balances cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 \ +--node tcp://127.0.0.1:36657 + +``` + +```json +// result of liquidity module params +circuit_breaker_enabled: false +init_pool_coin_mint_amount: "1000000" +max_order_amount_ratio: "0.100000000000000000" +max_reserve_coin_amount: "0" +min_init_deposit_amount: "1000000" +pool_creation_fee: +- amount: "100000000" + denom: uatom +pool_types: +- description: "" + id: 1 + max_reserve_coin_num: 2 + min_reserve_coin_num: 2 + name: DefaultPoolType +swap_fee_rate: "0.003000000000000000" +unit_batch_height: 1 +withdraw_fee_rate: "0.003000000000000000" +``` + +```json +// result of created liquidity pool +pagination: + next_key: null + total: "1" +pools: +- id: "1" + pool_coin_denom: pool024B000726712F1093C7D24EC329DE498EBB85B4B2D37C59D4F37BC542020151 + reserve_account_address: cosmos1qf9sqpexwyh3py786f8vx2w7fx8thpd5wz79sf + reserve_coin_denoms: + - ibc/1BE91D67775723D3230A9A5AC54BB29B92A5A51B4B8F20BBA37DF1CFA602297C + - uatom + type_id: 1 +``` + + +# Public Testnet info + +### Join Validator + +If you want to participate in the testnet as a validator, you can use the same account, validator key of the cosmoshub-4, or if you request an issue like [this](https://github.com/b-harvest/gravity-dex-upgrade-test/issues/1), we will send you some coins for the delegation manually. + + +### Chain-ID + +⚠️ Latest testnet:`cosmoshub-4-upgrade-testnet-1001`⚠️ July 6, 2021 2:00 GMT + +### Update History + +#### July 6, 2021 2:00 GMT - cosmoshub-4-upgrade-testnet-1001 + +`cosmoshub-4-upgrade-testnet` was updated to `cosmoshub-4-upgrade-testnet-1001` for fixing invariant errors + + +### Genesis + +Download the genesis here: [genesis.json.tar.bz2](https://github.com/b-harvest/gravity-dex-upgrade-test/blob/master/genesis.json.tar.bz2) of latest testnet:`cosmoshub-4-upgrade-testnet-1001`⚠️ July 6, 2021 2:00 GMT + +`tar xvzf genesis.json.tar.bz2` + +`cat genesis.json | shasum -a 256` + +> e0143b053719f78d43a2487e1de5a8d2daeb3e51694812e313edaf743f799c71 + + + +### Binary + +The testnet was started based on [gaia v4.2.1](https://github.com/cosmos/gaia/releases/tag/v4.2.1) and upgraded to [gaia v5.0.0](https://github.com/cosmos/gaia/releases/tag/v5.0.0) on `6659381` Height by `SoftwareUpgradeProposal` [#50](http://49.247.196.44:1317/cosmos/gov/v1beta1/proposals/50). + +So when you start to sync your node, you have to use the [gaia v4.2.1](https://github.com/cosmos/gaia/releases/tag/v4.2.1), And when it stops at the `6659381` height with the below panic, you should restart using [gaia v5.0.0](https://github.com/cosmos/gaia/releases/tag/v5.0.0). + +```bash +ERR UPGRADE "Gravity-DEX" NEEDED at height: 6659381: v5.0.0-4760cf1f1266accec7a107f440d46d9724c6fd08 +panic: UPGRADE "Gravity-DEX" NEEDED at height: 6659381: v5.0.0-4760cf1f1266accec7a107f440d46d9724c6fd08 +``` + + + +### P2P + +`791dd7d0d217e8a761261ab7a2d8105326f46604@49.247.196.44:26656` + +`74ca644dd1cce437aed792000066d2752aa69904@49.247.196.46:26656` + + + +### Endpoint + +`49.247.196.44:1317` + +`49.247.196.44:26657` + +`49.247.196.44:9090` + + + +`49.247.196.46:1317` + +`49.247.196.46:26657` + +`49.247.196.46:9090` + + + +min gas = 0 + +p2p peers = 200 + + + + + +# (Research) Modified `genesis.json` + +`diff exported_genesis_with_height_6659211_sorted_origin.json genesis.json -u` + +```diff +--- exported_genesis_with_height_6659211_sorted_origin.json 2021-06-21 18:15:44.000000000 +0900 ++++ genesis.json 2021-07-06 11:13:39.000000000 +0900 +@@ -194199,10 +194199,10 @@ + { + "@type": "/cosmos.auth.v1beta1.BaseAccount", + "account_number": "27720", +- "address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "pub_key": { + "@type": "/cosmos.crypto.secp256k1.PubKey", +- "key": "A6apc7iThbRkwboKqPy6eXxxQvTH+0lNkXZvugDM9V4g" ++ "key": "ApDOUyfcamDmnbEO7O4YKnKQQqQ93+gquLfGf7h5clX7" + }, + "sequence": "203" + }, +@@ -1223676,10 +1223676,10 @@ + { + "@type": "/cosmos.auth.v1beta1.BaseAccount", + "account_number": "10668", +- "address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "pub_key": { + "@type": "/cosmos.crypto.secp256k1.PubKey", +- "key": "Am5HzAWtsyvoQy49DyM4Q1sZiZL6UvTgKSJW4ERAhCR8" ++ "key": "AsM0d7NDJ/oFn+/WkeQKO2QIWE3SNBccoRLkrCK14T/i" + }, + "sequence": "15" + }, +@@ -2999974,7 +2999974,7 @@ + ] + }, + { +- "address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "coins": [ + { + "amount": "10000000", +@@ -2999993,7 +2999993,7 @@ + "denom": "ibc/EC4B5D87917DD5668D9998146F82D70FDF86652DB333D04CE29D1EB18E296AF5" + }, + { +- "amount": "107120822", ++ "amount": "1000000000107120822", + "denom": "uatom" + } + ] +@@ -3425455,7 +3425455,7 @@ + "address": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh", + "coins": [ + { +- "amount": "191488904896901", ++ "amount": "6191488904896901", + "denom": "uatom" + } + ] +@@ -3621122,7 +3621122,7 @@ + "coins": [] + }, + { +- "address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "coins": [ + { + "amount": "1462406", +@@ -4626926,7 +4626926,7 @@ + "denom": "ibc/FEE3FB19682DAAAB02A0328A2B84A80E7DDFE5BA48F7D2C8C30AAC649B8DD519" + }, + { +- "amount": "274699904554428", ++ "amount": "1006274699904554428", + "denom": "uatom" + } + ] +@@ -4715562,7 +4715562,7 @@ + "validator_address": "cosmosvaloper1pjmngrwcsatsuyy8m3qrunaun67sr9x7z5r2qs" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "6655951", + "previous_period": "616", +@@ -4888785,7 +4888785,7 @@ + "validator_address": "cosmosvaloper1tflk30mq5vgqjdly92kkhhq3raev2hnz6eete3" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "6655951", + "previous_period": "392907", +@@ -5277153,7 +5277153,7 @@ + "validator_address": "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "starting_info": { + "height": "6391150", + "previous_period": "71961", +@@ -5301687,7 +5301687,7 @@ + "validator_address": "cosmosvaloper1jlr62guqwrwkdt4m3y00zh2rrsamhjf9num5xr" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "6655951", + "previous_period": "1457", +@@ -5325366,7 +5325366,7 @@ + "validator_address": "cosmosvaloper1n229vhepft6wnkt5tjpwmxdmcnfz55jv3vp77d" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "starting_info": { + "height": "6391163", + "previous_period": "26989", +@@ -5390427,7 +5390427,7 @@ + "validator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "starting_info": { + "height": "6391150", + "previous_period": "100085", +@@ -5433190,7 +5433190,7 @@ + "starting_info": { + "height": "0", + "previous_period": "27294", +- "stake": "25390741.000000000000000000" ++ "stake": "6000000025390741.000000000000000000" + }, + "validator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" + }, +@@ -5449242,7 +5449242,7 @@ + "validator_address": "cosmosvaloper14l0fp639yudfl46zauvv8rkzjgd4u0zk2aseys" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "6655951", + "previous_period": "23914", +@@ -5481786,7 +5481786,7 @@ + "validator_address": "cosmosvaloper1hjct6q7npsspsg3dgvzk3sdf89spmlpfdn6m9d" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "6655951", + "previous_period": "5048", +@@ -5562516,7 +5562516,7 @@ + "validator_address": "cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "6655951", + "previous_period": "71384", +@@ -5573739,7 +5573739,7 @@ + "validator_address": "cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "starting_info": { + "height": "6391150", + "previous_period": "68153", +@@ -5602728,7 +5602728,7 @@ + "validator_address": "cosmosvaloper1ey69r37gfxvxg62sh4r0ktpuc46pzjrm873ae8" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "6655951", + "previous_period": "252870", +@@ -5752803,7 +5752803,7 @@ + "validator_address": "cosmosvaloper1et77usu8q2hargvyusl4qzryev8x8t9wwqkxfs" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "6655951", + "previous_period": "3996", +@@ -7470242,7 +7470242,7 @@ + "max_deposit_period": "1209600s", + "min_deposit": [ + { +- "amount": "64000000", ++ "amount": "1", + "denom": "uatom" + } + ] +@@ -7471209,7 +7471209,7 @@ + "submit_time": "2021-06-02T17:30:15.614131648Z", + "total_deposit": [ + { +- "amount": "64000000", ++ "amount": "1", + "denom": "uatom" + } + ], +@@ -7471244,8 +7471244,8 @@ + ], + "starting_proposal_id": "50", + "tally_params": { +- "quorum": "0.400000000000000000", +- "threshold": "0.500000000000000000", ++ "quorum": "0.000000000000000001", ++ "threshold": "0.000000000000000001", + "veto_threshold": "0.334000000000000000" + }, + "votes": [ +@@ -7476031,7 +7476031,7 @@ + } + ], + "voting_params": { +- "voting_period": "1209600s" ++ "voting_period": "60s" + } + }, + "ibc": { +@@ -9342270,7 +9342270,7 @@ + ] + }, + { +- "address": "cosmosvalcons1s0686a68krmr8f46ph6fklw0v8us4gdsm7nhz3", ++ "address": "cosmosvalcons10jc8h98awslz4pfqc26smf9sxaqxgwl4vxpcrp", + "missed_blocks": [ + { + "index": "10", +@@ -9827071,7 +9827071,7 @@ + ] + }, + { +- "address": "cosmosvalcons1kq9xxgmn0uepav9c6kwxl4yh599kpyu28e7ee6", ++ "address": "cosmosvalcons16k44u3v0m8uevnh4p2qy2xm08y3wdf92xsc3ve", + "missed_blocks": [ + { + "index": "0", +@@ -10797296,7 +10797296,7 @@ + } + }, + { +- "address": "cosmosvalcons1s0686a68krmr8f46ph6fklw0v8us4gdsm7nhz3", ++ "address": "cosmosvalcons10jc8h98awslz4pfqc26smf9sxaqxgwl4vxpcrp", + "validator_signing_info": { + "address": "", + "index_offset": "6827172", +@@ -10797747,7 +10797747,7 @@ + } + }, + { +- "address": "cosmosvalcons1kq9xxgmn0uepav9c6kwxl4yh599kpyu28e7ee6", ++ "address": "cosmosvalcons16k44u3v0m8uevnh4p2qy2xm08y3wdf92xsc3ve", + "validator_signing_info": { + "address": "", + "index_offset": "10061206", +@@ -10842841,42 +10842841,42 @@ + "validator_address": "cosmosvaloper1tflk30mq5vgqjdly92kkhhq3raev2hnz6eete3" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "3000000.000000000000000000", + "validator_address": "cosmosvaloper1pjmngrwcsatsuyy8m3qrunaun67sr9x7z5r2qs" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "5000000.000000000000000000", + "validator_address": "cosmosvaloper1tflk30mq5vgqjdly92kkhhq3raev2hnz6eete3" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "16100000.000000000000000000", + "validator_address": "cosmosvaloper1jlr62guqwrwkdt4m3y00zh2rrsamhjf9num5xr" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "1000000.000000000000000000", + "validator_address": "cosmosvaloper14l0fp639yudfl46zauvv8rkzjgd4u0zk2aseys" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "1000000.000000000000000000", + "validator_address": "cosmosvaloper1hjct6q7npsspsg3dgvzk3sdf89spmlpfdn6m9d" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "3000000.000000000000000000", + "validator_address": "cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "999999.999433247914197563", + "validator_address": "cosmosvaloper1ey69r37gfxvxg62sh4r0ktpuc46pzjrm873ae8" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "2000000.000000000000000000", + "validator_address": "cosmosvaloper1et77usu8q2hargvyusl4qzryev8x8t9wwqkxfs" + }, +@@ -11073821,22 +11073821,22 @@ + "validator_address": "cosmosvaloper196ax4vc0lwpxndu9dyhvca7jhxp70rmcvrj90c" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "shares": "5717570.000000000000000000", + "validator_address": "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "shares": "845084.506445134833187816", + "validator_address": "cosmosvaloper1n229vhepft6wnkt5tjpwmxdmcnfz55jv3vp77d" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "shares": "10238742.000000000000000000", + "validator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "shares": "55840909.000000000000000000", + "validator_address": "cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn" + }, +@@ -11445277,7 +11445277,7 @@ + }, + { + "delegator_address": "cosmos1ll705078lwg6yksn3flktpvzpe56gwvh7xmynw", +- "shares": "25390741.000000000000000000", ++ "shares": "6000000025390741.000000000000000000", + "validator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" + }, + { +@@ -11445342,7 +11445342,7 @@ + } + ], + "exported": true, +- "last_total_power": "191488844", ++ "last_total_power": "6191488844", + "last_validator_powers": [ + { + "address": "cosmosvaloper1qwl879nx9t6kef4supyazayf7vjhennyh568ys", +@@ -11445658,7 +11445658,7 @@ + }, + { + "address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf", +- "power": "13488360" ++ "power": "6013488360" + }, + { + "address": "cosmosvaloper15urq2dtp9qce4fyc85m6upwm9xul3049e02707", +@@ -11518421,7 +11518421,7 @@ + }, + "consensus_pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", +- "key": "cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM=" ++ "key": "qwiUMxz3llsy45fPvM0a8+XQeAJLvrX3QAEJmRMEEoU=" + }, + "delegator_shares": "2792532348046.000000000000000000", + "description": { +@@ -11523612,9 +11523612,9 @@ + }, + "consensus_pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", +- "key": "W459Kbdx+LJQ7dLVASW6sAfdqWqNRSXnvc53r9aOx/o=" ++ "key": "oi55Dw+JjLQc4u1WlAS3FsGwh5fd5/N5cP3VOLnZ/H0=" + }, +- "delegator_shares": "13488360679504.000000000000000000", ++ "delegator_shares": "6013488360679504.000000000000000000", + "description": { + "details": "Exchange the world", + "identity": "", +@@ -11523626,7 +11523626,7 @@ + "min_self_delegation": "1", + "operator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf", + "status": "BOND_STATUS_BONDED", +- "tokens": "13488360679504", ++ "tokens": "6013488360679504", + "unbonding_height": "0", + "unbonding_time": "1970-01-01T00:00:00Z" + }, +@@ -11526724,7 +11526724,7 @@ + "upgrade": {}, + "vesting": {} + }, +- "chain_id": "cosmoshub-4", ++ "chain_id": "cosmoshub-4-upgrade-testnet-1001", + "consensus_params": { + "block": { + "max_bytes": "200000", +@@ -11526747,12 +11526747,12 @@ + "initial_height": "6659211", + "validators": [ + { +- "address": "B00A6323737F321EB0B8D59C6FD497A14B60938A", ++ "address": "D5AB5E458FD9F9964EF50A80451B6F3922E6A4AA", + "name": "Certus One", + "power": "2792532", + "pub_key": { + "type": "tendermint/PubKeyEd25519", +- "value": "cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM=" ++ "value": "qwiUMxz3llsy45fPvM0a8+XQeAJLvrX3QAEJmRMEEoU=" + } + }, + { +@@ -11527449,12 +11527449,12 @@ + } + }, + { +- "address": "83F47D7747B0F633A6BA0DF49B7DCF61F90AA1B0", ++ "address": "7CB07B94FD743E2A8520C2B50DA4B03740643BF5", + "name": "Binance Staking", +- "power": "13488360", ++ "power": "6013488360", + "pub_key": { + "type": "tendermint/PubKeyEd25519", +- "value": "W459Kbdx+LJQ7dLVASW6sAfdqWqNRSXnvc53r9aOx/o=" ++ "value": "oi55Dw+JjLQc4u1WlAS3FsGwh5fd5/N5cP3VOLnZ/H0=" + } + }, + { + +``` diff --git a/genesis.json.tar.bz2 b/v5.0.0/genesis.json.tar.bz2 similarity index 100% rename from genesis.json.tar.bz2 rename to v5.0.0/genesis.json.tar.bz2 diff --git a/v5.0.5/README.md b/v5.0.5/README.md new file mode 100644 index 0000000..5753c66 --- /dev/null +++ b/v5.0.5/README.md @@ -0,0 +1,973 @@ +# Gravity DEX Upgrade Simulation Test + +## Versions + +- Cosmos Hub Mainnet `cosmoshub-4` current version: [gaia v5.0.5](https://github.com/cosmos/gaia/releases/tag/v5.0.5) +- Forked version of `gaiad`: [includes Gravity DEX that is based on Cosmos SDK v0.44.0](https://github.com/b-harvest/gravity-dex/tree/upgrade-liquidity-module-based-sdk-43) + +## Build + +```bash +git clone -b v5.0.5 https://github.com/cosmos/gaia.git +cd gaia +make build + +mv ./build/gaiad $GOBIN/gaiad_old +``` + +## Option 1: Fast track + +We have prepared a genesis file `genesis.json.tar.bz2` which was obtained after proceeding from `Step 1 to Step 5` in Option 2 below. Uncompress the genesis file and use it as the genesis data to mock the upgrade simulation test. You can go to `Step 4` to proceed. + +```bash +# uncompress the file +tar xvzf genesis.json.tar.bz2 + +# verify the hash +cat genesis.json | shasum -a 256 +> +a44e3392391e9afa4b53e08c7d6639ca46d6fd109d0280b93346582ed06e4ecf +``` + +## Option 2: Step by step guide + +We have prepared a genesis file `exported_genesis_with_height_7304500_sorted.json.tar.bz2` which was obtained by `gaia export --height 7304500` command from `cosmoshub-4` network and compressed the file by `tar -cvjSf exported_genesis_with_height_7304500.json.tar.bz2 exported_genesis_with_height_7304500.json`. Uncompress the genesis file and use it as the genesis data to mock the upgrade. + +```bash +# uncompress the file +tar xvzf ../data/exported_genesis_with_height_7304500_sorted.json.tar.bz2 + +# verify the hash +cat exported_genesis_with_height_7304500_sorted.json | shasum -a 256 +> +df10480978a9a211fbc2f82865659c1298f1ba97a3fee37512b299102fa1e9c3 + +# copy the file and name it to genesis.json +cp exported_genesis_with_height_7304500_sorted.json genesis.json +``` +## Steps + +### Step 1. Substitute validator keys and accounts + +In this step, we are going to swap 2 validators and add new 2 different accounts in the genesis file. We are also going to modify some parameters to improve test efficiency. The mnemonics for the 2 new different accounts and the following files are already prepared in this repository. + +- `priv_validator_key_val1.json`: validator1's consensus key + +- `priv_validator_key_val2.json`: validator2's consensus key + +- `guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host`: The mnemonic for `validator1`. + +- `friend excite rough reopen cover wheel spoon convince island path clean monkey play snow number walnut pull lock shoot hurry dream divide concert discover`: The mnemonic for `validator2`. + +- `render hire dirt bulk huge goat jungle number wear method check during menu goat accident scan noise nerve below target resource digital column flee`: This account is `user1` that is used for sending governance proposal and voting the proposal. + +- `junk appear guide guess bar reject vendor illegal script sting shock afraid detect ginger other theory relief dress develop core pull across hen float`: This account is `user2` that is used to test some cli interfaces for the liquidity module. + +```bash +# change chain id +sed -i '' 's%"chain_id": "cosmoshub-4",%"chain_id": "cosmoshub-4-upgrade-testnet-2001",%g' genesis.json + +# substitue "Certus One" validator1 +sed -i '' 's%cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM=%qwiUMxz3llsy45fPvM0a8+XQeAJLvrX3QAEJmRMEEoU=%g' genesis.json +sed -i '' 's%B00A6323737F321EB0B8D59C6FD497A14B60938A%D5AB5E458FD9F9964EF50A80451B6F3922E6A4AA%g' genesis.json +sed -i '' 's%cosmosvalcons1kq9xxgmn0uepav9c6kwxl4yh599kpyu28e7ee6%cosmosvalcons16k44u3v0m8uevnh4p2qy2xm08y3wdf92xsc3ve%g' genesis.json + +# substitue "Binance Staking" validator2 +sed -i '' 's%W459Kbdx+LJQ7dLVASW6sAfdqWqNRSXnvc53r9aOx/o=%oi55Dw+JjLQc4u1WlAS3FsGwh5fd5/N5cP3VOLnZ/H0=%g' genesis.json +sed -i '' 's%83F47D7747B0F633A6BA0DF49B7DCF61F90AA1B0%7CB07B94FD743E2A8520C2B50DA4B03740643BF5%g' genesis.json +sed -i '' 's%cosmosvalcons1s0686a68krmr8f46ph6fklw0v8us4gdsm7nhz3%cosmosvalcons10jc8h98awslz4pfqc26smf9sxaqxgwl4vxpcrp%g' genesis.json + +# substitute user1 account +# +# cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl --> cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6 +# Am5HzAWtsyvoQy49DyM4Q1sZiZL6UvTgKSJW4ERAhCR8 --> AsM0d7NDJ/oFn+/WkeQKO2QIWE3SNBccoRLkrCK14T/i +# +sed -i '' 's%cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl%cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6%g' genesis.json +sed -i '' 's%Am5HzAWtsyvoQy49DyM4Q1sZiZL6UvTgKSJW4ERAhCR8%AsM0d7NDJ/oFn+/WkeQKO2QIWE3SNBccoRLkrCK14T/i%g' genesis.json + +# substitute user2 account +# +# cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx --> cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 +# A6apc7iThbRkwboKqPy6eXxxQvTH+0lNkXZvugDM9V4g --> ApDOUyfcamDmnbEO7O4YKnKQQqQ93+gquLfGf7h5clX7 +# +sed -i '' 's%cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx%cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9%g' genesis.json +sed -i '' 's%A6apc7iThbRkwboKqPy6eXxxQvTH+0lNkXZvugDM9V4g%ApDOUyfcamDmnbEO7O4YKnKQQqQ93+gquLfGf7h5clX7%g' genesis.json +``` + +### Step 2. Change voting power and staking delegation to over 67% + +```bash +# fix delegation amount to over 67% +sed -i '' 's%"25390741.000000000000000000"%"6000000025390741.000000000000000000"%g' genesis.json + +# fix power of the validator +# +# Binance Staking validator's "delegator_shares" and "tokens" +# +sed -i '' 's%13991908901944%6013991908901944%g' genesis.json +sed -i '' 's%"power": "13991908"%"power": "6013991908"%g' genesis.json + +# fix last_total_power +sed -i '' 's%"194093279"%"6194093279"%g' genesis.json + +# fix total supply of uatom +sed -i '' 's%277549930240869%1006277549930240869%g' genesis.json + +# fix balance of bonded_tokens_pool module account +# +# cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh +# +sed -i '' 's%194093338099942%6194093338099942%g' genesis.json + +# fix the balance of a account to use as a faucet on testnet +# +# substituted user2 account: cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx --> cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 +# +sed -i '' 's%"amount": "72177323"%"amount": "1000000000072177323"%g' genesis.json +``` + +### Step 3. Modify `gov` parameters for test efficiency + +The following `gov` parameters are needed to be modified: + +- minimum deposit amount +- quorum +- threshold +- voting_period + +```bash +sed -i '' 's%"amount": "64000000",%"amount": "1",%g' genesis.json +sed -i '' 's%"quorum": "0.400000000000000000",%"quorum": "0.000000000000000001",%g' genesis.json +sed -i '' 's%"threshold": "0.500000000000000000",%"threshold": "0.000000000000000001",%g' genesis.json +sed -i '' 's%"voting_period": "1209600s"%"voting_period": "60s"%g' genesis.json +``` +### Step 4. Initialize the chain + +```bash +export EXPORTED_GENESIS=genesis.json +export BINARY=gaiad_old +export CHAIN_ID=cosmoshub-4-upgrade-testnet-2001 +export CHAIN_DIR=./data + +export VAL_1_CHAIN_DIR=$CHAIN_DIR/$CHAIN_ID/val1 +export VAL_1_MNEMONIC="guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host" +export VAL_1_KEY_NAME="val1" +export VAL_1_MONIKER="val1" + +export VAL_2_CHAIN_DIR=$CHAIN_DIR/$CHAIN_ID/val2 +export VAL_2_MNEMONIC="friend excite rough reopen cover wheel spoon convince island path clean monkey play snow number walnut pull lock shoot hurry dream divide concert discover" +export VAL_2_KEY_NAME="val2" +export VAL_2_MONIKER="val2" + +# Validator 1 +$BINARY init test --home $VAL_1_CHAIN_DIR --chain-id=$CHAIN_ID +echo $VAL_1_MNEMONIC | $BINARY --home $VAL_1_CHAIN_DIR keys add $VAL_1_KEY_NAME --recover --keyring-backend=test + +# Validator 2 +$BINARY --home $VAL_2_CHAIN_DIR init test --chain-id=$CHAIN_ID +echo $VAL_2_MNEMONIC | $BINARY --home $VAL_2_CHAIN_DIR keys add $VAL_2_KEY_NAME --recover --keyring-backend=test + +# Account 1 +export USER_1_CHAIN_DIR=$CHAIN_DIR/$CHAIN_ID/val2 +export USER_1_MNEMONIC="render hire dirt bulk huge goat jungle number wear method check during menu goat accident scan noise nerve below target resource digital column flee" +export USER_1_KEY_NAME="user1" + +# Account 2 +export USER_2_CHAIN_DIR=$CHAIN_DIR/$CHAIN_ID/val2 +export USER_2_MNEMONIC="junk appear guide guess bar reject vendor illegal script sting shock afraid detect ginger other theory relief dress develop core pull across hen float" +export USER_2_KEY_NAME="user2" + +echo $USER_1_MNEMONIC | $BINARY --home $USER_1_CHAIN_DIR keys add $USER_1_KEY_NAME --recover --keyring-backend=test +echo $USER_2_MNEMONIC | $BINARY --home $USER_2_CHAIN_DIR keys add $USER_2_KEY_NAME --recover --keyring-backend=test + +# +# - name: user1 +# type: local +# address: cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6 +# pubkey: cosmospub1addwnpepqtpngaangvnl5pvlaltfreq28djqskzd6g6pw89pztj2cg44uyl7y6xgev8 +# mnemonic: "" +# threshold: 0 +# pubkeys: [] +# +# - name: user2 +# type: local +# address: cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 +# pubkey: cosmospub1addwnpepq2gvu5e8m34xpe5aky8wemsc9fefqs4y8h07s24cklr8lwrewf2lklysaen +# mnemonic: "" +# threshold: 0 +# pubkeys: [] +``` + +### Step 5. Configuration + +Copy the genesis file and new validator consensus keys to the designated directories. And configure settings in both `config.toml` and `app.toml` + +```bash +# copy genesis file to the designated directories and copy validator consensus key files +cp genesis.json $VAL_1_CHAIN_DIR/config/genesis.json +cp genesis.json $VAL_2_CHAIN_DIR/config/genesis.json +cp ../data/priv_validator_key_val1.json $VAL_1_CHAIN_DIR/config/priv_validator_key.json +cp ../data/priv_validator_key_val2.json $VAL_2_CHAIN_DIR/config/priv_validator_key.json + +# configure parameters in config.toml and app.toml files +export VAL_1_P2P_PORT=26656 +export VAL_1_NODE_ID=$($BINARY tendermint --home $VAL_1_CHAIN_DIR show-node-id) +export VAL_2_P2P_PORT=36656 +export VAL_2_RPC_PORT=36657 +export VAL_2_API_PORT=1327 +export VAL_2_GRPC_PORT=9080 +export VAL_2_GRPC_WEB_SERVER_PORT=9081 +export VAL_2_ROSETTA_API_PORT=8081 +export VAL_2_PPROF_PORT=6061 +export VAL_2_NODE_ID=$($BINARY tendermint --home $VAL_2_CHAIN_DIR show-node-id) + +sed -i '' 's/enable = true/enable = false/g' $VAL_1_CHAIN_DIR/config/app.toml # disable all for val1 to prevent from colluding ports +sed -i '' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:'"$VAL_2_RPC_PORT"'"#g' $VAL_2_CHAIN_DIR/config/config.toml +sed -i '' 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:'"$VAL_2_P2P_PORT"'"#g' $VAL_2_CHAIN_DIR/config/config.toml +sed -i '' 's#"tcp://0.0.0.0:1317"#"tcp://0.0.0.0:'"$VAL_2_API_PORT"'"#g' $VAL_2_CHAIN_DIR/config/app.toml +sed -i '' 's#"0.0.0.0:9090"#"0.0.0.0:'"$VAL_2_GRPC_PORT"'"#g' $VAL_2_CHAIN_DIR/config/app.toml +sed -i '' 's#"0.0.0.0:9091"#"0.0.0.0:'"$VAL_2_GRPC_WEB_SERVER_PORT"'"#g' $VAL_2_CHAIN_DIR/config/app.toml +sed -i '' 's#":8080"#":'"$VAL_2_ROSETTA_API_PORT"'"#g' $VAL_2_CHAIN_DIR/config/app.toml +sed -i '' 's/enable = false/enable = true/g' $VAL_2_CHAIN_DIR/config/app.toml +sed -i '' 's/swagger = false/swagger = true/g' $VAL_2_CHAIN_DIR/config/app.toml +sed -i '' 's/minimum-gas-prices = ""/minimum-gas-prices = "0stake"/g' $VAL_1_CHAIN_DIR/config/app.toml +sed -i '' 's/minimum-gas-prices = ""/minimum-gas-prices = "0stake"/g' $VAL_2_CHAIN_DIR/config/app.toml +sed -i '' 's/persistent_peers = ""/persistent_peers = "'$VAL_2_NODE_ID'@'localhost':'$VAL_2_P2P_PORT'"/g' $VAL_1_CHAIN_DIR/config/config.toml +sed -i '' 's/persistent_peers = ""/persistent_peers = "'$VAL_1_NODE_ID'@'localhost':'$VAL_1_P2P_PORT'"/g' $VAL_2_CHAIN_DIR/config/config.toml +sed -i '' 's/unconditional_peer_ids = ""/unconditional_peer_ids = "'$VAL_1_NODE_ID'"/g' $VAL_2_CHAIN_DIR/config/config.toml +sed -i '' 's/unconditional_peer_ids = ""/unconditional_peer_ids = "'$VAL_2_NODE_ID'"/g' $VAL_1_CHAIN_DIR/config/config.toml +sed -i '' 's/pprof_laddr = "localhost:6060"/pprof_laddr = "localhost:'$VAL_2_PPROF_PORT'"/g' $VAL_2_CHAIN_DIR/config/config.toml +sed -i '' 's/addr_book_strict = true/addr_book_strict = false/g' $VAL_2_CHAIN_DIR/config/config.toml +sed -i '' 's/addr_book_strict = true/addr_book_strict = false/g' $VAL_1_CHAIN_DIR/config/config.toml +``` + +### Step 6. Start the chain + +Open up two terminals and start 2 validator nodes. It requires 2+ validators to start the network that is exported from live chain. Read [this issue](https://github.com/cosmos/cosmos-sdk/issues/7505) for more information about it. You can start the chain with `--x-crisis-skip-assert-invariants` flag to skip invariant checks since it takes a long time. It takes more than an hour to start the chain. Of course, it depends on the resources of your local machine. + +```bash +# +# Terminal 1 (note that you should run the below command from v5.0.5 directory) +# +export BINARY=gaiad_old +export CHAIN_ID=cosmoshub-4-upgrade-testnet-2001 +export HOME1=./data/$CHAIN_ID/val1 +$BINARY start --home $HOME1 + +# +# Optional Commands +# +# skip invariant checks to start the chain +$BINARY start --home $HOME1 --x-crisis-skip-assert-invariants + +# reset the blockchain database and its state +$BINARY unsafe-reset-all --home $HOME1 + +# +# Terminal 2 (note that you should run the below command from v5.0.5 directory) +# +export BINARY=gaiad_old +export CHAIN_ID=cosmoshub-4-upgrade-testnet-2001 +export HOME2=./data/$CHAIN_ID/val2 +$BINARY start --home $HOME2 + +# +# Optional Commands +# +# skip invariant checks to start the chain +$BINARY start --home $HOME2 --x-crisis-skip-assert-invariants + +# reset the blockchain database and its state +$BINARY unsafe-reset-all --home $HOME1 +``` + +### Step 7. Send an upgrade proposal to the network + +Open up terminal 3 to send an upgrade proposal along with a deposit and a vote. + +```bash +# +# Terminal 3 (note that you should run the below command from v5.0.5 directory) +# + +export BINARY=gaiad_old + +# make sure upgrade-height has enough time for the proposal to pass +$BINARY tx gov submit-proposal software-upgrade vega \ +--title vega \ +--deposit 1000uatom \ +--upgrade-height 7304550 \ +--upgrade-info "upgrade-liquidity-module-based-sdk-44" \ +--description "vega upgrade" \ +--gas 400000 \ +--from user1 \ +--keyring-backend test \ +--chain-id cosmoshub-4-upgrade-testnet-2001 \ +--home data/cosmoshub-4-upgrade-testnet-2001/val2 \ +--node tcp://localhost:36657 \ +--yes -b block + +# query the proposal to check the status. +# the status should be PROPOSAL_STATUS_VOTING_PERIOD. +$BINARY query gov proposal 54 \ +--chain-id cosmoshub-4-upgrade-testnet-2001 \ +--home data/cosmoshub-4-upgrade-testnet-2001/val2 \ +--node tcp://localhost:36657 + +# vote yes for the proposal +# note that voting period, quorum, and threshold params are modified +$BINARY tx gov vote 54 yes \ +--from user1 \ +--keyring-backend test \ +--chain-id cosmoshub-4-upgrade-testnet-2001 \ +--home data/cosmoshub-4-upgrade-testnet-2001/val2 \ +--node tcp://localhost:36657 \ +--yes -b block + +# wait for a while for the proposal to pass + +# query the proposal to check if it is passed +# the status should be PROPOSAL_STATUS_PASSED +$BINARY query gov proposal 54 \ +--chain-id cosmoshub-4-upgrade-testnet-2001 \ +--home data/cosmoshub-4-upgrade-testnet-2001/val2 \ +--node tcp://localhost:36657 +``` + +Result of the proposal + +```json +content: + '@type': /cosmos.upgrade.v1beta1.SoftwareUpgradeProposal + description: vega upgrade + plan: + height: "7304550" + info: upgrade-liquidity-module-based-sdk-44 + name: vega + time: "0001-01-01T00:00:00Z" + upgraded_client_state: null + title: vega +deposit_end_time: "2021-09-22T06:14:12.664014Z" +final_tally_result: + abstain: "0" + "no": "0" + no_with_veto: "0" + "yes": "75958321" +proposal_id: "54" +status: PROPOSAL_STATUS_PASSED +submit_time: "2021-09-08T06:14:12.664014Z" +total_deposit: +- amount: "1000" + denom: uatom +voting_end_time: "2021-09-08T06:15:12.664014Z" +voting_start_time: "2021-09-08T06:14:12.664014Z" +``` + +### Step 8. Restart node using new gaiad gravity-dex version + +The proposal has passed and it is all good to go. When `upgrade-height` is reached, the node must be halted for upgrade. + +> ERR UPGRADE "vega" NEEDED at height: 7304550: upgrade-liquidity-module-based-sdk-44 + ERR CONSENSUS FAILURE!!! err="UPGRADE \"vega\" NEEDED at height: 7304550: upgrade-liquidity-module-based-sdk-44" module=consensus stack="goroutine 286005 [running]:\nruntime/debug.Stack(0xc01aee9020, 0x55de1c0, 0xc054e7af10)\n\truntime/debug/stack.go:24 +0x9f\ngithub.com/tendermint/tendermint/consensus.(*State). + ........................................................................................................ + .................................................................................................................................. + +```bash +# build the gaia version that is rebased to Cosmos SDK v0.44.0 +# latest commit of upgrade-liquidity-module-based-sdk-43 branch +git clone -b upgrade-liquidity-module-based-sdk-43 https://github.com/b-harvest/gravity-dex.git +cd gravity-dex +make install + +# check version +gaiad version +> +upgrade-liquidity-module-based-sdk-43-xxxx + +# Terminal 1 +gaiad start --home $HOME1 --x-crisis-skip-assert-invariants + +# Terminal 2 +gaiad start --home $HOME2 --x-crisis-skip-assert-invariants +``` + +### Step 9. Test liquidity module + +Let's first query the values are set as liquidity parameter. + +```bash +gaiad query liquidity params \ +--node tcp://localhost:36657 \ +--output json | jq +``` + +Result + +```json +{ + "pool_types": [ + { + "id": 1, + "name": "StandardLiquidityPool", + "min_reserve_coin_num": 2, + "max_reserve_coin_num": 2, + "description": "Standard liquidity pool with pool price function X/Y, ESPM constraint, and two kinds of reserve coins" + } + ], + "min_init_deposit_amount": "1000000", + "init_pool_coin_mint_amount": "1000000", + "max_reserve_coin_amount": "0", + "pool_creation_fee": [ + { + "denom": "uatom", + "amount": "40000000" + } + ], + "swap_fee_rate": "0.003000000000000000", + "withdraw_fee_rate": "0.000000000000000000", + "max_order_amount_ratio": "0.100000000000000000", + "unit_batch_height": 1, + "circuit_breaker_enabled": false +} +``` + +```bash +export CHAIN_ID=cosmoshub-4-upgrade-testnet-2001 +export HOME1=./data/$CHAIN_ID/val1 +export HOME2=./data/$CHAIN_ID/val2 + +# query user2 balance +gaiad q bank balances cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 --output json | jq + +# create liquidity pool +gaiad tx liquidity create-pool 1 1000000ibc/1BE91D67775723D3230A9A5AC54BB29B92A5A51B4B8F20BBA37DF1CFA602297C,1000000uatom \ +--from user2 \ +--keyring-backend test \ +--home data/cosmoshub-4-upgrade-testnet-2001/val2 \ +--chain-id cosmoshub-4-upgrade-testnet-2001 \ +--gas 300000 \ +--node tcp://localhost:36657 \ +--yes -b block + +# query liquidity pool +gaiad q liquidity pools --node tcp://localhost:36657 --output json | jq + +# query reserve pool balances +gaiad q bank balances cosmos1qf9sqpexwyh3py786f8vx2w7fx8thpd5wz79sf --output json | jq + +# swap request +gaiad tx liquidity swap 10 1 100000uatom ibc/1BE91D67775723D3230A9A5AC54BB29B92A5A51B4B8F20BBA37DF1CFA602297C 0.019 0.003 \ +--home $HOME2 \ +--chain-id cosmoshub-4-upgrade-testnet-2001 \ +--node tcp://localhost:36657 \ +--from user2 \ +--keyring-backend test \ +--yes -b block + +gaiad query auth account cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6 \ +--node tcp://localhost:36657 \ +--output json | jq + +gaiad query auth account cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 \ +--node tcp://localhost:36657 \ +--output json | jq + +# query balance before transacted +gaiad query bank balances cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 \ +--node tcp://localhost:36657 \ +--output json | jq + +# withdraw request +gaiad tx liquidity withdraw 10 1000pool024B000726712F1093C7D24EC329DE498EBB85B4B2D37C59D4F37BC542020151 \ +--from user2 --keyring-backend test \ +--home data/cosmoshub-4-upgrade-testnet-2001/val2 \ +--chain-id cosmoshub-4-upgrade-testnet-2001 \ +--node tcp://localhost:36657 --yes -b block + + +gaiad tx liquidity deposit 10 1000000ibc/1BE91D67775723D3230A9A5AC54BB29B92A5A51B4B8F20BBA37DF1CFA602297C,1000000uatom \ +--from user2 --keyring-backend test \ +--home data/cosmoshub-4-upgrade-testnet-2001/val2 \ +--chain-id cosmoshub-4-upgrade-testnet-2001 \ +--node tcp://localhost:36657 --yes -b block + + +gaiad tx bank send user2 cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6 79373uatom \ +--keyring-backend test \ +--home data/cosmoshub-4-upgrade-testnet-2001/val2 \ +--chain-id cosmoshub-4-upgrade-testnet-2001 \ +--node tcp://localhost:36657 --yes -b block --output json + +# query balance after transacted +gaiad query bank balances cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 \ +--node tcp://localhost:36657 \ +--output json | jq +``` + + +## Modified parameters in `genesis.json` file + +```bash +diff exported_genesis_with_height_7304500_sorted.json genesis.json -u +``` + +```diff +--- exported_genesis_with_height_7304500_sorted.json 2021-08-23 21:52:43.000000000 +0900 ++++ genesis.json 2021-08-23 23:35:16.000000000 +0900 +@@ -1,6 +1,6 @@ + { + "genesis_time": "2019-12-11T16:11:34Z", +- "chain_id": "cosmoshub-4", ++ "chain_id": "cosmoshub-4-upgrade-testnet-2001", + "initial_height": "7304501", + "consensus_params": { + "block": { +@@ -22,10 +22,10 @@ + }, + "validators": [ + { +- "address": "B00A6323737F321EB0B8D59C6FD497A14B60938A", ++ "address": "D5AB5E458FD9F9964EF50A80451B6F3922E6A4AA", + "pub_key": { + "type": "tendermint/PubKeyEd25519", +- "value": "cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM=" ++ "value": "qwiUMxz3llsy45fPvM0a8+XQeAJLvrX3QAEJmRMEEoU=" + }, + "power": "2589549", + "name": "Certus One" +@@ -724,12 +724,12 @@ + "name": "DragonStake" + }, + { +- "address": "83F47D7747B0F633A6BA0DF49B7DCF61F90AA1B0", ++ "address": "7CB07B94FD743E2A8520C2B50DA4B03740643BF5", + "pub_key": { + "type": "tendermint/PubKeyEd25519", +- "value": "W459Kbdx+LJQ7dLVASW6sAfdqWqNRSXnvc53r9aOx/o=" ++ "value": "oi55Dw+JjLQc4u1WlAS3FsGwh5fd5/N5cP3VOLnZ/H0=" + }, +- "power": "13991908", ++ "power": "6013991908", + "name": "Binance Staking" + }, + { +@@ -225551,10 +225551,10 @@ + { + "@type": "/cosmos.auth.v1beta1.BaseAccount", + "account_number": "27720", +- "address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "pub_key": { + "@type": "/cosmos.crypto.secp256k1.PubKey", +- "key": "A6apc7iThbRkwboKqPy6eXxxQvTH+0lNkXZvugDM9V4g" ++ "key": "ApDOUyfcamDmnbEO7O4YKnKQQqQ93+gquLfGf7h5clX7" + }, + "sequence": "221" + }, +@@ -1411127,10 +1411127,10 @@ + { + "@type": "/cosmos.auth.v1beta1.BaseAccount", + "account_number": "10668", +- "address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "pub_key": { + "@type": "/cosmos.crypto.secp256k1.PubKey", +- "key": "Am5HzAWtsyvoQy49DyM4Q1sZiZL6UvTgKSJW4ERAhCR8" ++ "key": "AsM0d7NDJ/oFn+/WkeQKO2QIWE3SNBccoRLkrCK14T/i" + }, + "sequence": "22" + }, +@@ -3459808,7 +3459808,7 @@ + ] + }, + { +- "address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "coins": [ + { + "amount": "10000000", +@@ -3459827,7 +3459827,7 @@ + "denom": "ibc/EC4B5D87917DD5668D9998146F82D70FDF86652DB333D04CE29D1EB18E296AF5" + }, + { +- "amount": "72177323", ++ "amount": "1000000000072177323", + "denom": "uatom" + } + ] +@@ -3951624,7 +3951624,7 @@ + "address": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh", + "coins": [ + { +- "amount": "194093338099942", ++ "amount": "6194093338099942", + "denom": "uatom" + } + ] +@@ -4177422,7 +4177422,7 @@ + "coins": [] + }, + { +- "address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "coins": [ + { + "amount": "1450862", +@@ -5340100,7 +5340100,7 @@ + "denom": "poolF2805980C54E1474BDCCF70EF5FE881F3B8EFCF8BA3198765C01D91904521788" + }, + { +- "amount": "277549930240869", ++ "amount": "1006277549930240869", + "denom": "uatom" + } + ] +@@ -5440529,7 +5440529,7 @@ + "validator_address": "cosmosvaloper1pjmngrwcsatsuyy8m3qrunaun67sr9x7z5r2qs" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "7248467", + "previous_period": "745", +@@ -5645036,7 +5645036,7 @@ + "validator_address": "cosmosvaloper1tflk30mq5vgqjdly92kkhhq3raev2hnz6eete3" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "7248467", + "previous_period": "465175", +@@ -6050612,7 +6050612,7 @@ + "validator_address": "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "7274551", + "previous_period": "82115", +@@ -6061790,7 +6061790,7 @@ + "validator_address": "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "starting_info": { + "height": "7257832", + "previous_period": "81861", +@@ -6089357,7 +6089357,7 @@ + "validator_address": "cosmosvaloper1jlr62guqwrwkdt4m3y00zh2rrsamhjf9num5xr" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "7248467", + "previous_period": "1584", +@@ -6114566,7 +6114566,7 @@ + "validator_address": "cosmosvaloper1n229vhepft6wnkt5tjpwmxdmcnfz55jv3vp77d" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "starting_info": { + "height": "7257947", + "previous_period": "35398", +@@ -6185549,7 +6185549,7 @@ + "validator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "starting_info": { + "height": "7257832", + "previous_period": "124464", +@@ -6232533,7 +6232533,7 @@ + "starting_info": { + "height": "0", + "previous_period": "27294", +- "stake": "25390741.000000000000000000" ++ "stake": "6000000025390741.000000000000000000" + }, + "validator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" + }, +@@ -6286646,7 +6286646,7 @@ + "validator_address": "cosmosvaloper1hjct6q7npsspsg3dgvzk3sdf89spmlpfdn6m9d" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "7248467", + "previous_period": "5860", +@@ -6381587,7 +6381587,7 @@ + "validator_address": "cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "7248467", + "previous_period": "80368", +@@ -6394043,7 +6394043,7 @@ + "validator_address": "cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "starting_info": { + "height": "7257832", + "previous_period": "80551", +@@ -6425687,7 +6425687,7 @@ + "validator_address": "cosmosvaloper1ey69r37gfxvxg62sh4r0ktpuc46pzjrm873ae8" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "7248467", + "previous_period": "269308", +@@ -6581441,7 +6581441,7 @@ + "validator_address": "cosmosvaloper1et77usu8q2hargvyusl4qzryev8x8t9wwqkxfs" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "7248467", + "previous_period": "4225", +@@ -8477588,7 +8477588,7 @@ + "max_deposit_period": "1209600s", + "min_deposit": [ + { +- "amount": "64000000", ++ "amount": "1", + "denom": "uatom" + } + ] +@@ -8478740,7 +8478740,7 @@ + "submit_time": "2021-06-02T17:30:15.614131648Z", + "total_deposit": [ + { +- "amount": "64000000", ++ "amount": "1", + "denom": "uatom" + } + ], +@@ -8478861,7 +8478861,7 @@ + "submit_time": "2021-07-11T21:10:26.141197124Z", + "total_deposit": [ + { +- "amount": "64000000", ++ "amount": "1", + "denom": "uatom" + } + ], +@@ -8478896,13 +8478896,13 @@ + ], + "starting_proposal_id": "54", + "tally_params": { +- "quorum": "0.400000000000000000", +- "threshold": "0.500000000000000000", ++ "quorum": "0.000000000000000001", ++ "threshold": "0.000000000000000001", + "veto_threshold": "0.334000000000000000" + }, + "votes": [], + "voting_params": { +- "voting_period": "1209600s" ++ "voting_period": "60s" + } + }, + "ibc": { +@@ -12037724,7 +12037724,7 @@ + ] + }, + { +- "address": "cosmosvalcons1s0686a68krmr8f46ph6fklw0v8us4gdsm7nhz3", ++ "address": "cosmosvalcons10jc8h98awslz4pfqc26smf9sxaqxgwl4vxpcrp", + "missed_blocks": [ + { + "index": "10", +@@ -12512117,7 +12512117,7 @@ + ] + }, + { +- "address": "cosmosvalcons1kq9xxgmn0uepav9c6kwxl4yh599kpyu28e7ee6", ++ "address": "cosmosvalcons16k44u3v0m8uevnh4p2qy2xm08y3wdf92xsc3ve", + "missed_blocks": [ + { + "index": "0", +@@ -13540393,7 +13540393,7 @@ + } + }, + { +- "address": "cosmosvalcons1s0686a68krmr8f46ph6fklw0v8us4gdsm7nhz3", ++ "address": "cosmosvalcons10jc8h98awslz4pfqc26smf9sxaqxgwl4vxpcrp", + "validator_signing_info": { + "address": "", + "index_offset": "7472462", +@@ -13540844,7 +13540844,7 @@ + } + }, + { +- "address": "cosmosvalcons1kq9xxgmn0uepav9c6kwxl4yh599kpyu28e7ee6", ++ "address": "cosmosvalcons16k44u3v0m8uevnh4p2qy2xm08y3wdf92xsc3ve", + "validator_signing_info": { + "address": "", + "index_offset": "10706496", +@@ -13590926,42 +13590926,42 @@ + "validator_address": "cosmosvaloper1tflk30mq5vgqjdly92kkhhq3raev2hnz6eete3" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "3000000.000000000000000000", + "validator_address": "cosmosvaloper1pjmngrwcsatsuyy8m3qrunaun67sr9x7z5r2qs" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "5000000.000000000000000000", + "validator_address": "cosmosvaloper1tflk30mq5vgqjdly92kkhhq3raev2hnz6eete3" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "1000000.000000000000000000", + "validator_address": "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "16100000.000000000000000000", + "validator_address": "cosmosvaloper1jlr62guqwrwkdt4m3y00zh2rrsamhjf9num5xr" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "1000000.000000000000000000", + "validator_address": "cosmosvaloper1hjct6q7npsspsg3dgvzk3sdf89spmlpfdn6m9d" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "3000000.000000000000000000", + "validator_address": "cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "999999.999433247914197563", + "validator_address": "cosmosvaloper1ey69r37gfxvxg62sh4r0ktpuc46pzjrm873ae8" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "2000000.000000000000000000", + "validator_address": "cosmosvaloper1et77usu8q2hargvyusl4qzryev8x8t9wwqkxfs" + }, +@@ -13845146,22 +13845146,22 @@ + "validator_address": "cosmosvaloper196ax4vc0lwpxndu9dyhvca7jhxp70rmcvrj90c" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "shares": "5717570.000000000000000000", + "validator_address": "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "shares": "4161516.137544609690354305", + "validator_address": "cosmosvaloper1n229vhepft6wnkt5tjpwmxdmcnfz55jv3vp77d" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "shares": "10238742.000000000000000000", + "validator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "shares": "55840909.000000000000000000", + "validator_address": "cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn" + }, +@@ -14254917,7 +14254917,7 @@ + }, + { + "delegator_address": "cosmos1ll705078lwg6yksn3flktpvzpe56gwvh7xmynw", +- "shares": "25390741.000000000000000000", ++ "shares": "6000000025390741.000000000000000000", + "validator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" + }, + { +@@ -14254987,7 +14254987,7 @@ + } + ], + "exported": true, +- "last_total_power": "194093279", ++ "last_total_power": "6194093279", + "last_validator_powers": [ + { + "address": "cosmosvaloper1qwl879nx9t6kef4supyazayf7vjhennyh568ys", +@@ -14255303,7 +14255303,7 @@ + }, + { + "address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf", +- "power": "13991908" ++ "power": "6013991908" + }, + { + "address": "cosmosvaloper15urq2dtp9qce4fyc85m6upwm9xul3049e02707", +@@ -14255967,7 +14255967,7 @@ + "validator_src_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "entries": [ + { + "completion_time": "2021-09-02T16:58:32.491727097Z", +@@ -14336532,7 +14336532,7 @@ + }, + "consensus_pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", +- "key": "cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM=" ++ "key": "qwiUMxz3llsy45fPvM0a8+XQeAJLvrX3QAEJmRMEEoU=" + }, + "delegator_shares": "2589549881077.000000000000000000", + "description": { +@@ -14341810,9 +14341810,9 @@ + }, + "consensus_pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", +- "key": "W459Kbdx+LJQ7dLVASW6sAfdqWqNRSXnvc53r9aOx/o=" ++ "key": "oi55Dw+JjLQc4u1WlAS3FsGwh5fd5/N5cP3VOLnZ/H0=" + }, +- "delegator_shares": "13991908901944.000000000000000000", ++ "delegator_shares": "6013991908901944.000000000000000000", + "description": { + "details": "Exchange the world", + "identity": "", +@@ -14341824,7 +14341824,7 @@ + "min_self_delegation": "1", + "operator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf", + "status": "BOND_STATUS_BONDED", +- "tokens": "13991908901944", ++ "tokens": "6013991908901944", + "unbonding_height": "0", + "unbonding_time": "1970-01-01T00:00:00Z" + }, +@@ -14345108,4 +14345108,4 @@ + "upgrade": {}, + "vesting": {} + } +-} +\ No newline at end of file ++} +``` \ No newline at end of file diff --git a/v5.0.5/genesis.json.tar.bz2 b/v5.0.5/genesis.json.tar.bz2 new file mode 100644 index 0000000..d07607b Binary files /dev/null and b/v5.0.5/genesis.json.tar.bz2 differ diff --git a/v6.0.0/README.md b/v6.0.0/README.md new file mode 100644 index 0000000..b0268c0 --- /dev/null +++ b/v6.0.0/README.md @@ -0,0 +1,1174 @@ +# [Vega Upgrade]((https://github.com/cosmos/gaia/blob/main/docs/roadmap/cosmos-hub-roadmap-2.0.md#vega-upgrade-expected-q3-2021)) + +## Version + +- `cosmoshub-4` current version: [Gaia v5.0.5](https://github.com/cosmos/gaia/releases/tag/v5.0.5) +- Upgrade test version: [Gaia v6.0.0-rc2](https://github.com/cosmos/gaia/tree/v6.0.0-rc2) + +## Build + +### Gaia + +```bash +# Use git to clone the project and build it +git clone -b v5.0.5 https://github.com/cosmos/gaia.git +cd gaia +make build + +# Name an executable file as "gaiad_old" +mv ./build/gaiad $GOBIN/gaiad_old +``` + +### Forked Gaia + +```bash +# Use git to clone the project and build it +git clone -b v6.0.0-rc2 https://github.com/cosmos/gaia.git +cd gravity-dex +make install +``` + +## Option 1. Fast Track + +The genesis file `genesis.json.tar.bz2` is already prepared for this option. It is obtained by proceeding from **Step 1~3** in **Option 2** below. Uncompress the genesis file and use it as the genesis data to simulate the upgrade test. You can directly go to **Step 4** to proceed if you choose to go with this option. + +```bash +cd v6.0.0 + +# Uncompress the file that was compressed by the command `tar -cvjSf genesis.json.tar.bz2 genesis.json` +tar xvzf genesis.json.tar.bz2 + +# Verify the hash +cat genesis.json | shasum -a 256 +> +615a5c66ed3d721fe16802b3032918320945e6a4fbd975570e8ea5db206fa878 +``` + +## Option 2. Step By Step Guide + +`exported_genesis_with_height_7304500_sorted.json.tar.bz2` file inside `./data` folder in this repository is prepared. It is obtained by `$ gaia export --height 7304500` command from `cosmoshub-4` network and compressed the file by using `tar -cvjSf exported_genesis_with_height_7304500.json.tar.bz2 exported_genesis_with_height_7304500.json` command. Uncompress the exported file and use it as the genesis data to simulate the upgrade test. + +```bash +cd v6.0.0 + +# Uncompress the file +tar xvzf ../data/exported_genesis_with_height_7304500_sorted.json.tar.bz2 + +# Verify the hash +cat exported_genesis_with_height_7304500_sorted.json | shasum -a 256 +> +df10480978a9a211fbc2f82865659c1298f1ba97a3fee37512b299102fa1e9c3 + +# Copy the file and name it genesis.json +cp exported_genesis_with_height_7304500_sorted.json genesis.json +``` + +### (Option 2) Step 1. Substitute validator keys and accounts + +In this step, we will swap 2 validators with two new accounts in the genesis file and we will also modify some parameters to improve test efficiency. The following files that contain validators' consensus keys and mnemonics for the two accounts are already prepared. Why do we need to swap 2 validators? See [this issue](https://github.com/cosmos/cosmos-sdk/issues/7505) for reference. + +- `priv_validator_key_val1.json`: validator1's consensus key + +- `priv_validator_key_val2.json`: validator2's consensus key + +- `guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host`: mnemonics for validator1 + +- `friend excite rough reopen cover wheel spoon convince island path clean monkey play snow number walnut pull lock shoot hurry dream divide concert discover`: mnemonics for validator2 + +- `render hire dirt bulk huge goat jungle number wear method check during menu goat accident scan noise nerve below target resource digital column flee`: `user1` account that is used for sending governance proposal to the network + +- `junk appear guide guess bar reject vendor illegal script sting shock afraid detect ginger other theory relief dress develop core pull across hen float`: `user2` account that is used to test command-line interfaces (CLIs) for the liquidity module + +```bash +# Check platform +platform='unknown' +unamestr=`uname` +if [ "$unamestr" = 'Linux' ]; then + platform='linux' +fi + +# Replace values with new ones +if [ $platform = 'linux' ]; then + sed -i 's%"chain_id": "cosmoshub-4",%"chain_id": "cosmoshub-4-upgrade-testnet-2003",%g' genesis.json + sed -i 's%cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM=%qwiUMxz3llsy45fPvM0a8+XQeAJLvrX3QAEJmRMEEoU=%g' genesis.json + sed -i 's%B00A6323737F321EB0B8D59C6FD497A14B60938A%D5AB5E458FD9F9964EF50A80451B6F3922E6A4AA%g' genesis.json + sed -i 's%cosmosvalcons1kq9xxgmn0uepav9c6kwxl4yh599kpyu28e7ee6%cosmosvalcons16k44u3v0m8uevnh4p2qy2xm08y3wdf92xsc3ve%g' genesis.json + sed -i 's%W459Kbdx+LJQ7dLVASW6sAfdqWqNRSXnvc53r9aOx/o=%oi55Dw+JjLQc4u1WlAS3FsGwh5fd5/N5cP3VOLnZ/H0=%g' genesis.json + sed -i 's%83F47D7747B0F633A6BA0DF49B7DCF61F90AA1B0%7CB07B94FD743E2A8520C2B50DA4B03740643BF5%g' genesis.json + sed -i 's%cosmosvalcons1s0686a68krmr8f46ph6fklw0v8us4gdsm7nhz3%cosmosvalcons10jc8h98awslz4pfqc26smf9sxaqxgwl4vxpcrp%g' genesis.json + sed -i 's%cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl%cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6%g' genesis.json + sed -i 's%Am5HzAWtsyvoQy49DyM4Q1sZiZL6UvTgKSJW4ERAhCR8%AsM0d7NDJ/oFn+/WkeQKO2QIWE3SNBccoRLkrCK14T/i%g' genesis.json + sed -i 's%cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx%cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9%g' genesis.json + sed -i 's%A6apc7iThbRkwboKqPy6eXxxQvTH+0lNkXZvugDM9V4g%ApDOUyfcamDmnbEO7O4YKnKQQqQ93+gquLfGf7h5clX7%g' genesis.json +else + sed -i '' 's%"chain_id": "cosmoshub-4",%"chain_id": "cosmoshub-4-upgrade-testnet-2003",%g' genesis.json + sed -i '' 's%cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM=%qwiUMxz3llsy45fPvM0a8+XQeAJLvrX3QAEJmRMEEoU=%g' genesis.json + sed -i '' 's%B00A6323737F321EB0B8D59C6FD497A14B60938A%D5AB5E458FD9F9964EF50A80451B6F3922E6A4AA%g' genesis.json + sed -i '' 's%cosmosvalcons1kq9xxgmn0uepav9c6kwxl4yh599kpyu28e7ee6%cosmosvalcons16k44u3v0m8uevnh4p2qy2xm08y3wdf92xsc3ve%g' genesis.json + sed -i '' 's%W459Kbdx+LJQ7dLVASW6sAfdqWqNRSXnvc53r9aOx/o=%oi55Dw+JjLQc4u1WlAS3FsGwh5fd5/N5cP3VOLnZ/H0=%g' genesis.json + sed -i '' 's%83F47D7747B0F633A6BA0DF49B7DCF61F90AA1B0%7CB07B94FD743E2A8520C2B50DA4B03740643BF5%g' genesis.json + sed -i '' 's%cosmosvalcons1s0686a68krmr8f46ph6fklw0v8us4gdsm7nhz3%cosmosvalcons10jc8h98awslz4pfqc26smf9sxaqxgwl4vxpcrp%g' genesis.json + sed -i '' 's%cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl%cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6%g' genesis.json + sed -i '' 's%Am5HzAWtsyvoQy49DyM4Q1sZiZL6UvTgKSJW4ERAhCR8%AsM0d7NDJ/oFn+/WkeQKO2QIWE3SNBccoRLkrCK14T/i%g' genesis.json + sed -i '' 's%cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx%cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9%g' genesis.json + sed -i '' 's%A6apc7iThbRkwboKqPy6eXxxQvTH+0lNkXZvugDM9V4g%ApDOUyfcamDmnbEO7O4YKnKQQqQ93+gquLfGf7h5clX7%g' genesis.json +fi + +##################################################################### +# DO NOT PROCEED BELOW COMMANDS. +# IT'S JUST AN EXPLANATION ABOUT WHAT WE CHANGED WITH 'sed' COMMAND +##################################################################### + +# Change chain_id +sed -i $SED_I 's%"chain_id": "cosmoshub-4",%"chain_id": "cosmoshub-4-upgrade-testnet-2003",%g' genesis.json + +# Substitute "Certus One" with validator1 +# +# cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM= --> qwiUMxz3llsy45fPvM0a8+XQeAJLvrX3QAEJmRMEEoU= +# B00A6323737F321EB0B8D59C6FD497A14B60938A --> D5AB5E458FD9F9964EF50A80451B6F3922E6A4AA +# cosmosvalcons1kq9xxgmn0uepav9c6kwxl4yh599kpyu28e7ee6 --> cosmosvalcons16k44u3v0m8uevnh4p2qy2xm08y3wdf92xsc3ve +# +sed -i $SED_I 's%cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM=%qwiUMxz3llsy45fPvM0a8+XQeAJLvrX3QAEJmRMEEoU=%g' genesis.json +sed -i $SED_I 's%B00A6323737F321EB0B8D59C6FD497A14B60938A%D5AB5E458FD9F9964EF50A80451B6F3922E6A4AA%g' genesis.json +sed -i $SED_I 's%cosmosvalcons1kq9xxgmn0uepav9c6kwxl4yh599kpyu28e7ee6%cosmosvalcons16k44u3v0m8uevnh4p2qy2xm08y3wdf92xsc3ve%g' genesis.json + +# Substitute "Binance Staking" with validator2 +# +# W459Kbdx+LJQ7dLVASW6sAfdqWqNRSXnvc53r9aOx/o= --> oi55Dw+JjLQc4u1WlAS3FsGwh5fd5/N5cP3VOLnZ/H0= +# 83F47D7747B0F633A6BA0DF49B7DCF61F90AA1B0 --> 7CB07B94FD743E2A8520C2B50DA4B03740643BF5 +# cosmosvalcons1s0686a68krmr8f46ph6fklw0v8us4gdsm7nhz3 --> cosmosvalcons10jc8h98awslz4pfqc26smf9sxaqxgwl4vxpcrp +# +sed -i $SED_I 's%W459Kbdx+LJQ7dLVASW6sAfdqWqNRSXnvc53r9aOx/o=%oi55Dw+JjLQc4u1WlAS3FsGwh5fd5/N5cP3VOLnZ/H0=%g' genesis.json +sed -i $SED_I 's%83F47D7747B0F633A6BA0DF49B7DCF61F90AA1B0%7CB07B94FD743E2A8520C2B50DA4B03740643BF5%g' genesis.json +sed -i $SED_I 's%cosmosvalcons1s0686a68krmr8f46ph6fklw0v8us4gdsm7nhz3%cosmosvalcons10jc8h98awslz4pfqc26smf9sxaqxgwl4vxpcrp%g' genesis.json + +# Substitute user1 account +# +# cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl --> cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6 +# Am5HzAWtsyvoQy49DyM4Q1sZiZL6UvTgKSJW4ERAhCR8 --> AsM0d7NDJ/oFn+/WkeQKO2QIWE3SNBccoRLkrCK14T/i +# +sed -i $SED_I 's%cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl%cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6%g' genesis.json +sed -i $SED_I 's%Am5HzAWtsyvoQy49DyM4Q1sZiZL6UvTgKSJW4ERAhCR8%AsM0d7NDJ/oFn+/WkeQKO2QIWE3SNBccoRLkrCK14T/i%g' genesis.json + +# Substitute user2 account +# +# cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx --> cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 +# A6apc7iThbRkwboKqPy6eXxxQvTH+0lNkXZvugDM9V4g --> ApDOUyfcamDmnbEO7O4YKnKQQqQ93+gquLfGf7h5clX7 +# +sed -i $SED_I 's%cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx%cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9%g' genesis.json +sed -i $SED_I 's%A6apc7iThbRkwboKqPy6eXxxQvTH+0lNkXZvugDM9V4g%ApDOUyfcamDmnbEO7O4YKnKQQqQ93+gquLfGf7h5clX7%g' genesis.json +``` + +### (Option 2) Step 2. Change voting power and staking delegation to over 67% + +```bash +# Check platform +platform='unknown' +unamestr=`uname` +if [ "$unamestr" = 'Linux' ]; then + platform='linux' +fi + +# Replace values with new ones +if [ $platform = 'linux' ]; then + sed -i 's%"25390741.000000000000000000"%"6000000025390741.000000000000000000"%g' genesis.json + sed -i 's%13991908901944%6013991908901944%g' genesis.json + sed -i 's%"power": "13991908"%"power": "6013991908"%g' genesis.json + sed -i 's%"194093279"%"6194093279"%g' genesis.json + sed -i 's%277549930240869%1006277549930240869%g' genesis.json + sed -i 's%194093338099942%6194093338099942%g' genesis.json + sed -i 's%"amount": "72177323"%"amount": "1000000000072177323"%g' genesis.json +else + sed -i '' 's%"25390741.000000000000000000"%"6000000025390741.000000000000000000"%g' genesis.json + sed -i '' 's%13991908901944%6013991908901944%g' genesis.json + sed -i '' 's%"power": "13991908"%"power": "6013991908"%g' genesis.json + sed -i '' 's%"194093279"%"6194093279"%g' genesis.json + sed -i '' 's%277549930240869%1006277549930240869%g' genesis.json + sed -i '' 's%194093338099942%6194093338099942%g' genesis.json + sed -i '' 's%"amount": "72177323"%"amount": "1000000000072177323"%g' genesis.json +fi + +##################################################################### +# DO NOT PROCEED BELOW COMMANDS. +# IT'S JUST AN EXPLANATION ABOUT WHAT WE CHANGED WITH 'sed' COMMAND +##################################################################### + +# Fix delegation amount to over 67% to start the chain +sed -i $SED_I 's%"25390741.000000000000000000"%"6000000025390741.000000000000000000"%g' genesis.json + +# Fix power of the validator +# +# Binance Staking validator's "delegator_shares" and "tokens" +# +sed -i $SED_I 's%13991908901944%6013991908901944%g' genesis.json +sed -i $SED_I 's%"power": "13991908"%"power": "6013991908"%g' genesis.json + +# Fix last_total_power +sed -i $SED_I 's%"194093279"%"6194093279"%g' genesis.json + +# Fix total supply of 'uatom' +sed -i $SED_I 's%277549930240869%1006277549930240869%g' genesis.json + +# Fix balance of bonded_tokens_pool module account (cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh) +sed -i $SED_I 's%194093338099942%6194093338099942%g' genesis.json + +# Fix the balance of user2 account (cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9) +sed -i $SED_I 's%"amount": "72177323"%"amount": "1000000000072177323"%g' genesis.json +``` + +### (Option 2) Step 3. Modify governance parameters + +In this step, we will modify governance parameters to improve test efficiency. The following `gov` parameters are going to be modified: + +- minimum deposit amount +- quorum +- threshold +- voting_period + +```bash +# Check platform +platform='unknown' +unamestr=`uname` +if [ "$unamestr" = 'Linux' ]; then + platform='linux' +fi + +# Replace values with new ones +if [ $platform = 'linux' ]; then + sed -i 's%"amount": "64000000",%"amount": "1",%g' genesis.json + sed -i 's%"quorum": "0.400000000000000000",%"quorum": "0.000000000000000001",%g' genesis.json + sed -i 's%"threshold": "0.500000000000000000",%"threshold": "0.000000000000000001",%g' genesis.json + sed -i 's%"voting_period": "1209600s"%"voting_period": "60s"%g' genesis.json +else + sed -i '' 's%"amount": "64000000",%"amount": "1",%g' genesis.json + sed -i '' 's%"quorum": "0.400000000000000000",%"quorum": "0.000000000000000001",%g' genesis.json + sed -i '' 's%"threshold": "0.500000000000000000",%"threshold": "0.000000000000000001",%g' genesis.json + sed -i '' 's%"voting_period": "1209600s"%"voting_period": "60s"%g' genesis.json +fi +``` + +### Step 4. Initialize chain + +In this step, we will use `gaiad_old` binary to initialize validators's and node's configuration files. + +```bash +export EXPORTED_GENESIS=genesis.json +export BINARY=gaiad_old +export CHAIN_ID=cosmoshub-4-upgrade-testnet-2003 +export CHAIN_DIR=./data + +export VAL_1_CHAIN_DIR=$CHAIN_DIR/$CHAIN_ID/val1 +export VAL_1_MNEMONIC="guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host" +export VAL_1_KEY_NAME="val1" +export VAL_1_MONIKER="val1" +export VAL_2_CHAIN_DIR=$CHAIN_DIR/$CHAIN_ID/val2 +export VAL_2_MNEMONIC="friend excite rough reopen cover wheel spoon convince island path clean monkey play snow number walnut pull lock shoot hurry dream divide concert discover" +export VAL_2_KEY_NAME="val2" +export VAL_2_MONIKER="val2" + +# Validator 1 +$BINARY init test --home $VAL_1_CHAIN_DIR --chain-id=$CHAIN_ID +echo $VAL_1_MNEMONIC | $BINARY --home $VAL_1_CHAIN_DIR keys add $VAL_1_KEY_NAME --recover --keyring-backend=test + +# Validator 2 +$BINARY --home $VAL_2_CHAIN_DIR init test --chain-id=$CHAIN_ID +echo $VAL_2_MNEMONIC | $BINARY --home $VAL_2_CHAIN_DIR keys add $VAL_2_KEY_NAME --recover --keyring-backend=test + +# Account 1 +export USER_1_CHAIN_DIR=$CHAIN_DIR/$CHAIN_ID/val2 +export USER_1_MNEMONIC="render hire dirt bulk huge goat jungle number wear method check during menu goat accident scan noise nerve below target resource digital column flee" +export USER_1_KEY_NAME="user1" + +# Account 2 +export USER_2_CHAIN_DIR=$CHAIN_DIR/$CHAIN_ID/val2 +export USER_2_MNEMONIC="junk appear guide guess bar reject vendor illegal script sting shock afraid detect ginger other theory relief dress develop core pull across hen float" +export USER_2_KEY_NAME="user2" + +echo $USER_1_MNEMONIC | $BINARY --home $USER_1_CHAIN_DIR keys add $USER_1_KEY_NAME --recover --keyring-backend=test +echo $USER_2_MNEMONIC | $BINARY --home $USER_2_CHAIN_DIR keys add $USER_2_KEY_NAME --recover --keyring-backend=test + +# +# - name: user1 +# type: local +# address: cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6 +# pubkey: cosmospub1addwnpepqtpngaangvnl5pvlaltfreq28djqskzd6g6pw89pztj2cg44uyl7y6xgev8 +# mnemonic: "" +# threshold: 0 +# pubkeys: [] +# +# - name: user2 +# type: local +# address: cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 +# pubkey: cosmospub1addwnpepq2gvu5e8m34xpe5aky8wemsc9fefqs4y8h07s24cklr8lwrewf2lklysaen +# mnemonic: "" +# threshold: 0 +# pubkeys: [] +``` + +### Step 5. Configuration + +In this step, we will copy the genesis file and the validator consensus keys to the designated directories. We will also configure settings in both `config.toml` and `app.toml`. + +```bash +# Copy genesis file to the designated directories and copy validator consensus key files +cp genesis.json $VAL_1_CHAIN_DIR/config/genesis.json +cp genesis.json $VAL_2_CHAIN_DIR/config/genesis.json +cp ../data/priv_validator_key_val1.json $VAL_1_CHAIN_DIR/config/priv_validator_key.json +cp ../data/priv_validator_key_val2.json $VAL_2_CHAIN_DIR/config/priv_validator_key.json + +# Configure parameters in config.toml and app.toml files +export VAL_1_P2P_PORT=26656 +export VAL_1_NODE_ID=$($BINARY tendermint --home $VAL_1_CHAIN_DIR show-node-id) +export VAL_2_P2P_PORT=36656 +export VAL_2_RPC_PORT=36657 +export VAL_2_API_PORT=1327 +export VAL_2_GRPC_PORT=9080 +export VAL_2_GRPC_WEB_SERVER_PORT=9081 +export VAL_2_ROSETTA_API_PORT=8081 +export VAL_2_PPROF_PORT=6061 +export VAL_2_NODE_ID=$($BINARY tendermint --home $VAL_2_CHAIN_DIR show-node-id) + +# Set proper defaults and change ports (use a different sed for Mac or Linux) +if [ $platform = 'linux' ]; then + sed -i 's/enable = true/enable = false/g' $VAL_1_CHAIN_DIR/config/app.toml # disable this to prevent from port collision + sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0stake"/g' $VAL_1_CHAIN_DIR/config/app.toml + sed -i 's/persistent_peers = ""/persistent_peers = "'$VAL_2_NODE_ID'@'localhost':'$VAL_2_P2P_PORT'"/g' $VAL_1_CHAIN_DIR/config/config.toml + sed -i 's/unconditional_peer_ids = ""/unconditional_peer_ids = "'$VAL_2_NODE_ID'"/g' $VAL_1_CHAIN_DIR/config/config.toml + sed -i 's/addr_book_strict = true/addr_book_strict = false/g' $VAL_1_CHAIN_DIR/config/config.toml + sed -i 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:'"$VAL_2_RPC_PORT"'"#g' $VAL_2_CHAIN_DIR/config/config.toml + sed -i 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:'"$VAL_2_P2P_PORT"'"#g' $VAL_2_CHAIN_DIR/config/config.toml + sed -i 's#"tcp://0.0.0.0:1317"#"tcp://0.0.0.0:'"$VAL_2_API_PORT"'"#g' $VAL_2_CHAIN_DIR/config/app.toml + sed -i 's#"0.0.0.0:9090"#"0.0.0.0:'"$VAL_2_GRPC_PORT"'"#g' $VAL_2_CHAIN_DIR/config/app.toml + sed -i 's#"0.0.0.0:9091"#"0.0.0.0:'"$VAL_2_GRPC_WEB_SERVER_PORT"'"#g' $VAL_2_CHAIN_DIR/config/app.toml + sed -i 's#":8080"#":'"$VAL_2_ROSETTA_API_PORT"'"#g' $VAL_2_CHAIN_DIR/config/app.toml + sed -i 's/enable = false/enable = true/g' $VAL_2_CHAIN_DIR/config/app.toml + sed -i 's/swagger = false/swagger = true/g' $VAL_2_CHAIN_DIR/config/app.toml + sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0stake"/g' $VAL_2_CHAIN_DIR/config/app.toml + sed -i 's/persistent_peers = ""/persistent_peers = "'$VAL_1_NODE_ID'@'localhost':'$VAL_1_P2P_PORT'"/g' $VAL_2_CHAIN_DIR/config/config.toml + sed -i 's/unconditional_peer_ids = ""/unconditional_peer_ids = "'$VAL_1_NODE_ID'"/g' $VAL_2_CHAIN_DIR/config/config.toml + sed -i 's/pprof_laddr = "localhost:6060"/pprof_laddr = "localhost:'$VAL_2_PPROF_PORT'"/g' $VAL_2_CHAIN_DIR/config/config.toml + sed -i 's/addr_book_strict = true/addr_book_strict = false/g' $VAL_2_CHAIN_DIR/config/config.toml +else + sed -i '' 's/enable = true/enable = false/g' $VAL_1_CHAIN_DIR/config/app.toml # disable this to prevent from port collision + sed -i '' 's/minimum-gas-prices = ""/minimum-gas-prices = "0stake"/g' $VAL_1_CHAIN_DIR/config/app.toml + sed -i '' 's/persistent_peers = ""/persistent_peers = "'$VAL_2_NODE_ID'@'localhost':'$VAL_2_P2P_PORT'"/g' $VAL_1_CHAIN_DIR/config/config.toml + sed -i '' 's/unconditional_peer_ids = ""/unconditional_peer_ids = "'$VAL_2_NODE_ID'"/g' $VAL_1_CHAIN_DIR/config/config.toml + sed -i '' 's/addr_book_strict = true/addr_book_strict = false/g' $VAL_1_CHAIN_DIR/config/config.toml + sed -i '' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:'"$VAL_2_RPC_PORT"'"#g' $VAL_2_CHAIN_DIR/config/config.toml + sed -i '' 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:'"$VAL_2_P2P_PORT"'"#g' $VAL_2_CHAIN_DIR/config/config.toml + sed -i '' 's#"tcp://0.0.0.0:1317"#"tcp://0.0.0.0:'"$VAL_2_API_PORT"'"#g' $VAL_2_CHAIN_DIR/config/app.toml + sed -i '' 's#"0.0.0.0:9090"#"0.0.0.0:'"$VAL_2_GRPC_PORT"'"#g' $VAL_2_CHAIN_DIR/config/app.toml + sed -i '' 's#"0.0.0.0:9091"#"0.0.0.0:'"$VAL_2_GRPC_WEB_SERVER_PORT"'"#g' $VAL_2_CHAIN_DIR/config/app.toml + sed -i '' 's#":8080"#":'"$VAL_2_ROSETTA_API_PORT"'"#g' $VAL_2_CHAIN_DIR/config/app.toml + sed -i '' 's/enable = false/enable = true/g' $VAL_2_CHAIN_DIR/config/app.toml + sed -i '' 's/swagger = false/swagger = true/g' $VAL_2_CHAIN_DIR/config/app.toml + sed -i '' 's/minimum-gas-prices = ""/minimum-gas-prices = "0stake"/g' $VAL_2_CHAIN_DIR/config/app.toml + sed -i '' 's/persistent_peers = ""/persistent_peers = "'$VAL_1_NODE_ID'@'localhost':'$VAL_1_P2P_PORT'"/g' $VAL_2_CHAIN_DIR/config/config.toml + sed -i '' 's/unconditional_peer_ids = ""/unconditional_peer_ids = "'$VAL_1_NODE_ID'"/g' $VAL_2_CHAIN_DIR/config/config.toml + sed -i '' 's/pprof_laddr = "localhost:6060"/pprof_laddr = "localhost:'$VAL_2_PPROF_PORT'"/g' $VAL_2_CHAIN_DIR/config/config.toml + sed -i '' 's/addr_book_strict = true/addr_book_strict = false/g' $VAL_2_CHAIN_DIR/config/config.toml +fi +``` + +### Step 6. Start the chain + +In this step, we will open two terminals and start two validator nodes. It requires 2+ validators to start the network that is exported from live chain. Read [this issue](https://github.com/cosmos/cosmos-sdk/issues/7505) for more information about it. You can start the chain with `--x-crisis-skip-assert-invariants` flag to skip invariant checks since it takes quite a long time. It takes more than an hour to start the chain. Of course, it depends on the resources of your local machine. + +```bash +# +# Terminal 1 (note that you should run the below command from directory where data folder is located) +# +export BINARY=gaiad_old +export CHAIN_ID=cosmoshub-4-upgrade-testnet-2003 +export HOME1=./data/$CHAIN_ID/val1 +$BINARY start --home $HOME1 + +# +# Terminal 2 (note that you should run the below command from directory where data folder is located) +# +export BINARY=gaiad_old +export CHAIN_ID=cosmoshub-4-upgrade-testnet-2003 +export HOME2=./data/$CHAIN_ID/val2 +$BINARY start --home $HOME2 + +# +# (With --x-crisis-skip-assert-invariants flag) Terminal 1 +# +# skip invariant checks to start the chain +export BINARY=gaiad_old +export CHAIN_ID=cosmoshub-4-upgrade-testnet-2003 +export HOME1=./data/$CHAIN_ID/val1 +$BINARY start --home $HOME1 --x-crisis-skip-assert-invariants + +# +# (With --x-crisis-skip-assert-invariants flag) Terminal 2 +# +# skip invariant checks to start the chain +export BINARY=gaiad_old +export CHAIN_ID=cosmoshub-4-upgrade-testnet-2003 +export HOME2=./data/$CHAIN_ID/val2 +$BINARY start --home $HOME2 --x-crisis-skip-assert-invariants + +# +# Reset the blockchain database and its state +# +$BINARY unsafe-reset-all --home $HOME1 +$BINARY unsafe-reset-all --home $HOME2 +``` + +### Step 7. Send an upgrade proposal to the network + +In this step, we will open up `Terminal 3` to send an upgrade governance proposal along with a deposit. + +```bash +# +# Terminal 3 (note that you should run the below command from directory where data folder is located) +# +export BINARY=gaiad_old +export CHAIN_ID=cosmoshub-4-upgrade-testnet-2003 + +# **CAUTION** +# name: it is case sentitive. it should match with upgrade name; otherwise it won't start +# upgrade-height: make sure it has enough time for the proposal to pass +# +$BINARY tx gov submit-proposal software-upgrade Vega \ +--title Vega \ +--deposit 1000uatom \ +--upgrade-height 7304530 \ +--upgrade-info "v6.0.0-rc2-277a25b8940f0cfb1dc2d05fe11dc6e646840988" \ +--description "Vega Upgrade" \ +--gas 400000 \ +--from user1 \ +--keyring-backend test \ +--chain-id $CHAIN_ID \ +--home data/$CHAIN_ID/val2 \ +--node tcp://localhost:36657 \ +--yes -b block \ +-o json | jq + +# Query the proposal to check the status. +# the status should be PROPOSAL_STATUS_VOTING_PERIOD. +$BINARY query gov proposal 54 \ +--chain-id $CHAIN_ID \ +--home data/$CHAIN_ID/val2 \ +--node tcp://localhost:36657 \ +-o json | jq + +# Vote yes for the proposal +# Note that voting period, quorum, and threshold params are modified +$BINARY tx gov vote 54 yes \ +--from user1 \ +--keyring-backend test \ +--chain-id $CHAIN_ID \ +--home data/$CHAIN_ID/val2 \ +--node tcp://localhost:36657 \ +--yes -b block \ +-o json | jq + +# Wait for a while for the proposal to pass + +# Query the proposal to check if it is passed +# The status should be PROPOSAL_STATUS_PASSED +$BINARY query gov proposal 54 \ +--chain-id $CHAIN_ID \ +--home data/$CHAIN_ID/val2 \ +--node tcp://localhost:36657 \ +-o json | jq +``` + +Result of the proposal + +```json +{ + "proposal_id": "54", + "content": { + "@type": "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + "title": "Vega", + "description": "Vega Upgrade", + "plan": { + "name": "Vega", + "time": "0001-01-01T00:00:00Z", + "height": "7304530", + "info": "v6.0.0-rc2-277a25b8940f0cfb1dc2d05fe11dc6e646840988", + "upgraded_client_state": null + } + }, + "status": "PROPOSAL_STATUS_VOTING_PERIOD", + "final_tally_result": { + "yes": "0", + "abstain": "0", + "no": "0", + "no_with_veto": "0" + }, + "submit_time": "2021-10-25T12:57:49.938185Z", + "deposit_end_time": "2021-11-08T12:57:49.938185Z", + "total_deposit": [ + { + "denom": "uatom", + "amount": "1000" + } + ], + "voting_start_time": "2021-10-25T12:57:49.938185Z", + "voting_end_time": "2021-10-25T12:58:49.938185Z" +} +``` + +### Step 8. Restart node using `gaiad` + +The proposal has successfully passed and the chain is halted for upgrade when `upgrade-height` is reached. + +> ERR UPGRADE "Vega" NEEDED at height: 7304530: v6.0.0-rc2-277a25b8940f0cfb1dc2d05fe11dc6e646840988 +> ERR CONSENSUS FAILURE!!! err="UPGRADE \"Vega\" NEEDED at height: 7304530: v6.0.0-rc2-277a25b8940f0cfb1dc2d05fe11dc6e646840988" module=consensus stack="goroutine 167 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x65\ngithub.com/tendermint/tendermint/consensus.(*State)... + +In this step, we will use `gaiad` that includes the liquidity module `v1.4.1`. + +```bash +# +# Terminal 1 +# +gaiad start --home $HOME1 --x-crisis-skip-assert-invariants + +# +# Terminal 2 +# +gaiad start --home $HOME2 --x-crisis-skip-assert-invariants +``` + +## Test Gravity DEX + +### Query params + +Let's first query the values are set as liquidity parameter. + +```bash +gaiad query liquidity params \ +--node tcp://localhost:36657 \ +--output json | jq +``` + +```json +{ + "pool_types": [ + { + "id": 1, + "name": "StandardLiquidityPool", + "min_reserve_coin_num": 2, + "max_reserve_coin_num": 2, + "description": "Standard liquidity pool with pool price function X/Y, ESPM constraint, and two kinds of reserve coins" + } + ], + "min_init_deposit_amount": "1000000", + "init_pool_coin_mint_amount": "1000000", + "max_reserve_coin_amount": "0", + "pool_creation_fee": [ + { + "denom": "uatom", + "amount": "40000000" + } + ], + "swap_fee_rate": "0.003000000000000000", + "withdraw_fee_rate": "0.000000000000000000", + "max_order_amount_ratio": "0.100000000000000000", + "unit_batch_height": 1, + "circuit_breaker_enabled": false +} +``` + +### Change `InitPoolCoinMintAmount` parameter + +Now, let's change `init_pool_coin_mint_amount` through parameter change governance proposal + +```json +{ + "title": "Liquidity Param Change", + "description": "Update Initial PoolCoin Mint Amount", + "changes": [ + { + "subspace": "liquidity", + "key": "InitPoolCoinMintAmount", + "value": "1000000000000" + } + ], + "deposit": "10000uatom" +} +``` + +```bash +# Submit a parameter changes proposal to create a budget plan +gaiad tx gov submit-proposal param-change proposal.json \ +--from user1 \ +--keyring-backend test \ +--chain-id $CHAIN_ID \ +--home data/$CHAIN_ID/val2 \ +--node tcp://localhost:36657 \ +--yes -b block \ +-o json | jq + +# Query the proposal to check the status. +# The status should be PROPOSAL_STATUS_VOTING_PERIOD. +$BINARY query gov proposal 55 \ +--chain-id $CHAIN_ID \ +--home data/$CHAIN_ID/val2 \ +--node tcp://localhost:36657 \ +-o json | jq + +# Vote yes for the proposal +# Note that voting period, quorum, and threshold params are modified +$BINARY tx gov vote 55 yes \ +--from user1 \ +--keyring-backend test \ +--chain-id $CHAIN_ID \ +--home data/$CHAIN_ID/val2 \ +--node tcp://localhost:36657 \ +--yes -b block \ +-o json | jq + +# Wait for a while for the proposal to pass + +# Query the proposal to check if it is passed +# The status should be PROPOSAL_STATUS_PASSED +$BINARY query gov proposal 55 \ +--chain-id $CHAIN_ID \ +--home data/$CHAIN_ID/val2 \ +--node tcp://localhost:36657 \ +-o json | jq + +# Query the values are set as liquidity parameter to see if it is changed +gaiad query liquidity params \ +--node tcp://localhost:36657 \ +--output json | jq +``` + +### Liquidity Command-line Interfaces + +```bash +export CHAIN_ID=cosmoshub-4-upgrade-testnet-2003 +export HOME1=./data/$CHAIN_ID/val1 +export HOME2=./data/$CHAIN_ID/val2 + +# Query user2 balance +# http://localhost:1327/cosmos/bank/v1beta1/balances/cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 +gaiad q bank balances cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9 -o json | jq + +# Create pool +gaiad tx liquidity create-pool 1 1000000000uatom,9000000ibc/1BE91D67775723D3230A9A5AC54BB29B92A5A51B4B8F20BBA37DF1CFA602297C \ +--home $HOME2 \ +--chain-id $CHAIN_ID \ +--from user2 \ +--keyring-backend test \ +--gas 300000 \ +--node tcp://localhost:36657 \ +--yes -b block -o json | jq + +# Query pool with pool id 10 +gaiad q liquidity pool 10 --node tcp://localhost:36657 -o json | jq + +# Query reserve pool balances +gaiad q bank balances cosmos1qf9sqpexwyh3py786f8vx2w7fx8thpd5wz79sf -o json | jq + +# Withdraw some pool coins +# Note that withdrawing a small amount of pool coin will fail +gaiad tx liquidity withdraw 10 100000000pool024B000726712F1093C7D24EC329DE498EBB85B4B2D37C59D4F37BC542020151 \ +--home $HOME2 \ +--chain-id $CHAIN_ID \ +--from user2 \ +--keyring-backend test \ +--node tcp://localhost:36657 \ +--yes -b block -o json | jq + +# Deposit +gaiad tx liquidity deposit 10 100000000uatom,900000ibc/1BE91D67775723D3230A9A5AC54BB29B92A5A51B4B8F20BBA37DF1CFA602297C \ +--home $HOME2 \ +--chain-id $CHAIN_ID \ +--from user2 \ +--keyring-backend test \ +--node tcp://localhost:36657 \ +--yes -b block -o json | jq + +# Swap +gaiad tx liquidity swap 10 1 10000000uatom ibc/1BE91D67775723D3230A9A5AC54BB29B92A5A51B4B8F20BBA37DF1CFA602297C 0.0089 0.003 \ +--home $HOME2 \ +--chain-id $CHAIN_ID \ +--node tcp://localhost:36657 \ +--from user2 \ +--keyring-backend test \ +--yes -b block -o json | jq + +# +# Debugging if the transaction is successfully deposited, withdrew, or swapped requires +# you to look up the block height result that the transaction is included. +# Reference this link to find out the block height result +# http://localhost:36657/block_results?height={height} +# +# Copy and paste the result into this site that conveniently decodes keys and values from base64 format. +# https://hallazzang.github.io/tendermint-toolkit/ +# +``` + +## Modified parameters in `genesis.json` file + +```bash +diff exported_genesis_with_height_7304500_sorted.json genesis.json -u +``` + +```diff +--- exported_genesis_with_height_7304500_sorted.json 2021-08-23 21:52:43.000000000 +0900 ++++ genesis.json 2021-10-25 21:48:37.000000000 +0900 +@@ -1,6 +1,6 @@ + { + "genesis_time": "2019-12-11T16:11:34Z", +- "chain_id": "cosmoshub-4", ++ "chain_id": "cosmoshub-4-upgrade-testnet-2003", + "initial_height": "7304501", + "consensus_params": { + "block": { +@@ -22,10 +22,10 @@ + }, + "validators": [ + { +- "address": "B00A6323737F321EB0B8D59C6FD497A14B60938A", ++ "address": "D5AB5E458FD9F9964EF50A80451B6F3922E6A4AA", + "pub_key": { + "type": "tendermint/PubKeyEd25519", +- "value": "cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM=" ++ "value": "qwiUMxz3llsy45fPvM0a8+XQeAJLvrX3QAEJmRMEEoU=" + }, + "power": "2589549", + "name": "Certus One" +@@ -724,12 +724,12 @@ + "name": "DragonStake" + }, + { +- "address": "83F47D7747B0F633A6BA0DF49B7DCF61F90AA1B0", ++ "address": "7CB07B94FD743E2A8520C2B50DA4B03740643BF5", + "pub_key": { + "type": "tendermint/PubKeyEd25519", +- "value": "W459Kbdx+LJQ7dLVASW6sAfdqWqNRSXnvc53r9aOx/o=" ++ "value": "oi55Dw+JjLQc4u1WlAS3FsGwh5fd5/N5cP3VOLnZ/H0=" + }, +- "power": "13991908", ++ "power": "6013991908", + "name": "Binance Staking" + }, + { +@@ -225551,10 +225551,10 @@ + { + "@type": "/cosmos.auth.v1beta1.BaseAccount", + "account_number": "27720", +- "address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "pub_key": { + "@type": "/cosmos.crypto.secp256k1.PubKey", +- "key": "A6apc7iThbRkwboKqPy6eXxxQvTH+0lNkXZvugDM9V4g" ++ "key": "ApDOUyfcamDmnbEO7O4YKnKQQqQ93+gquLfGf7h5clX7" + }, + "sequence": "221" + }, +@@ -1411127,10 +1411127,10 @@ + { + "@type": "/cosmos.auth.v1beta1.BaseAccount", + "account_number": "10668", +- "address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "pub_key": { + "@type": "/cosmos.crypto.secp256k1.PubKey", +- "key": "Am5HzAWtsyvoQy49DyM4Q1sZiZL6UvTgKSJW4ERAhCR8" ++ "key": "AsM0d7NDJ/oFn+/WkeQKO2QIWE3SNBccoRLkrCK14T/i" + }, + "sequence": "22" + }, +@@ -3459808,7 +3459808,7 @@ + ] + }, + { +- "address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "coins": [ + { + "amount": "10000000", +@@ -3459827,7 +3459827,7 @@ + "denom": "ibc/EC4B5D87917DD5668D9998146F82D70FDF86652DB333D04CE29D1EB18E296AF5" + }, + { +- "amount": "72177323", ++ "amount": "1000000000072177323", + "denom": "uatom" + } + ] +@@ -3951624,7 +3951624,7 @@ + "address": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh", + "coins": [ + { +- "amount": "194093338099942", ++ "amount": "6194093338099942", + "denom": "uatom" + } + ] +@@ -4177422,7 +4177422,7 @@ + "coins": [] + }, + { +- "address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "coins": [ + { + "amount": "1450862", +@@ -5340100,7 +5340100,7 @@ + "denom": "poolF2805980C54E1474BDCCF70EF5FE881F3B8EFCF8BA3198765C01D91904521788" + }, + { +- "amount": "277549930240869", ++ "amount": "1006277549930240869", + "denom": "uatom" + } + ] +@@ -5440529,7 +5440529,7 @@ + "validator_address": "cosmosvaloper1pjmngrwcsatsuyy8m3qrunaun67sr9x7z5r2qs" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "7248467", + "previous_period": "745", +@@ -5645036,7 +5645036,7 @@ + "validator_address": "cosmosvaloper1tflk30mq5vgqjdly92kkhhq3raev2hnz6eete3" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "7248467", + "previous_period": "465175", +@@ -6050612,7 +6050612,7 @@ + "validator_address": "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "7274551", + "previous_period": "82115", +@@ -6061790,7 +6061790,7 @@ + "validator_address": "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "starting_info": { + "height": "7257832", + "previous_period": "81861", +@@ -6089357,7 +6089357,7 @@ + "validator_address": "cosmosvaloper1jlr62guqwrwkdt4m3y00zh2rrsamhjf9num5xr" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "7248467", + "previous_period": "1584", +@@ -6114566,7 +6114566,7 @@ + "validator_address": "cosmosvaloper1n229vhepft6wnkt5tjpwmxdmcnfz55jv3vp77d" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "starting_info": { + "height": "7257947", + "previous_period": "35398", +@@ -6185549,7 +6185549,7 @@ + "validator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "starting_info": { + "height": "7257832", + "previous_period": "124464", +@@ -6232533,7 +6232533,7 @@ + "starting_info": { + "height": "0", + "previous_period": "27294", +- "stake": "25390741.000000000000000000" ++ "stake": "6000000025390741.000000000000000000" + }, + "validator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" + }, +@@ -6286646,7 +6286646,7 @@ + "validator_address": "cosmosvaloper1hjct6q7npsspsg3dgvzk3sdf89spmlpfdn6m9d" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "7248467", + "previous_period": "5860", +@@ -6381587,7 +6381587,7 @@ + "validator_address": "cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "7248467", + "previous_period": "80368", +@@ -6394043,7 +6394043,7 @@ + "validator_address": "cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "starting_info": { + "height": "7257832", + "previous_period": "80551", +@@ -6425687,7 +6425687,7 @@ + "validator_address": "cosmosvaloper1ey69r37gfxvxg62sh4r0ktpuc46pzjrm873ae8" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "7248467", + "previous_period": "269308", +@@ -6581441,7 +6581441,7 @@ + "validator_address": "cosmosvaloper1et77usu8q2hargvyusl4qzryev8x8t9wwqkxfs" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "starting_info": { + "height": "7248467", + "previous_period": "4225", +@@ -8477588,7 +8477588,7 @@ + "max_deposit_period": "1209600s", + "min_deposit": [ + { +- "amount": "64000000", ++ "amount": "1", + "denom": "uatom" + } + ] +@@ -8478740,7 +8478740,7 @@ + "submit_time": "2021-06-02T17:30:15.614131648Z", + "total_deposit": [ + { +- "amount": "64000000", ++ "amount": "1", + "denom": "uatom" + } + ], +@@ -8478861,7 +8478861,7 @@ + "submit_time": "2021-07-11T21:10:26.141197124Z", + "total_deposit": [ + { +- "amount": "64000000", ++ "amount": "1", + "denom": "uatom" + } + ], +@@ -8478896,13 +8478896,13 @@ + ], + "starting_proposal_id": "54", + "tally_params": { +- "quorum": "0.400000000000000000", +- "threshold": "0.500000000000000000", ++ "quorum": "0.000000000000000001", ++ "threshold": "0.000000000000000001", + "veto_threshold": "0.334000000000000000" + }, + "votes": [], + "voting_params": { +- "voting_period": "1209600s" ++ "voting_period": "60s" + } + }, + "ibc": { +@@ -12037724,7 +12037724,7 @@ + ] + }, + { +- "address": "cosmosvalcons1s0686a68krmr8f46ph6fklw0v8us4gdsm7nhz3", ++ "address": "cosmosvalcons10jc8h98awslz4pfqc26smf9sxaqxgwl4vxpcrp", + "missed_blocks": [ + { + "index": "10", +@@ -12512117,7 +12512117,7 @@ + ] + }, + { +- "address": "cosmosvalcons1kq9xxgmn0uepav9c6kwxl4yh599kpyu28e7ee6", ++ "address": "cosmosvalcons16k44u3v0m8uevnh4p2qy2xm08y3wdf92xsc3ve", + "missed_blocks": [ + { + "index": "0", +@@ -13540393,7 +13540393,7 @@ + } + }, + { +- "address": "cosmosvalcons1s0686a68krmr8f46ph6fklw0v8us4gdsm7nhz3", ++ "address": "cosmosvalcons10jc8h98awslz4pfqc26smf9sxaqxgwl4vxpcrp", + "validator_signing_info": { + "address": "", + "index_offset": "7472462", +@@ -13540844,7 +13540844,7 @@ + } + }, + { +- "address": "cosmosvalcons1kq9xxgmn0uepav9c6kwxl4yh599kpyu28e7ee6", ++ "address": "cosmosvalcons16k44u3v0m8uevnh4p2qy2xm08y3wdf92xsc3ve", + "validator_signing_info": { + "address": "", + "index_offset": "10706496", +@@ -13590926,42 +13590926,42 @@ + "validator_address": "cosmosvaloper1tflk30mq5vgqjdly92kkhhq3raev2hnz6eete3" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "3000000.000000000000000000", + "validator_address": "cosmosvaloper1pjmngrwcsatsuyy8m3qrunaun67sr9x7z5r2qs" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "5000000.000000000000000000", + "validator_address": "cosmosvaloper1tflk30mq5vgqjdly92kkhhq3raev2hnz6eete3" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "1000000.000000000000000000", + "validator_address": "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "16100000.000000000000000000", + "validator_address": "cosmosvaloper1jlr62guqwrwkdt4m3y00zh2rrsamhjf9num5xr" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "1000000.000000000000000000", + "validator_address": "cosmosvaloper1hjct6q7npsspsg3dgvzk3sdf89spmlpfdn6m9d" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "3000000.000000000000000000", + "validator_address": "cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "999999.999433247914197563", + "validator_address": "cosmosvaloper1ey69r37gfxvxg62sh4r0ktpuc46pzjrm873ae8" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "shares": "2000000.000000000000000000", + "validator_address": "cosmosvaloper1et77usu8q2hargvyusl4qzryev8x8t9wwqkxfs" + }, +@@ -13845146,22 +13845146,22 @@ + "validator_address": "cosmosvaloper196ax4vc0lwpxndu9dyhvca7jhxp70rmcvrj90c" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "shares": "5717570.000000000000000000", + "validator_address": "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "shares": "4161516.137544609690354305", + "validator_address": "cosmosvaloper1n229vhepft6wnkt5tjpwmxdmcnfz55jv3vp77d" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "shares": "10238742.000000000000000000", + "validator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" + }, + { +- "delegator_address": "cosmos1dnxfxad3ag26l298f9pfv6u43nlt0madl3qsgl", ++ "delegator_address": "cosmos1w323u2q2f9h8nnhus0s9zmzfl4a3mft4xse2h6", + "shares": "55840909.000000000000000000", + "validator_address": "cosmosvaloper1clpqr4nrk4khgkxj78fcwwh6dl3uw4epsluffn" + }, +@@ -14254917,7 +14254917,7 @@ + }, + { + "delegator_address": "cosmos1ll705078lwg6yksn3flktpvzpe56gwvh7xmynw", +- "shares": "25390741.000000000000000000", ++ "shares": "6000000025390741.000000000000000000", + "validator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" + }, + { +@@ -14254987,7 +14254987,7 @@ + } + ], + "exported": true, +- "last_total_power": "194093279", ++ "last_total_power": "6194093279", + "last_validator_powers": [ + { + "address": "cosmosvaloper1qwl879nx9t6kef4supyazayf7vjhennyh568ys", +@@ -14255303,7 +14255303,7 @@ + }, + { + "address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf", +- "power": "13991908" ++ "power": "6013991908" + }, + { + "address": "cosmosvaloper15urq2dtp9qce4fyc85m6upwm9xul3049e02707", +@@ -14255967,7 +14255967,7 @@ + "validator_src_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf" + }, + { +- "delegator_address": "cosmos1z98eg2ztdp2glyla62629nrlvczg8s7f0tm3dx", ++ "delegator_address": "cosmos1wvvhhfm387xvfnqshmdaunnpujjrdxznr5d5x9", + "entries": [ + { + "completion_time": "2021-09-02T16:58:32.491727097Z", +@@ -14336532,7 +14336532,7 @@ + }, + "consensus_pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", +- "key": "cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM=" ++ "key": "qwiUMxz3llsy45fPvM0a8+XQeAJLvrX3QAEJmRMEEoU=" + }, + "delegator_shares": "2589549881077.000000000000000000", + "description": { +@@ -14341810,9 +14341810,9 @@ + }, + "consensus_pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", +- "key": "W459Kbdx+LJQ7dLVASW6sAfdqWqNRSXnvc53r9aOx/o=" ++ "key": "oi55Dw+JjLQc4u1WlAS3FsGwh5fd5/N5cP3VOLnZ/H0=" + }, +- "delegator_shares": "13991908901944.000000000000000000", ++ "delegator_shares": "6013991908901944.000000000000000000", + "description": { + "details": "Exchange the world", + "identity": "", +@@ -14341824,7 +14341824,7 @@ + "min_self_delegation": "1", + "operator_address": "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf", + "status": "BOND_STATUS_BONDED", +- "tokens": "13991908901944", ++ "tokens": "6013991908901944", + "unbonding_height": "0", + "unbonding_time": "1970-01-01T00:00:00Z" + }, +@@ -14345108,4 +14345108,4 @@ + "upgrade": {}, + "vesting": {} + } +-} +\ No newline at end of file ++} +``` + diff --git a/v6.0.0/genesis.json.tar.bz2 b/v6.0.0/genesis.json.tar.bz2 new file mode 100644 index 0000000..e490a84 Binary files /dev/null and b/v6.0.0/genesis.json.tar.bz2 differ diff --git a/v6.0.0/proposal.json b/v6.0.0/proposal.json new file mode 100644 index 0000000..bbe7ad0 --- /dev/null +++ b/v6.0.0/proposal.json @@ -0,0 +1,12 @@ +{ + "title": "Liquidity Param Change", + "description": "Update InitPoolCoinMintAmount", + "changes": [ + { + "subspace": "liquidity", + "key": "InitPoolCoinMintAmount", + "value": "1000000000000" + } + ], + "deposit": "10000uatom" +}