Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added upgrade name, and allow download. allows to test release can. #1195

Merged
merged 2 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@type": "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade",
"authority": os.environ["GOV_ADDRESS"],
"plan": {
"name": os.environ['VERSION'],
"name": os.environ['UPGRADE_NAME'],
"time": "0001-01-01T00:00:00Z",
"height": str(UPGRADE_HEIGHT).split('.')[0],
"info": os.environ["UPGRADE_INFO"],
Expand Down Expand Up @@ -44,13 +44,13 @@
# -y
# """

GOV_PROPOSAL = f"""zetacored tx gov submit-legacy-proposal software-upgrade "{os.environ['VERSION']}" \
GOV_PROPOSAL = f"""zetacored tx gov submit-legacy-proposal software-upgrade "{os.environ['UPGRADE_NAME']}" \
--from "{os.environ['MONIKER']}" \
--deposit {os.environ["DEPOSIT"]} \
--upgrade-height "{str(UPGRADE_HEIGHT).split('.')[0]}" \
--upgrade-info '{os.environ["UPGRADE_INFO"]}' \
--title "{os.environ['VERSION']}" \
--description "Zeta Release {os.environ['VERSION']}" \
--description "Zeta Release {os.environ['UPGRADE_NAME']}" \
--chain-id "{os.environ['CHAINID']}" \
--node "{os.environ['NODE']}" \
--keyring-backend test \
Expand Down
34 changes: 26 additions & 8 deletions .github/workflows/upgrade_path_testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ on:
workflow_dispatch:
inputs:
version:
description: 'The new version to upgrade to from latest state.'
description: 'The new version of tag you are going to download the binary from..'
required: true
default: 'v9.0.6'


default: 'v10.0.0-rc2'
upgrade_name:
description: 'The version that is set in setup_handlers.go'
required: true
default: 'v10.0.0'

jobs:
upgrade_path_test_state_export:
Expand All @@ -26,9 +28,10 @@ jobs:
LOG_LEVEL: "INFO"
CHAINID: "localnet_101-1"
DAEMON_HOME: "/home/runner/.zetacored"
UPGRADE_NAME: "${{ github.event.inputs.upgrade_name }}"
DAEMON_NAME: "zetacored"
DENOM: "azeta"
DAEMON_ALLOW_DOWNLOAD_BINARIES: "false"
DAEMON_ALLOW_DOWNLOAD_BINARIES: "true"
DAEMON_RESTART_AFTER_UPGRADE: "true"
MONIKER: "zeta"
BLOCK_TIME_SECONDS: "6"
Expand Down Expand Up @@ -91,6 +94,7 @@ jobs:
mkdir -p /home/runner/.zetacored/zetavisor
mkdir -p /home/runner/.zetacored/zetavisor/genesis/bin
mkdir -p /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.version }}/bin
mkdir -p /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.upgrade_name }}/bin

- name: "DOWNLOAD_STATE_EXPORT_AND_BINARIES"
run: |
Expand All @@ -100,12 +104,26 @@ jobs:
echo "*********DOWNLOAD UPGRADE BINARY AND PUT IN ZETAVISOR UPGRADES FOLDER*********"
wget -q ${github_binary_version_link} -O /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.version }}/bin/zetacored
ZETACORED_CHECKSUM=$(shasum -b -a 256 /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.version }}/bin/zetacored | cut -d ' ' -f 1)
sudo chmod a+x /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.version }}/bin/zetacored

echo "UPGRADE_INFO=${UPGRADE_INFO}" >> ${GITHUB_ENV}
ls -lah /home/runner/.zetacored/zetavisor/upgrades/
ls -lah /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.version }}/bin/zetacored

wget -q ${github_binary_version_link} -O /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.upgrade_name }}/bin/zetacored
ZETACORED_CHECKSUM=$(shasum -b -a 256 /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.upgrade_name }}/bin/zetacored | cut -d ' ' -f 1)
sudo chmod a+x /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.upgrade_name }}/bin/zetacored

echo "UPGRADE_INFO=${UPGRADE_INFO}" >> ${GITHUB_ENV}
ls -lah /home/runner/.zetacored/zetavisor/upgrades/
ls -lah /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.upgrade_name }}/bin/zetacored

echo "ZETACORED_CHECKSUM=${ZETACORED_CHECKSUM}" >> ${GITHUB_ENV}
UPGRADE_INFO='{"binaries": {"zetacored-linux/amd64": "https://github.com/zeta-chain/node/releases/download/${{ github.event.inputs.version }}/zetacored-ubuntu-22-amd64?checksum=sha256:'${ZETACORED_CHECKSUM}'"}}'
echo ${UPGRADE_INFO}
echo "UPGRADE_INFO=${UPGRADE_INFO}" >> ${GITHUB_ENV}
sudo chmod a+x /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.version }}/bin/zetacored



echo "*********DOWNLOAD CURRENT BINARY AND PUT IN ZETAVISOR GENESIS & CURRENT FOLDER*********"
current_version=$(curl https://rpc-archive.athens.zetachain.com:26657/abci_info -s | jq .result.response.version -r | tr -d '\n')
echo "STARTING_VERSION=${current_version}" >> ${GITHUB_ENV}
Expand Down