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

Ensure upgrade test uses the correct binary on restart #2478

Merged
merged 1 commit into from
Dec 13, 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
22 changes: 12 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ concurrency:

env:
go_version: '~1.20.12'
tmpnet_data_path: ~/.tmpnet/networks/1000

jobs:
Unit:
Expand Down Expand Up @@ -72,8 +73,9 @@ jobs:
uses: actions/upload-artifact@v3
if: always()
with:
name: e2e-artifact
path: ~/.tmpnet/networks/1000
name: e2e-tmpnet-data
path: ${{ env.tmpnet_data_path }}
if-no-files-found: error
e2e_existing_network:
runs-on: ubuntu-latest
steps:
Expand All @@ -92,8 +94,9 @@ jobs:
uses: actions/upload-artifact@v3
if: always()
with:
name: e2e-existing-network-tmpnet-artifact
path: ~/.tmpnet/networks/1000
name: e2e-existing-network-tmpnet-data
path: ${{ env.tmpnet_data_path }}
if-no-files-found: error
Upgrade:
runs-on: ubuntu-latest
steps:
Expand All @@ -107,15 +110,14 @@ jobs:
run: ./scripts/build.sh
- name: Run e2e tests
shell: bash
# 1.10.7 is the first version compatible with the ephnet fixture by
# virtue of writing a process context file on node start.
run: ./scripts/tests.upgrade.sh 1.10.7
- name: Upload ephnet network dir
run: ./scripts/tests.upgrade.sh
- name: Upload tmpnet network dir
uses: actions/upload-artifact@v3
if: always()
with:
name: upgrade-artifact
path: ~/.ephnet/networks/1000
name: upgrade-tmpnet-data
path: ${{ env.tmpnet_data_path }}
if-no-files-found: error
Lint:
runs-on: ubuntu-latest
steps:
Expand Down
13 changes: 10 additions & 3 deletions scripts/tests.upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@
set -euo pipefail

# e.g.,
# ./scripts/tests.upgrade.sh 1.7.16
# AVALANCHEGO_PATH=./path/to/avalanchego ./scripts/tests.upgrade.sh 1.7.16 # Customization of avalanchego path
# ./scripts/tests.upgrade.sh # Use default version
# ./scripts/tests.upgrade.sh 1.10.18 # Specify a version
# AVALANCHEGO_PATH=./path/to/avalanchego ./scripts/tests.upgrade.sh 1.10.18 # Customization of avalanchego path
if ! [[ "$0" =~ scripts/tests.upgrade.sh ]]; then
echo "must be run from repository root"
exit 255
fi

VERSION="${1:-}"
# 1.10.17 is the first version compatible with bls signing keys being
# included in the genesis. Attempting to upgrade from prior versions
# will result in nodes failing to boot due to the hash of the genesis
# not matching the hash of the committed genesis block.
Comment on lines +14 to +17
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# 1.10.17 is the first version compatible with bls signing keys being
# included in the genesis. Attempting to upgrade from prior versions
# will result in nodes failing to boot due to the hash of the genesis
# not matching the hash of the committed genesis block.
# The AvalancheGo local network does not support long-lived backwards
# compatible networks. When a breaking change is made to the local
# network, this flag must be updated to the last compatible version
# with the latest code.
# v1.10.17 includes the AWM activation on the C-Chain local network
# and the inclusion of BLS Public Keys in the network genesis.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Included with #2457

DEFAULT_VERSION="1.10.17"

VERSION="${1:-${DEFAULT_VERSION}}"
if [[ -z "${VERSION}" ]]; then
echo "Missing version argument!"
echo "Usage: ${0} [VERSION]" >>/dev/stderr
Expand Down
4 changes: 3 additions & 1 deletion tests/upgrade/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ var _ = ginkgo.Describe("[Upgrade]", func() {
node.Flags[config.BootstrapIPsKey] = strings.Join(bootstrapIPs, ",")
require.NoError(node.WriteConfig())

require.NoError(node.Start(ginkgo.GinkgoWriter, avalancheGoExecPath))
// Ensure the new node starts with the upgrade binary
node.ExecPath = avalancheGoExecPathToUpgradeTo
require.NoError(node.Start(ginkgo.GinkgoWriter, "" /* defaultExecPath */))
StephenButtolph marked this conversation as resolved.
Show resolved Hide resolved

ginkgo.By(fmt.Sprintf("waiting for node %q to report healthy after restart", node.GetID()))
e2e.WaitForHealthy(node)
Expand Down
Loading