From 26330640d20cce5656ff4dc9458a4f1e237c53cf Mon Sep 17 00:00:00 2001 From: ferrell-code Date: Thu, 22 Jul 2021 06:21:22 -0400 Subject: [PATCH] Parachains hrmp.rs to Frame V2 (#3475) * migrate * migrate runtimes * runtimes compile * ci * trigger ci --- polkadot/runtime/kusama/src/lib.rs | 2 +- polkadot/runtime/parachains/src/hrmp.rs | 406 +++++++++++------- polkadot/runtime/parachains/src/inclusion.rs | 10 +- .../runtime/parachains/src/initializer.rs | 6 +- polkadot/runtime/parachains/src/mock.rs | 2 +- .../parachains/src/runtime_api_impl/v1.rs | 2 +- polkadot/runtime/rococo/src/lib.rs | 2 +- polkadot/runtime/test-runtime/src/lib.rs | 2 +- polkadot/runtime/westend/src/lib.rs | 2 +- 9 files changed, 253 insertions(+), 181 deletions(-) diff --git a/polkadot/runtime/kusama/src/lib.rs b/polkadot/runtime/kusama/src/lib.rs index 324c8b9517..e427686f20 100644 --- a/polkadot/runtime/kusama/src/lib.rs +++ b/polkadot/runtime/kusama/src/lib.rs @@ -1489,7 +1489,7 @@ construct_runtime! { Initializer: parachains_initializer::{Pallet, Call, Storage} = 57, Dmp: parachains_dmp::{Pallet, Call, Storage} = 58, ParasUmp: parachains_ump::{Pallet, Call, Storage, Event} = 59, - ParasHrmp: parachains_hrmp::{Pallet, Call, Storage, Event} = 60, + Hrmp: parachains_hrmp::{Pallet, Call, Storage, Event} = 60, ParasSessionInfo: parachains_session_info::{Pallet, Call, Storage} = 61, // Parachain Onboarding Pallets. Start indices at 70 to leave room. diff --git a/polkadot/runtime/parachains/src/hrmp.rs b/polkadot/runtime/parachains/src/hrmp.rs index 03cfd39805..4c46c987fd 100644 --- a/polkadot/runtime/parachains/src/hrmp.rs +++ b/polkadot/runtime/parachains/src/hrmp.rs @@ -20,11 +20,9 @@ use crate::{ initializer, paras, dmp, }; use parity_scale_codec::{Decode, Encode}; -use frame_support::{ - decl_storage, decl_module, decl_error, decl_event, ensure, traits::{Get, ReservableCurrency}, - weights::Weight, StorageMap, StorageValue, dispatch::DispatchResult, -}; -use frame_system::ensure_root; +use frame_support::pallet_prelude::*; +use frame_support::traits::ReservableCurrency; +use frame_system::pallet_prelude::*; use primitives::v1::{ Balance, Hash, HrmpChannelId, Id as ParaId, InboundHrmpMessage, OutboundHrmpMessage, SessionIndex, @@ -36,6 +34,8 @@ use sp_std::{ prelude::*, }; +pub use pallet::*; + /// A description of a request to open an HRMP channel. #[derive(Encode, Decode)] pub struct HrmpOpenChannelRequest { @@ -215,139 +215,46 @@ impl fmt::Debug for OutboundHrmpAcceptanceErr { } } -pub trait Config: frame_system::Config + configuration::Config + paras::Config + dmp::Config { - /// The outer event type. - type Event: From + Into<::Event>; +#[frame_support::pallet] +pub mod pallet { + use super::*; - type Origin: From - + From<::Origin> - + Into::Origin>>; - /// An interface for reserving deposits for opening channels. - /// - /// NOTE that this Currency instance will be charged with the amounts defined in the `Configuration` - /// module. Specifically, that means that the `Balance` of the `Currency` implementation should - /// be the same as `Balance` as used in the `Configuration`. - type Currency: ReservableCurrency; -} + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(_); -decl_storage! { - trait Store for Module as Hrmp { - /// The set of pending HRMP open channel requests. + #[pallet::config] + pub trait Config: frame_system::Config + configuration::Config + paras::Config + dmp::Config { + /// The outer event type. + type Event: From> + IsType<::Event>; + + type Origin: From + + From<::Origin> + + Into::Origin>>; + + /// An interface for reserving deposits for opening channels. /// - /// The set is accompanied by a list for iteration. - /// - /// Invariant: - /// - There are no channels that exists in list but not in the set and vice versa. - HrmpOpenChannelRequests: map hasher(twox_64_concat) HrmpChannelId => Option; - HrmpOpenChannelRequestsList: Vec; - - /// This mapping tracks how many open channel requests are initiated by a given sender para. - /// Invariant: `HrmpOpenChannelRequests` should contain the same number of items that has `(X, _)` - /// as the number of `HrmpOpenChannelRequestCount` for `X`. - HrmpOpenChannelRequestCount: map hasher(twox_64_concat) ParaId => u32; - /// This mapping tracks how many open channel requests were accepted by a given recipient para. - /// Invariant: `HrmpOpenChannelRequests` should contain the same number of items `(_, X)` with - /// `confirmed` set to true, as the number of `HrmpAcceptedChannelRequestCount` for `X`. - HrmpAcceptedChannelRequestCount: map hasher(twox_64_concat) ParaId => u32; - - /// A set of pending HRMP close channel requests that are going to be closed during the session change. - /// Used for checking if a given channel is registered for closure. - /// - /// The set is accompanied by a list for iteration. - /// - /// Invariant: - /// - There are no channels that exists in list but not in the set and vice versa. - HrmpCloseChannelRequests: map hasher(twox_64_concat) HrmpChannelId => Option<()>; - HrmpCloseChannelRequestsList: Vec; - - /// The HRMP watermark associated with each para. - /// Invariant: - /// - each para `P` used here as a key should satisfy `Paras::is_valid_para(P)` within a session. - HrmpWatermarks: map hasher(twox_64_concat) ParaId => Option; - /// HRMP channel data associated with each para. - /// Invariant: - /// - each participant in the channel should satisfy `Paras::is_valid_para(P)` within a session. - HrmpChannels: map hasher(twox_64_concat) HrmpChannelId => Option; - /// Ingress/egress indexes allow to find all the senders and receivers given the opposite - /// side. I.e. - /// - /// (a) ingress index allows to find all the senders for a given recipient. - /// (b) egress index allows to find all the recipients for a given sender. - /// - /// Invariants: - /// - for each ingress index entry for `P` each item `I` in the index should present in `HrmpChannels` - /// as `(I, P)`. - /// - for each egress index entry for `P` each item `E` in the index should present in `HrmpChannels` - /// as `(P, E)`. - /// - there should be no other dangling channels in `HrmpChannels`. - /// - the vectors are sorted. - HrmpIngressChannelsIndex: map hasher(twox_64_concat) ParaId => Vec; - // NOTE that this field is used by parachains via merkle storage proofs, therefore changing - // the format will require migration of parachains. - HrmpEgressChannelsIndex: map hasher(twox_64_concat) ParaId => Vec; - - /// Storage for the messages for each channel. - /// Invariant: cannot be non-empty if the corresponding channel in `HrmpChannels` is `None`. - HrmpChannelContents: map hasher(twox_64_concat) HrmpChannelId => Vec>; - /// Maintains a mapping that can be used to answer the question: - /// What paras sent a message at the given block number for a given receiver. - /// Invariants: - /// - The inner `Vec` is never empty. - /// - The inner `Vec` cannot store two same `ParaId`. - /// - The outer vector is sorted ascending by block number and cannot store two items with the same - /// block number. - HrmpChannelDigests: map hasher(twox_64_concat) ParaId => Vec<(T::BlockNumber, Vec)>; + /// NOTE that this Currency instance will be charged with the amounts defined in the `Configuration` + /// pallet. Specifically, that means that the `Balance` of the `Currency` implementation should + /// be the same as `Balance` as used in the `Configuration`. + type Currency: ReservableCurrency; } - add_extra_genesis { - /// Preopen the given HRMP channels. - /// - /// The values in the tuple corresponds to `(sender, recipient, max_capacity, max_message_size)`, - /// i.e. similar to `init_open_channel`. In fact, the initialization is performed as if - /// the `init_open_channel` and `accept_open_channel` were called with the respective parameters - /// and the session change take place. - /// - /// As such, each channel initializer should satisfy the same constraints, namely: - /// - /// 1. `max_capacity` and `max_message_size` should be within the limits set by the configuration module. - /// 2. `sender` and `recipient` must be valid paras. - config(preopen_hrmp_channels): Vec<(ParaId, ParaId, u32, u32)>; - build(|config| { - initialize_storage::(&config.preopen_hrmp_channels); - }) + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// Open HRMP channel requested. + /// `[sender, recipient, proposed_max_capacity, proposed_max_message_size]` + OpenChannelRequested(ParaId, ParaId, u32, u32), + /// Open HRMP channel accepted. `[sender, recipient]` + OpenChannelAccepted(ParaId, ParaId), + /// HRMP channel closed. `[by_parachain, channel_id]` + ChannelClosed(ParaId, HrmpChannelId), } -} -#[cfg(feature = "std")] -fn initialize_storage(preopen_hrmp_channels: &[(ParaId, ParaId, u32, u32)]) { - let host_config = configuration::Module::::config(); - for &(sender, recipient, max_capacity, max_message_size) in preopen_hrmp_channels { - if let Err(err) = preopen_hrmp_channel::(sender, recipient, max_capacity, max_message_size) { - panic!("failed to initialize the genesis storage: {:?}", err); - } - } - >::process_hrmp_open_channel_requests(&host_config); -} - -#[cfg(feature = "std")] -fn preopen_hrmp_channel( - sender: ParaId, - recipient: ParaId, - max_capacity: u32, - max_message_size: u32 -) -> DispatchResult { - >::init_open_channel( - sender, - recipient, - max_capacity, - max_message_size, - )?; - >::accept_open_channel(recipient, sender)?; - Ok(()) -} - -decl_error! { - pub enum Error for Module { + #[pallet::error] + pub enum Error { /// The sender tried to open a channel to themselves. OpenHrmpChannelToSelf, /// The recipient is not a valid para. @@ -378,28 +285,168 @@ decl_error! { CloseHrmpChannelDoesntExist, /// The channel close request is already requested. CloseHrmpChannelAlreadyUnderway, - } -} - -decl_event! { - pub enum Event { - /// Open HRMP channel requested. - /// `[sender, recipient, proposed_max_capacity, proposed_max_message_size]` - OpenChannelRequested(ParaId, ParaId, u32, u32), - /// Open HRMP channel accepted. `[sender, recipient]` - OpenChannelAccepted(ParaId, ParaId), - /// HRMP channel closed. `[by_parachain, channel_id]` - ChannelClosed(ParaId, HrmpChannelId), } -} -decl_module! { - /// The HRMP module. - pub struct Module for enum Call where origin: ::Origin { - type Error = Error; + /// The set of pending HRMP open channel requests. + /// + /// The set is accompanied by a list for iteration. + /// + /// Invariant: + /// - There are no channels that exists in list but not in the set and vice versa. + #[pallet::storage] + pub type HrmpOpenChannelRequests = StorageMap< + _, + Twox64Concat, + HrmpChannelId, + HrmpOpenChannelRequest + >; - fn deposit_event() = default; + #[pallet::storage] + pub type HrmpOpenChannelRequestsList = StorageValue<_, Vec, ValueQuery>; + /// This mapping tracks how many open channel requests are initiated by a given sender para. + /// Invariant: `HrmpOpenChannelRequests` should contain the same number of items that has `(X, _)` + /// as the number of `HrmpOpenChannelRequestCount` for `X`. + #[pallet::storage] + pub type HrmpOpenChannelRequestCount = StorageMap< + _, + Twox64Concat, + ParaId, + u32, + ValueQuery + >; + + /// This mapping tracks how many open channel requests were accepted by a given recipient para. + /// Invariant: `HrmpOpenChannelRequests` should contain the same number of items `(_, X)` with + /// `confirmed` set to true, as the number of `HrmpAcceptedChannelRequestCount` for `X`. + #[pallet::storage] + pub type HrmpAcceptedChannelRequestCount = StorageMap< + _, + Twox64Concat, + ParaId, + u32, + ValueQuery + >; + + /// A set of pending HRMP close channel requests that are going to be closed during the session change. + /// Used for checking if a given channel is registered for closure. + /// + /// The set is accompanied by a list for iteration. + /// + /// Invariant: + /// - There are no channels that exists in list but not in the set and vice versa. + #[pallet::storage] + pub type HrmpCloseChannelRequests = StorageMap<_, Twox64Concat, HrmpChannelId, ()>; + + #[pallet::storage] + pub type HrmpCloseChannelRequestsList = StorageValue<_, Vec, ValueQuery>; + + /// The HRMP watermark associated with each para. + /// Invariant: + /// - each para `P` used here as a key should satisfy `Paras::is_valid_para(P)` within a session. + #[pallet::storage] + pub type HrmpWatermarks = StorageMap<_, Twox64Concat, ParaId, T::BlockNumber>; + + /// HRMP channel data associated with each para. + /// Invariant: + /// - each participant in the channel should satisfy `Paras::is_valid_para(P)` within a session. + #[pallet::storage] + pub type HrmpChannels = StorageMap<_, Twox64Concat, HrmpChannelId, HrmpChannel>; + + /// Ingress/egress indexes allow to find all the senders and receivers given the opposite + /// side. I.e. + /// + /// (a) ingress index allows to find all the senders for a given recipient. + /// (b) egress index allows to find all the recipients for a given sender. + /// + /// Invariants: + /// - for each ingress index entry for `P` each item `I` in the index should present in `HrmpChannels` + /// as `(I, P)`. + /// - for each egress index entry for `P` each item `E` in the index should present in `HrmpChannels` + /// as `(P, E)`. + /// - there should be no other dangling channels in `HrmpChannels`. + /// - the vectors are sorted. + #[pallet::storage] + pub type HrmpIngressChannelsIndex = StorageMap< + _, + Twox64Concat, + ParaId, + Vec, + ValueQuery + >; + + // NOTE that this field is used by parachains via merkle storage proofs, therefore changing + // the format will require migration of parachains. + #[pallet::storage] + pub type HrmpEgressChannelsIndex = StorageMap< + _, + Twox64Concat, + ParaId, + Vec, + ValueQuery + >; + + /// Storage for the messages for each channel. + /// Invariant: cannot be non-empty if the corresponding channel in `HrmpChannels` is `None`. + #[pallet::storage] + pub type HrmpChannelContents = StorageMap< + _, + Twox64Concat, + HrmpChannelId, + Vec>, + ValueQuery + >; + + /// Maintains a mapping that can be used to answer the question: + /// What paras sent a message at the given block number for a given receiver. + /// Invariants: + /// - The inner `Vec` is never empty. + /// - The inner `Vec` cannot store two same `ParaId`. + /// - The outer vector is sorted ascending by block number and cannot store two items with the same + /// block number. + #[pallet::storage] + pub type HrmpChannelDigests = StorageMap< + _, + Twox64Concat, + ParaId, + Vec<(T::BlockNumber, Vec)>, + ValueQuery + >; + + /// Preopen the given HRMP channels. + /// + /// The values in the tuple corresponds to `(sender, recipient, max_capacity, max_message_size)`, + /// i.e. similar to `init_open_channel`. In fact, the initialization is performed as if + /// the `init_open_channel` and `accept_open_channel` were called with the respective parameters + /// and the session change take place. + /// + /// As such, each channel initializer should satisfy the same constraints, namely: + /// + /// 1. `max_capacity` and `max_message_size` should be within the limits set by the configuration pallet. + /// 2. `sender` and `recipient` must be valid paras. + #[pallet::genesis_config] + pub struct GenesisConfig { + preopen_hrmp_channels: Vec<(ParaId, ParaId, u32, u32)>, + } + + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + GenesisConfig { + preopen_hrmp_channels: Default::default(), + } + } + } + + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + initialize_storage::(&self.preopen_hrmp_channels); + } + } + + #[pallet::call] + impl Pallet { /// Initiate opening a channel from a parachain to a given recipient with given channel /// parameters. /// @@ -410,9 +457,9 @@ decl_module! { /// /// The channel can be opened only after the recipient confirms it and only on a session /// change. - #[weight = 0] + #[pallet::weight(0)] pub fn hrmp_init_open_channel( - origin, + origin: OriginFor, recipient: ParaId, proposed_max_capacity: u32, proposed_max_message_size: u32, @@ -436,8 +483,8 @@ decl_module! { /// Accept a pending open channel request from the given sender. /// /// The channel will be opened only on the next session boundary. - #[weight = 0] - pub fn hrmp_accept_open_channel(origin, sender: ParaId) -> DispatchResult { + #[pallet::weight(0)] + pub fn hrmp_accept_open_channel(origin: OriginFor, sender: ParaId) -> DispatchResult { let origin = ensure_parachain(::Origin::from(origin))?; Self::accept_open_channel(origin, sender)?; Self::deposit_event(Event::OpenChannelAccepted(sender, origin)); @@ -448,8 +495,8 @@ decl_module! { /// recipient in the channel being closed. /// /// The closure can only happen on a session change. - #[weight = 0] - pub fn hrmp_close_channel(origin, channel_id: HrmpChannelId) -> DispatchResult { + #[pallet::weight(0)] + pub fn hrmp_close_channel(origin: OriginFor, channel_id: HrmpChannelId) -> DispatchResult { let origin = ensure_parachain(::Origin::from(origin))?; Self::close_channel(origin, channel_id.clone())?; Self::deposit_event(Event::ChannelClosed(origin, channel_id)); @@ -461,8 +508,8 @@ decl_module! { /// you to trigger the cleanup immediately for a specific parachain. /// /// Origin must be Root. - #[weight = 0] - pub fn force_clean_hrmp(origin, para: ParaId) -> DispatchResult { + #[pallet::weight(0)] + pub fn force_clean_hrmp(origin: OriginFor, para: ParaId) -> DispatchResult { ensure_root(origin)?; Self::clean_hrmp_after_outgoing(¶); Ok(()) @@ -472,8 +519,8 @@ decl_module! { /// /// If there are pending HRMP open channel requests, you can use this /// function process all of those requests immediately. - #[weight = 0] - pub fn force_process_hrmp_open(origin) -> DispatchResult { + #[pallet::weight(0)] + pub fn force_process_hrmp_open(origin: OriginFor) -> DispatchResult { ensure_root(origin)?; let host_config = configuration::Module::::config(); Self::process_hrmp_open_channel_requests(&host_config); @@ -484,8 +531,8 @@ decl_module! { /// /// If there are pending HRMP close channel requests, you can use this /// function process all of those requests immediately. - #[weight = 0] - pub fn force_process_hrmp_close(origin) -> DispatchResult { + #[pallet::weight(0)] + pub fn force_process_hrmp_close(origin: OriginFor) -> DispatchResult { ensure_root(origin)?; Self::process_hrmp_close_channel_requests(); Ok(()) @@ -493,8 +540,36 @@ decl_module! { } } +#[cfg(feature = "std")] +fn initialize_storage(preopen_hrmp_channels: &[(ParaId, ParaId, u32, u32)]) { + let host_config = configuration::Module::::config(); + for &(sender, recipient, max_capacity, max_message_size) in preopen_hrmp_channels { + if let Err(err) = preopen_hrmp_channel::(sender, recipient, max_capacity, max_message_size) { + panic!("failed to initialize the genesis storage: {:?}", err); + } + } + >::process_hrmp_open_channel_requests(&host_config); +} + +#[cfg(feature = "std")] +fn preopen_hrmp_channel( + sender: ParaId, + recipient: ParaId, + max_capacity: u32, + max_message_size: u32 +) -> DispatchResult { + >::init_open_channel( + sender, + recipient, + max_capacity, + max_message_size, + )?; + >::accept_open_channel(recipient, sender)?; + Ok(()) +} + /// Routines and getters related to HRMP. -impl Module { +impl Pallet { /// Block initialization logic, called by initializer. pub(crate) fn initializer_initialize(_now: T::BlockNumber) -> Weight { 0 @@ -962,7 +1037,7 @@ impl Module { /// Initiate opening a channel from a parachain to a given recipient with given channel /// parameters. /// - /// Basically the same as [`hrmp_init_open_channel`](Module::hrmp_init_open_channel) but intendend for calling directly from + /// Basically the same as [`hrmp_init_open_channel`](Pallet::hrmp_init_open_channel) but intendend for calling directly from /// other pallets rather than dispatched. pub fn init_open_channel( origin: ParaId, @@ -1063,7 +1138,7 @@ impl Module { /// Accept a pending open channel request from the given sender. /// - /// Basically the same as [`hrmp_accept_open_channel`](Module::hrmp_accept_open_channel) but + /// Basically the same as [`hrmp_accept_open_channel`](Pallet::hrmp_accept_open_channel) but /// intendend for calling directly from other pallets rather than dispatched. pub fn accept_open_channel(origin: ParaId, sender: ParaId) -> DispatchResult { let channel_id = HrmpChannelId { @@ -1225,7 +1300,6 @@ mod tests { use std::collections::{BTreeMap, HashSet}; fn run_to_block(to: BlockNumber, new_session: Option>) { - use frame_support::traits::{OnFinalize as _, OnInitialize as _}; let config = Configuration::config(); while System::block_number() < to { @@ -1357,8 +1431,6 @@ mod tests { } fn assert_storage_consistency_exhaustive() { - use frame_support::IterableStorageMap; - assert_eq!( ::HrmpOpenChannelRequests::iter() .map(|(k, _)| k) diff --git a/polkadot/runtime/parachains/src/inclusion.rs b/polkadot/runtime/parachains/src/inclusion.rs index e8dcb2f5bf..f75366bfb4 100644 --- a/polkadot/runtime/parachains/src/inclusion.rs +++ b/polkadot/runtime/parachains/src/inclusion.rs @@ -701,15 +701,15 @@ impl Pallet { receipt.descriptor.para_id, commitments.processed_downward_messages, ); - weight += >::receive_upward_messages( + weight += >::receive_upward_messages( receipt.descriptor.para_id, commitments.upward_messages, ); - weight += >::prune_hrmp( + weight += >::prune_hrmp( receipt.descriptor.para_id, T::BlockNumber::from(commitments.hrmp_watermark), ); - weight += >::queue_outbound_hrmp( + weight += >::queue_outbound_hrmp( receipt.descriptor.para_id, commitments.horizontal_messages, ); @@ -923,12 +923,12 @@ impl CandidateCheckContext { processed_downward_messages, )?; >::check_upward_messages(&self.config, para_id, upward_messages)?; - >::check_hrmp_watermark( + >::check_hrmp_watermark( para_id, self.relay_parent_number, hrmp_watermark, )?; - >::check_outbound_hrmp(&self.config, para_id, horizontal_messages)?; + >::check_outbound_hrmp(&self.config, para_id, horizontal_messages)?; Ok(()) } diff --git a/polkadot/runtime/parachains/src/initializer.rs b/polkadot/runtime/parachains/src/initializer.rs index b355e0d0cc..361365683b 100644 --- a/polkadot/runtime/parachains/src/initializer.rs +++ b/polkadot/runtime/parachains/src/initializer.rs @@ -141,7 +141,7 @@ pub mod pallet { T::DisputesHandler::initializer_initialize(now) + dmp::Pallet::::initializer_initialize(now) + ump::Module::::initializer_initialize(now) + - hrmp::Module::::initializer_initialize(now); + hrmp::Pallet::::initializer_initialize(now); HasInitialized::::set(Some(())); @@ -150,7 +150,7 @@ pub mod pallet { fn on_finalize(_: T::BlockNumber) { // reverse initialization order. - hrmp::Module::::initializer_finalize(); + hrmp::Pallet::::initializer_finalize(); ump::Module::::initializer_finalize(); dmp::Pallet::::initializer_finalize(); T::DisputesHandler::initializer_finalize(); @@ -240,7 +240,7 @@ impl Pallet { T::DisputesHandler::initializer_on_new_session(¬ification); dmp::Pallet::::initializer_on_new_session(¬ification, &outgoing_paras); ump::Module::::initializer_on_new_session(¬ification, &outgoing_paras); - hrmp::Module::::initializer_on_new_session(¬ification, &outgoing_paras); + hrmp::Pallet::::initializer_on_new_session(¬ification, &outgoing_paras); } /// Should be called when a new session occurs. Buffers the session notification to be applied diff --git a/polkadot/runtime/parachains/src/mock.rs b/polkadot/runtime/parachains/src/mock.rs index c909890020..904d87dae9 100644 --- a/polkadot/runtime/parachains/src/mock.rs +++ b/polkadot/runtime/parachains/src/mock.rs @@ -53,7 +53,7 @@ frame_support::construct_runtime!( Initializer: initializer::{Pallet, Call, Storage}, Dmp: dmp::{Pallet, Call, Storage}, Ump: ump::{Pallet, Call, Storage, Event}, - Hrmp: hrmp::{Pallet, Call, Storage, Event}, + Hrmp: hrmp::{Pallet, Call, Storage, Event}, SessionInfo: session_info::{Pallet, Call, Storage}, Disputes: disputes::{Pallet, Storage, Event}, } diff --git a/polkadot/runtime/parachains/src/runtime_api_impl/v1.rs b/polkadot/runtime/parachains/src/runtime_api_impl/v1.rs index 3757b16992..73962f8bbb 100644 --- a/polkadot/runtime/parachains/src/runtime_api_impl/v1.rs +++ b/polkadot/runtime/parachains/src/runtime_api_impl/v1.rs @@ -322,7 +322,7 @@ pub fn dmq_contents( pub fn inbound_hrmp_channels_contents( recipient: ParaId, ) -> BTreeMap>> { - >::inbound_hrmp_channels_contents(recipient) + >::inbound_hrmp_channels_contents(recipient) } /// Implementation for the `validation_code_by_hash` function of the runtime API. diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index caebeba49a..bc3cdd6e19 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -221,7 +221,7 @@ construct_runtime! { Initializer: parachains_initializer::{Pallet, Call, Storage}, Dmp: parachains_dmp::{Pallet, Call, Storage}, Ump: parachains_ump::{Pallet, Call, Storage, Event}, - Hrmp: parachains_hrmp::{Pallet, Call, Storage, Event, Config}, + Hrmp: parachains_hrmp::{Pallet, Call, Storage, Event, Config}, SessionInfo: parachains_session_info::{Pallet, Call, Storage}, // Parachain Onboarding Pallets diff --git a/polkadot/runtime/test-runtime/src/lib.rs b/polkadot/runtime/test-runtime/src/lib.rs index 32baf144dd..03ad07768f 100644 --- a/polkadot/runtime/test-runtime/src/lib.rs +++ b/polkadot/runtime/test-runtime/src/lib.rs @@ -543,7 +543,7 @@ construct_runtime! { Scheduler: parachains_scheduler::{Pallet, Call, Storage}, ParasSudoWrapper: paras_sudo_wrapper::{Pallet, Call}, SessionInfo: parachains_session_info::{Pallet, Call, Storage}, - Hrmp: parachains_hrmp::{Pallet, Call, Storage, Event}, + Hrmp: parachains_hrmp::{Pallet, Call, Storage, Event}, Ump: parachains_ump::{Pallet, Call, Storage, Event}, Dmp: parachains_dmp::{Pallet, Call, Storage}, ParasDisputes: parachains_disputes::{Pallet, Storage, Event}, diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index df58d6c12d..d15cdc8fc3 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -1080,7 +1080,7 @@ construct_runtime! { Initializer: parachains_initializer::{Pallet, Call, Storage} = 48, Dmp: parachains_dmp::{Pallet, Call, Storage} = 49, ParasUmp: parachains_ump::{Pallet, Call, Storage, Event} = 50, - ParasHrmp: parachains_hrmp::{Pallet, Call, Storage, Event} = 51, + Hrmp: parachains_hrmp::{Pallet, Call, Storage, Event} = 51, ParasSessionInfo: parachains_session_info::{Pallet, Call, Storage} = 52, // Parachain Onboarding Pallets. Start indices at 60 to leave room.