From 8970c3357b5051ee113336e11fac3c4745fe39aa Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 22 Nov 2023 12:43:10 +0100 Subject: [PATCH] enable treasury spend for polkadot and kusama --- CHANGELOG.md | 1 + Cargo.lock | 2 + relay/kusama/Cargo.toml | 4 + relay/kusama/src/lib.rs | 47 ++++------ relay/kusama/src/weights/mod.rs | 1 + relay/kusama/src/weights/pallet_asset_rate.rs | 86 +++++++++++++++++++ relay/polkadot/Cargo.toml | 6 +- relay/polkadot/src/lib.rs | 47 ++++------ relay/polkadot/src/weights/mod.rs | 1 + .../polkadot/src/weights/pallet_asset_rate.rs | 86 +++++++++++++++++++ .../asset-hub-kusama/src/xcm_config.rs | 8 +- .../asset-hub-polkadot/src/xcm_config.rs | 7 +- .../gluttons/glutton-kusama/Cargo.toml | 1 + 13 files changed, 236 insertions(+), 61 deletions(-) create mode 100644 relay/kusama/src/weights/pallet_asset_rate.rs create mode 100644 relay/polkadot/src/weights/pallet_asset_rate.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 51d5e2eaf9..1cc5e61197 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Implemented GenesisBuilder API for all runtimes ([polkadot-fellows/runtimes#87](https://github.com/polkadot-fellows/runtimes/pull/87)). Context: https://github.com/paritytech/polkadot-sdk/pull/1492 - XCM transport fees are now exponential and are sent to a treasury account ([polkadot-fellows/runtimes#87](https://github.com/polkadot-fellows/runtimes/pull/87)). Context: https://github.com/paritytech/polkadot-sdk/pull/1234 - System parachains are now trusted teleporters of each other ([polkadot-fellows/runtimes#87](https://github.com/polkadot-fellows/runtimes/pull/87)). Context: https://github.com/paritytech/polkadot-sdk/pull/1368 +- Treasury spends various asset kinds ([polkadot-fellows/runtimes#87](https://github.com/polkadot-fellows/runtimes/pull/87)) ### Fixed diff --git a/Cargo.lock b/Cargo.lock index 0031c204c9..e3e9eb7890 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8092,6 +8092,7 @@ dependencies = [ "frame-try-runtime", "hex-literal", "log", + "pallet-asset-rate", "pallet-authority-discovery", "pallet-authorship", "pallet-babe", @@ -11438,6 +11439,7 @@ dependencies = [ "hex-literal", "kusama-runtime-constants", "log", + "pallet-asset-rate", "pallet-authority-discovery", "pallet-authorship", "pallet-babe", diff --git a/relay/kusama/Cargo.toml b/relay/kusama/Cargo.toml index 34fa35d815..9c1c0f7af0 100644 --- a/relay/kusama/Cargo.toml +++ b/relay/kusama/Cargo.toml @@ -43,6 +43,7 @@ tx-pool-api = { package = "sp-transaction-pool", default-features = false , vers block-builder-api = { package = "sp-block-builder", default-features = false , version = "23.0.0" } sp-npos-elections = { default-features = false , version = "23.0.0" } +pallet-asset-rate = { default-features = false , version = "4.0.0" } pallet-authority-discovery = { default-features = false , version = "25.0.0" } pallet-authorship = { default-features = false , version = "25.0.0" } pallet-babe = { default-features = false , version = "25.0.0" } @@ -150,6 +151,7 @@ std = [ "kusama-runtime-constants/std", "log/std", "offchain-primitives/std", + "pallet-asset-rate/std", "pallet-authority-discovery/std", "pallet-authorship/std", "pallet-babe/std", @@ -236,6 +238,7 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", + "pallet-asset-rate/runtime-benchmarks", "pallet-babe/runtime-benchmarks", "pallet-bags-list/runtime-benchmarks", "pallet-balances/runtime-benchmarks", @@ -294,6 +297,7 @@ try-runtime = [ "frame-system/try-runtime", "frame-try-runtime", "frame-try-runtime/try-runtime", + "pallet-asset-rate/try-runtime", "pallet-authority-discovery/try-runtime", "pallet-authorship/try-runtime", "pallet-babe/try-runtime", diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index 57b979ef7f..838ceab802 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -87,7 +87,7 @@ use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{ AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, Extrinsic as ExtrinsicT, - Keccak256, OpaqueKeys, SaturatedConversion, Verify, + IdentityLookup, Keccak256, OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, RuntimeDebug, @@ -763,28 +763,6 @@ parameter_types! { pub const MaxPeerInHeartbeats: u32 = 10_000; } -#[cfg(not(feature = "runtime-benchmarks"))] -mod disable_new_treasury_functionality { - use super::*; - - /// Temporary workaround that disables new functionality from - /// https://github.com/paritytech/polkadot-sdk/pull/1333 - pub struct NeverLookup; - - impl sp_runtime::traits::StaticLookup for NeverLookup { - type Source = VersionedMultiLocation; - type Target = VersionedMultiLocation; - - fn lookup(_s: Self::Source) -> Result { - Err(frame_support::error::LookupError) - } - - fn unlookup(t: Self::Target) -> Self::Source { - t - } - } -} - impl pallet_treasury::Config for Runtime { type PalletId = TreasuryPalletId; type Currency = Balances; @@ -804,10 +782,7 @@ impl pallet_treasury::Config for Runtime { type SpendOrigin = TreasurySpender; type AssetKind = VersionedLocatableAsset; type Beneficiary = VersionedMultiLocation; - #[cfg(not(feature = "runtime-benchmarks"))] - type BeneficiaryLookup = disable_new_treasury_functionality::NeverLookup; - #[cfg(feature = "runtime-benchmarks")] - type BeneficiaryLookup = sp_runtime::traits::IdentityLookup; + type BeneficiaryLookup = IdentityLookup; type Paymaster = PayOverXcm< TreasuryInteriorLocation, crate::xcm_config::XcmRouter, @@ -818,7 +793,7 @@ impl pallet_treasury::Config for Runtime { LocatableAssetConverter, VersionedMultiLocationConverter, >; - type BalanceConverter = frame_support::traits::tokens::UnityAssetBalanceConversion; + type BalanceConverter = AssetRate; type PayoutPeriod = PayoutSpendPeriod; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = runtime_common::impls::benchmarks::TreasuryArguments; @@ -1553,6 +1528,18 @@ impl pallet_state_trie_migration::Config for Runtime { type MaxKeyLen = MigrationMaxKeyLen; } +impl pallet_asset_rate::Config for Runtime { + type WeightInfo = weights::pallet_asset_rate::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type CreateOrigin = EitherOfDiverse, Treasurer>; + type RemoveOrigin = EitherOfDiverse, Treasurer>; + type UpdateOrigin = EitherOfDiverse, Treasurer>; + type Currency = Balances; + type AssetKind = ::AssetKind; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = runtime_common::impls::benchmarks::AssetRateArguments; +} + construct_runtime! { pub enum Runtime { @@ -1683,6 +1670,9 @@ construct_runtime! { // Generalized message queue MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 100, + + // Asset rate. + AssetRate: pallet_asset_rate::{Pallet, Call, Storage, Event} = 101, } } @@ -1901,6 +1891,7 @@ mod benches { [pallet_utility, Utility] [pallet_vesting, Vesting] [pallet_whitelist, Whitelist] + [pallet_asset_rate, AssetRate] // XCM [pallet_xcm, XcmPallet] [pallet_xcm_benchmarks::fungible, pallet_xcm_benchmarks::fungible::Pallet::] diff --git a/relay/kusama/src/weights/mod.rs b/relay/kusama/src/weights/mod.rs index b3642d49d4..7c935b73e0 100644 --- a/relay/kusama/src/weights/mod.rs +++ b/relay/kusama/src/weights/mod.rs @@ -17,6 +17,7 @@ pub mod frame_election_provider_support; pub mod frame_system; +pub mod pallet_asset_rate; pub mod pallet_bags_list; pub mod pallet_balances; pub mod pallet_balances_nis_counterpart_balances; diff --git a/relay/kusama/src/weights/pallet_asset_rate.rs b/relay/kusama/src/weights/pallet_asset_rate.rs new file mode 100644 index 0000000000..e6fbff6374 --- /dev/null +++ b/relay/kusama/src/weights/pallet_asset_rate.rs @@ -0,0 +1,86 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! Autogenerated weights for `pallet_asset_rate` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-03, STEPS: `50`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `cob`, CPU: `` +//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/debug/polkadot +// benchmark +// pallet +// --chain=kusama-dev +// --steps=50 +// --repeat=2 +// --pallet=pallet_asset_rate +// --extrinsic=* +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/kusama/src/weights/ +// --header=./file_header.txt + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_asset_rate`. +pub struct WeightInfo(PhantomData); +impl pallet_asset_rate::WeightInfo for WeightInfo { + /// Storage: AssetRate ConversionRateToNative (r:1 w:1) + /// Proof: AssetRate ConversionRateToNative (max_values: None, max_size: Some(1237), added: 3712, mode: MaxEncodedLen) + fn create() -> Weight { + // Proof Size summary in bytes: + // Measured: `42` + // Estimated: `4702` + // Minimum execution time: 53_000_000 picoseconds. + Weight::from_parts(55_000_000, 0) + .saturating_add(Weight::from_parts(0, 4702)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: AssetRate ConversionRateToNative (r:1 w:1) + /// Proof: AssetRate ConversionRateToNative (max_values: None, max_size: Some(1237), added: 3712, mode: MaxEncodedLen) + fn update() -> Weight { + // Proof Size summary in bytes: + // Measured: `110` + // Estimated: `4702` + // Minimum execution time: 60_000_000 picoseconds. + Weight::from_parts(60_000_000, 0) + .saturating_add(Weight::from_parts(0, 4702)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: AssetRate ConversionRateToNative (r:1 w:1) + /// Proof: AssetRate ConversionRateToNative (max_values: None, max_size: Some(1237), added: 3712, mode: MaxEncodedLen) + fn remove() -> Weight { + // Proof Size summary in bytes: + // Measured: `110` + // Estimated: `4702` + // Minimum execution time: 66_000_000 picoseconds. + Weight::from_parts(74_000_000, 0) + .saturating_add(Weight::from_parts(0, 4702)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/relay/polkadot/Cargo.toml b/relay/polkadot/Cargo.toml index a2ab9af018..0208c50c83 100644 --- a/relay/polkadot/Cargo.toml +++ b/relay/polkadot/Cargo.toml @@ -39,6 +39,7 @@ sp-storage = { default-features = false , version = "17.0.0" } sp-version = { default-features = false , version = "26.0.0" } sp-npos-elections = { default-features = false , version = "23.0.0" } +pallet-asset-rate = { default-features = false , version = "4.0.0" } pallet-authority-discovery = { default-features = false , version = "25.0.0" } pallet-authorship = { default-features = false , version = "25.0.0" } pallet-babe = { default-features = false , version = "25.0.0" } @@ -140,6 +141,7 @@ std = [ "inherents/std", "log/std", "offchain-primitives/std", + "pallet-asset-rate/std", "pallet-authority-discovery/std", "pallet-authorship/std", "pallet-babe/std", @@ -172,8 +174,8 @@ std = [ "pallet-scheduler/std", "pallet-session-benchmarking?/std", "pallet-session/std", - "pallet-staking-runtime-api/std", "pallet-staking-reward-fn/std", + "pallet-staking-runtime-api/std", "pallet-staking/std", "pallet-timestamp/std", "pallet-tips/std", @@ -220,6 +222,7 @@ runtime-benchmarks = [ "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "hex-literal", + "pallet-asset-rate/runtime-benchmarks", "pallet-babe/runtime-benchmarks", "pallet-bags-list/runtime-benchmarks", "pallet-balances/runtime-benchmarks", @@ -272,6 +275,7 @@ try-runtime = [ "frame-system/try-runtime", "frame-try-runtime", "frame-try-runtime/try-runtime", + "pallet-asset-rate/try-runtime", "pallet-authority-discovery/try-runtime", "pallet-authorship/try-runtime", "pallet-babe/try-runtime", diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs index 42671dced5..cb7b1565c6 100644 --- a/relay/polkadot/src/lib.rs +++ b/relay/polkadot/src/lib.rs @@ -84,7 +84,7 @@ use sp_runtime::{ generic, impl_opaque_keys, traits::{ AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, Extrinsic as ExtrinsicT, - OpaqueKeys, SaturatedConversion, Verify, + IdentityLookup, OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, RuntimeDebug, @@ -728,28 +728,6 @@ parameter_types! { pub const CouncilSpendOriginMaxAmount: Balance = Balance::MAX; } -#[cfg(not(feature = "runtime-benchmarks"))] -mod disable_new_treasury_functionality { - use super::*; - - /// Temporary workaround that disables new functionality from - /// https://github.com/paritytech/polkadot-sdk/pull/1333 - pub struct NeverLookup; - - impl sp_runtime::traits::StaticLookup for NeverLookup { - type Source = VersionedMultiLocation; - type Target = VersionedMultiLocation; - - fn lookup(_s: Self::Source) -> Result { - Err(frame_support::error::LookupError) - } - - fn unlookup(t: Self::Target) -> Self::Source { - t - } - } -} - impl pallet_treasury::Config for Runtime { type PalletId = TreasuryPalletId; type Currency = Balances; @@ -769,10 +747,7 @@ impl pallet_treasury::Config for Runtime { type SpendOrigin = TreasurySpender; type AssetKind = VersionedLocatableAsset; type Beneficiary = VersionedMultiLocation; - #[cfg(not(feature = "runtime-benchmarks"))] - type BeneficiaryLookup = disable_new_treasury_functionality::NeverLookup; - #[cfg(feature = "runtime-benchmarks")] - type BeneficiaryLookup = sp_runtime::traits::IdentityLookup; + type BeneficiaryLookup = IdentityLookup; type Paymaster = PayOverXcm< TreasuryInteriorLocation, crate::xcm_config::XcmRouter, @@ -783,7 +758,7 @@ impl pallet_treasury::Config for Runtime { LocatableAssetConverter, VersionedMultiLocationConverter, >; - type BalanceConverter = frame_support::traits::tokens::UnityAssetBalanceConversion; + type BalanceConverter = AssetRate; type PayoutPeriod = PayoutSpendPeriod; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = runtime_common::impls::benchmarks::TreasuryArguments; @@ -1438,6 +1413,18 @@ impl frame_support::traits::OnRuntimeUpgrade for InitiateNominationPools { } } +impl pallet_asset_rate::Config for Runtime { + type WeightInfo = weights::pallet_asset_rate::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type CreateOrigin = EitherOfDiverse, Treasurer>; + type RemoveOrigin = EitherOfDiverse, Treasurer>; + type UpdateOrigin = EitherOfDiverse, Treasurer>; + type Currency = Balances; + type AssetKind = ::AssetKind; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = runtime_common::impls::benchmarks::AssetRateArguments; +} + construct_runtime! { pub enum Runtime { @@ -1533,6 +1520,9 @@ construct_runtime! { // Generalized message queue MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 100, + + // Asset rate. + AssetRate: pallet_asset_rate::{Pallet, Call, Storage, Event} = 101, } } @@ -1728,6 +1718,7 @@ mod benches { [pallet_conviction_voting, ConvictionVoting] [pallet_referenda, Referenda] [pallet_whitelist, Whitelist] + [pallet_asset_rate, AssetRate] // XCM [pallet_xcm, XcmPallet] [pallet_xcm_benchmarks::fungible, pallet_xcm_benchmarks::fungible::Pallet::] diff --git a/relay/polkadot/src/weights/mod.rs b/relay/polkadot/src/weights/mod.rs index 596b594c93..7eca87034b 100644 --- a/relay/polkadot/src/weights/mod.rs +++ b/relay/polkadot/src/weights/mod.rs @@ -17,6 +17,7 @@ pub mod frame_election_provider_support; pub mod frame_system; +pub mod pallet_asset_rate; pub mod pallet_bags_list; pub mod pallet_balances; pub mod pallet_bounties; diff --git a/relay/polkadot/src/weights/pallet_asset_rate.rs b/relay/polkadot/src/weights/pallet_asset_rate.rs new file mode 100644 index 0000000000..e6fbff6374 --- /dev/null +++ b/relay/polkadot/src/weights/pallet_asset_rate.rs @@ -0,0 +1,86 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! Autogenerated weights for `pallet_asset_rate` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-03, STEPS: `50`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `cob`, CPU: `` +//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/debug/polkadot +// benchmark +// pallet +// --chain=kusama-dev +// --steps=50 +// --repeat=2 +// --pallet=pallet_asset_rate +// --extrinsic=* +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/kusama/src/weights/ +// --header=./file_header.txt + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_asset_rate`. +pub struct WeightInfo(PhantomData); +impl pallet_asset_rate::WeightInfo for WeightInfo { + /// Storage: AssetRate ConversionRateToNative (r:1 w:1) + /// Proof: AssetRate ConversionRateToNative (max_values: None, max_size: Some(1237), added: 3712, mode: MaxEncodedLen) + fn create() -> Weight { + // Proof Size summary in bytes: + // Measured: `42` + // Estimated: `4702` + // Minimum execution time: 53_000_000 picoseconds. + Weight::from_parts(55_000_000, 0) + .saturating_add(Weight::from_parts(0, 4702)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: AssetRate ConversionRateToNative (r:1 w:1) + /// Proof: AssetRate ConversionRateToNative (max_values: None, max_size: Some(1237), added: 3712, mode: MaxEncodedLen) + fn update() -> Weight { + // Proof Size summary in bytes: + // Measured: `110` + // Estimated: `4702` + // Minimum execution time: 60_000_000 picoseconds. + Weight::from_parts(60_000_000, 0) + .saturating_add(Weight::from_parts(0, 4702)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: AssetRate ConversionRateToNative (r:1 w:1) + /// Proof: AssetRate ConversionRateToNative (max_values: None, max_size: Some(1237), added: 3712, mode: MaxEncodedLen) + fn remove() -> Weight { + // Proof Size summary in bytes: + // Measured: `110` + // Estimated: `4702` + // Minimum execution time: 66_000_000 picoseconds. + Weight::from_parts(74_000_000, 0) + .saturating_add(Weight::from_parts(0, 4702)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs index 8342c428e2..ce60d1b3d4 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs @@ -239,6 +239,9 @@ match_types! { MultiLocation { parents: 1, interior: Here } | MultiLocation { parents: 1, interior: X1(_) } }; + pub type TreasuryPallet: impl Contains = { + MultiLocation { parents: 1, interior: X1(PalletInstance(kusama_runtime_constants::TREASURY_PALLET_ID)) } + }; } /// A call filter for the XCM Transact instruction. This is a temporary measure until we properly @@ -460,8 +463,9 @@ pub type Barrier = TrailingSetTopicAsId< // If the message is one that immediately attemps to pay for execution, then // allow it. AllowTopLevelPaidExecutionFrom, - // Parent and its pluralities (i.e. governance bodies) get free execution. - AllowExplicitUnpaidExecutionFrom, + // Parent, its pluralities (i.e. governance bodies) and parent's treasury + // pallet get free execution. + AllowExplicitUnpaidExecutionFrom<(ParentOrParentsPlurality, TreasuryPallet)>, // Subscriptions for version tracking are OK. AllowSubscriptionsFrom, ), diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs index e377c24702..6b0a535b54 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs @@ -195,6 +195,9 @@ match_types! { pub type FellowshipSalaryPallet: impl Contains = { MultiLocation { parents: 1, interior: X2(Parachain(1001), PalletInstance(64)) } }; + pub type TreasuryPallet: impl Contains = { + MultiLocation { parents: 1, interior: X1(PalletInstance(polkadot_runtime_constants::TREASURY_PALLET_ID)) } + }; } /// A call filter for the XCM Transact instruction. This is a temporary measure until we properly @@ -375,12 +378,12 @@ pub type Barrier = TrailingSetTopicAsId< // If the message is one that immediately attemps to pay for execution, then // allow it. AllowTopLevelPaidExecutionFrom, - // Parent, its pluralities (i.e. governance bodies), and the Fellows plurality - // get free execution. + // The locations listed below get free execution. AllowExplicitUnpaidExecutionFrom<( ParentOrParentsPlurality, FellowsPlurality, FellowshipSalaryPallet, + TreasuryPallet, )>, // Subscriptions for version tracking are OK. AllowSubscriptionsFrom, diff --git a/system-parachains/gluttons/glutton-kusama/Cargo.toml b/system-parachains/gluttons/glutton-kusama/Cargo.toml index 95adc050a6..f86a9159d1 100644 --- a/system-parachains/gluttons/glutton-kusama/Cargo.toml +++ b/system-parachains/gluttons/glutton-kusama/Cargo.toml @@ -60,6 +60,7 @@ runtime-benchmarks = [ "frame-system/runtime-benchmarks", "pallet-glutton/runtime-benchmarks", "pallet-sudo?/runtime-benchmarks", + "parachains-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks",