Skip to content

Commit

Permalink
Merge branch 'main' into bkchr-try-stable-compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr authored Feb 10, 2025
2 parents e510dea + f947ebf commit f8b6872
Show file tree
Hide file tree
Showing 27 changed files with 252 additions and 135 deletions.
95 changes: 94 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Test all features"
name: "Tests"

# If you modify more test jobs, ensure that you add them as required to the job "confirmTestPassed"
# which is located at the end of this file (more info in the job)
Expand Down Expand Up @@ -228,6 +228,98 @@ jobs:
export PATH=$(pwd)/target/release:$PATH
cargo test --manifest-path integration-tests/zombienet/Cargo.toml
build-runtimes:
needs: [ runtime-matrix ]
runs-on: ubuntu-latest
strategy:
# Ensure the other jobs are continue
fail-fast: false
matrix:
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }}
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Set rust version via common env file
run: cat .github/env >> $GITHUB_ENV

- name: Install stable toolchain
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@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
with:
shared-key: "fellowship-cache-build-runtimes-test"
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: Build runtime ${{ matrix.runtime.name }}
run: |
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
# Build wasm
echo "Building wasm RUNTIME_BLOB_PATH=$RUNTIME_BLOB_PATH"
# Find out if the `metadata-hash` feature exists for the given package.
if cargo metadata --format-version=1 | jq '.packages[] | select(.name=="${{ matrix.runtime.package }}") | .features' | grep metadata-hash; then
FEATURES="--features=metadata-hash"
fi
# We only enable `metadata-hash`, but not `on-chain-release-build` to still have logs enabled.
echo "Setting features: ${FEATURES}"
cargo build --profile production -p ${{ matrix.runtime.package }} $FEATURES -q --locked
echo "RUNTIME_BLOB_PATH=$RUNTIME_BLOB_PATH" >> $GITHUB_ENV
- name: Upload ${{ matrix.runtime.name }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.runtime.name }}
path: ${{ env.RUNTIME_BLOB_PATH }}

ecosystem-tests:
needs: [runtime-matrix, build-runtimes]
runs-on: ubuntu-22.04
if: github.event_name == 'pull_request'
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Checkout polkadot-ecosystem-tests
uses: actions/checkout@v4
with:
repository: open-web3-stack/polkadot-ecosystem-tests
path: ecosystem-tests

- name: Download WASM artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true

- name: Setup runtime overrides
run: |
jq --raw-output '.[] | .name, .package' .github/workflows/runtimes-matrix.json | while read -r NAME && read -r PACKAGE; do
NAME="$(echo $NAME | tr -d '-' | tr '[:lower:]' '[:upper:]')"
RUNTIME_BLOB_NAME=$(echo $PACKAGE | sed 's/-/_/g').compact.compressed.wasm
echo "Setting runtime override ${NAME}_WASM=$(pwd)/${RUNTIME_BLOB_NAME}"
# Set the path to the build runtimes
eval "export ${NAME}_WASM=$(pwd)/${RUNTIME_BLOB_NAME}"
done
- name: Installing dependencies of ecosystem tests
working-directory: ./ecosystem-tests
run: yarn install

- name: Running ecosystem tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 60
max_attempts: 3
command: cd ecosystem-tests && yarn test

# 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)
# it will still require all the steps to succeed.
Expand All @@ -241,5 +333,6 @@ jobs:
- integration-test
- build-chain-spec-generator
- zombienet-smoke
- ecosystem-tests
steps:
- run: echo '### Good job! All the tests passed 🚀' >> $GITHUB_STEP_SUMMARY
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog for the runtimes governed by the Polkadot Fellowship.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]
## [1.4.0] 07.02.2025

### Fixed

Expand All @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Coretime chain: allow cross-chain region transfers ([polkadot-fellows/runtimes/pull/483](https://github.com/polkadot-fellows/runtimes/pull/483))
- Unstake the last remaining corrupt ledger ([polkadot-fellows/runtimes/pull/538](https://github.com/polkadot-fellows/runtimes/pull/538))
- Disallow `add_sub` and `set_subs` from `NonTransfer` proxy type in people chain runtimes ([polkadot-fellows/runtimes#518](https://github.com/polkadot-fellows/runtimes/pull/518))
- Added the `XcmRecorder` config item to all runtimes so `local_xcm` can be returned from `DryRunApi` ([polkadot-fellows/runtimes#576](https://github.com/polkadot-fellows/runtimes/pull/576))

### Added

Expand All @@ -33,6 +34,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- 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))
- Update to Polkadot SDK `stable2409-4` ([polkadot-fellows/runtimes#558](https://github.com/polkadot-fellows/runtimes/pull/558))
- Asset Hubs: disable vested transfers as preparation for the Asset Hub Migration ([polkadot-fellows/runtime#579](https://github.com/polkadot-fellows/runtimes/pull/579))

#### From [#490](https://github.com/polkadot-fellows/runtimes/pull/490)

Expand Down
2 changes: 1 addition & 1 deletion relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kusama"),
impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 2,
spec_version: 1_003_003,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 26,
Expand Down
2 changes: 1 addition & 1 deletion relay/kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
type RuntimeCall = RuntimeCall;
type XcmSender = XcmRouter;
type XcmRecorder = ();
type XcmRecorder = XcmPallet;
type AssetTransactor = LocalAssetTransactor;
type OriginConverter = LocalOriginConverter;
type IsReserve = ();
Expand Down
4 changes: 2 additions & 2 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("polkadot"),
impl_name: create_runtime_str!("parity-polkadot"),
authoring_version: 0,
spec_version: 1_003_004,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 26,
Expand Down Expand Up @@ -2017,7 +2017,7 @@ pub mod restore_corrupt_ledger_2 {
impl OnRuntimeUpgrade for Migrate {
fn on_runtime_upgrade() -> frame_election_provider_support::Weight {
// ensure this only runs once, in the 1.4.0 release
if System::last_runtime_upgrade_spec_version() < 1_400_000 {
if System::last_runtime_upgrade_spec_version() < 1_004_000 {
let _ = pallet_staking::Pallet::<Runtime>::force_unstake(
RawOrigin::Root.into(),
CorruptStash::get(),
Expand Down
2 changes: 1 addition & 1 deletion relay/polkadot/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
type RuntimeCall = RuntimeCall;
type XcmSender = XcmRouter;
type XcmRecorder = ();
type XcmRecorder = XcmPallet;
type AssetTransactor = LocalAssetTransactor;
type OriginConverter = LocalOriginConverter;
// Polkadot Relay recognises no chains which act as reserves.
Expand Down
17 changes: 12 additions & 5 deletions system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ use frame_support::{
ord_parameter_types, parameter_types,
traits::{
fungible, fungibles, tokens::imbalance::ResolveAssetTo, AsEnsureOriginWithArg, ConstBool,
ConstU128, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Equals, InstanceFilter,
TransformOrigin, WithdrawReasons,
ConstU128, ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse, Equals, EverythingBut,
InstanceFilter, TransformOrigin, WithdrawReasons,
},
weights::{ConstantMultiplier, Weight, WeightToFee as _},
BoundedVec, PalletId,
Expand Down Expand Up @@ -121,7 +121,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_004,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 15,
Expand All @@ -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_004,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 15,
Expand Down Expand Up @@ -175,9 +175,16 @@ parameter_types! {
pub const SS58Prefix: u8 = 2;
}

pub struct VestedTransferCalls;
impl Contains<RuntimeCall> for VestedTransferCalls {
fn contains(call: &RuntimeCall) -> bool {
matches!(call, RuntimeCall::Vesting(pallet_vesting::Call::vested_transfer { .. }))
}
}

// Configure FRAME pallets to include in runtime.
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BaseCallFilter = EverythingBut<VestedTransferCalls>;
type BlockWeights = RuntimeBlockWeights;
type BlockLength = RuntimeBlockLength;
type AccountId = AccountId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
type RuntimeCall = RuntimeCall;
type XcmSender = XcmRouter;
type XcmRecorder = ();
type XcmRecorder = PolkadotXcm;
type AssetTransactor = AssetTransactors;
type OriginConverter = XcmOriginToTransactDispatchOrigin;
// Asset Hub trusts only particular, pre-configured bridged locations from a different consensus
Expand Down
15 changes: 11 additions & 4 deletions system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ use frame_support::{
parameter_types,
traits::{
fungible, fungibles, tokens::imbalance::ResolveAssetTo, AsEnsureOriginWithArg, ConstBool,
ConstU32, ConstU64, ConstU8, EitherOfDiverse, Equals, InstanceFilter, NeverEnsureOrigin,
TransformOrigin, WithdrawReasons,
ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse, Equals, EverythingBut,
InstanceFilter, NeverEnsureOrigin, TransformOrigin, WithdrawReasons,
},
weights::{ConstantMultiplier, Weight, WeightToFee as _},
PalletId,
Expand Down Expand Up @@ -155,7 +155,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("statemint"),
impl_name: create_runtime_str!("statemint"),
authoring_version: 1,
spec_version: 1_003_004,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 15,
Expand Down Expand Up @@ -193,9 +193,16 @@ parameter_types! {
pub const SS58Prefix: u8 = 0;
}

pub struct VestedTransferCalls;
impl Contains<RuntimeCall> for VestedTransferCalls {
fn contains(call: &RuntimeCall) -> bool {
matches!(call, RuntimeCall::Vesting(pallet_vesting::Call::vested_transfer { .. }))
}
}

// Configure FRAME pallets to include in runtime.
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BaseCallFilter = EverythingBut<VestedTransferCalls>;
type BlockWeights = RuntimeBlockWeights;
type BlockLength = RuntimeBlockLength;
type AccountId = AccountId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
type RuntimeCall = RuntimeCall;
type XcmSender = XcmRouter;
type XcmRecorder = ();
type XcmRecorder = PolkadotXcm;
type AssetTransactor = AssetTransactors;
type OriginConverter = XcmOriginToTransactDispatchOrigin;
// Asset Hub trusts only particular, pre-configured bridged locations from a different consensus
Expand Down
2 changes: 1 addition & 1 deletion system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("bridge-hub-kusama"),
impl_name: create_runtime_str!("bridge-hub-kusama"),
authoring_version: 1,
spec_version: 1_003_003,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("bridge-hub-polkadot"),
impl_name: create_runtime_str!("bridge-hub-polkadot"),
authoring_version: 1,
spec_version: 1_003_003,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("collectives"),
impl_name: create_runtime_str!("collectives"),
authoring_version: 1,
spec_version: 1_003_003,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 7,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
type RuntimeCall = RuntimeCall;
type XcmSender = XcmRouter;
type XcmRecorder = ();
type XcmRecorder = PolkadotXcm;
type AssetTransactor = FungibleTransactor;
type OriginConverter = XcmOriginToTransactDispatchOrigin;
// Collectives does not recognize a reserve location for any asset. Users must teleport DOT
Expand Down
2 changes: 1 addition & 1 deletion system-parachains/coretime/coretime-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("coretime-kusama"),
impl_name: create_runtime_str!("coretime-kusama"),
authoring_version: 1,
spec_version: 1_003_003,
spec_version: 1_004_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
Loading

0 comments on commit f8b6872

Please sign in to comment.