From b86664aefe6d5e77957ab7f5ebabf75249df8768 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Fri, 20 Oct 2023 23:55:16 +0200 Subject: [PATCH] Move all bridging pallet configurations to the submodule where they belong --- .../src/bridge_common_config.rs | 25 ++- .../src/bridge_hub_rococo_config.rs | 55 +++++- .../src/bridge_hub_wococo_config.rs | 54 +++++- .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 163 +++--------------- .../bridge-hub-rococo/src/xcm_config.rs | 12 +- .../bridge-hub-rococo/tests/tests.rs | 25 +-- 6 files changed, 167 insertions(+), 167 deletions(-) diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_common_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_common_config.rs index 4aece56c54042..a5f375eeddb96 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_common_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_common_config.rs @@ -21,7 +21,7 @@ //! For example, the messaging pallet needs to know the sending and receiving chains, but the //! GRANDPA tracking pallet only needs to be aware of one chain. -use super::{weights, Runtime, RuntimeEvent}; +use super::{weights, AccountId, Balance, Balances, BlockNumber, Runtime, RuntimeEvent}; use bp_parachains::SingleParaStoredHeaderDataBuilder; use frame_support::{parameter_types, traits::ConstU32}; @@ -33,6 +33,12 @@ parameter_types! { pub const MaxRococoParaHeadDataSize: u32 = bp_rococo::MAX_NESTED_PARACHAIN_HEAD_DATA_SIZE; pub const WococoBridgeParachainPalletName: &'static str = "Paras"; pub const MaxWococoParaHeadDataSize: u32 = bp_wococo::MAX_NESTED_PARACHAIN_HEAD_DATA_SIZE; + + pub storage RequiredStakeForStakeAndSlash: Balance = 1_000_000; + pub const RelayerStakeLease: u32 = 8; + pub const RelayerStakeReserveId: [u8; 8] = *b"brdgrlrs"; + + pub storage DeliveryRewardInBalance: u64 = 1_000_000; } /// Add GRANDPA bridge pallet to track Wococo relay chain. @@ -80,3 +86,20 @@ impl pallet_bridge_parachains::Config for Runtime type HeadsToKeep = ParachainHeadsToKeep; type MaxParaHeadDataSize = MaxRococoParaHeadDataSize; } + +/// Allows collect and claim rewards for relayers +impl pallet_bridge_relayers::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Reward = Balance; + type PaymentProcedure = + bp_relayers::PayRewardFromAccount, AccountId>; + type StakeAndSlash = pallet_bridge_relayers::StakeAndSlashNamed< + AccountId, + BlockNumber, + Balances, + RelayerStakeReserveId, + RequiredStakeForStakeAndSlash, + RelayerStakeLease, + >; + type WeightInfo = weights::pallet_bridge_relayers::WeightInfo; +} diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_rococo_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_rococo_config.rs index be96b8f21fcd4..078e216ec89c6 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_rococo_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_rococo_config.rs @@ -14,25 +14,31 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -//! Bridge definitions that are used on Rococo to bridge with Wococo. +//! Bridge definitions used on BridgeHub with the Rococo flavor. use crate::{ - bridge_common_config::BridgeParachainWococoInstance, BridgeWococoMessages, ParachainInfo, - Runtime, WithBridgeHubWococoMessagesInstance, XcmRouter, + bridge_common_config::{BridgeParachainWococoInstance, DeliveryRewardInBalance}, + weights, AccountId, BridgeWococoMessages, ParachainInfo, Runtime, RuntimeEvent, RuntimeOrigin, + XcmRouter, }; use bp_messages::LaneId; use bridge_runtime_common::{ messages, messages::{ - source::FromBridgedChainMessagesDeliveryProof, target::FromBridgedChainMessagesProof, + source::{FromBridgedChainMessagesDeliveryProof, TargetHeaderChainAdapter}, + target::{FromBridgedChainMessagesProof, SourceHeaderChainAdapter}, MessageBridge, ThisChainWithMessages, UnderlyingChainProvider, }, - messages_xcm_extension::{SenderAndLane, XcmBlobHauler, XcmBlobHaulerAdapter}, + messages_xcm_extension::{ + SenderAndLane, XcmAsPlainPayload, XcmBlobHauler, XcmBlobHaulerAdapter, + XcmBlobMessageDispatch, + }, refund_relayer_extension::{ ActualFeeRefund, RefundBridgedParachainMessages, RefundSignedExtensionAdapter, RefundableMessagesLane, RefundableParachain, }, }; + use codec::Encode; use frame_support::{parameter_types, traits::PalletInfoAccess}; use sp_runtime::RuntimeDebug; @@ -162,7 +168,7 @@ impl UnderlyingChainProvider for BridgeHubRococo { } impl ThisChainWithMessages for BridgeHubRococo { - type RuntimeOrigin = crate::RuntimeOrigin; + type RuntimeOrigin = RuntimeOrigin; } /// Signed extension that refunds relayers that are delivering messages from the Wococo parachain. @@ -182,6 +188,43 @@ parameter_types! { pub const BridgeHubWococoMessagesLane: bp_messages::LaneId = DEFAULT_XCM_LANE_TO_BRIDGE_HUB_WOCOCO; } +/// Add XCM messages support for BridgeHubRococo to support Rococo->Wococo XCM messages +pub type WithBridgeHubWococoMessagesInstance = pallet_bridge_messages::Instance1; +impl pallet_bridge_messages::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = weights::pallet_bridge_messages_bridge_messages_bench_runtime_with_bridge_hub_wococo_messages_instance::WeightInfo; + type BridgedChainId = BridgeHubWococoChainId; + type ActiveOutboundLanes = ActiveOutboundLanesToBridgeHubWococo; + type MaxUnrewardedRelayerEntriesAtInboundLane = MaxUnrewardedRelayerEntriesAtInboundLane; + type MaxUnconfirmedMessagesAtInboundLane = MaxUnconfirmedMessagesAtInboundLane; + + type MaximalOutboundPayloadSize = ToBridgeHubWococoMaximalOutboundPayloadSize; + type OutboundPayload = XcmAsPlainPayload; + + type InboundPayload = XcmAsPlainPayload; + type InboundRelayer = AccountId; + type DeliveryPayments = (); + + type TargetHeaderChain = TargetHeaderChainAdapter; + type LaneMessageVerifier = ToBridgeHubWococoMessageVerifier; + type DeliveryConfirmationPayments = pallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter< + Runtime, + WithBridgeHubWococoMessagesInstance, + DeliveryRewardInBalance, + >; + + type SourceHeaderChain = SourceHeaderChainAdapter; + type MessageDispatch = XcmBlobMessageDispatch< + OnBridgeHubRococoBlobDispatcher, + Self::WeightInfo, + cumulus_pallet_xcmp_queue::bridging::OutXcmpChannelStatusProvider< + AssetHubRococoParaId, + Runtime, + >, + >; + type OnMessagesDelivered = OnMessagesDelivered; +} + #[cfg(test)] mod tests { use super::*; diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_wococo_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_wococo_config.rs index 4039ac7ce7001..dfafd9a9f688e 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_wococo_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_wococo_config.rs @@ -14,20 +14,25 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -//! Bridge definitions that are used on Wococo to bridge with Rococo. +//! Bridge definitions used on BridgeHub with the Wococo flavor. use crate::{ - bridge_common_config::BridgeParachainRococoInstance, BridgeRococoMessages, ParachainInfo, - Runtime, WithBridgeHubRococoMessagesInstance, XcmRouter, + bridge_common_config::{BridgeParachainRococoInstance, DeliveryRewardInBalance}, + weights, AccountId, BridgeRococoMessages, ParachainInfo, Runtime, RuntimeEvent, RuntimeOrigin, + XcmRouter, }; use bp_messages::LaneId; use bridge_runtime_common::{ messages, messages::{ - source::FromBridgedChainMessagesDeliveryProof, target::FromBridgedChainMessagesProof, + source::{FromBridgedChainMessagesDeliveryProof, TargetHeaderChainAdapter}, + target::{FromBridgedChainMessagesProof, SourceHeaderChainAdapter}, MessageBridge, ThisChainWithMessages, UnderlyingChainProvider, }, - messages_xcm_extension::{SenderAndLane, XcmBlobHauler, XcmBlobHaulerAdapter}, + messages_xcm_extension::{ + SenderAndLane, XcmAsPlainPayload, XcmBlobHauler, XcmBlobHaulerAdapter, + XcmBlobMessageDispatch, + }, refund_relayer_extension::{ ActualFeeRefund, RefundBridgedParachainMessages, RefundSignedExtensionAdapter, RefundableMessagesLane, RefundableParachain, @@ -162,7 +167,7 @@ impl UnderlyingChainProvider for BridgeHubWococo { } impl ThisChainWithMessages for BridgeHubWococo { - type RuntimeOrigin = crate::RuntimeOrigin; + type RuntimeOrigin = RuntimeOrigin; } /// Signed extension that refunds relayers that are delivering messages from the Rococo parachain. @@ -182,6 +187,43 @@ parameter_types! { pub const BridgeHubRococoMessagesLane: bp_messages::LaneId = DEFAULT_XCM_LANE_TO_BRIDGE_HUB_ROCOCO; } +/// Add XCM messages support for BridgeHubWococo to support Wococo->Rococo XCM messages +pub type WithBridgeHubRococoMessagesInstance = pallet_bridge_messages::Instance2; +impl pallet_bridge_messages::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = weights::pallet_bridge_messages_bridge_messages_bench_runtime_with_bridge_hub_rococo_messages_instance::WeightInfo; + type BridgedChainId = BridgeHubRococoChainId; + type ActiveOutboundLanes = ActiveOutboundLanesToBridgeHubRococo; + type MaxUnrewardedRelayerEntriesAtInboundLane = MaxUnrewardedRelayerEntriesAtInboundLane; + type MaxUnconfirmedMessagesAtInboundLane = MaxUnconfirmedMessagesAtInboundLane; + + type MaximalOutboundPayloadSize = ToBridgeHubRococoMaximalOutboundPayloadSize; + type OutboundPayload = XcmAsPlainPayload; + + type InboundPayload = XcmAsPlainPayload; + type InboundRelayer = AccountId; + type DeliveryPayments = (); + + type TargetHeaderChain = TargetHeaderChainAdapter; + type LaneMessageVerifier = ToBridgeHubRococoMessageVerifier; + type DeliveryConfirmationPayments = pallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter< + Runtime, + WithBridgeHubRococoMessagesInstance, + DeliveryRewardInBalance, + >; + + type SourceHeaderChain = SourceHeaderChainAdapter; + type MessageDispatch = XcmBlobMessageDispatch< + OnBridgeHubWococoBlobDispatcher, + Self::WeightInfo, + cumulus_pallet_xcmp_queue::bridging::OutXcmpChannelStatusProvider< + AssetHubWococoParaId, + Runtime, + >, + >; + type OnMessagesDelivered = OnMessagesDelivered; +} + #[cfg(test)] mod tests { use super::*; diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index ae9a84efbec23..de581e6e1266a 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -80,19 +80,8 @@ use xcm::latest::prelude::*; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; use crate::{ - bridge_hub_rococo_config::{ - BridgeRefundBridgeHubWococoMessages, OnBridgeHubRococoBlobDispatcher, - WithBridgeHubWococoMessageBridge, - }, - bridge_hub_wococo_config::{ - BridgeRefundBridgeHubRococoMessages, OnBridgeHubWococoBlobDispatcher, - WithBridgeHubRococoMessageBridge, - }, - xcm_config::XcmRouter, -}; -use bridge_runtime_common::{ - messages::{source::TargetHeaderChainAdapter, target::SourceHeaderChainAdapter}, - messages_xcm_extension::{XcmAsPlainPayload, XcmBlobMessageDispatch}, + bridge_hub_rococo_config::BridgeRefundBridgeHubWococoMessages, + bridge_hub_wococo_config::BridgeRefundBridgeHubRococoMessages, xcm_config::XcmRouter, }; use parachains_common::{ impls::DealWithFees, @@ -468,110 +457,6 @@ impl pallet_utility::Config for Runtime { type WeightInfo = weights::pallet_utility::WeightInfo; } -parameter_types! { - pub storage DeliveryRewardInBalance: u64 = 1_000_000; - pub storage RequiredStakeForStakeAndSlash: Balance = 1_000_000; - - pub const RelayerStakeLease: u32 = 8; - pub const RelayerStakeReserveId: [u8; 8] = *b"brdgrlrs"; -} - -/// Add XCM messages support for BridgeHubRococo to support Rococo->Wococo XCM messages -pub type WithBridgeHubWococoMessagesInstance = pallet_bridge_messages::Instance1; -impl pallet_bridge_messages::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = weights::pallet_bridge_messages_bridge_messages_bench_runtime_with_bridge_hub_wococo_messages_instance::WeightInfo; - type BridgedChainId = bridge_hub_rococo_config::BridgeHubWococoChainId; - type ActiveOutboundLanes = bridge_hub_rococo_config::ActiveOutboundLanesToBridgeHubWococo; - type MaxUnrewardedRelayerEntriesAtInboundLane = - bridge_hub_rococo_config::MaxUnrewardedRelayerEntriesAtInboundLane; - type MaxUnconfirmedMessagesAtInboundLane = - bridge_hub_rococo_config::MaxUnconfirmedMessagesAtInboundLane; - - type MaximalOutboundPayloadSize = - bridge_hub_rococo_config::ToBridgeHubWococoMaximalOutboundPayloadSize; - type OutboundPayload = XcmAsPlainPayload; - - type InboundPayload = XcmAsPlainPayload; - type InboundRelayer = AccountId; - type DeliveryPayments = (); - - type TargetHeaderChain = TargetHeaderChainAdapter; - type LaneMessageVerifier = bridge_hub_rococo_config::ToBridgeHubWococoMessageVerifier; - type DeliveryConfirmationPayments = pallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter< - Runtime, - WithBridgeHubWococoMessagesInstance, - DeliveryRewardInBalance, - >; - - type SourceHeaderChain = SourceHeaderChainAdapter; - type MessageDispatch = XcmBlobMessageDispatch< - OnBridgeHubRococoBlobDispatcher, - Self::WeightInfo, - cumulus_pallet_xcmp_queue::bridging::OutXcmpChannelStatusProvider< - bridge_hub_rococo_config::AssetHubRococoParaId, - Runtime, - >, - >; - type OnMessagesDelivered = bridge_hub_rococo_config::OnMessagesDelivered; -} - -/// Add XCM messages support for BridgeHubWococo to support Wococo->Rococo XCM messages -pub type WithBridgeHubRococoMessagesInstance = pallet_bridge_messages::Instance2; -impl pallet_bridge_messages::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = weights::pallet_bridge_messages_bridge_messages_bench_runtime_with_bridge_hub_rococo_messages_instance::WeightInfo; - type BridgedChainId = bridge_hub_wococo_config::BridgeHubRococoChainId; - type ActiveOutboundLanes = bridge_hub_wococo_config::ActiveOutboundLanesToBridgeHubRococo; - type MaxUnrewardedRelayerEntriesAtInboundLane = - bridge_hub_wococo_config::MaxUnrewardedRelayerEntriesAtInboundLane; - type MaxUnconfirmedMessagesAtInboundLane = - bridge_hub_wococo_config::MaxUnconfirmedMessagesAtInboundLane; - - type MaximalOutboundPayloadSize = - bridge_hub_wococo_config::ToBridgeHubRococoMaximalOutboundPayloadSize; - type OutboundPayload = XcmAsPlainPayload; - - type InboundPayload = XcmAsPlainPayload; - type InboundRelayer = AccountId; - type DeliveryPayments = (); - - type TargetHeaderChain = TargetHeaderChainAdapter; - type LaneMessageVerifier = bridge_hub_wococo_config::ToBridgeHubRococoMessageVerifier; - type DeliveryConfirmationPayments = pallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter< - Runtime, - WithBridgeHubRococoMessagesInstance, - DeliveryRewardInBalance, - >; - - type SourceHeaderChain = SourceHeaderChainAdapter; - type MessageDispatch = XcmBlobMessageDispatch< - OnBridgeHubWococoBlobDispatcher, - Self::WeightInfo, - cumulus_pallet_xcmp_queue::bridging::OutXcmpChannelStatusProvider< - bridge_hub_wococo_config::AssetHubWococoParaId, - Runtime, - >, - >; - type OnMessagesDelivered = bridge_hub_wococo_config::OnMessagesDelivered; -} - -/// Allows collect and claim rewards for relayers -impl pallet_bridge_relayers::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Reward = Balance; - type PaymentProcedure = - bp_relayers::PayRewardFromAccount, AccountId>; - type StakeAndSlash = pallet_bridge_relayers::StakeAndSlashNamed< - AccountId, - BlockNumber, - Balances, - RelayerStakeReserveId, - RequiredStakeForStakeAndSlash, - RelayerStakeLease, - >; - type WeightInfo = weights::pallet_bridge_relayers::WeightInfo; -} // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( @@ -656,12 +541,12 @@ mod benches { [pallet_xcm_benchmarks::generic, XcmGeneric] // Bridge pallets at Rococo [pallet_bridge_grandpa, BridgeWococoGrandpa] - [pallet_bridge_parachains, BridgeParachainsBench::] - [pallet_bridge_messages, BridgeMessagesBench::] + [pallet_bridge_parachains, BridgeParachainsBench::] + [pallet_bridge_messages, BridgeMessagesBench::] // Bridge pallets at Wococo [pallet_bridge_grandpa, BridgeRococoGrandpa] - [pallet_bridge_parachains, BridgeParachainsBench::] - [pallet_bridge_messages, BridgeMessagesBench::] + [pallet_bridge_parachains, BridgeParachainsBench::] + [pallet_bridge_messages, BridgeMessagesBench::] // Bridge relayer pallets [pallet_bridge_relayers, BridgeRelayersBench::] ); @@ -848,7 +733,7 @@ impl_runtime_apis! { } } - // This exposed by BridgeHubRococo + // This is exposed by BridgeHubRococo impl bp_bridge_hub_wococo::FromBridgeHubWococoInboundLaneApi for Runtime { fn message_details( lane: bp_messages::LaneId, @@ -856,12 +741,12 @@ impl_runtime_apis! { ) -> Vec { bridge_runtime_common::messages_api::inbound_message_details::< Runtime, - WithBridgeHubWococoMessagesInstance, + bridge_hub_rococo_config::WithBridgeHubWococoMessagesInstance, >(lane, messages) } } - // This exposed by BridgeHubRococo + // This is exposed by BridgeHubRococo impl bp_bridge_hub_wococo::ToBridgeHubWococoOutboundLaneApi for Runtime { fn message_details( lane: bp_messages::LaneId, @@ -870,7 +755,7 @@ impl_runtime_apis! { ) -> Vec { bridge_runtime_common::messages_api::outbound_message_details::< Runtime, - WithBridgeHubWococoMessagesInstance, + bridge_hub_rococo_config::WithBridgeHubWococoMessagesInstance, >(lane, begin, end) } } @@ -883,7 +768,7 @@ impl_runtime_apis! { ) -> Vec { bridge_runtime_common::messages_api::inbound_message_details::< Runtime, - WithBridgeHubRococoMessagesInstance, + bridge_hub_wococo_config::WithBridgeHubRococoMessagesInstance, >(lane, messages) } } @@ -897,7 +782,7 @@ impl_runtime_apis! { ) -> Vec { bridge_runtime_common::messages_api::outbound_message_details::< Runtime, - WithBridgeHubRococoMessagesInstance, + bridge_hub_wococo_config::WithBridgeHubRococoMessagesInstance, >(lane, begin, end) } } @@ -1087,9 +972,9 @@ impl_runtime_apis! { MessageProofParams, }; - impl BridgeMessagesConfig for Runtime { + impl BridgeMessagesConfig for Runtime { fn is_relayer_rewarded(relayer: &Self::AccountId) -> bool { - let bench_lane_id = >::bench_lane_id(); + let bench_lane_id = >::bench_lane_id(); let bridged_chain_id = bp_runtime::BRIDGE_HUB_WOCOCO_CHAIN_ID; pallet_bridge_relayers::Pallet::::relayer_reward( relayer, @@ -1109,7 +994,7 @@ impl_runtime_apis! { ParachainSystem::open_outbound_hrmp_channel_for_benchmarks_or_tests(42.into()); prepare_message_proof_from_parachain::< Runtime, - BridgeGrandpaWococoInstance, + bridge_common_config::BridgeGrandpaWococoInstance, bridge_hub_rococo_config::WithBridgeHubWococoMessageBridge, >(params, generate_xcm_builder_bridge_message_sample(X2(GlobalConsensus(Rococo), Parachain(42)))) } @@ -1119,7 +1004,7 @@ impl_runtime_apis! { ) -> bridge_hub_rococo_config::ToWococoBridgeHubMessagesDeliveryProof { prepare_message_delivery_proof_from_parachain::< Runtime, - BridgeGrandpaWococoInstance, + bridge_common_config::BridgeGrandpaWococoInstance, bridge_hub_rococo_config::WithBridgeHubWococoMessageBridge, >(params) } @@ -1130,9 +1015,9 @@ impl_runtime_apis! { } } - impl BridgeMessagesConfig for Runtime { + impl BridgeMessagesConfig for Runtime { fn is_relayer_rewarded(relayer: &Self::AccountId) -> bool { - let bench_lane_id = >::bench_lane_id(); + let bench_lane_id = >::bench_lane_id(); let bridged_chain_id = bp_runtime::BRIDGE_HUB_ROCOCO_CHAIN_ID; pallet_bridge_relayers::Pallet::::relayer_reward( relayer, @@ -1152,7 +1037,7 @@ impl_runtime_apis! { ParachainSystem::open_outbound_hrmp_channel_for_benchmarks_or_tests(42.into()); prepare_message_proof_from_parachain::< Runtime, - BridgeGrandpaRococoInstance, + bridge_common_config::BridgeGrandpaRococoInstance, bridge_hub_wococo_config::WithBridgeHubRococoMessageBridge, >(params, generate_xcm_builder_bridge_message_sample(X2(GlobalConsensus(Wococo), Parachain(42)))) } @@ -1162,7 +1047,7 @@ impl_runtime_apis! { ) -> bridge_hub_wococo_config::ToRococoBridgeHubMessagesDeliveryProof { prepare_message_delivery_proof_from_parachain::< Runtime, - BridgeGrandpaRococoInstance, + bridge_common_config::BridgeGrandpaRococoInstance, bridge_hub_wococo_config::WithBridgeHubRococoMessageBridge, >(params) } @@ -1183,7 +1068,7 @@ impl_runtime_apis! { Config as BridgeRelayersConfig, }; - impl BridgeParachainsConfig for Runtime { + impl BridgeParachainsConfig for Runtime { fn parachains() -> Vec { use bp_runtime::Parachain; vec![bp_polkadot_core::parachains::ParaId(bp_bridge_hub_wococo::BridgeHubWococo::PARACHAIN_ID)] @@ -1199,7 +1084,7 @@ impl_runtime_apis! { bp_polkadot_core::parachains::ParaHeadsProof, Vec<(bp_polkadot_core::parachains::ParaId, bp_polkadot_core::parachains::ParaHash)>, ) { - prepare_parachain_heads_proof::( + prepare_parachain_heads_proof::( parachains, parachain_head_size, proof_size, @@ -1207,7 +1092,7 @@ impl_runtime_apis! { } } - impl BridgeParachainsConfig for Runtime { + impl BridgeParachainsConfig for Runtime { fn parachains() -> Vec { use bp_runtime::Parachain; vec![bp_polkadot_core::parachains::ParaId(bp_bridge_hub_rococo::BridgeHubRococo::PARACHAIN_ID)] @@ -1223,7 +1108,7 @@ impl_runtime_apis! { bp_polkadot_core::parachains::ParaHeadsProof, Vec<(bp_polkadot_core::parachains::ParaId, bp_polkadot_core::parachains::ParaHash)>, ) { - prepare_parachain_heads_proof::( + prepare_parachain_heads_proof::( parachains, parachain_head_size, proof_size, diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs index 5b433cded8c55..9d0183901ef29 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs @@ -15,13 +15,15 @@ // along with Cumulus. If not, see . use super::{ - AccountId, AllPalletsWithSystem, Balances, BaseDeliveryFee, DeliveryRewardInBalance, - FeeAssetId, ParachainInfo, ParachainSystem, PolkadotXcm, RequiredStakeForStakeAndSlash, - Runtime, RuntimeCall, RuntimeEvent, RuntimeFlavor, RuntimeOrigin, TransactionByteFee, - WeightToFee, XcmpQueue, + AccountId, AllPalletsWithSystem, Balances, BaseDeliveryFee, FeeAssetId, ParachainInfo, + ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeFlavor, RuntimeOrigin, + TransactionByteFee, WeightToFee, XcmpQueue, }; use crate::{ - bridge_common_config::{BridgeGrandpaRococoInstance, BridgeGrandpaWococoInstance}, + bridge_common_config::{ + BridgeGrandpaRococoInstance, BridgeGrandpaWococoInstance, DeliveryRewardInBalance, + RequiredStakeForStakeAndSlash, + }, bridge_hub_rococo_config::ToBridgeHubWococoHaulBlobExporter, bridge_hub_wococo_config::ToBridgeHubRococoHaulBlobExporter, }; diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs index c319149532835..2ccb31b5bfc8b 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs @@ -20,9 +20,9 @@ use bp_polkadot_core::Signature; use bridge_hub_rococo_runtime::{ bridge_common_config, bridge_hub_rococo_config, bridge_hub_wococo_config, xcm_config::{RelayNetwork, TokenLocation, XcmConfig}, - AllPalletsWithoutSystem, BridgeRejectObsoleteHeadersAndMessages, DeliveryRewardInBalance, - Executive, ExistentialDeposit, ParachainSystem, PolkadotXcm, RequiredStakeForStakeAndSlash, - Runtime, RuntimeCall, RuntimeEvent, SessionKeys, SignedExtra, UncheckedExtrinsic, + AllPalletsWithoutSystem, BridgeRejectObsoleteHeadersAndMessages, Executive, ExistentialDeposit, + ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, SessionKeys, SignedExtra, + UncheckedExtrinsic, }; use codec::{Decode, Encode}; use frame_support::parameter_types; @@ -95,11 +95,14 @@ fn collator_session_keys() -> bridge_hub_test_utils::CollatorSessionKeys