-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into feat/punish-broadcast…
…-timeout * origin/main: feat: end to end network upgrade github action (#4274) feat: spec_version of PR is greater than spec version of current release (#4355) feat: enforce version is greater than release version on PRs to main (#4351) fix: btc witnesser test failing sometimes (#4353) fix: connections can become stale when reconnecting (#4310) chore: add `chainflip-rpc-node` systemd file 🚀 (#4352) feat: API Bins check SC compatibility (#4342) chore: update runtime spec checks ⛓️ (#4349) feat: Add version cmd to all bins (#4343) fix: changelog check 🤫 (#4348) chore: update docker tags 🐳 (#4347) chore: add runtime version check 👀 (#4344) feat: shave fees on ingress (#4335) pick/persa fixes (#4329) feat: track btc fees on success (#4334) ensure we dont create BTC transaction outputs below the bitcoin dust limit (#4340) fix: sweeping before withdrawal (#4337)
- Loading branch information
Showing
87 changed files
with
1,852 additions
and
444 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
force-version-bump: | ||
runs-on: [digitalocean] | ||
steps: | ||
- name: Checkout backend | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure NodeJS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: "pnpm" | ||
registry-url: "https://npm.pkg.github.com" | ||
scope: "@chainflip-io" | ||
cache-dependency-path: "bouncer/pnpm-lock.yaml" | ||
- name: Download latest release binaries | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
workflow: release-perseverance.yml | ||
name: chainflip-backend-bin-ubuntu-22.04 | ||
github_token: ${{ secrets.CF_BACKEND_GITHUB_TOKEN }} | ||
path: latest-release-bins | ||
- name: Permissions for latest binaries | ||
run: | | ||
chmod +x ./latest-release-bins/chainflip-* | ||
- name: Version of the latest release | ||
run: | | ||
set -x | ||
echo $(pwd) | ||
RELEASE_VERSION=$(./latest-release-bins/chainflip-engine --version) | ||
echo $RELEASE_VERSION | ||
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV | ||
- name: Install node dependencies | ||
working-directory: bouncer | ||
run: pnpm install | ||
|
||
- name: Check the version of the branch is greater than the current release | ||
working-directory: bouncer | ||
run: | | ||
set -x | ||
echo ${{ env.RELEASE_VERSION }} | ||
./commands/read_workspace_tomls.ts ${{ github.workspace }} "${{ env.RELEASE_VERSION }}" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
name: Test upgrade from latest release to main | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
FORCE_COLOR: 1 | ||
|
||
permissions: | ||
packages: read | ||
contents: read | ||
|
||
jobs: | ||
upgrade_test: | ||
runs-on: [digitalocean] | ||
# conservatively 1.5 hours. 2 bouncer runs need to occur. | ||
timeout-minutes: 90 | ||
steps: | ||
|
||
- name: Checkout chainflip-backend | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to Github Container Registry 🔑 | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Configure NodeJS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: "pnpm" | ||
registry-url: "https://npm.pkg.github.com" | ||
scope: "@chainflip-io" | ||
cache-dependency-path: "bouncer/pnpm-lock.yaml" | ||
|
||
- name: Set NPM registry | ||
run: | | ||
pnpm set @chainflip-io:registry=https://npm.pkg.github.com/ | ||
pnpm set //npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }} | ||
- name: Install system packages | ||
run: | | ||
sudo apt update | ||
sudo apt install -y bc xxd | ||
- name: Install wscat | ||
run: | | ||
npm install -g wscat | ||
- name: Download try-runtime binary | ||
uses: jaxxstorm/action-install-gh-release@v1.10.0 | ||
with: | ||
repo: paritytech/try-runtime-cli | ||
tag: v0.5.0 | ||
extension-matching: disable | ||
rename-to: try-runtime | ||
chmod: 0755 | ||
|
||
- name: Download latest release binaries | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
workflow: release-perseverance.yml | ||
name: chainflip-backend-bin-ubuntu-22.04 | ||
github_token: ${{ secrets.CF_BACKEND_GITHUB_TOKEN }} | ||
path: latest-release-bins | ||
|
||
- name: Permissions for latest binaries | ||
run: | | ||
chmod +x ./latest-release-bins/chainflip-* | ||
- name: Version of the latest release | ||
run: | | ||
set -x | ||
RELEASE_VERSION=$(./latest-release-bins/chainflip-engine --version) | ||
echo $RELEASE_VERSION | ||
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV | ||
- name: Download latest main binaries | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
workflow: ci-main.yml | ||
name: chainflip-backend-bin-try-runtime-ubuntu-22.04 | ||
path: main-bins | ||
|
||
- name: Permissions for latest binaries | ||
run: | | ||
chmod +x ./main-bins/chainflip-* | ||
- name: Download latest main runtime | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
workflow: ci-main.yml | ||
name: chainflip-node-runtime-try-runtime | ||
path: main-runtime | ||
|
||
- name: Install node dependencies | ||
working-directory: bouncer | ||
run: pnpm install | ||
|
||
- name: Start a localnet from current release | ||
env: | ||
BINARY_ROOT_PATH: ./latest-release-bins | ||
run: | | ||
set -x | ||
mkdir -p /tmp/chainflip/bashful | ||
mkdir -p /tmp/chainflip/doc | ||
mkdir -p /tmp/chainflip/dopey | ||
touch ./localnet/.setup_complete | ||
./localnet/manage.sh | ||
- name: Run bouncer on latest release | ||
id: pre-upgrade-bouncer | ||
working-directory: bouncer | ||
run: | | ||
./run.sh | ||
# we need to be sure that when this fails, we catch the error, any panics etc. that occur | ||
# TODO: Run swaps simultaneously to the upgrade - we could do that inside the `upgrade_network` command itself. | ||
- name: Upgrade network | ||
shell: bash | ||
id: upgrade-network | ||
working-directory: bouncer | ||
run: | | ||
./commands/upgrade_network.ts prebuilt \ | ||
--runtime ./../main-runtime/state_chain_runtime.compact.compressed.wasm \ | ||
--bins ./../main-bins \ | ||
--localnet_init ./../localnet/init \ | ||
--oldVersion "${{ env.RELEASE_VERSION }}" | ||
- name: Run bouncer after upgrade | ||
id: post-upgrade-bouncer | ||
working-directory: bouncer | ||
run: | | ||
./run-no-setup.sh | ||
- name: Print chainflip-engine logs | ||
if: failure() | ||
run: | | ||
cat /tmp/chainflip/*/chainflip-engine.log | ||
- name: Print chainflip-node logs | ||
if: failure() | ||
run: | | ||
cat /tmp/chainflip/*/chainflip-node.log | ||
- name: Print broker logs | ||
if: failure() | ||
run: | | ||
cat /tmp/chainflip/chainflip-broker-api.log | ||
- name: Print lp-api logs | ||
if: failure() | ||
run: | | ||
cat /tmp/chainflip/chainflip-lp-api.log | ||
- name: Upload Localnet Logs 💾 | ||
if: always() | ||
continue-on-error: true | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: localnet-logs | ||
path: | | ||
/tmp/chainflip/*/chainflip-*.log | ||
- name: Clean Up docker containers 🧹 | ||
if: always() | ||
continue-on-error: true | ||
run: | | ||
ls -alR /tmp/chainflip | ||
docker compose -f localnet/docker-compose.yml -p "chainflip-localnet" logs | ||
docker compose -f localnet/docker-compose.yml -p "chainflip-localnet" down --rmi all --volumes --remove-orphans | ||
- name: Notify on failed upgrade test | ||
if: failure() && github.ref_name == 'main' || cancelled() && github.ref_name == 'main' | ||
env: | ||
DISCORD_USERNAME: "Upgrade Test" | ||
DISCORD_WEBHOOK: ${{ secrets.CF_DISCORD_ALERTS_CRITICAL }} | ||
uses: Ilshidur/action-discord@0.3.2 | ||
with: | ||
args: | | ||
❗️❗️❗️❗️ Sorry **${{ github.actor }}**, The Upgrade Test has not passed ❗️❗️❗️❗️ | ||
👾 Link to job: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
#️⃣ Tagging: <@&939151218708709416> |
Oops, something went wrong.