Skip to content

Commit

Permalink
Check runtime upgrade (#3232)
Browse files Browse the repository at this point in the history
* fix wrong folder name

* replace "use", execute it locally, disable first half for testing

* add back

* minor update of INFO output

* fmt

---------

Co-authored-by: Yang <[email protected]>
  • Loading branch information
BillyWooo and Yang authored Jan 24, 2025
1 parent 0b9513d commit a224554
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 11 deletions.
51 changes: 45 additions & 6 deletions .github/workflows/check-runtime-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,49 @@ jobs:
with:
fetch-depth: 0

- name: Run ${{ matrix.runtime.name }} try-runtime check
uses: BillyWooo/[email protected]
- name: Download try-runtime-cli
run: |
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.8.0/try-runtime-x86_64-unknown-linux-musl -o try-runtime
chmod +x ./try-runtime
mv try-runtime parachain
shell: bash

- name: Install Protoc
uses: arduino/[email protected]
with:
runtime-package: ${{ matrix.runtime.package }}
node-uri: ${{ matrix.runtime.uri }}
checks: "all"
extra-args: ""
version: "3.6.1"

- name: Add wasm32-unknown-unknown target
run: rustup target add wasm32-unknown-unknown
shell: bash

- name: Add rust-src component
run: rustup component add rust-src
shell: bash

- name: Build ${{ matrix.runtime.name }}
run: |
cd parachain
cargo build --profile production -p ${{ matrix.runtime.package }} --features try-runtime -q --locked
shell: bash

- name: Check migrations
run: |
cd parachain
PACKAGE_NAME=${{ matrix.runtime.package }}
RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm
RUNTIME_BLOB_PATH=./target/production/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME
export RUST_LOG=remote-ext=debug,runtime=debug
# Store the command in a variable so we can log it
COMMAND="./try-runtime \
--runtime $RUNTIME_BLOB_PATH \
on-runtime-upgrade --disable-mbm-checks --blocktime 12000000 \
live --uri ${{ matrix.runtime.uri }}"
# Echo the command before running it, for debugging purposes
echo "Running command:"
echo "$COMMAND"
eval "$COMMAND"
shell: bash
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,5 @@ clean-all-build:
@echo "Clean tee-worker/identity..."
@cd tee-worker/identity && make clean

@echo "Clean tee-worker/omni-worker..."
@cd tee-worker/omni-worker && make distclean
@echo "Clean tee-worker/omni-executor..."
@cd tee-worker/omni-executor && make distclean
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ where
additional_extrinsic_params,
);
let xt = compose_extrinsic_offline!(&self.signer, call, extrinsic_params).encode();
log::info!("extrinsic created: {}", hex::encode(&xt));
log::info!("extrinsic nonce: {}", nonce_value);
log::info!("extrinsic hash: {}", hex::encode(blake2_256(&xt)));
log::info!(
"extrinsic created with nonce: {}, hash: {}",
nonce_value,
hex::encode(blake2_256(&xt))
);
nonce_value += 1;
xt
})
Expand Down

0 comments on commit a224554

Please sign in to comment.