From c2d30289f7c7f2588c009c99e5a65561a8ddf357 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 11 Aug 2021 11:18:27 +0200 Subject: [PATCH 1/9] ci: new workflow for exrtinsic ordering checks from bin --- .../extrinsic-ordering-check-from-bin.yml | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/extrinsic-ordering-check-from-bin.yml diff --git a/.github/workflows/extrinsic-ordering-check-from-bin.yml b/.github/workflows/extrinsic-ordering-check-from-bin.yml new file mode 100644 index 000000000000..2bdc967ba960 --- /dev/null +++ b/.github/workflows/extrinsic-ordering-check-from-bin.yml @@ -0,0 +1,68 @@ +# This workflow performs the Extrinsic Ordering Check on demand using a binary + +name: Extrinsic Ordering Check from Binary +on: + workflow_dispatch: + inputs: + reference_url: + description: The WebSocket url of the reference node + default: wss://rpc.polkadot.io + required: true + binary_url: + description: A url to a Linux binary for the node containing the runtime to test + default: https://some/url/polkadot + required: true + chain: + description: The name of the chain under test. Usually, you would pass a local chain + default: polkadot-local + required: true + +jobs: + check: + name: Run check + runs-on: ubuntu-latest + env: + CHAIN: ${{github.event.inputs.chain}} + + steps: + # - name: Ensure that the 'chain' is a local one + # env: + # run: | + # if [[ $CHAIN == *"local"* ]] ; then + # echo OK, we will run the test on $CHAIN + # exit 0 + # else + # echo Err, you need to pass a local chain such as 'polkadot-local', $CHAIN does not cut it + # exit 1 + # fi + + - name: Fetch binary + env: + BIN_URL: ${{github.event.inputs.binary_url}} + run: | + echo Fetching $BIN_URL + wget $BIN_URL + chmod a+x polkadot + ./polkadot --version + + - name: Start local node + run: | + echo Running on $CHAIN + ./polkadot --chain=$CHAIN & + + - name: Compare the metadata + run: | + CMD="docker run --network host jacogr/polkadot-js-tools metadata wss://rpc.polkadot.io ws://localhost:9944" + echo Running $CMD + OUTPUT=$($CMD) + echo $OUTPUT | tee output.txt + + - name: Stop our local node + run: pkill polkadot + + - name: Save output as artifact + uses: actions/upload-artifact@v2 + with: + name: $CHAIN + path: | + output.txt From e76dc2ed5c47ffe5d0bfdc62c52e2d1c2b26f36a Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 11 Aug 2021 11:30:47 +0200 Subject: [PATCH 2/9] fix workflow --- .github/workflows/extrinsic-ordering-check-from-bin.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/extrinsic-ordering-check-from-bin.yml b/.github/workflows/extrinsic-ordering-check-from-bin.yml index 2bdc967ba960..4bcfb112faba 100644 --- a/.github/workflows/extrinsic-ordering-check-from-bin.yml +++ b/.github/workflows/extrinsic-ordering-check-from-bin.yml @@ -53,9 +53,8 @@ jobs: - name: Compare the metadata run: | CMD="docker run --network host jacogr/polkadot-js-tools metadata wss://rpc.polkadot.io ws://localhost:9944" - echo Running $CMD - OUTPUT=$($CMD) - echo $OUTPUT | tee output.txt + echo -e "Running:\n$CMD" + $CMD | tee output.txt - name: Stop our local node run: pkill polkadot @@ -63,6 +62,6 @@ jobs: - name: Save output as artifact uses: actions/upload-artifact@v2 with: - name: $CHAIN + name: ${{ env.CHAIN }} path: | output.txt From ad39fb8b670692337ac2ed83f13da5067eed9343 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 11 Aug 2021 11:58:13 +0200 Subject: [PATCH 3/9] sanitize output and show result --- .github/workflows/extrinsic-ordering-check-from-bin.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/extrinsic-ordering-check-from-bin.yml b/.github/workflows/extrinsic-ordering-check-from-bin.yml index 4bcfb112faba..2491c2ea91da 100644 --- a/.github/workflows/extrinsic-ordering-check-from-bin.yml +++ b/.github/workflows/extrinsic-ordering-check-from-bin.yml @@ -54,7 +54,11 @@ jobs: run: | CMD="docker run --network host jacogr/polkadot-js-tools metadata wss://rpc.polkadot.io ws://localhost:9944" echo -e "Running:\n$CMD" - $CMD | tee output.txt + $CMD > output.txt + sed -z -i 's/\n\n/\n/g' output.txt + + - name: Show result + run: cat output.txt - name: Stop our local node run: pkill polkadot From dccac8e820aab1ada5d1472a8ba059e18ee49aa4 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 11 Aug 2021 12:10:05 +0200 Subject: [PATCH 4/9] add context to the output --- .../workflows/extrinsic-ordering-check-from-bin.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/extrinsic-ordering-check-from-bin.yml b/.github/workflows/extrinsic-ordering-check-from-bin.yml index 2491c2ea91da..6b68439e0b33 100644 --- a/.github/workflows/extrinsic-ordering-check-from-bin.yml +++ b/.github/workflows/extrinsic-ordering-check-from-bin.yml @@ -39,6 +39,7 @@ jobs: - name: Fetch binary env: BIN_URL: ${{github.event.inputs.binary_url}} + REF_URL: ${{github.event.inputs.reference_url}} run: | echo Fetching $BIN_URL wget $BIN_URL @@ -50,9 +51,18 @@ jobs: echo Running on $CHAIN ./polkadot --chain=$CHAIN & + - name: Prepare output + run: | + VERSION=$(./polkadot --version) + echo "Metadata comparison:" >> output.txt + echo "Date: $(date)" >> output.txt + echo "Reference: $REF_URL" >> output.txt + echo "Target version: $VERSION" >> output.txt + echo "-------------------------------------------" >> output.txt + - name: Compare the metadata run: | - CMD="docker run --network host jacogr/polkadot-js-tools metadata wss://rpc.polkadot.io ws://localhost:9944" + CMD="docker run --network host jacogr/polkadot-js-tools metadata $REF_URL ws://localhost:9944" echo -e "Running:\n$CMD" $CMD > output.txt sed -z -i 's/\n\n/\n/g' output.txt From 3e0bd87258f709c7f093ff47ff1e1435fc9ed94e Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 11 Aug 2021 12:11:24 +0200 Subject: [PATCH 5/9] Add default url --- .github/workflows/extrinsic-ordering-check-from-bin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/extrinsic-ordering-check-from-bin.yml b/.github/workflows/extrinsic-ordering-check-from-bin.yml index 6b68439e0b33..06bb9f846595 100644 --- a/.github/workflows/extrinsic-ordering-check-from-bin.yml +++ b/.github/workflows/extrinsic-ordering-check-from-bin.yml @@ -10,7 +10,7 @@ on: required: true binary_url: description: A url to a Linux binary for the node containing the runtime to test - default: https://some/url/polkadot + default: https://releases.parity.io/polkadot/x86_64-debian:stretch/v0.9.9-rc1/polkadot required: true chain: description: The name of the chain under test. Usually, you would pass a local chain From 7cd84b4f68253b65e144cb0a4657dbfa2df352d0 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 11 Aug 2021 12:14:32 +0200 Subject: [PATCH 6/9] fix envs --- .../extrinsic-ordering-check-from-bin.yml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/extrinsic-ordering-check-from-bin.yml b/.github/workflows/extrinsic-ordering-check-from-bin.yml index 06bb9f846595..d5c0b4fbe173 100644 --- a/.github/workflows/extrinsic-ordering-check-from-bin.yml +++ b/.github/workflows/extrinsic-ordering-check-from-bin.yml @@ -23,23 +23,11 @@ jobs: runs-on: ubuntu-latest env: CHAIN: ${{github.event.inputs.chain}} + BIN_URL: ${{github.event.inputs.binary_url}} + REF_URL: ${{github.event.inputs.reference_url}} steps: - # - name: Ensure that the 'chain' is a local one - # env: - # run: | - # if [[ $CHAIN == *"local"* ]] ; then - # echo OK, we will run the test on $CHAIN - # exit 0 - # else - # echo Err, you need to pass a local chain such as 'polkadot-local', $CHAIN does not cut it - # exit 1 - # fi - - name: Fetch binary - env: - BIN_URL: ${{github.event.inputs.binary_url}} - REF_URL: ${{github.event.inputs.reference_url}} run: | echo Fetching $BIN_URL wget $BIN_URL From 54e0d2e092da7b551efec2a6998c2b3146fd9888 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 11 Aug 2021 12:19:44 +0200 Subject: [PATCH 7/9] fix output generation --- .github/workflows/extrinsic-ordering-check-from-bin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/extrinsic-ordering-check-from-bin.yml b/.github/workflows/extrinsic-ordering-check-from-bin.yml index d5c0b4fbe173..fa70a3071c4a 100644 --- a/.github/workflows/extrinsic-ordering-check-from-bin.yml +++ b/.github/workflows/extrinsic-ordering-check-from-bin.yml @@ -52,7 +52,7 @@ jobs: run: | CMD="docker run --network host jacogr/polkadot-js-tools metadata $REF_URL ws://localhost:9944" echo -e "Running:\n$CMD" - $CMD > output.txt + $CMD >> output.txt sed -z -i 's/\n\n/\n/g' output.txt - name: Show result From a6b03ee448fe4cd89ef6761d66b99dc5d9b6b3e9 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 11 Aug 2021 12:27:09 +0200 Subject: [PATCH 8/9] Fix the release todos with a link to the gha --- .github/ISSUE_TEMPLATE/release.md | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index 0516ae4090fc..eda72372dd07 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -105,26 +105,15 @@ functions. Compare the metadata of the current and new runtimes and ensure that the `module index, call index` tuples map to the same set of functions. In case of a breaking change, increase `transaction_version`. -To verify the order has not changed: - -1. Download the latest release-candidate binary either from the draft-release -on Github, or -[AWS](https://releases.parity.io/polkadot/x86_64-debian:stretch/{{ env.VERSION }}-rc1/polkadot) -(adjust the rc in this URL as necessary). -2. Run the release-candidate binary using a local chain: -`./polkadot --chain=polkadot-local` or `./polkadot --chain=kusama.local` -3. Use [`polkadot-js-tools`](https://github.com/polkadot-js/tools) to compare -the metadata: - - For Polkadot: `docker run --network host jacogr/polkadot-js-tools metadata wss://rpc.polkadot.io ws://localhost:9944` - - For Kusama: `docker run --network host jacogr/polkadot-js-tools metadata wss://kusama-rpc.polkadot.io ws://localhost:9944` -4. Things to look for in the output are lines like: +To verify the order has not changed, you may manually start the following [Github Action](https://github.com/paritytech/polkadot/actions/workflows/extrinsic-ordering-check-from-bin.yml). It takes around a minute to run and will produce the report as artifact you need to manually check. + +The things to look for in the output are lines like: - `[Identity] idx 28 -> 25 (calls 15)` - indicates the index for `Identity` has changed - `[+] Society, Recovery` - indicates the new version includes 2 additional modules/pallets. - If no indices have changed, every modules line should look something like `[Identity] idx 25 (calls 15)` Note: Adding new functions to the runtime does not constitute a breaking change -as long as they are added to the end of a pallet (i.e., does not break any -other call index). +as long as teh indexes did not change. ### Proxy Filtering From 673d10b5afb6e150dc7640e8d82e76fff49791d6 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 11 Aug 2021 12:44:24 +0200 Subject: [PATCH 9/9] fix typo --- .github/ISSUE_TEMPLATE/release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index eda72372dd07..feda82850105 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -113,7 +113,7 @@ The things to look for in the output are lines like: - If no indices have changed, every modules line should look something like `[Identity] idx 25 (calls 15)` Note: Adding new functions to the runtime does not constitute a breaking change -as long as teh indexes did not change. +as long as the indexes did not change. ### Proxy Filtering