From 96705637ba7279ac63dcd2bcebe454867a87da2d Mon Sep 17 00:00:00 2001 From: fewensa <37804932+fewensa@users.noreply.github.com> Date: Mon, 11 Mar 2024 18:19:52 +0800 Subject: [PATCH] Update Proposal Hash to Whitelist Hash (#1448) * Update Proposal Hash to Whitelist Hash * Detect whitelist pallet index --- .github/note-template/runtime.md | 4 ++-- .github/workflows/release.yml | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/note-template/runtime.md b/.github/note-template/runtime.md index b830abfa0..380d8d144 100644 --- a/.github/note-template/runtime.md +++ b/.github/note-template/runtime.md @@ -1,9 +1,9 @@ ## {{ .Env.CHAIN | strings.Title }}

Upgrade Priority LOW :green_circle:

-#### Proposal Hash +#### Whitelist Hash ``` -{{ (ds "srtool").runtimes.compressed.subwasm.proposal_hash }} +{{ .Env.WHITELIST_HASH }} ``` #### Blake2 256 Hash ``` diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5a36bc8f..ad4790544 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -110,6 +110,12 @@ jobs: curl -LO ${{ env.GOMPLATE_URL }}/${{ env.GOMPLATE_VERSION }}/${{ env.GOMPLATE }} chmod u+x ${{ env.GOMPLATE }} sudo mv ${{ env.GOMPLATE }} /usr/bin/gomplate + - name: Setup wuh + run: | + curl -LO https://github.com/darwinia-network/darwinia-releases/releases/download/v0.1.0/wuh.zst + zstd -d wuh.zst + chmod u+x ./wuh + sudo mv ./wuh /usr/bin/wuh - name: Filter run: | SKIP_BUILD=${{ env.SKIP_BUILD }} @@ -146,7 +152,15 @@ jobs: if [ "$FILTER" == "true" ]; then echo '${{ steps.srtool_build.outputs.json }}' | jq > build/${CHAIN}-srtool.json - mv ${{ steps.srtool_build.outputs.wasm_compressed }} build/ + + WASM_FILE='${{ steps.srtool_build.outputs.wasm_compressed }}' + WHITELIST_PALLET_INDEX=0x33 + if [ "$CHAIN" == "crab" ]; then + WHITELIST_PALLET_INDEX=0x2f + fi + export WHITELIST_HASH=$(wuh ${WASM_FILE} ${WHITELIST_PALLET_INDEX} 0x01) + + mv ${WASM_FILE} build/ cat .github/note-template/runtime.md \ | gomplate -d srtool=build/${CHAIN}-srtool.json \