Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -719,13 +719,14 @@ impl pallet_proxy::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 SelfParaId: ParaId = ParaId::new(1000);
}

impl cumulus_pallet_parachain_system::Config for Runtime {
type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo<Runtime>;
type RuntimeEvent = RuntimeEvent;
type OnSystemEvent = ();
type SelfParaId = parachain_info::Pallet<Runtime>;
type SelfParaId = SelfParaId;
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type ReservedDmpWeight = ReservedDmpWeight;
type OutboundXcmpMessageSource = XcmpQueue;
Expand Down Expand Up @@ -2010,6 +2011,12 @@ impl_runtime_apis! {
PolkadotXcm::is_trusted_teleporter(asset, location)
}
}

impl cumulus_primitives_core::GetParachainIdentity<Block> for Runtime {
fn id() -> ParaId {
<Runtime as cumulus_pallet_parachain_system::Config>::SelfParaId::get()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -771,13 +771,14 @@ impl pallet_proxy::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 SelfParaId: ParaId = ParaId::new(1000);
}

impl cumulus_pallet_parachain_system::Config for Runtime {
type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo<Runtime>;
type RuntimeEvent = RuntimeEvent;
type OnSystemEvent = ();
type SelfParaId = parachain_info::Pallet<Runtime>;
type SelfParaId = SelfParaId;
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type ReservedDmpWeight = ReservedDmpWeight;
type OutboundXcmpMessageSource = XcmpQueue;
Expand Down Expand Up @@ -2308,6 +2309,12 @@ impl_runtime_apis! {
)
}
}

impl cumulus_primitives_core::GetParachainIdentity<Block> for Runtime {
fn id() -> ParaId {
<Runtime as cumulus_pallet_parachain_system::Config>::SelfParaId::get()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ impl pallet_transaction_payment::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 SelfParaId: ParaId = ParaId::new(1002);
}

impl cumulus_pallet_parachain_system::Config for Runtime {
Expand Down Expand Up @@ -1540,6 +1541,12 @@ impl_runtime_apis! {
PolkadotXcm::is_trusted_teleporter(asset, location)
}
}

impl cumulus_primitives_core::GetParachainIdentity<Block> for Runtime {
fn id() -> ParaId {
<Runtime as cumulus_pallet_parachain_system::Config>::SelfParaId::get()
}
}
}

#[cfg(test)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +361,14 @@ impl pallet_transaction_payment::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 SelfParaId: ParaId = ParaId::new(1002);
}

impl cumulus_pallet_parachain_system::Config for Runtime {
type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo<Runtime>;
type RuntimeEvent = RuntimeEvent;
type OnSystemEvent = ();
type SelfParaId = parachain_info::Pallet<Runtime>;
type SelfParaId = SelfParaId;
type OutboundXcmpMessageSource = XcmpQueue;
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type ReservedDmpWeight = ReservedDmpWeight;
Expand Down Expand Up @@ -1361,6 +1362,12 @@ impl_runtime_apis! {
PolkadotXcm::is_trusted_teleporter(asset, location)
}
}

impl cumulus_primitives_core::GetParachainIdentity<Block> for Runtime {
fn id() -> ParaId {
<Runtime as cumulus_pallet_parachain_system::Config>::SelfParaId::get()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,14 @@ impl pallet_proxy::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 SelfParaId: ParaId = ParaId::new(1001);
}

impl cumulus_pallet_parachain_system::Config for Runtime {
type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo<Runtime>;
type RuntimeEvent = RuntimeEvent;
type OnSystemEvent = ();
type SelfParaId = parachain_info::Pallet<Runtime>;
type SelfParaId = SelfParaId;
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type ReservedDmpWeight = ReservedDmpWeight;
type OutboundXcmpMessageSource = XcmpQueue;
Expand Down Expand Up @@ -1299,6 +1300,12 @@ impl_runtime_apis! {
PolkadotXcm::is_trusted_teleporter(asset, location)
}
}

impl cumulus_primitives_core::GetParachainIdentity<Block> for Runtime {
fn id() -> ParaId {
<Runtime as cumulus_pallet_parachain_system::Config>::SelfParaId::get()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern crate alloc;

use alloc::{vec, vec::Vec};
use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;
use cumulus_primitives_core::{AggregateMessageOrigin, ClaimQueueOffset, CoreSelector};
use cumulus_primitives_core::{AggregateMessageOrigin, ClaimQueueOffset, CoreSelector, ParaId};
use sp_api::impl_runtime_apis;
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
use sp_runtime::{
Expand Down Expand Up @@ -289,13 +289,14 @@ parameter_types! {
pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent;
pub const SelfParaId: ParaId = ParaId::new(1200);
}

impl cumulus_pallet_parachain_system::Config for Runtime {
type WeightInfo = ();
type RuntimeEvent = RuntimeEvent;
type OnSystemEvent = ();
type SelfParaId = parachain_info::Pallet<Runtime>;
type SelfParaId = SelfParaId;
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type ReservedDmpWeight = ReservedDmpWeight;
type OutboundXcmpMessageSource = XcmpQueue;
Expand Down Expand Up @@ -892,6 +893,12 @@ impl_runtime_apis! {
PolkadotXcm::is_trusted_teleporter(asset, location)
}
}

impl cumulus_primitives_core::GetParachainIdentity<Block> for Runtime {
fn id() -> ParaId {
<Runtime as cumulus_pallet_parachain_system::Config>::SelfParaId::get()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,14 @@ 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;
pub const SelfParaId: ParaId = ParaId::new(1005);
}

impl cumulus_pallet_parachain_system::Config for Runtime {
type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo<Runtime>;
type RuntimeEvent = RuntimeEvent;
type OnSystemEvent = ();
type SelfParaId = parachain_info::Pallet<Runtime>;
type SelfParaId = SelfParaId;
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type OutboundXcmpMessageSource = XcmpQueue;
type ReservedDmpWeight = ReservedDmpWeight;
Expand Down Expand Up @@ -1182,6 +1183,12 @@ impl_runtime_apis! {
PolkadotXcm::is_trusted_teleporter(asset, location)
}
}

impl cumulus_primitives_core::GetParachainIdentity<Block> for Runtime {
fn id() -> ParaId {
<Runtime as cumulus_pallet_parachain_system::Config>::SelfParaId::get()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,14 @@ 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;
pub const SelfParaId: ParaId = ParaId::new(1005);
}

impl cumulus_pallet_parachain_system::Config for Runtime {
type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo<Runtime>;
type RuntimeEvent = RuntimeEvent;
type OnSystemEvent = ();
type SelfParaId = parachain_info::Pallet<Runtime>;
type SelfParaId = SelfParaId;
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type OutboundXcmpMessageSource = XcmpQueue;
type ReservedDmpWeight = ReservedDmpWeight;
Expand Down Expand Up @@ -1177,6 +1178,12 @@ impl_runtime_apis! {
PolkadotXcm::is_trusted_teleporter(asset, location)
}
}

impl cumulus_primitives_core::GetParachainIdentity<Block> for Runtime {
fn id() -> ParaId {
<Runtime as cumulus_pallet_parachain_system::Config>::SelfParaId::get()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
11 changes: 9 additions & 2 deletions cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ use sp_runtime::{
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;

use cumulus_primitives_core::{AggregateMessageOrigin, ClaimQueueOffset, CoreSelector};
use cumulus_primitives_core::{AggregateMessageOrigin, ClaimQueueOffset, CoreSelector, ParaId};
pub use frame_support::{
construct_runtime, derive_impl,
dispatch::DispatchClass,
Expand Down Expand Up @@ -167,6 +167,7 @@ parameter_types! {
// We do anything the parent chain tells us in this runtime.
pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(2);
pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent;
pub const SelfParaId: ParaId = ParaId::new(1300);
}

type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook<
Expand All @@ -179,7 +180,7 @@ type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook<
impl cumulus_pallet_parachain_system::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type OnSystemEvent = ();
type SelfParaId = parachain_info::Pallet<Runtime>;
type SelfParaId = SelfParaId;
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type OutboundXcmpMessageSource = ();
type ReservedDmpWeight = ReservedDmpWeight;
Expand Down Expand Up @@ -501,6 +502,12 @@ impl_runtime_apis! {
vec![]
}
}

impl cumulus_primitives_core::GetParachainIdentity<Block> for Runtime {
fn id() -> ParaId {
<Runtime as cumulus_pallet_parachain_system::Config>::SelfParaId::get()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
9 changes: 8 additions & 1 deletion cumulus/parachains/runtimes/people/people-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,13 @@ 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;
pub const SelfParaId: ParaId = ParaId::new(1004);
}

impl cumulus_pallet_parachain_system::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type OnSystemEvent = ();
type SelfParaId = parachain_info::Pallet<Runtime>;
type SelfParaId = SelfParaId;
type OutboundXcmpMessageSource = XcmpQueue;
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type ReservedDmpWeight = ReservedDmpWeight;
Expand Down Expand Up @@ -1097,6 +1098,12 @@ impl_runtime_apis! {
PolkadotXcm::is_trusted_teleporter(asset, location)
}
}

impl cumulus_primitives_core::GetParachainIdentity<Block> for Runtime {
fn id() -> ParaId {
<Runtime as cumulus_pallet_parachain_system::Config>::SelfParaId::get()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
9 changes: 8 additions & 1 deletion cumulus/parachains/runtimes/people/people-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,13 @@ 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;
pub const SelfParaId: ParaId = ParaId::new(1004);
}

impl cumulus_pallet_parachain_system::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type OnSystemEvent = ();
type SelfParaId = parachain_info::Pallet<Runtime>;
type SelfParaId = SelfParaId;
type OutboundXcmpMessageSource = XcmpQueue;
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type ReservedDmpWeight = ReservedDmpWeight;
Expand Down Expand Up @@ -1097,6 +1098,12 @@ impl_runtime_apis! {
PolkadotXcm::is_trusted_teleporter(asset, location)
}
}

impl cumulus_primitives_core::GetParachainIdentity<Block> for Runtime {
fn id() -> ParaId {
<Runtime as cumulus_pallet_parachain_system::Config>::SelfParaId::get()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
9 changes: 8 additions & 1 deletion cumulus/parachains/runtimes/testing/penpal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,13 +632,14 @@ 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;
pub const SelfParaId: ParaId = ParaId::new(2042);
}

impl cumulus_pallet_parachain_system::Config for Runtime {
type WeightInfo = ();
type RuntimeEvent = RuntimeEvent;
type OnSystemEvent = ();
type SelfParaId = parachain_info::Pallet<Runtime>;
type SelfParaId = SelfParaId;
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type ReservedDmpWeight = ReservedDmpWeight;
type OutboundXcmpMessageSource = XcmpQueue;
Expand Down Expand Up @@ -1179,6 +1180,12 @@ impl_runtime_apis! {
PolkadotXcm::is_trusted_teleporter(asset, location)
}
}

impl cumulus_primitives_core::GetParachainIdentity<Block> for Runtime {
fn id() -> ParaId {
<Runtime as cumulus_pallet_parachain_system::Config>::SelfParaId::get()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ 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;
pub const SelfParaId: ParaId = ParaId::new(3222);
}

type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook<
Expand All @@ -297,7 +298,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
type WeightInfo = ();
type RuntimeEvent = RuntimeEvent;
type OnSystemEvent = ();
type SelfParaId = parachain_info::Pallet<Runtime>;
type SelfParaId = SelfParaId;
type OutboundXcmpMessageSource = XcmpQueue;
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type ReservedDmpWeight = ReservedDmpWeight;
Expand Down Expand Up @@ -871,6 +872,12 @@ impl_runtime_apis! {
ParachainSystem::core_selector()
}
}

impl cumulus_primitives_core::GetParachainIdentity<Block> for Runtime {
fn id() -> ParaId {
<Runtime as cumulus_pallet_parachain_system::Config>::SelfParaId::get()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
7 changes: 7 additions & 0 deletions cumulus/primitives/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,4 +402,11 @@ sp_api::decl_runtime_apis! {
/// Retrieve core selector and claim queue offset for the next block.
fn core_selector() -> (CoreSelector, ClaimQueueOffset);
}

/// Runtime api used to access general info about a parachain runtime.
pub trait GetParachainIdentity {

/// Retrieve the parachain id used for runtime.
fn id() -> ParaId;
}
}
Loading