From eca0995cfc49cbeefd89451734047983079f111c Mon Sep 17 00:00:00 2001 From: kienn6034 Date: Wed, 17 Jan 2024 14:30:00 +0700 Subject: [PATCH] chore: get upgrade handler --- contrib/updates/upgrade-test.sh | 7 +++++-- scripts/upgrade_test.sh | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/contrib/updates/upgrade-test.sh b/contrib/updates/upgrade-test.sh index 2631b88e..dcceecd8 100755 --- a/contrib/updates/upgrade-test.sh +++ b/contrib/updates/upgrade-test.sh @@ -7,6 +7,7 @@ NODE1_HOME=node1/migalood SELECTED_CONTAINER=migaloodnode1 BINARY_OLD="docker exec $SELECTED_CONTAINER ./old/migalood" TESTNET_NVAL=${1:-3} +UPGRADE_CLIFF_HEIGHT=25 # sleep to wait for localnet to come up echo "Wait for localnet to come up" @@ -17,7 +18,7 @@ $BINARY_OLD status --home $NODE1_HOME STATUS_INFO=($($BINARY_OLD status --home $NODE1_HOME | jq -r '.NodeInfo.network,.SyncInfo.latest_block_height')) echo "Current status info: $STATUS_INFO" CHAIN_ID=${STATUS_INFO[0]} -UPGRADE_HEIGHT=$((STATUS_INFO[1] + 40)) +UPGRADE_HEIGHT=$((STATUS_INFO[1] + UPGRADE_CLIFF_HEIGHT)) echo "Upgrade should happens at: $UPGRADE_HEIGHT" @@ -37,6 +38,9 @@ echo $UPGRADE_INFO echo "Submitting software upgrade proposal..." $BINARY_OLD tx gov submit-legacy-proposal software-upgrade "$SOFTWARE_UPGRADE_NAME" --upgrade-height $UPGRADE_HEIGHT --upgrade-info "$UPGRADE_INFO" --title "upgrade" --description "upgrade" --from node1 --keyring-backend test --chain-id $CHAIN_ID --home $NODE1_HOME -y > /dev/null 2>&1 + +echo "upgrade name: $SOFTWARE_UPGRADE_NAME" + sleep 5 echo "Depositing to software upgrade proposal..." @@ -50,7 +54,6 @@ for (( i=0; i<$TESTNET_NVAL; i++ )); do if [[ $(docker ps -a | grep migaloodnode$i | wc -l) -eq 1 ]]; then $BINARY_OLD tx gov vote 1 yes --from node$i --keyring-backend test --chain-id $CHAIN_ID --home "node$i/migalood" -y > /dev/null 2>&1 echo -e "---> Node $i voted yes" - sleep 1 fi done diff --git a/scripts/upgrade_test.sh b/scripts/upgrade_test.sh index 225aabf4..f3d9c45e 100755 --- a/scripts/upgrade_test.sh +++ b/scripts/upgrade_test.sh @@ -3,7 +3,7 @@ # the upgrade is a fork, "true" otherwise FORK=${FORK:-"false"} -OLD_VERSION=v3.0.2 +OLD_VERSION=v3.0.4 UPGRADE_WAIT=${UPGRADE_WAIT:-20} HOME=mytestnet ROOT=$(pwd)