Skip to content

Commit

Permalink
add dmp-queue to the lazy migration, use better weights
Browse files Browse the repository at this point in the history
  • Loading branch information
lemunozm committed Jun 7, 2024
1 parent 5baab79 commit b5a7d89
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 12 deletions.
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ num_enum = { version = "0.5.3", default-features = false }

# Cumulus
cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" }
cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" }
cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" }
cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" }
cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" }
Expand Down
3 changes: 3 additions & 0 deletions runtime/altair/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ runtime-common = { workspace = true }
axelar-gateway-precompile = { workspace = true }
chainbridge = { workspace = true }
cumulus-pallet-aura-ext = { workspace = true }
cumulus-pallet-dmp-queue = { workspace = true }
cumulus-pallet-parachain-system = { workspace = true }
cumulus-pallet-xcm = { workspace = true }
cumulus-pallet-xcmp-queue = { workspace = true }
Expand Down Expand Up @@ -196,6 +197,7 @@ std = [
"axelar-gateway-precompile/std",
"chainbridge/std",
"cumulus-pallet-aura-ext/std",
"cumulus-pallet-dmp-queue/std",
"cumulus-pallet-parachain-system/std",
"cumulus-pallet-xcm/std",
"cumulus-pallet-xcmp-queue/std",
Expand Down Expand Up @@ -364,6 +366,7 @@ try-runtime = [
"axelar-gateway-precompile/try-runtime",
"chainbridge/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",
Expand Down
15 changes: 11 additions & 4 deletions runtime/altair/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
type ReservedXcmpWeight = ReservedXcmpWeight;
type RuntimeEvent = RuntimeEvent;
type SelfParaId = staging_parachain_info::Pallet<Runtime>;
type WeightInfo = ();
type WeightInfo = cumulus_pallet_parachain_system::weights::SubstrateWeight<Runtime>;
type XcmpMessageHandler = XcmpQueue;
}

Expand Down Expand Up @@ -334,7 +334,7 @@ impl pallet_message_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type ServiceWeight = MessageQueueServiceWeight;
type Size = u32;
type WeightInfo = ();
type WeightInfo = pallet_message_queue::weights::SubstrateWeight<Runtime>;
}

/// XCMP Queue is responsible to handle XCM messages coming directly from
Expand All @@ -351,9 +351,16 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
type XcmpQueue = TransformOrigin<MessageQueue, AggregateMessageOrigin, ParaId, ParaIdToSibling>;
}

impl cumulus_pallet_dmp_queue::Config for Runtime {
type DmpSink = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = cumulus_pallet_dmp_queue::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
pub const MinimumPeriod: Millis = SLOT_DURATION / 2;
}

impl pallet_timestamp::Config for Runtime {
type MinimumPeriod = MinimumPeriod;
/// A timestamp: milliseconds since the unix epoch.
Expand Down Expand Up @@ -978,7 +985,7 @@ impl pallet_treasury::Config for Runtime {
type SpendFunds = ();
type SpendOrigin = frame_support::traits::NeverEnsureOrigin<Balance>;
type SpendPeriod = SpendPeriod;
type WeightInfo = (); // Using default weights for recomended hardware
type WeightInfo = pallet_treasury::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
Expand Down Expand Up @@ -2034,7 +2041,7 @@ construct_runtime!(
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 120,
PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Config<T>, Event<T>, Origin} = 121,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 122,
// Removed: DmpQueue = 123
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 123,
XTokens: pallet_restricted_xtokens::{Pallet, Call} = 124,
XcmTransactor: pallet_xcm_transactor::{Pallet, Call, Storage, Event<T>} = 125,
OrmlXTokens: orml_xtokens::{Pallet, Event<T>} = 126,
Expand Down
3 changes: 3 additions & 0 deletions runtime/centrifuge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ runtime-common = { workspace = true }
axelar-gateway-precompile = { workspace = true }
chainbridge = { workspace = true }
cumulus-pallet-aura-ext = { workspace = true }
cumulus-pallet-dmp-queue = { workspace = true }
cumulus-pallet-parachain-system = { workspace = true }
cumulus-pallet-xcm = { workspace = true }
cumulus-pallet-xcmp-queue = { workspace = true }
Expand Down Expand Up @@ -196,6 +197,7 @@ std = [
"axelar-gateway-precompile/std",
"chainbridge/std",
"cumulus-pallet-aura-ext/std",
"cumulus-pallet-dmp-queue/std",
"cumulus-pallet-parachain-system/std",
"cumulus-pallet-xcm/std",
"cumulus-pallet-xcmp-queue/std",
Expand Down Expand Up @@ -363,6 +365,7 @@ try-runtime = [
"axelar-gateway-precompile/try-runtime",
"chainbridge/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",
Expand Down
14 changes: 10 additions & 4 deletions runtime/centrifuge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
type ReservedXcmpWeight = ReservedXcmpWeight;
type RuntimeEvent = RuntimeEvent;
type SelfParaId = staging_parachain_info::Pallet<Runtime>;
type WeightInfo = ();
type WeightInfo = cumulus_pallet_parachain_system::weights::SubstrateWeight<Runtime>;
type XcmpMessageHandler = XcmpQueue;
}

Expand Down Expand Up @@ -335,7 +335,7 @@ impl pallet_message_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type ServiceWeight = MessageQueueServiceWeight;
type Size = u32;
type WeightInfo = ();
type WeightInfo = pallet_message_queue::weights::SubstrateWeight<Runtime>;
}

/// XCMP Queue is responsible to handle XCM messages coming directly from
Expand All @@ -352,6 +352,12 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
type XcmpQueue = TransformOrigin<MessageQueue, AggregateMessageOrigin, ParaId, ParaIdToSibling>;
}

impl cumulus_pallet_dmp_queue::Config for Runtime {
type DmpSink = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = cumulus_pallet_dmp_queue::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
pub const NativeToken: CurrencyId = CurrencyId::Native;
}
Expand Down Expand Up @@ -1095,7 +1101,7 @@ impl pallet_treasury::Config for Runtime {
type SpendFunds = ();
type SpendOrigin = frame_support::traits::NeverEnsureOrigin<Balance>;
type SpendPeriod = SpendPeriod;
type WeightInfo = (); // Using default weights for recomended hardware
type WeightInfo = pallet_treasury::weights::SubstrateWeight<Runtime>;
}

// our pallets
Expand Down Expand Up @@ -2142,7 +2148,7 @@ construct_runtime!(
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 120,
PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Config<T>, Event<T>, Origin} = 121,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 122,
// Removed: DmpQueue = 123
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 123,
XTokens: pallet_restricted_xtokens::{Pallet, Call} = 124,
XcmTransactor: pallet_xcm_transactor::{Pallet, Call, Storage, Event<T>} = 125,
OrmlXTokens: orml_xtokens::{Pallet, Event<T>} = 126,
Expand Down
3 changes: 3 additions & 0 deletions runtime/development/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ runtime-common = { workspace = true }
axelar-gateway-precompile = { workspace = true }
chainbridge = { workspace = true }
cumulus-pallet-aura-ext = { workspace = true }
cumulus-pallet-dmp-queue = { workspace = true }
cumulus-pallet-parachain-system = { workspace = true }
cumulus-pallet-xcm = { workspace = true }
cumulus-pallet-xcmp-queue = { workspace = true }
Expand Down Expand Up @@ -196,6 +197,7 @@ std = [
"axelar-gateway-precompile/std",
"chainbridge/std",
"cumulus-pallet-aura-ext/std",
"cumulus-pallet-dmp-queue/std",
"cumulus-pallet-parachain-system/std",
"cumulus-pallet-xcm/std",
"cumulus-pallet-xcmp-queue/std",
Expand Down Expand Up @@ -363,6 +365,7 @@ try-runtime = [
"axelar-gateway-precompile/try-runtime",
"chainbridge/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",
Expand Down
14 changes: 10 additions & 4 deletions runtime/development/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
type ReservedXcmpWeight = ReservedXcmpWeight;
type RuntimeEvent = RuntimeEvent;
type SelfParaId = staging_parachain_info::Pallet<Runtime>;
type WeightInfo = ();
type WeightInfo = cumulus_pallet_parachain_system::weights::SubstrateWeight<Runtime>;
type XcmpMessageHandler = XcmpQueue;
}

Expand Down Expand Up @@ -337,7 +337,7 @@ impl pallet_message_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type ServiceWeight = MessageQueueServiceWeight;
type Size = u32;
type WeightInfo = ();
type WeightInfo = pallet_message_queue::weights::SubstrateWeight<Runtime>;
}

/// XCMP Queue is responsible to handle XCM messages coming directly from
Expand All @@ -354,6 +354,12 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
type XcmpQueue = TransformOrigin<MessageQueue, AggregateMessageOrigin, ParaId, ParaIdToSibling>;
}

impl cumulus_pallet_dmp_queue::Config for Runtime {
type DmpSink = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = cumulus_pallet_dmp_queue::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
pub const MinimumPeriod: Millis = SLOT_DURATION / 2;
}
Expand Down Expand Up @@ -1030,7 +1036,7 @@ impl pallet_treasury::Config for Runtime {
type SpendFunds = ();
type SpendOrigin = frame_support::traits::NeverEnsureOrigin<Balance>;
type SpendPeriod = SpendPeriod;
type WeightInfo = (); // Using default weights for recomended hardware
type WeightInfo = pallet_treasury::weights::SubstrateWeight<Runtime>;
}

// our pallets
Expand Down Expand Up @@ -2124,7 +2130,7 @@ construct_runtime!(
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 120,
PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Config<T>, Event<T>, Origin} = 121,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 122,
// Removed: DmpQueue = 123
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 123,
XTokens: pallet_restricted_xtokens::{Pallet, Call} = 124,
XcmTransactor: pallet_xcm_transactor::{Pallet, Call, Storage, Event<T>} = 125,
OrmlXTokens: orml_xtokens::{Pallet, Event<T>} = 126,
Expand Down

0 comments on commit b5a7d89

Please sign in to comment.