Upgrade generic-template to polkadot-stable2503 (#414)

* init

* upgrade tanssi deps used in generic template moonkit and dancekit

* upgrade orml to 2503

* upgrade moonbeam to 2503

* upgrade abstractions to 2503

* DecodeWithMemTracking to fix 15 of 44 errors for runtime compilation

* toml sort

* use str array instead of raw strings for gov track names

* fix weight info implementations abstractions require more updates

* more fixes still wip

* fix imports

* generic runtime compiles

* update node network starter to match latest changes in polkadot sdk

* toml sort generic cargo toml

* update generic xcm mocks

* update fuzzer

* fix import still debugging async backing compilation errors

* fix clippy errors by using tx extensions to replace signed extra

* toml sort

* accept clippy suggestion
This commit is contained in:
Amar Singh
2025-06-27 10:08:20 -04:00
committed by GitHub
parent 987536368c
commit 93d31c3ed5
23 changed files with 3474 additions and 3180 deletions
+2 -2
View File
@@ -79,11 +79,11 @@ xcm-executor = { workspace = true }
assets-common = { workspace = true }
cumulus-pallet-parachain-system = { workspace = true }
cumulus-pallet-session-benchmarking = { workspace = true }
cumulus-pallet-weight-reclaim = { workspace = true }
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-timestamp = { workspace = true }
cumulus-primitives-utility = { workspace = true }
parachain-info = { workspace = true }
@@ -122,11 +122,11 @@ std = [
"cumulus-pallet-aura-ext/std",
"cumulus-pallet-parachain-system/std",
"cumulus-pallet-session-benchmarking/std",
"cumulus-pallet-weight-reclaim/std",
"cumulus-pallet-xcm/std",
"cumulus-pallet-xcmp-queue/std",
"cumulus-primitives-aura/std",
"cumulus-primitives-core/std",
"cumulus-primitives-storage-weight-reclaim/std",
"cumulus-primitives-timestamp/std",
"cumulus-primitives-utility/std",
"dp-consensus/std",
@@ -1,5 +1,5 @@
use frame_support::{dispatch::GetDispatchInfo, weights::Weight};
use parity_scale_codec::{Decode, Encode};
use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode};
use scale_info::TypeInfo;
use sp_core::H256;
use sp_runtime::traits::Hash as THash;
@@ -17,7 +17,9 @@ use crate::{
};
// Our AssetType. For now we only handle Xcm Assets
#[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)]
#[derive(
Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, DecodeWithMemTracking, TypeInfo,
)]
pub enum AssetType {
Xcm(xcm::v4::Location),
}
@@ -117,7 +119,19 @@ impl AccountIdAssetIdConversion<AccountId, AssetId> for Runtime {
}
}
#[derive(Clone, Default, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)]
#[derive(
Clone,
Default,
Eq,
Debug,
PartialEq,
Ord,
PartialOrd,
Encode,
Decode,
DecodeWithMemTracking,
TypeInfo,
)]
pub struct AssetRegistrarMetadata {
pub name: Vec<u8>,
pub symbol: Vec<u8>,
@@ -14,7 +14,17 @@ pub mod pallet_custom_origins {
#[pallet::pallet]
pub struct Pallet<T>(_);
#[derive(PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, TypeInfo, RuntimeDebug)]
#[derive(
PartialEq,
Eq,
Clone,
MaxEncodedLen,
Encode,
Decode,
DecodeWithMemTracking,
TypeInfo,
RuntimeDebug,
)]
#[pallet::origin]
pub enum Origin {
/// Origin for spending (any amount of) funds.
@@ -1,5 +1,10 @@
//! Track configurations for governance.
use alloc::borrow::Cow;
use pallet_referenda::Track;
use sp_runtime::str_array as s;
use super::*;
use crate::constants::MINUTES;
@@ -34,156 +39,155 @@ const APP_WHITELISTED_CALLER: Curve =
const SUP_WHITELISTED_CALLER: Curve =
Curve::make_reciprocal(1, 28, percent(20), percent(5), percent(50));
const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 10] = [
(
0,
pallet_referenda::TrackInfo {
name: "root",
max_deciding: 1,
decision_deposit: 100 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 12 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_ROOT,
min_support: SUP_ROOT,
},
),
(
1,
pallet_referenda::TrackInfo {
name: "whitelisted_caller",
max_deciding: 100,
decision_deposit: 10 * GRAND,
prepare_period: 6 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 4 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_WHITELISTED_CALLER,
min_support: SUP_WHITELISTED_CALLER,
},
),
(
11,
pallet_referenda::TrackInfo {
name: "treasurer",
max_deciding: 10,
decision_deposit: GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_TREASURER,
min_support: SUP_TREASURER,
},
),
(
20,
pallet_referenda::TrackInfo {
name: "referendum_canceller",
max_deciding: 1_000,
decision_deposit: 10 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 14 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_REFERENDUM_CANCELLER,
min_support: SUP_REFERENDUM_CANCELLER,
},
),
(
21,
pallet_referenda::TrackInfo {
name: "referendum_killer",
max_deciding: 1_000,
decision_deposit: 50 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_REFERENDUM_KILLER,
min_support: SUP_REFERENDUM_KILLER,
},
),
(
30,
pallet_referenda::TrackInfo {
name: "small_tipper",
max_deciding: 200,
decision_deposit: 3 * CENTS,
prepare_period: MINUTES,
decision_period: 14 * MINUTES,
confirm_period: 4 * MINUTES,
min_enactment_period: MINUTES,
min_approval: APP_SMALL_TIPPER,
min_support: SUP_SMALL_TIPPER,
},
),
(
31,
pallet_referenda::TrackInfo {
name: "big_tipper",
max_deciding: 100,
decision_deposit: 10 * 3 * CENTS,
prepare_period: 4 * MINUTES,
decision_period: 14 * MINUTES,
confirm_period: 12 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_BIG_TIPPER,
min_support: SUP_BIG_TIPPER,
},
),
(
32,
pallet_referenda::TrackInfo {
name: "small_spender",
max_deciding: 50,
decision_deposit: 100 * 3 * CENTS,
prepare_period: 10 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 10 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_SMALL_SPENDER,
min_support: SUP_SMALL_SPENDER,
},
),
(
33,
pallet_referenda::TrackInfo {
name: "medium_spender",
max_deciding: 50,
decision_deposit: 200 * 3 * CENTS,
prepare_period: 10 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 12 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_MEDIUM_SPENDER,
min_support: SUP_MEDIUM_SPENDER,
},
),
(
34,
pallet_referenda::TrackInfo {
name: "big_spender",
max_deciding: 50,
decision_deposit: 400 * 3 * CENTS,
prepare_period: 10 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 14 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_BIG_SPENDER,
min_support: SUP_BIG_SPENDER,
},
),
];
pub struct TracksInfo;
impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
type Id = u16;
type RuntimeOrigin = <RuntimeOrigin as frame_support::traits::OriginTrait>::PalletsOrigin;
fn tracks() -> &'static [(Self::Id, pallet_referenda::TrackInfo<Balance, BlockNumber>)] {
&TRACKS_DATA[..]
fn tracks() -> impl Iterator<Item = Cow<'static, Track<Self::Id, Balance, BlockNumber>>> {
static DATA: [Track<u16, Balance, BlockNumber>; 10] = [
Track {
id: 0u16,
info: pallet_referenda::TrackInfo {
name: s("root"),
max_deciding: 1,
decision_deposit: 100 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 12 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_ROOT,
min_support: SUP_ROOT,
},
},
Track {
id: 1u16,
info: pallet_referenda::TrackInfo {
name: s("whitelisted_caller"),
max_deciding: 100,
decision_deposit: 10 * GRAND,
prepare_period: 6 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 4 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_WHITELISTED_CALLER,
min_support: SUP_WHITELISTED_CALLER,
},
},
Track {
id: 11u16,
info: pallet_referenda::TrackInfo {
name: s("treasurer"),
max_deciding: 10,
decision_deposit: GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_TREASURER,
min_support: SUP_TREASURER,
},
},
Track {
id: 20u16,
info: pallet_referenda::TrackInfo {
name: s("referendum_canceller"),
max_deciding: 1_000,
decision_deposit: 10 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 14 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_REFERENDUM_CANCELLER,
min_support: SUP_REFERENDUM_CANCELLER,
},
},
Track {
id: 21u16,
info: pallet_referenda::TrackInfo {
name: s("referendum_killer"),
max_deciding: 1_000,
decision_deposit: 50 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_REFERENDUM_KILLER,
min_support: SUP_REFERENDUM_KILLER,
},
},
Track {
id: 30u16,
info: pallet_referenda::TrackInfo {
name: s("small_tipper"),
max_deciding: 200,
decision_deposit: 3 * CENTS,
prepare_period: MINUTES,
decision_period: 14 * MINUTES,
confirm_period: 4 * MINUTES,
min_enactment_period: MINUTES,
min_approval: APP_SMALL_TIPPER,
min_support: SUP_SMALL_TIPPER,
},
},
Track {
id: 31u16,
info: pallet_referenda::TrackInfo {
name: s("big_tipper"),
max_deciding: 100,
decision_deposit: 10 * 3 * CENTS,
prepare_period: 4 * MINUTES,
decision_period: 14 * MINUTES,
confirm_period: 12 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_BIG_TIPPER,
min_support: SUP_BIG_TIPPER,
},
},
Track {
id: 32u16,
info: pallet_referenda::TrackInfo {
name: s("small_spender"),
max_deciding: 50,
decision_deposit: 100 * 3 * CENTS,
prepare_period: 10 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 10 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_SMALL_SPENDER,
min_support: SUP_SMALL_SPENDER,
},
},
Track {
id: 33u16,
info: pallet_referenda::TrackInfo {
name: s("medium_spender"),
max_deciding: 50,
decision_deposit: 200 * 3 * CENTS,
prepare_period: 10 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 12 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_MEDIUM_SPENDER,
min_support: SUP_MEDIUM_SPENDER,
},
},
Track {
id: 34u16,
info: pallet_referenda::TrackInfo {
name: s("big_spender"),
max_deciding: 50,
decision_deposit: 400 * 3 * CENTS,
prepare_period: 10 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 14 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_BIG_SPENDER,
min_support: SUP_BIG_SPENDER,
},
},
];
DATA.iter().map(Cow::Borrowed)
}
fn track_for(id: &Self::RuntimeOrigin) -> Result<Self::Id, ()> {
@@ -211,7 +215,6 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
}
}
}
pallet_referenda::impl_tracksinfo_get!(TracksInfo, Balance, BlockNumber);
#[cfg(test)]
mod tests {
@@ -8,7 +8,7 @@ use frame_support::{
use orml_traits::{location::Reserve, parameter_type_with_key};
use orml_xcm_support::MultiNativeAsset;
use pallet_xcm::XcmPassthrough;
use parity_scale_codec::{Decode, Encode};
use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode};
use polkadot_parachain_primitives::primitives::{self, Sibling};
use scale_info::TypeInfo;
use sp_runtime::{traits::Convert, Vec};
@@ -214,7 +214,9 @@ parameter_type_with_key! {
}
// Our currencyId. We distinguish for now between SelfReserve, and Others, defined by their Id.
#[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)]
#[derive(
Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, DecodeWithMemTracking, TypeInfo,
)]
pub enum CurrencyId {
// Our native token
SelfReserve,
@@ -380,7 +382,9 @@ impl frame_support::traits::Contains<Location> for AssetFeesFilter {
// For now we only allow to transact in the relay, although this might change in the future
// Transactors just defines the chains in which we allow transactions to be issued through
// xcm
#[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)]
#[derive(
Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, DecodeWithMemTracking, TypeInfo,
)]
pub enum Transactors {
Relay,
}
+2
View File
@@ -1,6 +1,8 @@
#![cfg_attr(not(feature = "std"), no_std)]
#![recursion_limit = "256"]
extern crate alloc;
// Make the WASM binary available.
#[cfg(feature = "std")]
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
+18 -15
View File
@@ -5,7 +5,7 @@ use frame_support::{parameter_types, traits::InstanceFilter, weights::Weight, Pa
use frame_system::EnsureRoot;
#[cfg(not(feature = "tanssi"))]
use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
use polkadot_runtime_common::impls::{
LocatableAssetConverter, VersionedLocatableAsset, VersionedLocationConverter,
};
@@ -72,23 +72,25 @@ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
/// Block type as expected by this runtime.
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
/// The SignedExtension to the basic transaction logic.
pub type SignedExtra = (
frame_system::CheckNonZeroSender<Runtime>,
frame_system::CheckSpecVersion<Runtime>,
frame_system::CheckTxVersion<Runtime>,
frame_system::CheckGenesis<Runtime>,
frame_system::CheckEra<Runtime>,
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_asset_tx_payment::ChargeAssetTxPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>,
);
/// The TransactionExtension to the basic transaction logic.
pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim<
Runtime,
(
frame_system::CheckNonZeroSender<Runtime>,
frame_system::CheckSpecVersion<Runtime>,
frame_system::CheckTxVersion<Runtime>,
frame_system::CheckGenesis<Runtime>,
frame_system::CheckEra<Runtime>,
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_asset_tx_payment::ChargeAssetTxPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
),
>;
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, TxExtension>;
/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
@@ -146,6 +148,7 @@ pub type TreasuryPaymaster = PayOverXcm<
Copy,
Clone,
Decode,
DecodeWithMemTracking,
Default,
Encode,
Eq,
@@ -53,13 +53,36 @@ impl<T: frame_system::Config> cumulus_pallet_xcmp_queue::WeightInfo for WeightIn
/// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0)
/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::Pages` (r:0 w:1)
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`)
fn enqueue_xcmp_message() -> Weight {
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
/// The range of component `n` is `[1, 105467]`.
fn enqueue_n_bytes_xcmp_message(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `82`
// Estimated: `5487`
// Minimum execution time: 16_214_000 picoseconds.
Weight::from_parts(16_707_000, 0)
// Minimum execution time: 12_977_000 picoseconds.
Weight::from_parts(9_165_318, 0)
.saturating_add(Weight::from_parts(0, 5487))
// Standard Error: 6
.saturating_add(Weight::from_parts(943, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `XcmpQueue::QueueConfig` (r:1 w:0)
/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0)
/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::Pages` (r:0 w:1)
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
fn enqueue_2_empty_xcmp_messages() -> Weight {
// Proof Size summary in bytes:
// Measured: `82`
// Estimated: `5487`
// Minimum execution time: 21_041_000 picoseconds.
Weight::from_parts(21_560_000, 0)
.saturating_add(Weight::from_parts(0, 5487))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
@@ -123,6 +123,20 @@ impl<T: frame_system::Config> pallet_message_queue::WeightInfo for WeightInfo<T>
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `MessageQueue::BookStateFor` (r:1 w:0)
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::ServiceHead` (r:0 w:1)
/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`)
fn set_service_head() -> Weight {
// Proof Size summary in bytes:
// Measured: `198`
// Estimated: `3517`
// Minimum execution time: 7_257_000 picoseconds.
Weight::from_parts(7_582_000, 0)
.saturating_add(Weight::from_parts(0, 3517))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::Pages` (r:1 w:1)
@@ -144,4 +144,19 @@ impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Multisig::Multisigs` (r:1 w:1)
/// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`)
/// The range of component `s` is `[2, 100]`.
fn poke_deposit(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `487 + s * (1 ±0)`
// Estimated: `6811`
// Minimum execution time: 29_451_000 picoseconds.
Weight::from_parts(31_338_818, 0)
.saturating_add(Weight::from_parts(0, 6811))
// Standard Error: 1_549
.saturating_add(Weight::from_parts(147_032, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
}
@@ -205,4 +205,20 @@ impl<T: frame_system::Config> pallet_proxy::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Proxy::Proxies` (r:1 w:1)
/// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Proxy::Announcements` (r:1 w:1)
/// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`)
fn poke_deposit() -> Weight {
// Proof Size summary in bytes:
// Measured: `487`
// Estimated: `5698`
// Minimum execution time: 47_219_000 picoseconds.
Weight::from_parts(48_694_000, 0)
.saturating_add(Weight::from_parts(0, 5698))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
}
@@ -81,4 +81,20 @@ impl<T: frame_system::Config> pallet_utility::WeightInfo for WeightInfo<T> {
// Standard Error: 3_741
.saturating_add(Weight::from_parts(5_077_442, 0).saturating_mul(c.into()))
}
fn dispatch_as_fallible() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_848_000 picoseconds.
Weight::from_parts(7_202_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
fn if_else() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 8_510_000 picoseconds.
Weight::from_parts(8_903_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
}
@@ -32,6 +32,28 @@ use core::marker::PhantomData;
/// Weight functions for `pallet_xcm`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
/// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1)
/// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn add_authorized_alias() -> Weight {
// Proof Size summary in bytes:
// Measured: `498`
// Estimated: `3963`
// Minimum execution time: 19_789_000 picoseconds.
Weight::from_parts(20_317_000, 3963)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `PolkadotXcm::AuthorizedAliases` (r:1 w:1)
/// Proof: `PolkadotXcm::AuthorizedAliases` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn remove_authorized_alias() -> Weight {
// Proof Size summary in bytes:
// Measured: `537`
// Estimated: `4002`
// Minimum execution time: 20_805_000 picoseconds.
Weight::from_parts(21_481_000, 4002)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
/// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
@@ -82,6 +82,7 @@ pub fn para_ext(para_id: u32) -> sp_io::TestExternalities {
pallet_balances::GenesisConfig::<Runtime> {
balances: vec![(ALICE, INITIAL_BALANCE), (parent_account_id(), INITIAL_BALANCE)],
..Default::default()
}
.assimilate_storage(&mut t)
.unwrap();
@@ -106,6 +107,7 @@ pub fn relay_ext() -> sp_io::TestExternalities {
(child_account_id(1), INITIAL_BALANCE),
(child_account_id(2), INITIAL_BALANCE),
],
..Default::default()
}
.assimilate_storage(&mut t)
.unwrap();
@@ -3,7 +3,7 @@ use core::marker::PhantomData;
use frame_support::{
construct_runtime, derive_impl, parameter_types,
traits::{ConstU128, ContainsPair, Everything, Nothing},
traits::{ConstU128, ContainsPair, Disabled, Everything, Nothing},
weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight},
};
use frame_system::EnsureRoot;
@@ -70,6 +70,8 @@ pub type TrustedLockers = TrustedLockerCase<RelayTokenForRelay>;
impl pallet_xcm::Config for Runtime {
type AdminOrigin = EnsureRoot<AccountId>;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
// Aliasing is disabled: xcm_executor::Config::Aliasers is set to `Nothing`.
type AuthorizedAliasConsideration = Disabled;
type Currency = Balances;
type CurrencyMatcher = ();
type ExecuteXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
@@ -42,6 +42,7 @@ impl xcm_executor::Config for XcmConfig {
type UniversalAliases = Nothing;
type UniversalLocation = constants::UniversalLocation;
type Weigher = weigher::Weigher;
type XcmEventEmitter = PolkadotXcm;
type XcmRecorder = PolkadotXcm;
type XcmSender = XcmRouter;
}
@@ -3,7 +3,7 @@
mod xcm_config;
use frame_support::{
construct_runtime, derive_impl, parameter_types,
traits::{ConstU128, Everything, Nothing, ProcessMessage, ProcessMessageError},
traits::{ConstU128, Disabled, Everything, Nothing, ProcessMessage, ProcessMessageError},
weights::{Weight, WeightMeter},
};
use frame_system::EnsureRoot;
@@ -55,6 +55,8 @@ pub type LocalOriginToLocation =
impl pallet_xcm::Config for Runtime {
type AdminOrigin = EnsureRoot<AccountId>;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
// Aliasing is disabled: xcm_executor::Config::Aliasers is set to `Nothing`.
type AuthorizedAliasConsideration = Disabled;
type Currency = Balances;
type CurrencyMatcher = IsConcrete<constants::TokenLocation>;
// Anyone can execute XCM messages locally...
@@ -43,6 +43,7 @@ impl Config for XcmConfig {
type UniversalAliases = Nothing;
type UniversalLocation = constants::UniversalLocation;
type Weigher = weigher::Weigher;
type XcmEventEmitter = XcmPallet;
type XcmRecorder = XcmPallet;
type XcmSender = XcmRouter;
}