Skip to content

Commit 1bf1511

Browse files
MaciejBajchiefbiiko
authored andcommitted
:fix: Replace unstable srtool with subwasm to calc para hash
1 parent 08ece2c commit 1bf1511

File tree

1 file changed

+7
-23
lines changed

1 file changed

+7
-23
lines changed

scripts/upgrade-runtime.sh

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,8 @@ if ! git tag --list | grep -Fq $tag; then
5252
exit 1
5353
fi
5454

55-
if ! cargo install --list | grep -Fq 'srtool-cli v0.8.0'; then
56-
echo "installing srtool-cli..."
57-
cargo install \
58-
--git https://github.com/chevdor/srtool-cli \
59-
--tag v0.8.0
60-
fi
55+
echo "🏭 installing chevdor/subwasm v0.16.1 a tool to calculate blake2 of runtime blob runtime wasm..."
56+
cargo install --locked --git https://github.com/chevdor/subwasm --tag v0.16.1
6157

6258
set -Ee
6359

@@ -103,24 +99,12 @@ if [[ $new_author_version != $((old_author_version + 1)) ]]; then
10399
exit 1
104100
fi
105101

106-
echo "🏭 compiling runtime wasm..."
107-
108-
report="$( \
109-
srtool build \
110-
--profile release \
111-
--runtime-dir runtime/parachain \
112-
--package circuit-parachain-runtime \
113-
--app \
114-
$root_dir \
115-
)"
116-
117-
report="{${report#*\{}" # left trimming nonjson
118-
wasm="$root_dir/$(jq -r .runtimes.compressed.wasm <<<"$report")"
119-
hash=$( \
120-
jq -r .runtimes.compressed.blake2_256 <<<"$report" \
121-
)
122102

123-
cp $wasm $used_wasm
103+
echo "🏭 building runtime wasm..."
104+
cargo build --locked --profile release --target-dir target/ --out-dir $(pwd)/out -Z unstable-options
105+
echo "🏭 calculating blake2 of runtime circuit_parachain_runtime.compact.compressed.wasm..."
106+
hash=$(subwasm -j info ./target/release/wbuild/circuit-parachain-runtime/circuit_parachain_runtime.compact.compressed.wasm | jq -r .blake2_256)
107+
echo $hash
124108

125109
read -n 1 -p "e2e-tested on rococo-local?
126110
runtime upgrade tested on rococo-local?

0 commit comments

Comments
 (0)