diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 157a98f4ec..3427f2619d 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -23,8 +23,9 @@ jobs: app-id: ${{ secrets.MERGE_APP_ID }} private-key: ${{ secrets.MERGE_APP_KEY }} - name: Set auto merge - uses: paritytech/auto-merge-bot@v1.0.1 + uses: paritytech/auto-merge-bot@v1.1.0 with: GITHUB_TOKEN: ${{ steps.merge_token.outputs.token }} MERGE_METHOD: "SQUASH" ALLOWLIST: ${{ steps.fellows.outputs.github-handles }} + UPDATE_BEFORE_MERGE: true diff --git a/.github/workflows/check-migrations.yml b/.github/workflows/check-migrations.yml index fb433d7257..f2f2d621ee 100644 --- a/.github/workflows/check-migrations.yml +++ b/.github/workflows/check-migrations.yml @@ -60,8 +60,14 @@ jobs: if [[ "${{ matrix.runtime.is_relay }}" == "true" ]]; then EXTRA_FLAGS+="--no-weight-warnings" echo "Disabling weight checks since we are on a relay" + + echo "Disabling try-state checks on the relay" + CHECKS="pre-and-post" else echo "Enabling weight checks since we are not on a relay" + + echo "Enabling try-state checks on the non-relay" + CHECKS="all" fi # Disable the spec version check when we dont want to release. @@ -74,15 +80,17 @@ jobs: fi echo "Flags: $EXTRA_FLAGS" + echo "Checks: $CHECKS" echo "EXTRA_ARGS=$EXTRA_FLAGS" >> $GITHUB_ENV + echo "CHECKS=$CHECKS" >> $GITHUB_ENV - name: Run ${{ matrix.runtime.name }} Runtime Checks - uses: "paritytech/try-runtime-gha@v0.1.0" + uses: "paritytech/try-runtime-gha@v0.2.0" with: runtime-package: ${{ matrix.runtime.package }} node-uri: ${{ matrix.runtime.uri }} - checks: "pre-and-post" + checks: ${{ env.CHECKS }} extra-args: ${{ env.EXTRA_ARGS }} # This will only run if all the tests in its "needs" array passed. diff --git a/CHANGELOG.md b/CHANGELOG.md index 28108324f5..7e90d1c5f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +43,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Pallet-xcm: add new extrinsic for asset transfers using explicit reserve ([SDK v1.11 #3695](https://github.com/paritytech/polkadot-sdk/pull/3695)). - Ranked collective introduce `Add` and `Remove` origins ([SDK v1.8 #3212](https://github.com/paritytech/polkadot-sdk/pull/3212)). - Runtime apis to help with delegate-stake based Nomination Pools ([SDK v1.13 #4537](https://github.com/paritytech/polkadot-sdk/pull/4537)). -- Kusama system chains: enable PoV-reclaim. ### Added @@ -54,6 +53,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Polkadot chains: allow arbitrary XCM execution ([polkadot-fellows/runtimes#345](https://github.com/polkadot-fellows/runtimes/pull/345)). - Bounties: Remove payout delay ([polkadot-fellows/runtimes#386](https://github.com/polkadot-fellows/runtimes/pull/386)). - Polkadot System Chains: Reduce the base transaction fee by half ([polkadot-fellows/runtimes#398](https://github.com/polkadot-fellows/runtimes/pull/398)). +- Asset Hubs: setup auto incremented asset id to 50_000_000 for trust backed assets ([polkadot-fellows/runtimes#414](https://github.com/polkadot-fellows/runtimes/pull/414)). #### From [#322](https://github.com/polkadot-fellows/runtimes/pull/322): diff --git a/Cargo.lock b/Cargo.lock index 8f7b5acd34..1c51abaf9c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -635,7 +635,6 @@ dependencies = [ "cumulus-pallet-xcmp-queue", "cumulus-primitives-aura", "cumulus-primitives-core", - "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-utility", "frame-benchmarking", "frame-executive", @@ -1754,7 +1753,6 @@ dependencies = [ "cumulus-pallet-xcmp-queue", "cumulus-primitives-aura", "cumulus-primitives-core", - "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-utility", "frame-benchmarking", "frame-executive", @@ -2676,7 +2674,6 @@ dependencies = [ "cumulus-pallet-xcmp-queue", "cumulus-primitives-aura", "cumulus-primitives-core", - "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-utility", "frame-benchmarking", "frame-executive", @@ -2785,7 +2782,6 @@ dependencies = [ "cumulus-pallet-xcmp-queue", "cumulus-primitives-aura", "cumulus-primitives-core", - "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-utility", "frame-benchmarking", "frame-executive", @@ -3284,24 +3280,6 @@ dependencies = [ "sp-trie 36.0.0", ] -[[package]] -name = "cumulus-primitives-storage-weight-reclaim" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a82ed8a74984791fb996ddaf89b62fe21aff4aac02597050ac5eed3bc215902" -dependencies = [ - "cumulus-primitives-core", - "cumulus-primitives-proof-size-hostfunction", - "docify", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 38.0.0", - "sp-std", -] - [[package]] name = "cumulus-primitives-utility" version = "0.15.0" @@ -9643,7 +9621,6 @@ dependencies = [ "cumulus-pallet-xcmp-queue", "cumulus-primitives-aura", "cumulus-primitives-core", - "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-utility", "enumflags2", "frame-benchmarking", diff --git a/Cargo.toml b/Cargo.toml index d5b9f64d82..4c67d70987 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,7 +57,6 @@ cumulus-pallet-xcmp-queue = { version = "0.15.0", default-features = false } cumulus-primitives-aura = { version = "0.14.0", default-features = false } cumulus-primitives-core = { version = "0.14.0", default-features = false } cumulus-primitives-utility = { version = "0.15.0", default-features = false } -cumulus-primitives-storage-weight-reclaim = { version = "6.0.0", default-features = false } emulated-integration-tests-common = { version = "11.0.0" } encointer-balances-tx-payment = { version = "~13.1.0", default-features = false } encointer-balances-tx-payment-rpc-runtime-api = { version = "~13.1.0", default-features = false } diff --git a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml index 341f0cbc86..510662d905 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml @@ -93,7 +93,6 @@ cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { features = ["bridging"], workspace = true } cumulus-primitives-aura = { workspace = true } cumulus-primitives-core = { workspace = true } -cumulus-primitives-storage-weight-reclaim = { workspace = true } cumulus-primitives-utility = { workspace = true } pallet-collator-selection = { workspace = true } parachain-info = { workspace = true } @@ -211,7 +210,6 @@ std = [ "cumulus-pallet-xcmp-queue/std", "cumulus-primitives-aura/std", "cumulus-primitives-core/std", - "cumulus-primitives-storage-weight-reclaim/std", "cumulus-primitives-utility/std", "frame-benchmarking?/std", "frame-executive/std", 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 3ec1be3037..48ee7c5d85 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs @@ -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, EnsureOrigin, EnsureOriginWithArg, - Equals, InstanceFilter, TransformOrigin, WithdrawReasons, + ConstU128, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Equals, InstanceFilter, + TransformOrigin, WithdrawReasons, }, weights::{ConstantMultiplier, Weight, WeightToFee as _}, BoundedVec, PalletId, @@ -297,27 +297,6 @@ parameter_types! { /// We allow root to execute privileged asset operations. pub type AssetsForceOrigin = EnsureRoot; -/// Ensure that the proposed asset id is less than `50_000_000` and origin is signed. -pub struct EnsureLessThanAutoIncrement; -impl EnsureOriginWithArg - for EnsureLessThanAutoIncrement -{ - type Success = AccountId; - fn try_origin( - o: RuntimeOrigin, - a: &AssetIdForTrustBackedAssets, - ) -> Result { - if *a >= 50_000_000 { - return Err(o); - } - as EnsureOrigin>::try_origin(o) - } - #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin(_a: &AssetIdForTrustBackedAssets) -> Result { - as EnsureOrigin>::try_successful_origin() - } -} - // Called "Trust Backed" assets because these are generally registered by some account, and users of // the asset assume it has some claimed backing. The pallet is called `Assets` in // `construct_runtime` to avoid breaking changes on storage reads. @@ -329,7 +308,7 @@ impl pallet_assets::Config for Runtime { type AssetId = AssetIdForTrustBackedAssets; type AssetIdParameter = codec::Compact; type Currency = Balances; - type CreateOrigin = EnsureLessThanAutoIncrement; + type CreateOrigin = AsEnsureOriginWithArg>; type ForceOrigin = AssetsForceOrigin; type AssetDeposit = AssetDeposit; type MetadataDepositBase = MetadataDepositBase; @@ -339,7 +318,7 @@ impl pallet_assets::Config for Runtime { type Freezer = (); type Extra = (); type WeightInfo = weights::pallet_assets_local::WeightInfo; - type CallbackHandle = (); + type CallbackHandle = pallet_assets::AutoIncAssetId; type AssetAccountDeposit = AssetAccountDeposit; type RemoveItemsLimit = frame_support::traits::ConstU32<1000>; #[cfg(feature = "runtime-benchmarks")] @@ -1065,7 +1044,6 @@ pub type SignedExtra = ( frame_system::CheckWeight, pallet_asset_conversion_tx_payment::ChargeAssetTxPayment, frame_metadata_hash_extension::CheckMetadataHash, - cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim, ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = @@ -1080,6 +1058,11 @@ pub type Migrations = ( frame_support::migrations::RemovePallet, pallet_collator_selection::migration::v2::MigrationToV2, cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5, + pallet_assets::migration::next_asset_id::SetNextAssetId< + ConstU32<50_000_000>, + Runtime, + TrustBackedAssetsInstance, + >, // permanent pallet_xcm::migration::MigrateToLatestXcmVersion, ); diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs index 0047954b40..cc54fa8be0 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs @@ -100,8 +100,8 @@ use frame_support::{ parameter_types, traits::{ fungible, fungibles, tokens::imbalance::ResolveAssetTo, AsEnsureOriginWithArg, ConstBool, - ConstU32, ConstU64, ConstU8, EitherOfDiverse, EnsureOrigin, EnsureOriginWithArg, Equals, - InstanceFilter, NeverEnsureOrigin, TransformOrigin, WithdrawReasons, + ConstU32, ConstU64, ConstU8, EitherOfDiverse, Equals, InstanceFilter, NeverEnsureOrigin, + TransformOrigin, WithdrawReasons, }, weights::{ConstantMultiplier, Weight, WeightToFee as _}, PalletId, @@ -315,27 +315,6 @@ parameter_types! { /// We allow root to execute privileged asset operations. pub type AssetsForceOrigin = EnsureRoot; -/// Ensure that the proposed asset id is less than `50_000_000` and origin is signed. -pub struct EnsureLessThanAutoIncrement; -impl EnsureOriginWithArg - for EnsureLessThanAutoIncrement -{ - type Success = AccountId; - fn try_origin( - o: RuntimeOrigin, - a: &AssetIdForTrustBackedAssets, - ) -> Result { - if *a >= 50_000_000 { - return Err(o); - } - as EnsureOrigin>::try_origin(o) - } - #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin(_a: &AssetIdForTrustBackedAssets) -> Result { - as EnsureOrigin>::try_successful_origin() - } -} - // Called "Trust Backed" assets because these are generally registered by some account, and users of // the asset assume it has some claimed backing. The pallet is called `Assets` in // `construct_runtime` to avoid breaking changes on storage reads. @@ -347,7 +326,7 @@ impl pallet_assets::Config for Runtime { type AssetId = AssetIdForTrustBackedAssets; type AssetIdParameter = codec::Compact; type Currency = Balances; - type CreateOrigin = EnsureLessThanAutoIncrement; + type CreateOrigin = AsEnsureOriginWithArg>; type ForceOrigin = AssetsForceOrigin; type AssetDeposit = AssetDeposit; type MetadataDepositBase = MetadataDepositBase; @@ -357,7 +336,7 @@ impl pallet_assets::Config for Runtime { type Freezer = (); type Extra = (); type WeightInfo = weights::pallet_assets_local::WeightInfo; - type CallbackHandle = (); + type CallbackHandle = pallet_assets::AutoIncAssetId; type AssetAccountDeposit = AssetAccountDeposit; type RemoveItemsLimit = frame_support::traits::ConstU32<1000>; #[cfg(feature = "runtime-benchmarks")] @@ -1061,6 +1040,11 @@ pub type Migrations = ( cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4, pallet_collator_selection::migration::v2::MigrationToV2, cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5, + pallet_assets::migration::next_asset_id::SetNextAssetId< + ConstU32<50_000_000>, + Runtime, + TrustBackedAssetsInstance, + >, // permanent pallet_xcm::migration::MigrateToLatestXcmVersion, ); diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml index 14ae435720..c5fd0a09e2 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -82,7 +82,6 @@ cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { features = ["bridging"], workspace = true } cumulus-primitives-aura = { workspace = true } cumulus-primitives-core = { workspace = true } -cumulus-primitives-storage-weight-reclaim = { workspace = true } cumulus-primitives-utility = { workspace = true } pallet-collator-selection = { workspace = true } parachain-info = { workspace = true } @@ -154,7 +153,6 @@ std = [ "cumulus-pallet-xcmp-queue/std", "cumulus-primitives-aura/std", "cumulus-primitives-core/std", - "cumulus-primitives-storage-weight-reclaim/std", "cumulus-primitives-utility/std", "frame-benchmarking?/std", "frame-executive/std", diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs index e223cabceb..77370cf3c5 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -123,7 +123,6 @@ pub type SignedExtra = ( BridgeRejectObsoleteHeadersAndMessages, bridge_to_polkadot_config::RefundBridgeHubPolkadotMessages, frame_metadata_hash_extension::CheckMetadataHash, - cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim, ); bridge_runtime_common::generate_bridge_reject_obsolete_headers_and_messages! { diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs index 20b3b28dbd..cd2db38318 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs @@ -256,7 +256,6 @@ fn construct_extrinsic( BridgeRejectObsoleteHeadersAndMessages, (RefundBridgeHubPolkadotMessages::default()), frame_metadata_hash_extension::CheckMetadataHash::::new(false), - cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim::::new(), ); let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap(); let signature = payload.using_encoded(|e| sender.sign(e)); diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs index 5aaabf4380..805f8cb051 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs @@ -83,7 +83,6 @@ fn construct_extrinsic( BridgeRejectObsoleteHeadersAndMessages, (RefundBridgeHubPolkadotMessages::default()), frame_metadata_hash_extension::CheckMetadataHash::::new(false), - cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim::::new(), ); let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap(); let signature = payload.using_encoded(|e| sender.sign(e)); diff --git a/system-parachains/coretime/coretime-kusama/Cargo.toml b/system-parachains/coretime/coretime-kusama/Cargo.toml index 9214f46600..618dbf9276 100644 --- a/system-parachains/coretime/coretime-kusama/Cargo.toml +++ b/system-parachains/coretime/coretime-kusama/Cargo.toml @@ -74,7 +74,6 @@ cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { workspace = true } cumulus-primitives-aura = { workspace = true } cumulus-primitives-core = { workspace = true } -cumulus-primitives-storage-weight-reclaim = { workspace = true } cumulus-primitives-utility = { workspace = true } pallet-collator-selection = { workspace = true } parachain-info = { workspace = true } @@ -97,7 +96,6 @@ std = [ "cumulus-pallet-xcmp-queue/std", "cumulus-primitives-aura/std", "cumulus-primitives-core/std", - "cumulus-primitives-storage-weight-reclaim/std", "cumulus-primitives-utility/std", "frame-benchmarking?/std", "frame-executive/std", diff --git a/system-parachains/coretime/coretime-kusama/src/lib.rs b/system-parachains/coretime/coretime-kusama/src/lib.rs index 9354b1c52d..95324c4ce3 100644 --- a/system-parachains/coretime/coretime-kusama/src/lib.rs +++ b/system-parachains/coretime/coretime-kusama/src/lib.rs @@ -107,7 +107,6 @@ pub type SignedExtra = ( frame_system::CheckWeight, pallet_transaction_payment::ChargeTransactionPayment, frame_metadata_hash_extension::CheckMetadataHash, - cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim, ); /// Unchecked extrinsic type as expected by this runtime. diff --git a/system-parachains/coretime/coretime-polkadot/Cargo.toml b/system-parachains/coretime/coretime-polkadot/Cargo.toml index 24739058a3..e1a786d326 100644 --- a/system-parachains/coretime/coretime-polkadot/Cargo.toml +++ b/system-parachains/coretime/coretime-polkadot/Cargo.toml @@ -74,7 +74,6 @@ cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { workspace = true } cumulus-primitives-aura = { workspace = true } cumulus-primitives-core = { workspace = true } -cumulus-primitives-storage-weight-reclaim = { workspace = true } cumulus-primitives-utility = { workspace = true } pallet-collator-selection = { workspace = true } parachain-info = { workspace = true } @@ -97,7 +96,6 @@ std = [ "cumulus-pallet-xcmp-queue/std", "cumulus-primitives-aura/std", "cumulus-primitives-core/std", - "cumulus-primitives-storage-weight-reclaim/std", "cumulus-primitives-utility/std", "frame-benchmarking?/std", "frame-executive/std", diff --git a/system-parachains/coretime/coretime-polkadot/src/lib.rs b/system-parachains/coretime/coretime-polkadot/src/lib.rs index 7e524b5eee..8404f7a2ea 100644 --- a/system-parachains/coretime/coretime-polkadot/src/lib.rs +++ b/system-parachains/coretime/coretime-polkadot/src/lib.rs @@ -114,7 +114,10 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Migrations to apply on runtime upgrade. -pub type Migrations = (pallet_xcm::migration::MigrateToLatestXcmVersion,); +pub type Migrations = ( + // permanent + pallet_xcm::migration::MigrateToLatestXcmVersion, +); /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< diff --git a/system-parachains/people/people-kusama/Cargo.toml b/system-parachains/people/people-kusama/Cargo.toml index 63cd39ec49..71fb788fea 100644 --- a/system-parachains/people/people-kusama/Cargo.toml +++ b/system-parachains/people/people-kusama/Cargo.toml @@ -72,7 +72,6 @@ cumulus-pallet-session-benchmarking = { workspace = true } cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { workspace = true } cumulus-primitives-core = { workspace = true } -cumulus-primitives-storage-weight-reclaim = { workspace = true } cumulus-primitives-utility = { workspace = true } pallet-collator-selection = { workspace = true } parachain-info = { workspace = true } @@ -93,7 +92,6 @@ std = [ "cumulus-pallet-xcmp-queue/std", "cumulus-primitives-aura/std", "cumulus-primitives-core/std", - "cumulus-primitives-storage-weight-reclaim/std", "cumulus-primitives-utility/std", "enumflags2/std", "frame-benchmarking?/std", diff --git a/system-parachains/people/people-kusama/src/lib.rs b/system-parachains/people/people-kusama/src/lib.rs index c28b249965..f0b9bf90f3 100644 --- a/system-parachains/people/people-kusama/src/lib.rs +++ b/system-parachains/people/people-kusama/src/lib.rs @@ -144,7 +144,6 @@ pub type SignedExtra = ( frame_system::CheckWeight, pallet_transaction_payment::ChargeTransactionPayment, frame_metadata_hash_extension::CheckMetadataHash, - cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim, ); /// Unchecked extrinsic type as expected by this runtime.