From 91a44989ceade7809397d5cc504b731ae8990882 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Sat, 19 Oct 2024 00:08:55 +0100 Subject: [PATCH 1/2] Update try-runtime-cli (#463) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update try-runtime-cli for MBM testing that was added https://github.com/paritytech/try-runtime-cli/pull/90 - Fix KAH spec version that was incorrectly bumped - Disable MBM testing for Encointer runtime until https://github.com/paritytech/try-runtime-cli/issues/101 is fixed (single-block-migrations are still checked). - [x] Does not require a CHANGELOG entry --------- Signed-off-by: Oliver Tale-Yazdi Co-authored-by: fellowship-merge-bot[bot] <151052383+fellowship-merge-bot[bot]@users.noreply.github.com> Co-authored-by: Bastian Köcher --- .github/workflows/check-migrations.yml | 55 ++++++++++++++++--- .github/workflows/runtimes-matrix.json | 42 +++++++++----- .../asset-hubs/asset-hub-kusama/src/lib.rs | 2 +- 3 files changed, 75 insertions(+), 24 deletions(-) diff --git a/.github/workflows/check-migrations.yml b/.github/workflows/check-migrations.yml index f2f2d621ee..968ff80c00 100644 --- a/.github/workflows/check-migrations.yml +++ b/.github/workflows/check-migrations.yml @@ -53,10 +53,10 @@ jobs: - name: Checkout sources uses: actions/checkout@v4 - - name: Build EXTRA_ARGS + - name: Build EXTRA_FLAGS run: | # When running on relay, we don't need weight checks. - EXTRA_FLAGS="" + EXTRA_FLAGS="${{ matrix.runtime.extra_args }}" if [[ "${{ matrix.runtime.is_relay }}" == "true" ]]; then EXTRA_FLAGS+="--no-weight-warnings" echo "Disabling weight checks since we are on a relay" @@ -70,6 +70,8 @@ jobs: CHECKS="all" fi + EXTRA_FLAGS+=" --blocktime ${{ matrix.runtime.blocktime }} " + # Disable the spec version check when we dont want to release. # The program prints either `1` or `0`. if [ "$(.github/changelog-processor.py CHANGELOG.md --should-release)" = "0" ]; then @@ -82,16 +84,51 @@ jobs: echo "Flags: $EXTRA_FLAGS" echo "Checks: $CHECKS" - echo "EXTRA_ARGS=$EXTRA_FLAGS" >> $GITHUB_ENV + echo "EXTRA_FLAGS=$EXTRA_FLAGS" >> $GITHUB_ENV echo "CHECKS=$CHECKS" >> $GITHUB_ENV - - name: Run ${{ matrix.runtime.name }} Runtime Checks - uses: "paritytech/try-runtime-gha@v0.2.0" + - name: Install Protoc + uses: arduino/setup-protoc@v1.3.0 with: - runtime-package: ${{ matrix.runtime.package }} - node-uri: ${{ matrix.runtime.uri }} - checks: ${{ env.CHECKS }} - extra-args: ${{ env.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: Run ${{ matrix.runtime.name }} Runtime Checks + #uses: "paritytech/try-runtime-gha@v0.2.0" + env: + EXTRA_FLAGS: ${{ env.EXTRA_FLAGS }} + CHECKS: ${{ env.CHECKS }} + run: | + cargo install -q --git https://github.com/paritytech/try-runtime-cli --tag v0.8.0 --locked && try-runtime --version + + cargo build --profile production -p ${{ matrix.runtime.package }} --features try-runtime -q --locked + + 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 + + echo "Extra args: $EXTRA_FLAGS" + + # Store the command in a variable so we can log it + COMMAND="try-runtime \ + --runtime $RUNTIME_BLOB_PATH \ + on-runtime-upgrade --checks=$CHECKS \ + $EXTRA_FLAGS \ + live --uri ${{ matrix.runtime.uri }}" + + # Echo the command before running it, for debugging purposes + echo "Running command:" + echo "$COMMAND" + eval "$COMMAND" + # This will only run if all the tests in its "needs" array passed. # Add this as your required job, becuase if the matrix changes size (new things get added) diff --git a/.github/workflows/runtimes-matrix.json b/.github/workflows/runtimes-matrix.json index b38a129e60..172c53929c 100644 --- a/.github/workflows/runtimes-matrix.json +++ b/.github/workflows/runtimes-matrix.json @@ -4,89 +4,103 @@ "package": "polkadot-runtime", "path": "relay/polkadot", "uri": "wss://try-runtime.polkadot.io:443", - "is_relay": true + "is_relay": true, + "blocktime": 6000 }, { "name": "kusama", "package": "staging-kusama-runtime", "path": "relay/kusama", "uri": "wss://try-runtime-kusama.polkadot.io:443", - "is_relay": true + "is_relay": true, + "blocktime": 6000 }, { "name": "glutton-kusama", "package": "glutton-kusama-runtime", "path": "system-parachains/gluttons/glutton-kusama", - "is_relay": false + "is_relay": false, + "blocktime": 12000 }, { "name": "asset-hub-kusama", "package": "asset-hub-kusama-runtime", "path": "system-parachains/asset-hubs/asset-hub-kusama", "uri": "wss://kusama-asset-hub-rpc.polkadot.io:443", - "is_relay": false + "is_relay": false, + "blocktime": 12000 }, { "name": "asset-hub-polkadot", "package": "asset-hub-polkadot-runtime", "path": "system-parachains/asset-hubs/asset-hub-polkadot", "uri": "wss://polkadot-asset-hub-rpc.polkadot.io:443", - "is_relay": false + "is_relay": false, + "blocktime": 12000 }, { "name": "bridge-hub-kusama", "package": "bridge-hub-kusama-runtime", "path": "system-parachains/bridge-hubs/bridge-hub-kusama", "uri": "wss://kusama-bridge-hub-rpc.polkadot.io:443", - "is_relay": false + "is_relay": false, + "blocktime": 12000 }, { "name": "bridge-hub-polkadot", "package": "bridge-hub-polkadot-runtime", "path": "system-parachains/bridge-hubs/bridge-hub-polkadot", "uri": "wss://polkadot-bridge-hub-rpc.polkadot.io:443", - "is_relay": false + "is_relay": false, + "blocktime": 12000 }, { "name": "collectives-polkadot", "package": "collectives-polkadot-runtime", "path": "system-parachains/collectives/collectives-polkadot", "uri": "wss://polkadot-collectives-rpc.polkadot.io:443", - "is_relay": false + "is_relay": false, + "blocktime": 12000 }, { "name": "coretime-kusama", "package": "coretime-kusama-runtime", "path": "system-parachains/coretime/coretime-kusama", "uri": "wss://kusama-coretime-rpc.polkadot.io:443", - "is_relay": false + "is_relay": false, + "blocktime": 12000 }, { "name": "coretime-polkadot", "package": "coretime-polkadot-runtime", "path": "system-parachains/coretime/coretime-polkadot", - "uri": "wss://polkadot-coretime-rpc.polkadot.io:443", - "is_relay": false + "is_relay": false, + "blocktime": 12000, + "uri": "wss://polkadot-coretime-rpc.polkadot.io:443" }, { "name": "people-kusama", "package": "people-kusama-runtime", "path": "system-parachains/people/people-kusama", "uri": "wss://kusama-people-rpc.polkadot.io:443", - "is_relay": false + "is_relay": false, + "blocktime": 6000 }, { "name": "people-polkadot", "package": "people-polkadot-runtime", "path": "system-parachains/people/people-polkadot", "uri": "wss://polkadot-people-rpc.polkadot.io:443", - "is_relay": false + "is_relay": false, + "blocktime": 12000 }, { "name": "encointer-kusama", "package": "encointer-kusama-runtime", "path": "system-parachains/encointer", "uri": "wss://kusama.api.encointer.org:443", - "is_relay": false + "is_relay": false, + "blocktime": 12000, + "extra_args": "--disable-mbm-checks" } ] diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs index 2e37a24db9..ec92b587f7 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs @@ -137,7 +137,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("statemine"), impl_name: create_runtime_str!("statemine"), authoring_version: 1, - spec_version: 1_003_000, + spec_version: 1_003_003, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 15, From 7bbf00566d86d51fcd5582779e7e9c37a814405e Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 21 Oct 2024 19:00:27 +0200 Subject: [PATCH 2/2] Switch clippy from +nightly to $RUST_STABLE_VERSION (#489) Relates to: https://github.com/paritytech/polkadot-sdk/issues/6127 - [X] Does not require a CHANGELOG entry --- .github/workflows/clippy.yml | 9 ++++++--- relay/kusama/src/governance/origins.rs | 1 - relay/polkadot/src/governance/origins.rs | 1 - .../collectives-polkadot/src/ambassador/origins.rs | 1 - .../collectives-polkadot/src/fellowship/origins.rs | 1 - 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 2aadfd20d8..a5dc42a6eb 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -25,8 +25,11 @@ jobs: - name: Set rust version via common env file run: cat .github/env >> $GITHUB_ENV - - name: Install nightly toolchain - run: rustup toolchain install "nightly-$RUST_NIGHTLY_VERSION" --profile minimal --component clippy + - name: Install stable toolchain + run: | + rustup toolchain install $RUST_STABLE_VERSION --profile minimal --component clippy + cargo --version + cargo clippy --version - name: Fetch cache uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 @@ -34,7 +37,7 @@ jobs: shared-key: "fellowship-cache-clippy" - name: Clippy - run: cargo +nightly-$RUST_NIGHTLY_VERSION clippy --all-targets --locked -q + run: cargo clippy --all-targets --locked -q env: RUSTFLAGS: "-D warnings" SKIP_WASM_BUILD: 1 diff --git a/relay/kusama/src/governance/origins.rs b/relay/kusama/src/governance/origins.rs index a8ef1bc86c..24dcf17801 100644 --- a/relay/kusama/src/governance/origins.rs +++ b/relay/kusama/src/governance/origins.rs @@ -18,7 +18,6 @@ pub use pallet_custom_origins::*; -#[allow(unreachable_patterns)] #[frame_support::pallet] pub mod pallet_custom_origins { use crate::{Balance, GRAND, QUID}; diff --git a/relay/polkadot/src/governance/origins.rs b/relay/polkadot/src/governance/origins.rs index b71466c208..f1283b551e 100644 --- a/relay/polkadot/src/governance/origins.rs +++ b/relay/polkadot/src/governance/origins.rs @@ -18,7 +18,6 @@ pub use pallet_custom_origins::*; -#[allow(unreachable_patterns)] #[frame_support::pallet] pub mod pallet_custom_origins { use crate::{Balance, DOLLARS, GRAND}; diff --git a/system-parachains/collectives/collectives-polkadot/src/ambassador/origins.rs b/system-parachains/collectives/collectives-polkadot/src/ambassador/origins.rs index adb076fc8a..691fd10f24 100644 --- a/system-parachains/collectives/collectives-polkadot/src/ambassador/origins.rs +++ b/system-parachains/collectives/collectives-polkadot/src/ambassador/origins.rs @@ -15,7 +15,6 @@ //! The Ambassador Program's origins. -#[allow(unreachable_patterns)] #[frame_support::pallet] pub mod pallet_origins { use crate::ambassador::ranks; diff --git a/system-parachains/collectives/collectives-polkadot/src/fellowship/origins.rs b/system-parachains/collectives/collectives-polkadot/src/fellowship/origins.rs index 10213635c7..b6815e673f 100644 --- a/system-parachains/collectives/collectives-polkadot/src/fellowship/origins.rs +++ b/system-parachains/collectives/collectives-polkadot/src/fellowship/origins.rs @@ -19,7 +19,6 @@ use super::ranks; pub use pallet_origins::*; -#[allow(unreachable_patterns)] #[frame_support::pallet] pub mod pallet_origins { use super::ranks;