Ensure xcm versions over bridge (on sending chains) (#2481)

## Summary

This pull request proposes a solution for improved control of the
versioned XCM flow over the bridge (across different consensus chains)
and resolves the situation where the sending chain/consensus has already
migrated to a higher XCM version than the receiving chain/consensus.

## Problem/Motivation

The current flow over the bridge involves a transfer from AssetHubRococo
(AHR) to BridgeHubRococo (BHR) to BridgeHubWestend (BHW) and finally to
AssetHubWestend (AHW), beginning with a reserve-backed transfer on AHR.

In this process:
1. AHR sends XCM `ExportMessage` through `XcmpQueue`, incorporating XCM
version checks using the `WrapVersion` feature, influenced by
`pallet_xcm::SupportedVersion` (managed by
`pallet_xcm::force_xcm_version` or version discovery).

2. BHR handles the `ExportMessage` instruction, utilizing the latest XCM
version. The `HaulBlobExporter` converts the inner XCM to
[`VersionedXcm::from`](https://github.com/paritytech/polkadot-sdk/blob/63ac2471aa0210f0ac9903bdd7d8f9351f9a635f/polkadot/xcm/xcm-builder/src/universal_exports.rs#L465-L467),
also using the latest XCM version.

However, challenges arise:
- Incompatibility when BHW uses a different version than BHR. For
instance, if BHR migrates to **XCMv4** while BHW remains on **XCMv3**,
BHR's `VersionedXcm::from` uses `VersionedXcm::V4` variant, causing
encoding issues for BHW.
  ```
	/// Just a simulation of possible error, which could happen on BHW
	/// (this code is based on actual master without XCMv4)
	let encoded = hex_literal::hex!("0400");
	println!("{:?}", VersionedXcm::<()>::decode(&mut &encoded[..]));

Err(Error { cause: None, desc: "Could not decode `VersionedXcm`, variant
doesn't exist" })
  ``` 
- Similar compatibility issues exist between AHR and AHW.

## Solution

This pull request introduces the following solutions:

1. **New trait `CheckVersion`** - added to the `xcm` module and exposing
`pallet_xcm::SupportedVersion`. This enhancement allows checking the
actual XCM version for desired destinations outside of the `pallet_xcm`
module.

2. **Version Check in `HaulBlobExporter`** uses `CheckVersion` to check
known/configured destination versions, ensuring compatibility. For
example, in the scenario mentioned, BHR can store the version `3` for
BHW. If BHR is on XCMv4, it will attempt to downgrade the message to
version `3` instead of using the latest version `4`.

3. **Version Check in `pallet-xcm-bridge-hub-router`** - this check
ensures compatibility with the real destination's XCM version,
preventing the unnecessary sending of messages to the local bridge hub
if versions are incompatible.

These additions aim to improve the control and compatibility of XCM
flows over the bridge and addressing issues related to version
mismatches.

## Possible alternative solution

_(More investigation is needed, and at the very least, it should extend
to XCMv4/5. If this proves to be a viable option, I can open an RFC for
XCM.)._

Add the `XcmVersion` attribute to the `ExportMessage` so that the
sending chain can determine, based on what is stored in
`pallet_xcm::SupportedVersion`, the version the destination is using.
This way, we may not need to handle the version in `HaulBlobExporter`.

```
ExportMessage {
	network: NetworkId,
	destination: InteriorMultiLocation,
	xcm: Xcm<()>
	destination_xcm_version: Version, // <- new attritbute
},
```

```
pub trait ExportXcm {
        fn validate(
		network: NetworkId,
		channel: u32,
		universal_source: &mut Option<InteriorMultiLocation>,
		destination: &mut Option<InteriorMultiLocation>,
		message: &mut Option<Xcm<()>>,
                destination_xcm_version: Version, , // <- new attritbute
	) -> SendResult<Self::Ticket>;
```

## Future Directions

This PR does not fix version discovery over bridge, further
investigation will be conducted here:
https://github.com/paritytech/polkadot-sdk/issues/2417.

## TODO

- [x] `pallet_xcm` mock for tests uses hard-coded XCM version `2` -
change to 3 or lastest?
- [x] fix `pallet-xcm-bridge-hub-router`
- [x] fix HaulBlobExporter with version determination
[here](https://github.com/paritytech/polkadot-sdk/blob/2183669d05f9b510f979a0cc3c7847707bacba2e/polkadot/xcm/xcm-builder/src/universal_exports.rs#L465)
- [x] add unit-tests to the runtimes
- [x] run benchmarks for `ExportMessage`
- [x] extend local run scripts about `force_xcm_version(dest, version)`
- [ ] when merged, prepare governance calls for Rococo/Westend
- [ ] add PRDoc

Part of: https://github.com/paritytech/parity-bridges-common/issues/2719

---------

Co-authored-by: command-bot <>
This commit is contained in:
Branislav Kontur
2023-12-12 16:04:26 +01:00
committed by GitHub
parent 42a3afba94
commit 575b8f8d15
55 changed files with 1277 additions and 488 deletions
@@ -20,7 +20,7 @@ use crate::{
bridge_common_config::{BridgeParachainWestendInstance, DeliveryRewardInBalance},
weights,
xcm_config::UniversalLocation,
AccountId, BridgeWestendMessages, Runtime, RuntimeEvent, RuntimeOrigin,
AccountId, BridgeWestendMessages, PolkadotXcm, Runtime, RuntimeEvent, RuntimeOrigin,
XcmOverBridgeHubWestend, XcmRouter,
};
use bp_messages::LaneId;
@@ -33,7 +33,7 @@ use bridge_runtime_common::{
},
messages_xcm_extension::{
SenderAndLane, XcmAsPlainPayload, XcmBlobHauler, XcmBlobHaulerAdapter,
XcmBlobMessageDispatch,
XcmBlobMessageDispatch, XcmVersionOfDestAndRemoteBridge,
},
refund_relayer_extension::{
ActualFeeRefund, RefundBridgedParachainMessages, RefundSignedExtensionAdapter,
@@ -58,6 +58,10 @@ parameter_types! {
pub const BridgeHubWestendChainId: bp_runtime::ChainId = bp_runtime::BRIDGE_HUB_WESTEND_CHAIN_ID;
pub BridgeRococoToWestendMessagesPalletInstance: InteriorMultiLocation = X1(PalletInstance(<BridgeWestendMessages as PalletInfoAccess>::index() as u8));
pub WestendGlobalConsensusNetwork: NetworkId = NetworkId::Westend;
pub WestendGlobalConsensusNetworkLocation: MultiLocation = MultiLocation {
parents: 2,
interior: X1(GlobalConsensus(WestendGlobalConsensusNetwork::get()))
};
// see the `FEE_BOOST_PER_MESSAGE` constant to get the meaning of this value
pub PriorityBoostPerMessage: u64 = 182_044_444_444_444;
@@ -80,6 +84,14 @@ parameter_types! {
pub CongestedMessage: Xcm<()> = build_congestion_message(true).into();
pub UncongestedMessage: Xcm<()> = build_congestion_message(false).into();
pub BridgeHubWestendLocation: MultiLocation = MultiLocation {
parents: 2,
interior: X2(
GlobalConsensus(WestendGlobalConsensusNetwork::get()),
Parachain(<bp_bridge_hub_westend::BridgeHubWestend as bp_runtime::Parachain>::PARACHAIN_ID)
)
};
}
pub const XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WESTEND: LaneId = LaneId([0, 0, 0, 2]);
@@ -120,7 +132,6 @@ pub struct ToBridgeHubWestendXcmBlobHauler;
impl XcmBlobHauler for ToBridgeHubWestendXcmBlobHauler {
type Runtime = Runtime;
type MessagesInstance = WithBridgeHubWestendMessagesInstance;
type ToSourceChainSender = XcmRouter;
type CongestedMessage = CongestedMessage;
type UncongestedMessage = UncongestedMessage;
@@ -234,9 +245,11 @@ impl pallet_bridge_messages::Config<WithBridgeHubWestendMessagesInstance> for Ru
pub type XcmOverBridgeHubWestendInstance = pallet_xcm_bridge_hub::Instance1;
impl pallet_xcm_bridge_hub::Config<XcmOverBridgeHubWestendInstance> for Runtime {
type UniversalLocation = UniversalLocation;
type BridgedNetworkId = WestendGlobalConsensusNetwork;
type BridgedNetwork = WestendGlobalConsensusNetworkLocation;
type BridgeMessagesPalletInstance = WithBridgeHubWestendMessagesInstance;
type MessageExportPrice = ();
type DestinationVersion =
XcmVersionOfDestAndRemoteBridge<PolkadotXcm, BridgeHubWestendLocation>;
type Lanes = ActiveLanes;
type LanesSupport = ToBridgeHubWestendXcmBlobHauler;
}
@@ -853,7 +853,7 @@ impl_runtime_apis! {
type XcmConfig = xcm_config::XcmConfig;
type AccountIdConverter = xcm_config::LocationToAccountId;
type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper<
xcm_config::XcmConfig,
xcm_config::XcmConfig,
ExistentialDepositMultiAsset,
xcm_config::PriceForParentDelivery,
>;
@@ -933,6 +933,21 @@ impl_runtime_apis! {
fn export_message_origin_and_destination(
) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError> {
// save XCM version for remote bridge hub
let _ = PolkadotXcm::force_xcm_version(
RuntimeOrigin::root(),
Box::new(bridge_to_westend_config::BridgeHubWestendLocation::get()),
XCM_VERSION,
).map_err(|e| {
log::error!(
"Failed to dispatch `force_xcm_version({:?}, {:?}, {:?})`, error: {:?}",
RuntimeOrigin::root(),
bridge_to_westend_config::BridgeHubWestendLocation::get(),
XCM_VERSION,
e
);
BenchmarkError::Stop("XcmVersion was not stored!")
})?;
Ok(
(
bridge_to_westend_config::FromAssetHubRococoToAssetHubWestendRoute::get().location,
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_xcm_benchmarks::generic`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-11-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-11-29, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-yprdrvc7-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-r43aesjn-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024
// Executed Command:
@@ -68,8 +68,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `171`
// Estimated: `6196`
// Minimum execution time: 63_453_000 picoseconds.
Weight::from_parts(64_220_000, 6196)
// Minimum execution time: 61_049_000 picoseconds.
Weight::from_parts(62_672_000, 6196)
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(4))
}
@@ -77,8 +77,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_238_000 picoseconds.
Weight::from_parts(2_351_000, 0)
// Minimum execution time: 1_972_000 picoseconds.
Weight::from_parts(2_095_000, 0)
}
// Storage: `PolkadotXcm::Queries` (r:1 w:0)
// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`)
@@ -86,58 +86,58 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `32`
// Estimated: `3497`
// Minimum execution time: 7_953_000 picoseconds.
Weight::from_parts(8_162_000, 3497)
// Minimum execution time: 7_541_000 picoseconds.
Weight::from_parts(7_875_000, 3497)
.saturating_add(T::DbWeight::get().reads(1))
}
pub fn transact() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 9_080_000 picoseconds.
Weight::from_parts(9_333_000, 0)
// Minimum execution time: 8_467_000 picoseconds.
Weight::from_parts(8_653_000, 0)
}
pub fn refund_surplus() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_415_000 picoseconds.
Weight::from_parts(2_519_000, 0)
// Minimum execution time: 2_141_000 picoseconds.
Weight::from_parts(2_231_000, 0)
}
pub fn set_error_handler() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_045_000 picoseconds.
Weight::from_parts(2_184_000, 0)
// Minimum execution time: 1_881_000 picoseconds.
Weight::from_parts(1_941_000, 0)
}
pub fn set_appendix() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_065_000 picoseconds.
Weight::from_parts(2_125_000, 0)
// Minimum execution time: 1_846_000 picoseconds.
Weight::from_parts(1_916_000, 0)
}
pub fn clear_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_077_000 picoseconds.
Weight::from_parts(2_164_000, 0)
// Minimum execution time: 1_857_000 picoseconds.
Weight::from_parts(1_910_000, 0)
}
pub fn descend_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_868_000 picoseconds.
Weight::from_parts(2_933_000, 0)
// Minimum execution time: 2_493_000 picoseconds.
Weight::from_parts(2_570_000, 0)
}
pub fn clear_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_058_000 picoseconds.
Weight::from_parts(2_164_000, 0)
// Minimum execution time: 1_857_000 picoseconds.
Weight::from_parts(1_930_000, 0)
}
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
@@ -159,8 +159,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `171`
// Estimated: `6196`
// Minimum execution time: 55_971_000 picoseconds.
Weight::from_parts(56_869_000, 6196)
// Minimum execution time: 54_805_000 picoseconds.
Weight::from_parts(55_690_000, 6196)
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(4))
}
@@ -170,8 +170,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `90`
// Estimated: `3555`
// Minimum execution time: 11_382_000 picoseconds.
Weight::from_parts(11_672_000, 3555)
// Minimum execution time: 11_062_000 picoseconds.
Weight::from_parts(11_505_000, 3555)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -179,8 +179,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_071_000 picoseconds.
Weight::from_parts(2_193_000, 0)
// Minimum execution time: 1_873_000 picoseconds.
Weight::from_parts(1_962_000, 0)
}
// Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1)
// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`)
@@ -200,8 +200,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `38`
// Estimated: `3503`
// Minimum execution time: 22_573_000 picoseconds.
Weight::from_parts(23_423_000, 3503)
// Minimum execution time: 22_356_000 picoseconds.
Weight::from_parts(23_066_000, 3503)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(3))
}
@@ -211,44 +211,44 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_870_000 picoseconds.
Weight::from_parts(3_993_000, 0)
// Minimum execution time: 3_819_000 picoseconds.
Weight::from_parts(3_992_000, 0)
.saturating_add(T::DbWeight::get().writes(1))
}
pub fn burn_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_483_000 picoseconds.
Weight::from_parts(3_598_000, 0)
// Minimum execution time: 3_033_000 picoseconds.
Weight::from_parts(3_157_000, 0)
}
pub fn expect_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_241_000 picoseconds.
Weight::from_parts(2_297_000, 0)
// Minimum execution time: 1_994_000 picoseconds.
Weight::from_parts(2_056_000, 0)
}
pub fn expect_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_230_000 picoseconds.
Weight::from_parts(2_318_000, 0)
// Minimum execution time: 1_978_000 picoseconds.
Weight::from_parts(2_069_000, 0)
}
pub fn expect_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_051_000 picoseconds.
Weight::from_parts(2_153_000, 0)
// Minimum execution time: 1_894_000 picoseconds.
Weight::from_parts(1_977_000, 0)
}
pub fn expect_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_306_000 picoseconds.
Weight::from_parts(2_380_000, 0)
// Minimum execution time: 2_114_000 picoseconds.
Weight::from_parts(2_223_000, 0)
}
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
@@ -270,8 +270,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `171`
// Estimated: `6196`
// Minimum execution time: 60_201_000 picoseconds.
Weight::from_parts(61_132_000, 6196)
// Minimum execution time: 58_704_000 picoseconds.
Weight::from_parts(59_677_000, 6196)
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(4))
}
@@ -279,8 +279,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_554_000 picoseconds.
Weight::from_parts(4_704_000, 0)
// Minimum execution time: 4_506_000 picoseconds.
Weight::from_parts(4_672_000, 0)
}
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
@@ -302,8 +302,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `171`
// Estimated: `6196`
// Minimum execution time: 56_071_000 picoseconds.
Weight::from_parts(56_889_000, 6196)
// Minimum execution time: 54_896_000 picoseconds.
Weight::from_parts(56_331_000, 6196)
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(4))
}
@@ -311,25 +311,29 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_093_000 picoseconds.
Weight::from_parts(2_169_000, 0)
// Minimum execution time: 1_946_000 picoseconds.
Weight::from_parts(2_002_000, 0)
}
pub fn set_topic() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_027_000 picoseconds.
Weight::from_parts(2_172_000, 0)
// Minimum execution time: 1_898_000 picoseconds.
Weight::from_parts(1_961_000, 0)
}
pub fn clear_topic() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_035_000 picoseconds.
Weight::from_parts(2_164_000, 0)
// Minimum execution time: 1_895_000 picoseconds.
Weight::from_parts(1_964_000, 0)
}
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `PolkadotXcm::SupportedVersion` (r:2 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `BridgeWestendMessages::PalletOperatingMode` (r:1 w:0)
// Proof: `BridgeWestendMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
// Storage: `BridgeWestendMessages::OutboundLanes` (r:1 w:1)
@@ -341,27 +345,27 @@ impl<T: frame_system::Config> WeightInfo<T> {
/// The range of component `x` is `[1, 1000]`.
pub fn export_message(x: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `96`
// Estimated: `1529`
// Minimum execution time: 25_636_000 picoseconds.
Weight::from_parts(25_405_640, 1529)
// Standard Error: 321
.saturating_add(Weight::from_parts(365_002, 0).saturating_mul(x.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `190`
// Estimated: `6130`
// Minimum execution time: 36_547_000 picoseconds.
Weight::from_parts(37_623_117, 6130)
// Standard Error: 735
.saturating_add(Weight::from_parts(315_274, 0).saturating_mul(x.into()))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(3))
}
pub fn set_fees_mode() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_036_000 picoseconds.
Weight::from_parts(2_136_000, 0)
// Minimum execution time: 1_868_000 picoseconds.
Weight::from_parts(1_910_000, 0)
}
pub fn unpaid_execution() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_147_000 picoseconds.
Weight::from_parts(2_276_000, 0)
// Minimum execution time: 1_998_000 picoseconds.
Weight::from_parts(2_069_000, 0)
}
}
@@ -21,11 +21,11 @@ use bridge_hub_rococo_runtime::{
bridge_common_config, bridge_to_westend_config,
xcm_config::{RelayNetwork, TokenLocation, XcmConfig},
AllPalletsWithoutSystem, BridgeRejectObsoleteHeadersAndMessages, Executive, ExistentialDeposit,
ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, SessionKeys, SignedExtra,
TransactionPayment, UncheckedExtrinsic,
ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, SessionKeys,
SignedExtra, TransactionPayment, UncheckedExtrinsic,
};
use codec::{Decode, Encode};
use frame_support::{dispatch::GetDispatchInfo, parameter_types};
use frame_support::{dispatch::GetDispatchInfo, parameter_types, traits::ConstU8};
use frame_system::pallet_prelude::HeaderFor;
use parachains_common::{rococo::fee::WeightToFee, AccountId, AuraId, Balance};
use sp_keyring::AccountKeyring::Alice;
@@ -104,8 +104,9 @@ mod bridge_hub_rococo_tests {
RequiredStakeForStakeAndSlash,
};
use bridge_to_westend_config::{
BridgeHubWestendChainId, WestendGlobalConsensusNetwork, WithBridgeHubWestendMessageBridge,
WithBridgeHubWestendMessagesInstance, XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WESTEND,
BridgeHubWestendChainId, BridgeHubWestendLocation, WestendGlobalConsensusNetwork,
WithBridgeHubWestendMessageBridge, WithBridgeHubWestendMessagesInstance,
XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WESTEND,
};
bridge_hub_test_utils::test_cases::include_teleports_for_native_asset_works!(
@@ -196,7 +197,7 @@ mod bridge_hub_rococo_tests {
Some((TokenLocation::get(), ExistentialDeposit::get()).into()),
// value should be >= than value generated by `can_calculate_weight_for_paid_export_message_with_reserve_transfer`
Some((TokenLocation::get(), bp_bridge_hub_rococo::BridgeHubRococoBaseXcmFeeInRocs::get()).into()),
|| (),
|| PolkadotXcm::force_xcm_version(RuntimeOrigin::root(), Box::new(BridgeHubWestendLocation::get()), XCM_VERSION).expect("version saved!"),
)
}
@@ -211,6 +212,7 @@ mod bridge_hub_rococo_tests {
WithBridgeHubWestendMessagesInstance,
RelayNetwork,
WestendGlobalConsensusNetwork,
ConstU8<2>,
>(
collator_session_keys(),
bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID,