mirror of
https://github.com/pezkuwichain/pezkuwi-runtime-templates.git
synced 2026-06-12 08:51:02 +00:00
Upgrade polkadot-sdk v1.3.0 -> 1.6.0 (#96)
This commit is contained in:
+7
-3
@@ -32,6 +32,7 @@ pallet-assets = { workspace = true }
|
||||
pallet-aura = { workspace = true }
|
||||
pallet-authorship = { workspace = true }
|
||||
pallet-balances = { workspace = true }
|
||||
pallet-message-queue = { workspace = true }
|
||||
pallet-multisig = { workspace = true }
|
||||
pallet-proxy = { workspace = true }
|
||||
pallet-session = { workspace = true }
|
||||
@@ -64,7 +65,6 @@ xcm-executor = { workspace = true }
|
||||
# Cumulus
|
||||
assets-common = { workspace = true }
|
||||
cumulus-pallet-aura-ext = { workspace = true }
|
||||
cumulus-pallet-dmp-queue = { workspace = true }
|
||||
cumulus-pallet-parachain-system = { workspace = true, features = [ "parameterized-consensus-hook" ] }
|
||||
cumulus-pallet-session-benchmarking = { workspace = true }
|
||||
cumulus-pallet-xcm = { workspace = true }
|
||||
@@ -73,6 +73,7 @@ cumulus-primitives-core = { workspace = true }
|
||||
cumulus-primitives-utility = { workspace = true }
|
||||
pallet-collator-selection = { workspace = true }
|
||||
parachain-info = { workspace = true }
|
||||
parachains-common = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
sp-io = { workspace = true }
|
||||
@@ -85,7 +86,6 @@ default = [ "std" ]
|
||||
std = [
|
||||
"assets-common/std",
|
||||
"cumulus-pallet-aura-ext/std",
|
||||
"cumulus-pallet-dmp-queue/std",
|
||||
"cumulus-pallet-parachain-system/std",
|
||||
"cumulus-pallet-session-benchmarking/std",
|
||||
"cumulus-pallet-xcm/std",
|
||||
@@ -105,6 +105,7 @@ std = [
|
||||
"pallet-authorship/std",
|
||||
"pallet-balances/std",
|
||||
"pallet-collator-selection/std",
|
||||
"pallet-message-queue/std",
|
||||
"pallet-multisig/std",
|
||||
"pallet-proxy/std",
|
||||
"pallet-session/std",
|
||||
@@ -116,6 +117,7 @@ std = [
|
||||
"pallet-utility/std",
|
||||
"pallet-xcm/std",
|
||||
"parachain-info/std",
|
||||
"parachains-common/std",
|
||||
"parity-scale-codec/std",
|
||||
"polkadot-parachain-primitives/std",
|
||||
"polkadot-runtime-common/std",
|
||||
@@ -151,12 +153,14 @@ runtime-benchmarks = [
|
||||
"pallet-assets/runtime-benchmarks",
|
||||
"pallet-balances/runtime-benchmarks",
|
||||
"pallet-collator-selection/runtime-benchmarks",
|
||||
"pallet-message-queue/runtime-benchmarks",
|
||||
"pallet-multisig/runtime-benchmarks",
|
||||
"pallet-sudo/runtime-benchmarks",
|
||||
"pallet-template/runtime-benchmarks",
|
||||
"pallet-timestamp/runtime-benchmarks",
|
||||
"pallet-utility/runtime-benchmarks",
|
||||
"pallet-xcm/runtime-benchmarks",
|
||||
"parachains-common/runtime-benchmarks",
|
||||
"polkadot-parachain-primitives/runtime-benchmarks",
|
||||
"polkadot-runtime-common/runtime-benchmarks",
|
||||
"sp-runtime/runtime-benchmarks",
|
||||
@@ -166,7 +170,6 @@ runtime-benchmarks = [
|
||||
|
||||
try-runtime = [
|
||||
"cumulus-pallet-aura-ext/try-runtime",
|
||||
"cumulus-pallet-dmp-queue/try-runtime",
|
||||
"cumulus-pallet-parachain-system/try-runtime",
|
||||
"cumulus-pallet-xcm/try-runtime",
|
||||
"cumulus-pallet-xcmp-queue/try-runtime",
|
||||
@@ -179,6 +182,7 @@ try-runtime = [
|
||||
"pallet-authorship/try-runtime",
|
||||
"pallet-balances/try-runtime",
|
||||
"pallet-collator-selection/try-runtime",
|
||||
"pallet-message-queue/try-runtime",
|
||||
"pallet-multisig/try-runtime",
|
||||
"pallet-proxy/try-runtime",
|
||||
"pallet-session/try-runtime",
|
||||
|
||||
+38
-14
@@ -11,7 +11,7 @@ mod weights;
|
||||
pub mod xcm_config;
|
||||
|
||||
use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
|
||||
use cumulus_primitives_core::ParaId;
|
||||
use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
|
||||
use frame_support::{
|
||||
construct_runtime,
|
||||
dispatch::DispatchClass,
|
||||
@@ -19,7 +19,7 @@ use frame_support::{
|
||||
parameter_types,
|
||||
traits::{
|
||||
AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything,
|
||||
InstanceFilter,
|
||||
InstanceFilter, TransformOrigin,
|
||||
},
|
||||
weights::{
|
||||
constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient,
|
||||
@@ -32,6 +32,7 @@ use frame_system::{
|
||||
EnsureRoot, EnsureSigned,
|
||||
};
|
||||
use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling};
|
||||
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
|
||||
use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery;
|
||||
// Polkadot imports
|
||||
@@ -56,12 +57,11 @@ use sp_version::NativeVersion;
|
||||
use sp_version::RuntimeVersion;
|
||||
// XCM Imports
|
||||
use xcm::latest::prelude::BodyId;
|
||||
use xcm_executor::XcmExecutor;
|
||||
|
||||
use crate::{
|
||||
constants::currency::{deposit, CENTS, EXISTENTIAL_DEPOSIT, MICROCENTS, MILLICENTS},
|
||||
weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight},
|
||||
xcm_config::{RelayLocation, XcmConfig, XcmOriginToTransactDispatchOrigin},
|
||||
xcm_config::{RelayLocation, XcmOriginToTransactDispatchOrigin},
|
||||
};
|
||||
|
||||
/// Alias to 512-bit hash when used in the context of a transaction signature on
|
||||
@@ -485,6 +485,7 @@ impl pallet_sudo::Config for Runtime {
|
||||
parameter_types! {
|
||||
pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
|
||||
pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
|
||||
pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent;
|
||||
}
|
||||
|
||||
impl cumulus_pallet_parachain_system::Config for Runtime {
|
||||
@@ -495,36 +496,58 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
|
||||
BLOCK_PROCESSING_VELOCITY,
|
||||
UNINCLUDED_SEGMENT_CAPACITY,
|
||||
>;
|
||||
type DmpMessageHandler = DmpQueue;
|
||||
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
|
||||
type OnSystemEvent = ();
|
||||
type OutboundXcmpMessageSource = XcmpQueue;
|
||||
type ReservedDmpWeight = ReservedDmpWeight;
|
||||
type ReservedXcmpWeight = ReservedXcmpWeight;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type SelfParaId = parachain_info::Pallet<Runtime>;
|
||||
type WeightInfo = cumulus_pallet_parachain_system::weights::SubstrateWeight<Runtime>;
|
||||
type XcmpMessageHandler = XcmpQueue;
|
||||
}
|
||||
|
||||
impl parachain_info::Config for Runtime {}
|
||||
|
||||
parameter_types! {
|
||||
pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block;
|
||||
}
|
||||
|
||||
impl pallet_message_queue::Config for Runtime {
|
||||
type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>;
|
||||
type MaxStale = sp_core::ConstU32<8>;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type MessageProcessor = pallet_message_queue::mock_helpers::NoopMessageProcessor<
|
||||
cumulus_primitives_core::AggregateMessageOrigin,
|
||||
>;
|
||||
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||
type MessageProcessor = xcm_builder::ProcessXcmMessage<
|
||||
AggregateMessageOrigin,
|
||||
xcm_executor::XcmExecutor<xcm_config::XcmConfig>,
|
||||
RuntimeCall,
|
||||
>;
|
||||
// The XCMP queue pallet is only ever able to handle the `Sibling(ParaId)` origin:
|
||||
type QueueChangeHandler = NarrowOriginToSibling<XcmpQueue>;
|
||||
type QueuePausedQuery = NarrowOriginToSibling<XcmpQueue>;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type ServiceWeight = MessageQueueServiceWeight;
|
||||
type Size = u32;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
impl cumulus_pallet_aura_ext::Config for Runtime {}
|
||||
|
||||
impl cumulus_pallet_xcmp_queue::Config for Runtime {
|
||||
type ChannelInfo = ParachainSystem;
|
||||
type ControllerOrigin = EnsureRoot<AccountId>;
|
||||
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
|
||||
type ExecuteOverweightOrigin = EnsureRoot<AccountId>;
|
||||
type MaxInboundSuspended = ConstU32<1_000>;
|
||||
type PriceForSiblingDelivery = NoPriceForMessageDelivery<ParaId>;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type VersionWrapper = ();
|
||||
type WeightInfo = cumulus_pallet_xcmp_queue::weights::SubstrateWeight<Runtime>;
|
||||
type XcmExecutor = XcmExecutor<XcmConfig>;
|
||||
}
|
||||
|
||||
impl cumulus_pallet_dmp_queue::Config for Runtime {
|
||||
type ExecuteOverweightOrigin = EnsureRoot<AccountId>;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type XcmExecutor = XcmExecutor<XcmConfig>;
|
||||
// Enqueue XCMP messages from siblings for later processing.
|
||||
type XcmpQueue = TransformOrigin<MessageQueue, AggregateMessageOrigin, ParaId, ParaIdToSibling>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -649,7 +672,7 @@ construct_runtime!(
|
||||
XcmpQueue: cumulus_pallet_xcmp_queue = 30,
|
||||
PolkadotXcm: pallet_xcm = 31,
|
||||
CumulusXcm: cumulus_pallet_xcm = 32,
|
||||
DmpQueue: cumulus_pallet_dmp_queue = 33,
|
||||
MessageQueue: pallet_message_queue = 33,
|
||||
|
||||
// Template
|
||||
TemplatePallet: pallet_template = 50,
|
||||
@@ -664,6 +687,7 @@ mod benches {
|
||||
[pallet_balances, Balances]
|
||||
[pallet_session, SessionBench::<Runtime>]
|
||||
[pallet_timestamp, Timestamp]
|
||||
[pallet_message_queue, MessageQueue]
|
||||
[pallet_sudo, Sudo]
|
||||
[pallet_collator_selection, CollatorSelection]
|
||||
[cumulus_pallet_xcmp_queue, XcmpQueue]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Storage indices integration checks
|
||||
use frame_support::traits::PalletInfo;
|
||||
use parachain_template_runtime::{
|
||||
Aura, AuraExt, Authorship, Balances, CollatorSelection, CumulusXcm, DmpQueue, Multisig,
|
||||
Aura, AuraExt, Authorship, Balances, CollatorSelection, CumulusXcm, MessageQueue, Multisig,
|
||||
ParachainInfo, ParachainSystem, PolkadotXcm, Proxy, Runtime, Session, Sudo, System,
|
||||
TemplatePallet, Timestamp, TransactionPayment, XcmpQueue,
|
||||
};
|
||||
@@ -29,6 +29,6 @@ fn verify_pallet_prefixes() {
|
||||
assert_pallet_prefix::<XcmpQueue>("XcmpQueue");
|
||||
assert_pallet_prefix::<PolkadotXcm>("PolkadotXcm");
|
||||
assert_pallet_prefix::<CumulusXcm>("CumulusXcm");
|
||||
assert_pallet_prefix::<DmpQueue>("DmpQueue");
|
||||
assert_pallet_prefix::<MessageQueue>("MessageQueue");
|
||||
assert_pallet_prefix::<TemplatePallet>("TemplatePallet");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user