Skip to content

Polkadot stable2503 #1023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions Cargo.dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
1 change: 1 addition & 0 deletions asset-registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions asset-registry/src/mock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -294,6 +295,7 @@ pub fn relay_ext() -> sp_io::TestExternalities {

pallet_balances::GenesisConfig::<Runtime> {
balances: vec![(ALICE, 1_000)],
..Default::default()
}
.assimilate_storage(&mut t)
.unwrap();
Expand Down
6 changes: 4 additions & 2 deletions asset-registry/src/mock/para.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -239,6 +239,7 @@ impl Config for XcmConfig {
type HrmpChannelAcceptedHandler = ();
type HrmpChannelClosingHandler = ();
type XcmRecorder = ();
type XcmEventEmitter = ();
}

impl cumulus_pallet_xcm::Config for Runtime {
Expand Down Expand Up @@ -277,6 +278,7 @@ impl pallet_xcm::Config for Runtime {
type AdminOrigin = EnsureRoot<AccountId>;
type MaxRemoteLockConsumers = ConstU32<0>;
type RemoteLockConsumerIdentifier = ();
type AuthorizedAliasConsideration = ();
}

pub struct AccountIdToLocation;
Expand Down
2 changes: 2 additions & 0 deletions asset-registry/src/mock/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ impl Config for XcmConfig {
type HrmpChannelAcceptedHandler = ();
type HrmpChannelClosingHandler = ();
type XcmRecorder = ();
type XcmEventEmitter = ();
}

pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, KusamaNetwork>;
Expand Down Expand Up @@ -148,6 +149,7 @@ impl pallet_xcm::Config for Runtime {
type AdminOrigin = EnsureRoot<AccountId>;
type MaxRemoteLockConsumers = ConstU32<0>;
type RemoteLockConsumerIdentifier = ();
type AuthorizedAliasConsideration = ();
}

impl origin::Config for Runtime {}
Expand Down
2 changes: 1 addition & 1 deletion authority/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<BlockNumber, PalletsOrigin> {
/// Number of blocks that this call have been delayed.
pub(crate) delay: BlockNumber,
Expand Down
3 changes: 2 additions & 1 deletion authority/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions currencies/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ impl ExtBuilder {
.filter(|(_, currency_id, _)| *currency_id == NATIVE_CURRENCY_ID)
.map(|(account_id, _, initial_balance)| (account_id, initial_balance))
.collect::<Vec<_>>(),
..Default::default()
}
.assimilate_storage(&mut t)
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion gradually-update/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Key, Value> {
pub key: Key,
pub target_value: Value,
Expand Down
18 changes: 15 additions & 3 deletions rate-limit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<u8, ConstU32<MAX_FILTER_KEY_LENGTH>>),
Expand Down
16 changes: 3 additions & 13 deletions tokens/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -184,14 +181,7 @@ pub mod module {
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::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
Expand Down
12 changes: 11 additions & 1 deletion traits/src/asset_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ pub trait AssetProcessor<AssetId, Metadata> {
}

/// 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<Balance, CustomMetadata, StringLimit: Get<u32>>
Expand Down
21 changes: 14 additions & 7 deletions traits/src/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
$(
Expand All @@ -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>] {
$(
Expand All @@ -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>] {
$(
Expand Down Expand Up @@ -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) )?;

Expand Down Expand Up @@ -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 {
$(
Expand All @@ -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>] {
$(
Expand All @@ -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>] {
$(
Expand Down
2 changes: 1 addition & 1 deletion vesting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<BlockNumber, Balance>
where
Balance: MaxEncodedLen + HasCompact,
Expand Down
1 change: 1 addition & 0 deletions vesting/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ impl ExtBuilder {

pallet_balances::GenesisConfig::<Runtime> {
balances: vec![(ALICE, ALICE_BALANCE), (CHARLIE, CHARLIE_BALANCE)],
..Default::default()
}
.assimilate_storage(&mut t)
.unwrap();
Expand Down
1 change: 1 addition & 0 deletions xtokens/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion xtokens/src/mock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -303,6 +303,7 @@ pub fn relay_ext() -> sp_io::TestExternalities {

pallet_balances::GenesisConfig::<Runtime> {
balances: vec![(ALICE, 1_000)],
..Default::default()
}
.assimilate_storage(&mut t)
.unwrap();
Expand Down
2 changes: 2 additions & 0 deletions xtokens/src/mock/para.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ impl Config for XcmConfig {
type HrmpChannelAcceptedHandler = ();
type HrmpChannelClosingHandler = ();
type XcmRecorder = ();
type XcmEventEmitter = ();
}

impl cumulus_pallet_xcm::Config for Runtime {
Expand Down Expand Up @@ -204,6 +205,7 @@ impl pallet_xcm::Config for Runtime {
type AdminOrigin = EnsureRoot<AccountId>;
type MaxRemoteLockConsumers = ConstU32<0>;
type RemoteLockConsumerIdentifier = ();
type AuthorizedAliasConsideration = ();
}

pub struct AccountIdToLocation;
Expand Down
Loading