From 696fb1714fa240735772360c7163296b14abef8d Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Sun, 23 Jun 2024 14:04:04 +0200 Subject: [PATCH 01/12] add missing try runtime install --- ci/run-check.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ci/run-check.sh b/ci/run-check.sh index 0bc6dea814..69a603d353 100755 --- a/ci/run-check.sh +++ b/ci/run-check.sh @@ -46,6 +46,12 @@ case $TARGET in try-runtime) cargo build -p centrifuge-chain --release --features try-runtime + # Check if try-runtime is available + if ! command try-runtime --version &> /dev/null + then + echo "try-runtime could not be found, trying 'cargo install try-runtime-cli'" + cargo install try-runtime-cli + fi if [ "$1" == "altair" ]; then echo "Running try-runtime for altair" RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=trace \ From bf5e8168e2c7c229aa9fa4afe5211bc682a86a8e Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Sun, 23 Jun 2024 14:12:25 +0200 Subject: [PATCH 02/12] remove lable trigger --- .github/workflows/try-runtime.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index db72231f7b..c2ec94dfe4 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -5,7 +5,6 @@ on: issue_comment: types: [created] pull_request: - types: [labeled] paths: - '**.rs' - .github/workflows/try-runtime.yml @@ -20,7 +19,6 @@ jobs: chain: [altair, centrifuge] if: > github.event_name == 'schedule' || - contains(github.event.pull_request.labels.*.name, 'D8-migration') || (github.event_name == 'issue_comment' && contains(github.event.comment.body, '/try-runtime') && github.event.issue.pull_request != '') From a8b417d1bd0840d9307630091e6de0b3050761c6 Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Sun, 23 Jun 2024 14:17:37 +0200 Subject: [PATCH 03/12] add github_token to workflow --- .github/workflows/try-runtime.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index c2ec94dfe4..63e744e6e2 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -38,9 +38,11 @@ jobs: echo "::set-output name=pr_author::$PR_AUTHOR" echo "::set-output name=comment_author::$COMMENT_AUTHOR" env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ github.token }} - name: Check if commenter is PR author and a repo contributor + env: + GITHUB_TOKEN: ${{ github.token }} if: > steps.get-users.outputs.pr_author == steps.get-users.outputs.comment_author && github.event_name == 'issue_comment' From bc7c1f3a7669f86072e97e67a4f67d1232c60016 Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Sun, 23 Jun 2024 14:32:03 +0200 Subject: [PATCH 04/12] fix code checkout when triggered from PR --- .github/workflows/try-runtime.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 63e744e6e2..3fc2bc433a 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -6,7 +6,6 @@ on: types: [created] pull_request: paths: - - '**.rs' - .github/workflows/try-runtime.yml jobs: try-runtime: @@ -19,6 +18,7 @@ jobs: chain: [altair, centrifuge] if: > github.event_name == 'schedule' || + github.event_name == 'pull_request' || (github.event_name == 'issue_comment' && contains(github.event.comment.body, '/try-runtime') && github.event.issue.pull_request != '') @@ -26,8 +26,17 @@ jobs: runs-on: ubuntu-latest-4-cores name: "${{ matrix.chain }}" steps: - - name: Check out code + - name: Check out code (Pull Request) uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab #3.5.2 + with: + ref: ${{ github.event.pull_request.head.sha }} + if: github.event_name == 'issue_comment' || github.event_name == 'pull_request' + + - name: Check out code (main) + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab #3.5.2 + with: + ref: 'refs/heads/main' + if: github.event_name == 'schedule' - name: Get PR author and commenter id: get-users From 2f67950920ea716b51de183942b1d837740d6680 Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Sun, 23 Jun 2024 15:55:52 +0200 Subject: [PATCH 05/12] downlaod try-runtime directly --- ci/run-check.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/run-check.sh b/ci/run-check.sh index 69a603d353..1dde59bfce 100755 --- a/ci/run-check.sh +++ b/ci/run-check.sh @@ -45,23 +45,23 @@ case $TARGET in ;; try-runtime) - cargo build -p centrifuge-chain --release --features try-runtime # Check if try-runtime is available if ! command try-runtime --version &> /dev/null then echo "try-runtime could not be found, trying 'cargo install try-runtime-cli'" - cargo install try-runtime-cli + curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.6.1/try-runtime-x86_64-unknown-linux-musl -o try-runtime + chmod +x ./try-runtime fi if [ "$1" == "altair" ]; then echo "Running try-runtime for altair" RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=trace \ - try-runtime \ + ./try-runtime \ --runtime target/release/wbuild/altair-runtime/altair_runtime.wasm \ on-runtime-upgrade live --uri wss://fullnode.altair.centrifuge.io:443 elif [ "$1" == "centrifuge" ]; then echo "Running try-runtime for centrifuge" RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=trace \ - try-runtime \ + ./try-runtime \ --runtime target/release/wbuild/centrifuge-runtime/centrifuge_runtime.wasm \ on-runtime-upgrade live --uri wss://fullnode.centrifuge.io:443 else From 1be2d8bf89564364308d0a50aebce4dfd1012687 Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Sun, 23 Jun 2024 17:32:28 +0200 Subject: [PATCH 06/12] make --features explicit --- .github/workflows/try-runtime.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 3fc2bc433a..c3f499b609 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -77,7 +77,7 @@ jobs: # - name: Install try-runtime-cli # run: cargo install --git https://github.com/paritytech/try-runtime-cli --tag v0.5.4 --locked - name: cargo build - run: ./ci/run-check.sh -F try-runtime + run: ./ci/run-check.sh --features try-runtime env: TARGET: cargo-build RUSTC_WRAPPER: "sccache" From 78e99080a388a3fae8368801f406f38281e9af3a Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Mon, 24 Jun 2024 11:34:23 +0200 Subject: [PATCH 07/12] add demo try-runtime --- .github/workflows/try-runtime.yml | 2 +- ci/run-check.sh | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index c3f499b609..1561a64eeb 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - chain: [altair, centrifuge] + chain: [altair, centrifuge, demo] if: > github.event_name == 'schedule' || github.event_name == 'pull_request' || diff --git a/ci/run-check.sh b/ci/run-check.sh index 1dde59bfce..b93cf4ff70 100755 --- a/ci/run-check.sh +++ b/ci/run-check.sh @@ -64,6 +64,12 @@ case $TARGET in ./try-runtime \ --runtime target/release/wbuild/centrifuge-runtime/centrifuge_runtime.wasm \ on-runtime-upgrade live --uri wss://fullnode.centrifuge.io:443 + elif [ "$1" == "demo" ]; then + echo "Running try-runtime for demo env" + RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=trace \ + ./try-runtime \ + --runtime target/release/wbuild/development-runtime/development.wasm \ + on-runtime-upgrade live --uri wss://node-7118620155331796992.gx.onfinality.io/ws?apikey=00538f2d-6297-44e3-8812-4b9d579524b2 else echo "Invalid argument. Please specify 'altair' or 'centrifuge'." exit 1 From 27b136a46c35dafb76b1bd08170c907c1faf7c0e Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Mon, 24 Jun 2024 13:12:40 +0200 Subject: [PATCH 08/12] fix developent runtime path --- ci/run-check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run-check.sh b/ci/run-check.sh index b93cf4ff70..faa31b4fda 100755 --- a/ci/run-check.sh +++ b/ci/run-check.sh @@ -68,7 +68,7 @@ case $TARGET in echo "Running try-runtime for demo env" RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=trace \ ./try-runtime \ - --runtime target/release/wbuild/development-runtime/development.wasm \ + --runtime target/release/wbuild/development_runtime/development.wasm \ on-runtime-upgrade live --uri wss://node-7118620155331796992.gx.onfinality.io/ws?apikey=00538f2d-6297-44e3-8812-4b9d579524b2 else echo "Invalid argument. Please specify 'altair' or 'centrifuge'." From 71a430293bb049473e8eb08927f75f1a01a0aea3 Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Mon, 24 Jun 2024 13:15:18 +0200 Subject: [PATCH 09/12] Print the target directory contents --- ci/run-check.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/run-check.sh b/ci/run-check.sh index faa31b4fda..9d88644495 100755 --- a/ci/run-check.sh +++ b/ci/run-check.sh @@ -45,6 +45,10 @@ case $TARGET in ;; try-runtime) + echo "Contents of target/release/wbuild/:" + ls -l target/release/wbuild/ + echo "Contents of subdirectories in target/release/wbuild/:" + ls -l target/release/wbuild/*/ # Check if try-runtime is available if ! command try-runtime --version &> /dev/null then From 15fdeeea93ab8e3d3971035a13149237a0f341c3 Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Mon, 24 Jun 2024 15:35:16 +0200 Subject: [PATCH 10/12] change wss node and wasm path --- ci/run-check.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/run-check.sh b/ci/run-check.sh index 9d88644495..96677e3e50 100755 --- a/ci/run-check.sh +++ b/ci/run-check.sh @@ -72,8 +72,8 @@ case $TARGET in echo "Running try-runtime for demo env" RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=trace \ ./try-runtime \ - --runtime target/release/wbuild/development_runtime/development.wasm \ - on-runtime-upgrade live --uri wss://node-7118620155331796992.gx.onfinality.io/ws?apikey=00538f2d-6297-44e3-8812-4b9d579524b2 + --runtime target/release/wbuild/development-runtime/development_runtime.wasm \ + on-runtime-upgrade live --uri wss://fullnode-query.demo.k-f.dev # fullnode.demo.k-f.dev is throtlled and thus it might fail else echo "Invalid argument. Please specify 'altair' or 'centrifuge'." exit 1 From 996cabc3d9be91d046077c323b004c4301f582d6 Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Tue, 25 Jun 2024 01:19:46 +0200 Subject: [PATCH 11/12] missing port --- ci/run-check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run-check.sh b/ci/run-check.sh index 96677e3e50..54f2d1cb06 100755 --- a/ci/run-check.sh +++ b/ci/run-check.sh @@ -73,7 +73,7 @@ case $TARGET in RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=trace \ ./try-runtime \ --runtime target/release/wbuild/development-runtime/development_runtime.wasm \ - on-runtime-upgrade live --uri wss://fullnode-query.demo.k-f.dev # fullnode.demo.k-f.dev is throtlled and thus it might fail + on-runtime-upgrade live --uri wss://fullnode-query.demo.k-f.dev:443 # fullnode.demo.k-f.dev is throtlled and thus it might fail else echo "Invalid argument. Please specify 'altair' or 'centrifuge'." exit 1 From adb53fec94b90ffc5b1c96f84a943ef7dbffe95d Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Tue, 25 Jun 2024 16:08:43 +0200 Subject: [PATCH 12/12] Update try-runtime version Co-authored-by: William Freudenberger --- ci/run-check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run-check.sh b/ci/run-check.sh index 54f2d1cb06..bbb17dea7a 100755 --- a/ci/run-check.sh +++ b/ci/run-check.sh @@ -53,7 +53,7 @@ case $TARGET in if ! command try-runtime --version &> /dev/null then echo "try-runtime could not be found, trying 'cargo install try-runtime-cli'" - curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.6.1/try-runtime-x86_64-unknown-linux-musl -o try-runtime + curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.7.0/try-runtime-x86_64-unknown-linux-musl -o try-runtime chmod +x ./try-runtime fi if [ "$1" == "altair" ]; then