diff --git a/.github/changelog-processor.py b/.github/changelog-processor.py index 43ad132fed..692b87d05d 100755 --- a/.github/changelog-processor.py +++ b/.github/changelog-processor.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import sys diff --git a/.github/install-deps.sh b/.github/install-deps.sh new file mode 100755 index 0000000000..5e056ef536 --- /dev/null +++ b/.github/install-deps.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +sudo apt update +sudo apt install --assume-yes openssl pkg-config g++ make cmake protobuf-compiler libssl-dev libclang-dev libudev-dev git + +# Free space on the runner +df -h +sudo apt -y autoremove --purge +sudo apt -y autoclean +sudo rm -rf /usr/share/dotnet +sudo rm -rf /opt/ghc +sudo rm -rf "/usr/local/share/boost" +sudo rm -rf "$AGENT_TOOLSDIRECTORY" +df -h + diff --git a/.github/scripts/cmd/cmd.py b/.github/scripts/cmd/cmd.py index 589ce7e173..c8f3f26566 100755 --- a/.github/scripts/cmd/cmd.py +++ b/.github/scripts/cmd/cmd.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import sys diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 52b6801f9b..e92088bccf 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -43,7 +43,9 @@ jobs: uses: actions/checkout@v4 - name: Verify - run: .github/changelog-processor.py CHANGELOG.md --validate-changelog + run: | + sudo apt install python3 + .github/changelog-processor.py CHANGELOG.md --validate-changelog # 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/check-features.yml b/.github/workflows/check-features.yml index 6b67389ca7..87bed37014 100644 --- a/.github/workflows/check-features.yml +++ b/.github/workflows/check-features.yml @@ -18,20 +18,22 @@ jobs: runs-on: ubuntu-22.04 steps: - - name: Install stable Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - - name: Install Zepter - run: cargo install --locked -q zepter && zepter --version - - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 # Dont clone historic commits. + - name: Set rust version via common env file + run: cat .github/env >> $GITHUB_ENV + + - name: Install stable toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: "${{env.RUST_STABLE_VERSION}}" + + - name: Install Zepter + run: cargo install --locked -q zepter && zepter --version + - name: Check features run: | zepter run check diff --git a/.github/workflows/check-migrations.yml b/.github/workflows/check-migrations.yml index 948ae5bf10..8038081d36 100644 --- a/.github/workflows/check-migrations.yml +++ b/.github/workflows/check-migrations.yml @@ -54,8 +54,13 @@ jobs: - name: Checkout sources uses: actions/checkout@v4 + - name: Install updates and dependencies + run: .github/install-deps.sh + - name: Build EXTRA_FLAGS run: | + sudo apt install python3 + # When running on relay, we don't need weight checks. EXTRA_FLAGS="${{ matrix.runtime.extra_args }}" if [[ "${{ matrix.runtime.is_relay }}" == "true" ]]; then @@ -88,18 +93,15 @@ jobs: echo "EXTRA_FLAGS=$EXTRA_FLAGS" >> $GITHUB_ENV echo "CHECKS=$CHECKS" >> $GITHUB_ENV - - name: Install Protoc - uses: arduino/setup-protoc@v1.3.0 - with: - version: "3.6.1" + - name: Set rust version via common env file + run: cat .github/env >> $GITHUB_ENV - - 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: Install stable toolchain + uses: dtolnay/rust-toolchain@master + with: + targets: "wasm32-unknown-unknown" + components: "rust-src" + toolchain: "${{env.RUST_STABLE_VERSION}}" - name: Run ${{ matrix.runtime.name }} Runtime Checks #uses: "paritytech/try-runtime-gha@v0.2.0" diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index a5dc42a6eb..e67ef0ff95 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -16,28 +16,31 @@ jobs: runs-on: ubuntu-22.04 steps: - - name: Install updates and protobuf-compiler - run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler - - name: Checkout uses: actions/checkout@v4 + - name: Install updates and dependencies + run: .github/install-deps.sh + - name: Set rust version via common env file run: cat .github/env >> $GITHUB_ENV - name: Install stable toolchain - run: | - rustup toolchain install $RUST_STABLE_VERSION --profile minimal --component clippy - cargo --version - cargo clippy --version + uses: dtolnay/rust-toolchain@master + with: + components: "clippy" + toolchain: "${{env.RUST_STABLE_VERSION}}" - name: Fetch cache - uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 + uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7 with: shared-key: "fellowship-cache-clippy" + save-if: ${{ github.ref == 'refs/heads/master' }} - name: Clippy - run: cargo clippy --all-targets --locked -q + run: | + cargo clippy --version + cargo clippy --all-targets --locked -q env: RUSTFLAGS: "-D warnings" SKIP_WASM_BUILD: 1 diff --git a/.github/workflows/cmd.yml b/.github/workflows/cmd.yml index e30982abee..e8ec2cc23c 100644 --- a/.github/workflows/cmd.yml +++ b/.github/workflows/cmd.yml @@ -125,6 +125,7 @@ jobs: CMD: ${{ steps.get-pr-comment.outputs.group2 }} # to avoid "" around the command run: | echo 'help<> $GITHUB_OUTPUT + sudo apt install python3 python3 .github/scripts/cmd/cmd.py $CMD >> $GITHUB_OUTPUT echo 'EOF' >> $GITHUB_OUTPUT @@ -217,14 +218,8 @@ jobs: env: JOB_NAME: 'cmd' if: ${{ startsWith(github.event.comment.body, '/cmd') && !contains(github.event.comment.body, '--help') && contains(needs.fellows.outputs.github-handles, github.event.sender.login) }} - runs-on: ${{ startsWith(github.event.comment.body, '/cmd bench') && 'gitrun-001' || 'ubuntu-22.04' }} + runs-on: ${{ startsWith(github.event.comment.body, '/cmd bench') && 'self-hosted' || 'ubuntu-22.04' }} steps: - - name: Install updates and protobuf-compiler - if: startsWith(github.event.comment.body, '/cmd bench') - run: | - sudo apt update && sudo apt install --assume-yes \ - openssl pkg-config g++ make cmake protobuf-compiler curl libssl-dev libclang-dev libudev-dev git jq - - name: Get command uses: actions-ecosystem/action-regex-match@v2 id: get-pr-comment @@ -274,14 +269,19 @@ jobs: repository: ${{ needs.get-pr-branch.outputs.repo }} ref: ${{ needs.get-pr-branch.outputs.pr-branch }} + - name: Install updates and dependencies + if: startsWith(github.event.comment.body, '/cmd bench') + run: .github/install-deps.sh + - name: Set rust version via common env file run: cat .github/env >> $GITHUB_ENV - - name: Install Rust + - name: Install nightly toolchain uses: dtolnay/rust-toolchain@master + if: startsWith(steps.get-pr-comment.outputs.group2, 'fmt') || startsWith(steps.get-pr-comment.outputs.group2, 'bench') with: - targets: "wasm32-unknown-unknown,x86_64-unknown-linux-musl" - components: "rust-src rustfmt clippy" + targets: "wasm32-unknown-unknown" + components: "rust-src, rustfmt" toolchain: "nightly-${{env.RUST_NIGHTLY_VERSION}}" - name: Install dependencies for bench @@ -294,9 +294,10 @@ jobs: - name: Setup Cache if: startsWith(steps.get-pr-comment.outputs.group2, 'bench') - uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 + uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7 with: - shared-key: "fellowship-cmd" + shared-key: "fellowship-cache-cmd" + save-if: ${{ github.ref == 'refs/heads/master' }} - name: Run cmd id: cmd @@ -306,6 +307,7 @@ jobs: echo "github.ref: ${{ github.ref }}" echo "Running command: $CMD on branch ${{ needs.get-pr-branch.outputs.pr-branch }}" git remote -v + sudo apt install python3 python3 .github/scripts/cmd/cmd.py $CMD git status git diff diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml index 2b115bd863..dd90b93a13 100644 --- a/.github/workflows/fmt.yml +++ b/.github/workflows/fmt.yml @@ -24,8 +24,14 @@ jobs: run: cat .github/env >> $GITHUB_ENV - name: Install nightly toolchain + uses: dtolnay/rust-toolchain@master + with: + targets: "wasm32-unknown-unknown" + components: "rustfmt" + toolchain: "nightly-${{env.RUST_NIGHTLY_VERSION}}" + + - name: Install taplo run: | - rustup toolchain install "nightly-$RUST_NIGHTLY_VERSION" --profile minimal --component rustfmt cargo install taplo-cli --version $TAPLO_VERSION - name: Rustfmt (check) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d5deb9e7f..e97ee37494 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,7 @@ jobs: echo "should-release=$(.github/changelog-processor.py CHANGELOG.md --should-release)" >> $GITHUB_OUTPUT echo "version=$(.github/changelog-processor.py CHANGELOG.md --print-latest-version)" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT + runtime-matrix: needs: [ collect-release-information ] if: needs.collect-release-information.outputs.should-release == '1' @@ -32,6 +33,7 @@ jobs: TASKS=$(echo $(cat .github/workflows/runtimes-matrix.json) | sed 's/ //g' ) echo $TASKS echo "runtime=$TASKS" >> $GITHUB_OUTPUT + build-runtimes: needs: [ runtime-matrix ] continue-on-error: true diff --git a/.github/workflows/review-bot.yml b/.github/workflows/review-bot.yml index ffb6763014..1233a9a454 100644 --- a/.github/workflows/review-bot.yml +++ b/.github/workflows/review-bot.yml @@ -26,7 +26,7 @@ jobs: app-id: ${{ secrets.REVIEW_APP_ID }} private-key: ${{ secrets.REVIEW_APP_KEY }} - name: "Evaluates PR reviews and assigns reviewers" - uses: paritytech/review-bot@v2.6.0 + uses: paritytech/review-bot@v2.7.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} team-token: ${{ steps.team_token.outputs.token }} diff --git a/.github/workflows/review-trigger.yml b/.github/workflows/review-trigger.yml index 82570a0e46..8d87ad0ffb 100644 --- a/.github/workflows/review-trigger.yml +++ b/.github/workflows/review-trigger.yml @@ -28,7 +28,7 @@ jobs: env: GH_TOKEN: ${{ github.token }} - name: Get the GitHub handle of the fellows - uses: paritytech/get-fellows-action@v1.2.0 + uses: paritytech/get-fellows-action@v1.3.0 id: fellows # Require new reviews when the author is pushing and he is not a fellow - name: Fail when author pushes new code diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3f39ff79cf..b1f9867bf7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,37 +53,27 @@ jobs: matrix: runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }} steps: - - name: Install updates and protobuf-compiler - run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler - - - name: Free space on the runner - run: | - df -h - sudo apt -y autoremove --purge - sudo apt -y autoclean - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - df -h - - name: Checkout uses: actions/checkout@v4 + - name: Install updates and dependencies + run: .github/install-deps.sh + - name: Set rust version via common env file run: cat .github/env >> $GITHUB_ENV - name: Install stable toolchain - run: | - rustup install $RUST_STABLE_VERSION - rustup default $RUST_STABLE_VERSION - rustup target add wasm32-unknown-unknown - rustup component add rust-src + uses: dtolnay/rust-toolchain@master + with: + targets: "wasm32-unknown-unknown" + components: "rust-src" + toolchain: "${{env.RUST_STABLE_VERSION}}" - name: Fetch cache - uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 + uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7 with: - shared-key: "fellowship-cache-tests" + shared-key: "fellowship-cache-runtime-tests" + save-if: ${{ github.ref == 'refs/heads/master' }} - name: Download frame-omni-bencher run: | @@ -132,37 +122,27 @@ jobs: with: access_token: ${{ github.token }} - - name: Install updates and protobuf-compiler - run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler - - - name: Free space on the runner - run: | - df -h - sudo apt -y autoremove --purge - sudo apt -y autoclean - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - df -h - - name: Checkout uses: actions/checkout@v4 + - name: Install updates and dependencies + run: .github/install-deps.sh + - name: Set rust version via common env file run: cat .github/env >> $GITHUB_ENV - name: Install stable toolchain - run: | - rustup install $RUST_STABLE_VERSION - rustup default $RUST_STABLE_VERSION - rustup target add wasm32-unknown-unknown - rustup component add rust-src + uses: dtolnay/rust-toolchain@master + with: + targets: "wasm32-unknown-unknown" + components: "rust-src" + toolchain: "${{env.RUST_STABLE_VERSION}}" - name: Fetch cache - uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 + uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7 with: - shared-key: "fellowship-cache-tests" + shared-key: "fellowship-cache-integration-tests" + save-if: ${{ github.ref == 'refs/heads/master' }} - name: Test ${{ matrix.itest.name }} run: cargo test -p ${{ matrix.itest.package }} --release --locked -q @@ -178,37 +158,27 @@ jobs: with: access_token: ${{ github.token }} - - name: Install updates and protobuf-compiler - run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler - - - name: Free space on the runner - run: | - df -h - sudo apt -y autoremove --purge - sudo apt -y autoclean - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - df -h - - name: Checkout uses: actions/checkout@v4 + - name: Install updates and dependencies + run: .github/install-deps.sh + - name: Set rust version via common env file run: cat .github/env >> $GITHUB_ENV - name: Install stable toolchain - run: | - rustup install $RUST_STABLE_VERSION - rustup default $RUST_STABLE_VERSION - rustup target add wasm32-unknown-unknown - rustup component add rust-src + uses: dtolnay/rust-toolchain@master + with: + targets: "wasm32-unknown-unknown" + components: "rust-src" + toolchain: "${{env.RUST_STABLE_VERSION}}" - name: Fetch cache - uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 + uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7 with: - shared-key: "fellowship-cache-tests" + shared-key: "fellowship-cache-chain-spec-tests" + save-if: ${{ github.ref == 'refs/heads/master' }} - name: Build run: cargo test -p chain-spec-generator --release --locked -q --features=runtime-benchmarks @@ -226,37 +196,27 @@ jobs: with: access_token: ${{ github.token }} - - name: Install updates and protobuf-compiler - run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler - - - name: Free space on the runner - run: | - df -h - sudo apt -y autoremove --purge - sudo apt -y autoclean - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - df -h - - name: Checkout uses: actions/checkout@v4 + - name: Install updates and dependencies + run: .github/install-deps.sh + - name: Set rust version via common env file run: cat .github/env >> $GITHUB_ENV - name: Install stable toolchain - run: | - rustup install $RUST_STABLE_VERSION - rustup default $RUST_STABLE_VERSION - rustup target add wasm32-unknown-unknown - rustup component add rust-src + uses: dtolnay/rust-toolchain@master + with: + targets: "wasm32-unknown-unknown" + components: "rust-src" + toolchain: "${{env.RUST_STABLE_VERSION}}" - name: Fetch cache - uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 + uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7 with: - shared-key: "fellowship-cache-integration-tests" + shared-key: "fellowship-cache-zombienet-tests" + save-if: ${{ github.ref == 'refs/heads/master' }} - name: Build run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index de2734761c..5cd8090aab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Kusama Treasury: allow burn parameters to be set via OpenGov ([polkadot-fellows/runtimes#511](https://github.com/polkadot-fellows/runtimes/pull/511)) - Remove Snowbridge create agent and channel extrinsics. ([polkadot-fellows/runtimes#506](https://github.com/polkadot-fellows/runtimes/pull/506)) - Update the XCM `Weigher` from `FixedWeightBounds` to `WeightInfoBounds` with benchmarked weights for Polkadot Collectives ([polkadot-fellows/runtimes#547](https://github.com/polkadot-fellows/runtimes/pull/547)) +- Increase max PoV size to 10Mib on Kusama ([polkadot-fellows/runtimes#553](https://github.com/polkadot-fellows/runtimes/pull/553)) #### From [#490](https://github.com/polkadot-fellows/runtimes/pull/490) diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index 042162caff..14004de653 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -25,7 +25,7 @@ extern crate alloc; use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::{ dynamic_params::{dynamic_pallet_params, dynamic_params}, - traits::{EnsureOrigin, EnsureOriginWithArg}, + traits::{EnsureOrigin, EnsureOriginWithArg, OnRuntimeUpgrade}, weights::constants::{WEIGHT_PROOF_SIZE_PER_KB, WEIGHT_REF_TIME_PER_MICROS}, }; use kusama_runtime_constants::system_parachain::coretime::TIMESLICE_PERIOD; @@ -57,12 +57,14 @@ use sp_std::{ }; use runtime_parachains::{ - assigner_coretime as parachains_assigner_coretime, configuration as parachains_configuration, - configuration::ActiveConfigHrmpChannelSizeAndCapacityRatio, - coretime, disputes as parachains_disputes, - disputes::slashing as parachains_slashing, - dmp as parachains_dmp, hrmp as parachains_hrmp, inclusion as parachains_inclusion, - inclusion::{AggregateMessageOrigin, UmpQueueId}, + assigner_coretime as parachains_assigner_coretime, + configuration::{ + self as parachains_configuration, ActiveConfigHrmpChannelSizeAndCapacityRatio, WeightInfo, + }, + coretime, + disputes::{self as parachains_disputes, slashing as parachains_slashing}, + dmp as parachains_dmp, hrmp as parachains_hrmp, + inclusion::{self as parachains_inclusion, AggregateMessageOrigin, UmpQueueId}, initializer as parachains_initializer, on_demand as parachains_on_demand, origin as parachains_origin, paras as parachains_paras, paras_inherent as parachains_paras_inherent, reward_points as parachains_reward_points, @@ -1902,6 +1904,47 @@ parameter_types! { pub const MaxPoolsToMigrate: u32 = 500; } +const NEW_MAX_POV: u32 = 10 * 1024 * 1024; + +pub struct Activate10MbPovs; +impl OnRuntimeUpgrade for Activate10MbPovs { + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { + // The pre-upgrade state doesn't matter + Ok(vec![]) + } + + fn on_runtime_upgrade() -> Weight { + match parachains_configuration::Pallet::::set_max_pov_size( + frame_system::RawOrigin::Root.into(), + NEW_MAX_POV, + ) { + Ok(()) => + weights::runtime_parachains_configuration::WeightInfo::::set_config_with_u32(), + Err(e) => { + log::warn!( + target: LOG_TARGET, + "Failed to set max PoV size. Error: {e:?}" + ); + Weight::zero() + }, + } + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { + let pending = parachains_configuration::PendingConfigs::::get(); + let Some((_, last_pending)) = pending.last() else { + return Err(sp_runtime::TryRuntimeError::CannotLookup); + }; + frame_support::ensure!( + last_pending.max_pov_size == NEW_MAX_POV, + "Setting max PoV size to 10 Mb should be pending" + ); + Ok(()) + } +} + /// All migrations that will run on the next runtime upgrade. /// /// This contains the combined migrations of the last 10 releases. It allows to skip runtime @@ -1925,6 +1968,7 @@ pub mod migrations { Runtime, MaxPoolsToMigrate, >, + Activate10MbPovs, ); /// Migrations/checks that do not need to be versioned and can run on every update.