diff --git a/Cargo.dev.toml b/Cargo.dev.toml index d2c5e286a..58d697850 100644 --- a/Cargo.dev.toml +++ b/Cargo.dev.toml @@ -37,35 +37,35 @@ scale-info = { version = "2.10.0", default-features = false, features = ["derive serde = { version = "1.0.214" } parity-scale-codec = { version = "3.6.12", default-features = false, features = ["max-encoded-len"] } -cumulus-pallet-xcm = { version = "0.18.0", default-features = false } -cumulus-primitives-core = { version = "0.17.0", default-features = false } -frame-benchmarking = { version = "39.0.0", default-features = false } -frame-support = { version = "39.0.0", default-features = false } -frame-system = { version = "39.1.0", default-features = false } -pallet-balances = { version = "40.0.0", default-features = false } -pallet-elections-phragmen = { version = "40.0.0", default-features = false } -pallet-message-queue = { version = "42.0.0", default-features = false } -pallet-preimage = { version = "39.0.0", default-features = false } -pallet-root-testing = { version = "15.0.0", default-features = false } -pallet-scheduler = { version = "40.0.0", default-features = false } -pallet-timestamp = { version = "38.0.0", default-features = false } -pallet-treasury = { version = "38.0.0", default-features = false } -pallet-xcm = { version = "18.0.0", default-features = false } -polkadot-parachain-primitives = { version = "15.0.0", default-features = false } -polkadot-runtime-common = { version = "18.0.0", default-features = false } -polkadot-runtime-parachains = { version = "18.0.1", default-features = false } -sp-api = { version = "35.0.0", default-features = false } -sp-application-crypto = { version = "39.0.0", default-features = false } -sp-arithmetic = { version = "26.0.0", default-features = false } -sp-core = { version = "35.0.0", default-features = false } -sp-io = { version = "39.0.0", default-features = false } -sp-runtime = { version = "40.1.0", default-features = false } -sp-runtime-interface = { version = "29.0.0", default-features = false } -sp-staking = { version = "37.0.0", default-features = false } +cumulus-pallet-xcm = { version = "0.19.1", default-features = false } +cumulus-primitives-core = { version = "0.18.1", default-features = false } +frame-benchmarking = { version = "40.0.0", default-features = false } +frame-support = { version = "40.1.0", default-features = false } +frame-system = { version = "40.1.0", default-features = false } +pallet-balances = { version = "41.1.0", default-features = false } +pallet-elections-phragmen = { version = "41.1.0", default-features = false } +pallet-message-queue = { version = "43.1.0", default-features = false } +pallet-preimage = { version = "40.0.0", default-features = false } +pallet-root-testing = { version = "16.0.0", default-features = false } +pallet-scheduler = { version = "41.0.0", default-features = false } +pallet-timestamp = { version = "39.0.0", default-features = false } +pallet-treasury = { version = "39.0.0", default-features = false } +pallet-xcm = { version = "19.1.0", default-features = false } +polkadot-parachain-primitives = { version = "16.1.0", default-features = false } +polkadot-runtime-common = { version = "19.1.0", default-features = false } +polkadot-runtime-parachains = { version = "19.1.0", default-features = false } +sp-api = { version = "36.0.1", default-features = false } +sp-application-crypto = { version = "40.1.0", default-features = false } +sp-arithmetic = { version = "26.1.0", default-features = false } +sp-core = { version = "36.1.0", default-features = false } +sp-io = { version = "40.0.0", default-features = false } +sp-runtime = { version = "41.1.0", default-features = false } +sp-runtime-interface = { version = "29.0.1", default-features = false } +sp-staking = { version = "38.0.0", default-features = false } sp-std = { version = "14.0.0", default-features = false } sp-storage = { version = "22.0.0", default-features = false } -xcm = { version = "15.0.1", package = "staging-xcm", default-features = false } -xcm-builder = { version = "18.0.0", package = "staging-xcm-builder", default-features = false } -xcm-executor = { version = "18.0.0", package = "staging-xcm-executor", default-features = false } +xcm = { version = "16.1.0", package = "staging-xcm", default-features = false } +xcm-builder = { version = "20.0.0", package = "staging-xcm-builder", default-features = false } +xcm-executor = { version = "19.1.0", package = "staging-xcm-executor", default-features = false } -xcm-simulator = { version = "18.0.0" } +xcm-simulator = { version = "20.0.0" } \ No newline at end of file diff --git a/asset-registry/Cargo.toml b/asset-registry/Cargo.toml index 23f09cf6a..b3bce188c 100644 --- a/asset-registry/Cargo.toml +++ b/asset-registry/Cargo.toml @@ -83,6 +83,7 @@ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", + "xcm/runtime-benchmarks", ] try-runtime = [ "frame-support/try-runtime", diff --git a/asset-registry/src/mock/mod.rs b/asset-registry/src/mock/mod.rs index f18427c57..2597f131e 100644 --- a/asset-registry/src/mock/mod.rs +++ b/asset-registry/src/mock/mod.rs @@ -33,6 +33,7 @@ pub const CHARLIE: AccountId32 = AccountId32::new([2u8; 32]); Ord, parity_scale_codec::MaxEncodedLen, TypeInfo, + DecodeWithMemTracking, )] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub enum CurrencyId { @@ -294,6 +295,7 @@ pub fn relay_ext() -> sp_io::TestExternalities { pallet_balances::GenesisConfig:: { balances: vec![(ALICE, 1_000)], + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/asset-registry/src/mock/para.rs b/asset-registry/src/mock/para.rs index 5e54fbb20..30223af7b 100644 --- a/asset-registry/src/mock/para.rs +++ b/asset-registry/src/mock/para.rs @@ -16,7 +16,7 @@ use orml_traits::{ }; use orml_xcm_support::{IsNativeConcrete, MultiCurrencyAdapter, MultiNativeAsset}; use pallet_xcm::XcmPassthrough; -use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use polkadot_parachain_primitives::primitives::Sibling; use sp_core::Get; use sp_runtime::{ @@ -82,7 +82,7 @@ impl orml_tokens::Config for Runtime { type DustRemovalWhitelist = Nothing; } -#[derive(scale_info::TypeInfo, Encode, Decode, Clone, Eq, PartialEq, Debug, MaxEncodedLen)] +#[derive(scale_info::TypeInfo, Encode, Decode, Clone, Eq, PartialEq, Debug, MaxEncodedLen, DecodeWithMemTracking)] pub struct CustomMetadata { pub fee_per_second: u128, } @@ -239,6 +239,7 @@ impl Config for XcmConfig { type HrmpChannelAcceptedHandler = (); type HrmpChannelClosingHandler = (); type XcmRecorder = (); + type XcmEventEmitter = (); } impl cumulus_pallet_xcm::Config for Runtime { @@ -277,6 +278,7 @@ impl pallet_xcm::Config for Runtime { type AdminOrigin = EnsureRoot; type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); + type AuthorizedAliasConsideration = (); } pub struct AccountIdToLocation; diff --git a/asset-registry/src/mock/relay.rs b/asset-registry/src/mock/relay.rs index 9b2daf768..4867308b8 100644 --- a/asset-registry/src/mock/relay.rs +++ b/asset-registry/src/mock/relay.rs @@ -115,6 +115,7 @@ impl Config for XcmConfig { type HrmpChannelAcceptedHandler = (); type HrmpChannelClosingHandler = (); type XcmRecorder = (); + type XcmEventEmitter = (); } pub type LocalOriginToLocation = SignedToAccountId32; @@ -148,6 +149,7 @@ impl pallet_xcm::Config for Runtime { type AdminOrigin = EnsureRoot; type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); + type AuthorizedAliasConsideration = (); } impl origin::Config for Runtime {} diff --git a/authority/src/lib.rs b/authority/src/lib.rs index b31ee2fc1..8878fb63d 100644 --- a/authority/src/lib.rs +++ b/authority/src/lib.rs @@ -55,7 +55,7 @@ mod weights; pub use weights::WeightInfo; /// A delayed origin. Can only be dispatched via `dispatch_as` with a delay. -#[derive(PartialEq, Eq, Clone, RuntimeDebug, Encode, Decode, TypeInfo)] +#[derive(PartialEq, Eq, Clone, RuntimeDebug, Encode, Decode, TypeInfo, DecodeWithMemTracking)] pub struct DelayedOrigin { /// Number of blocks that this call have been delayed. pub(crate) delay: BlockNumber, diff --git a/authority/src/mock.rs b/authority/src/mock.rs index 59ea0dbae..7535de905 100644 --- a/authority/src/mock.rs +++ b/authority/src/mock.rs @@ -51,13 +51,14 @@ impl pallet_scheduler::Config for Runtime { type WeightInfo = (); type OriginPrivilegeCmp = EqualPrivilegeOnly; type Preimages = Preimage; + type BlockNumberProvider = System; } impl pallet_root_testing::Config for Runtime { type RuntimeEvent = RuntimeEvent; } -#[derive(Clone, Encode, Decode, Eq, PartialEq, Ord, PartialOrd, Debug, TypeInfo)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Ord, PartialOrd, Debug, TypeInfo, DecodeWithMemTracking)] pub enum MockAsOriginId { Root, Account1, diff --git a/currencies/src/mock.rs b/currencies/src/mock.rs index b719650a1..7d7270578 100644 --- a/currencies/src/mock.rs +++ b/currencies/src/mock.rs @@ -155,6 +155,7 @@ impl ExtBuilder { .filter(|(_, currency_id, _)| *currency_id == NATIVE_CURRENCY_ID) .map(|(account_id, _, initial_balance)| (account_id, initial_balance)) .collect::>(), + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/gradually-update/src/lib.rs b/gradually-update/src/lib.rs index a2fa33cd9..6573ffbe7 100644 --- a/gradually-update/src/lib.rs +++ b/gradually-update/src/lib.rs @@ -43,7 +43,7 @@ mod tests; /// Gradually update a value stored at `key` to `target_value`, /// change `per_block` * `T::UpdateFrequency` per `T::UpdateFrequency` /// blocks. -#[derive(Encode, Decode, Clone, Eq, PartialEq, MaxEncodedLen, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Clone, Eq, PartialEq, MaxEncodedLen, RuntimeDebug, TypeInfo, DecodeWithMemTracking)] pub struct GraduallyUpdate { pub key: Key, pub target_value: Value, diff --git a/rate-limit/src/lib.rs b/rate-limit/src/lib.rs index 5c0193c9f..c25959f24 100644 --- a/rate-limit/src/lib.rs +++ b/rate-limit/src/lib.rs @@ -36,14 +36,14 @@ pub mod module { use super::*; /// Period type. - #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] + #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, DecodeWithMemTracking)] pub enum Period { Blocks(u64), Seconds(u64), } /// Limit rules type. - #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] + #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, DecodeWithMemTracking)] pub enum RateLimitRule { /// Each period to reset remainder quota to `quota` amount. /// `can_consume` check return true when the remainder quota gte the @@ -68,7 +68,19 @@ pub mod module { pub const MAX_FILTER_KEY_LENGTH: u32 = 256; /// Match rules to filter key is in bypass whitelist. - #[derive(PartialOrd, Ord, PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] + #[derive( + PartialOrd, + Ord, + PartialEq, + Eq, + Clone, + Encode, + Decode, + RuntimeDebug, + TypeInfo, + MaxEncodedLen, + DecodeWithMemTracking, + )] pub enum KeyFilter { /// If the encoded key is equal to the vec, the key is in whitelist. Match(BoundedVec>), diff --git a/tokens/src/lib.rs b/tokens/src/lib.rs index 078c07c86..3bb23e767 100644 --- a/tokens/src/lib.rs +++ b/tokens/src/lib.rs @@ -58,11 +58,8 @@ use frame_system::{ensure_signed, pallet_prelude::*}; use parity_scale_codec::MaxEncodedLen; use scale_info::TypeInfo; use sp_runtime::{ - traits::{ - AtLeast32BitUnsigned, Bounded, CheckedAdd, CheckedSub, MaybeSerializeDeserialize, Member, Saturating, - StaticLookup, Zero, - }, - ArithmeticError, DispatchError, DispatchResult, FixedPointOperand, RuntimeDebug, TokenError, + traits::{Bounded, CheckedAdd, CheckedSub, MaybeSerializeDeserialize, Member, Saturating, StaticLookup, Zero}, + ArithmeticError, DispatchError, DispatchResult, RuntimeDebug, TokenError, }; use sp_std::{cmp, convert::Infallible, marker, prelude::*, vec::Vec}; @@ -184,14 +181,7 @@ pub mod module { type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The balance type - type Balance: Parameter - + Member - + AtLeast32BitUnsigned - + Default - + Copy - + MaybeSerializeDeserialize - + MaxEncodedLen - + FixedPointOperand; + type Balance: frame_support::traits::tokens::Balance; /// The amount type, should be signed version of `Balance` type Amount: Signed diff --git a/traits/src/asset_registry.rs b/traits/src/asset_registry.rs index 7e871e4a7..5ffddcaef 100644 --- a/traits/src/asset_registry.rs +++ b/traits/src/asset_registry.rs @@ -20,7 +20,17 @@ pub trait AssetProcessor { } /// Data describing the asset properties. -#[derive(TypeInfo, Encode, Decode, CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, MaxEncodedLen)] +#[derive( + TypeInfo, + Encode, + Decode, + CloneNoBound, + EqNoBound, + PartialEqNoBound, + RuntimeDebugNoBound, + MaxEncodedLen, + DecodeWithMemTracking, +)] #[codec(mel_bound(skip_type_params(StringLimit)))] #[scale_info(skip_type_params(StringLimit))] pub struct AssetMetadata> diff --git a/traits/src/parameters.rs b/traits/src/parameters.rs index 04c1ad741..4d0874365 100644 --- a/traits/src/parameters.rs +++ b/traits/src/parameters.rs @@ -144,7 +144,8 @@ macro_rules! define_parameters { $crate::parameters::parity_scale_codec::Decode, $crate::parameters::parity_scale_codec::MaxEncodedLen, $crate::parameters::sp_runtime::RuntimeDebug, - $crate::parameters::scale_info::TypeInfo + $crate::parameters::scale_info::TypeInfo, + $crate::parameters::parity_scale_codec::DecodeWithMemTracking )] $vis enum $name { $( @@ -161,7 +162,8 @@ macro_rules! define_parameters { $crate::parameters::parity_scale_codec::Decode, $crate::parameters::parity_scale_codec::MaxEncodedLen, $crate::parameters::sp_runtime::RuntimeDebug, - $crate::parameters::scale_info::TypeInfo + $crate::parameters::scale_info::TypeInfo, + $crate::parameters::parity_scale_codec::DecodeWithMemTracking )] $vis enum [<$name Key>] { $( @@ -178,7 +180,8 @@ macro_rules! define_parameters { $crate::parameters::parity_scale_codec::Decode, $crate::parameters::parity_scale_codec::MaxEncodedLen, $crate::parameters::sp_runtime::RuntimeDebug, - $crate::parameters::scale_info::TypeInfo + $crate::parameters::scale_info::TypeInfo, + $crate::parameters::parity_scale_codec::DecodeWithMemTracking )] $vis enum [<$name Value>] { $( @@ -209,7 +212,8 @@ macro_rules! define_parameters { $crate::parameters::parity_scale_codec::Decode, $crate::parameters::parity_scale_codec::MaxEncodedLen, $crate::parameters::sp_runtime::RuntimeDebug, - $crate::parameters::scale_info::TypeInfo + $crate::parameters::scale_info::TypeInfo, + $crate::parameters::parity_scale_codec::DecodeWithMemTracking )] $vis struct $key_name $( (pub $key_para) )?; @@ -334,7 +338,8 @@ macro_rules! define_aggregrated_parameters { $crate::parameters::parity_scale_codec::Decode, $crate::parameters::parity_scale_codec::MaxEncodedLen, $crate::parameters::sp_runtime::RuntimeDebug, - $crate::parameters::scale_info::TypeInfo + $crate::parameters::scale_info::TypeInfo, + $crate::parameters::parity_scale_codec::DecodeWithMemTracking )] $vis enum $name { $( @@ -351,7 +356,8 @@ macro_rules! define_aggregrated_parameters { $crate::parameters::parity_scale_codec::Decode, $crate::parameters::parity_scale_codec::MaxEncodedLen, $crate::parameters::sp_runtime::RuntimeDebug, - $crate::parameters::scale_info::TypeInfo + $crate::parameters::scale_info::TypeInfo, + $crate::parameters::parity_scale_codec::DecodeWithMemTracking )] $vis enum [<$name Key>] { $( @@ -368,7 +374,8 @@ macro_rules! define_aggregrated_parameters { $crate::parameters::parity_scale_codec::Decode, $crate::parameters::parity_scale_codec::MaxEncodedLen, $crate::parameters::sp_runtime::RuntimeDebug, - $crate::parameters::scale_info::TypeInfo + $crate::parameters::scale_info::TypeInfo, + $crate::parameters::parity_scale_codec::DecodeWithMemTracking )] $vis enum [<$name Value>] { $( diff --git a/vesting/src/lib.rs b/vesting/src/lib.rs index 2209eb1e0..0f6863967 100644 --- a/vesting/src/lib.rs +++ b/vesting/src/lib.rs @@ -58,7 +58,7 @@ pub const VESTING_LOCK_ID: LockIdentifier = *b"ormlvest"; /// /// Benefits would be granted gradually, `per_period` amount every `period` /// of blocks after `start`. -#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, MaxEncodedLen, TypeInfo, DecodeWithMemTracking)] pub struct VestingSchedule where Balance: MaxEncodedLen + HasCompact, diff --git a/vesting/src/mock.rs b/vesting/src/mock.rs index 61064ab6f..121f2b396 100644 --- a/vesting/src/mock.rs +++ b/vesting/src/mock.rs @@ -111,6 +111,7 @@ impl ExtBuilder { pallet_balances::GenesisConfig:: { balances: vec![(ALICE, ALICE_BALANCE), (CHARLIE, CHARLIE_BALANCE)], + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/xtokens/Cargo.toml b/xtokens/Cargo.toml index e6c24e048..87b90ce6d 100644 --- a/xtokens/Cargo.toml +++ b/xtokens/Cargo.toml @@ -76,6 +76,7 @@ runtime-benchmarks = [ "pallet-xcm/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-executor/runtime-benchmarks", + "xcm/runtime-benchmarks", ] try-runtime = [ "frame-support/try-runtime", diff --git a/xtokens/src/mock/mod.rs b/xtokens/src/mock/mod.rs index 99c564384..2da76c071 100644 --- a/xtokens/src/mock/mod.rs +++ b/xtokens/src/mock/mod.rs @@ -36,7 +36,7 @@ pub const CHARLIE: AccountId32 = AccountId32::new([2u8; 32]); parity_scale_codec::MaxEncodedLen, TypeInfo, )] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, DecodeWithMemTracking))] pub enum CurrencyId { /// Relay chain token. R, @@ -303,6 +303,7 @@ pub fn relay_ext() -> sp_io::TestExternalities { pallet_balances::GenesisConfig:: { balances: vec![(ALICE, 1_000)], + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/xtokens/src/mock/para.rs b/xtokens/src/mock/para.rs index e467eca28..dddb1a406 100644 --- a/xtokens/src/mock/para.rs +++ b/xtokens/src/mock/para.rs @@ -171,6 +171,7 @@ impl Config for XcmConfig { type HrmpChannelAcceptedHandler = (); type HrmpChannelClosingHandler = (); type XcmRecorder = (); + type XcmEventEmitter = (); } impl cumulus_pallet_xcm::Config for Runtime { @@ -204,6 +205,7 @@ impl pallet_xcm::Config for Runtime { type AdminOrigin = EnsureRoot; type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); + type AuthorizedAliasConsideration = (); } pub struct AccountIdToLocation; diff --git a/xtokens/src/mock/para_relative_view.rs b/xtokens/src/mock/para_relative_view.rs index 6c2ed8d54..18682c1d5 100644 --- a/xtokens/src/mock/para_relative_view.rs +++ b/xtokens/src/mock/para_relative_view.rs @@ -167,6 +167,7 @@ impl Config for XcmConfig { type HrmpChannelAcceptedHandler = (); type HrmpChannelClosingHandler = (); type XcmRecorder = (); + type XcmEventEmitter = (); } impl cumulus_pallet_xcm::Config for Runtime { @@ -200,6 +201,7 @@ impl pallet_xcm::Config for Runtime { type AdminOrigin = EnsureRoot; type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); + type AuthorizedAliasConsideration = (); } pub struct AccountIdToLocation; diff --git a/xtokens/src/mock/para_teleport.rs b/xtokens/src/mock/para_teleport.rs index 1dfac0acb..b6ab52f0d 100644 --- a/xtokens/src/mock/para_teleport.rs +++ b/xtokens/src/mock/para_teleport.rs @@ -145,6 +145,7 @@ impl Config for XcmConfig { type HrmpChannelAcceptedHandler = (); type HrmpChannelClosingHandler = (); type XcmRecorder = (); + type XcmEventEmitter = (); } impl cumulus_pallet_xcm::Config for Runtime { @@ -178,6 +179,7 @@ impl pallet_xcm::Config for Runtime { type AdminOrigin = EnsureRoot; type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); + type AuthorizedAliasConsideration = (); } pub struct AccountIdToLocation; diff --git a/xtokens/src/mock/relay.rs b/xtokens/src/mock/relay.rs index c3068fc41..b033c0903 100644 --- a/xtokens/src/mock/relay.rs +++ b/xtokens/src/mock/relay.rs @@ -125,6 +125,7 @@ impl Config for XcmConfig { type HrmpChannelAcceptedHandler = (); type HrmpChannelClosingHandler = (); type XcmRecorder = (); + type XcmEventEmitter = (); } pub type LocalOriginToLocation = SignedToAccountId32; @@ -154,6 +155,7 @@ impl pallet_xcm::Config for Runtime { type AdminOrigin = EnsureRoot; type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); + type AuthorizedAliasConsideration = (); } impl origin::Config for Runtime {}