Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
93 changes: 93 additions & 0 deletions Cargo.lock

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

14 changes: 14 additions & 0 deletions bridges/modules/xcm-bridge-hub/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,22 @@
#![warn(missing_docs)]
#![cfg_attr(not(feature = "std"), no_std)]

<<<<<<< HEAD
use bridge_runtime_common::messages_xcm_extension::XcmBlobHauler;
use pallet_bridge_messages::Config as BridgeMessagesConfig;
=======
use bp_messages::{LaneState, MessageNonce};
use bp_runtime::{AccountIdOf, BalanceOf, RangeInclusiveExt};
use bp_xcm_bridge_hub::BridgeLocationsError;
pub use bp_xcm_bridge_hub::{
Bridge, BridgeId, BridgeLocations, BridgeState, LocalXcmChannelManager,
};
use frame_support::{traits::fungible::MutateHold, DefaultNoBound};
use frame_system::Config as SystemConfig;
use pallet_bridge_messages::{Config as BridgeMessagesConfig, LanesManagerError};
use sp_runtime::traits::Zero;
use sp_std::{boxed::Box, vec::Vec};
>>>>>>> ada12be (Bridges small nits/improvements (#7383))
use xcm::prelude::*;

pub use exporter::PalletAsHaulBlobExporter;
Expand Down
22 changes: 22 additions & 0 deletions cumulus/pallets/xcmp-queue/src/bridging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ impl<SiblingBridgeHubParaId: Get<ParaId>, Runtime: crate::Config>
}
}

<<<<<<< HEAD
/// Adapter implementation for `bp_xcm_bridge_hub_router::XcmChannelStatusProvider` which checks
/// only `OutboundXcmpStatus` for defined `SiblingParaId` if is suspended.
pub struct OutXcmpChannelStatusProvider<SiblingBridgeHubParaId, Runtime>(
Expand All @@ -53,6 +54,19 @@ impl<SiblingBridgeHubParaId: Get<ParaId>, Runtime: crate::Config>
{
fn is_congested() -> bool {
let sibling_bridge_hub_id: ParaId = SiblingBridgeHubParaId::get();
=======
/// Adapter implementation for `bp_xcm_bridge::ChannelStatusProvider` and/or
/// `bp_xcm_bridge_hub_router::XcmChannelStatusProvider` which checks only `OutboundXcmpStatus`
/// for defined `Location` if is suspended.
pub struct OutXcmpChannelStatusProvider<Runtime>(core::marker::PhantomData<Runtime>);
impl<Runtime: crate::Config> OutXcmpChannelStatusProvider<Runtime> {
fn is_congested(with: &Location) -> bool {
// handle congestion only for a sibling parachain locations.
let sibling_para_id: ParaId = match with.unpack() {
(_, [Parachain(para_id)]) => (*para_id).into(),
_ => return false,
};
>>>>>>> ada12be (Bridges small nits/improvements (#7383))

// let's find the channel's state with the sibling parachain,
let Some((outbound_state, queued_pages)) =
Expand Down Expand Up @@ -84,6 +98,14 @@ impl<SiblingBridgeHubParaId: Get<ParaId>, Runtime: crate::Config>
}
}

impl<Runtime: crate::Config> bp_xcm_bridge_hub_router::XcmChannelStatusProvider
for OutXcmpChannelStatusProvider<Runtime>
{
fn is_congested(with: &Location) -> bool {
Self::is_congested(with)
}
}

#[cfg(feature = "runtime-benchmarks")]
pub fn suspend_channel_for_benchmarks<T: crate::Config>(target: ParaId) {
pallet::Pallet::<T>::suspend_channel(target)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ workspace = true
[dependencies]
codec = { workspace = true }
scale-info = { features = ["derive"], workspace = true }
<<<<<<< HEAD
hex-literal = { workspace = true, default-features = true }
sp-core.workspace = true
frame-support.workspace = true
Expand Down Expand Up @@ -41,3 +42,38 @@ snowbridge-pallet-system.workspace = true
snowbridge-pallet-outbound-queue.workspace = true
snowbridge-pallet-inbound-queue-fixtures.workspace = true
snowbridge-pallet-inbound-queue-fixtures.default-features = true
=======

# Substrate
frame-support = { workspace = true }
pallet-asset-conversion = { workspace = true }
pallet-assets = { workspace = true }
pallet-balances = { workspace = true }
pallet-message-queue = { workspace = true, default-features = true }
sp-core = { workspace = true }
sp-runtime = { workspace = true }

# Polkadot
pallet-xcm = { workspace = true }
xcm = { workspace = true }
xcm-executor = { workspace = true }
xcm-runtime-apis = { workspace = true }

# Bridges
pallet-bridge-messages = { workspace = true }

# Cumulus
cumulus-pallet-xcmp-queue = { workspace = true }
emulated-integration-tests-common = { workspace = true }
parachains-common = { workspace = true, default-features = true }
rococo-system-emulated-network = { workspace = true }
rococo-westend-system-emulated-network = { workspace = true }
testnet-parachains-constants = { features = ["rococo", "westend"], workspace = true, default-features = true }

# Snowbridge
snowbridge-core = { workspace = true }
snowbridge-pallet-inbound-queue-fixtures = { workspace = true, default-features = true }
snowbridge-pallet-outbound-queue = { workspace = true }
snowbridge-pallet-system = { workspace = true }
snowbridge-router-primitives = { workspace = true }
>>>>>>> ada12be (Bridges small nits/improvements (#7383))
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ workspace = true

[dependencies]
hex-literal = { workspace = true, default-features = true }
<<<<<<< HEAD
frame-support.workspace = true
pallet-assets.workspace = true
pallet-asset-conversion.workspace = true
Expand All @@ -31,3 +32,42 @@ emulated-integration-tests-common.workspace = true
parachains-common.workspace = true
parachains-common.default-features = true
rococo-westend-system-emulated-network.workspace = true
=======
log = { workspace = true }
scale-info = { workspace = true }

# Substrate
frame-support = { workspace = true }
pallet-asset-conversion = { workspace = true }
pallet-assets = { workspace = true }
pallet-balances = { workspace = true }
pallet-message-queue = { workspace = true, default-features = true }
sp-core = { workspace = true }
sp-runtime = { workspace = true }

# Polkadot
pallet-xcm = { workspace = true }
xcm = { workspace = true }
xcm-executor = { workspace = true }
xcm-runtime-apis = { workspace = true }

# Bridges
pallet-bridge-messages = { workspace = true }

# Cumulus
asset-hub-westend-runtime = { workspace = true }
bridge-hub-westend-runtime = { workspace = true }
cumulus-pallet-xcmp-queue = { workspace = true }
emulated-integration-tests-common = { workspace = true }
parachains-common = { workspace = true, default-features = true }
rococo-westend-system-emulated-network = { workspace = true }
testnet-parachains-constants = { features = ["rococo", "westend"], workspace = true, default-features = true }

# Snowbridge
snowbridge-core = { workspace = true }
snowbridge-pallet-inbound-queue = { workspace = true }
snowbridge-pallet-inbound-queue-fixtures = { workspace = true }
snowbridge-pallet-outbound-queue = { workspace = true }
snowbridge-pallet-system = { workspace = true }
snowbridge-router-primitives = { workspace = true }
>>>>>>> ada12be (Bridges small nits/improvements (#7383))
43 changes: 43 additions & 0 deletions cumulus/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ workspace = true
codec = { features = ["derive", "max-encoded-len"], workspace = true }
impl-trait-for-tuples = { workspace = true }
log = { workspace = true }
<<<<<<< HEAD
frame-support.workspace = true
frame-system.workspace = true
sp-core.workspace = true
Expand Down Expand Up @@ -42,6 +43,44 @@ bp-runtime.workspace = true
bp-test-utils.workspace = true
pallet-bridge-grandpa.workspace = true
pallet-bridge-parachains.workspace = true
=======

# Substrate
frame-support = { workspace = true }
frame-system = { workspace = true }
pallet-balances = { workspace = true }
pallet-timestamp = { workspace = true }
pallet-utility = { workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-keyring = { workspace = true, default-features = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
sp-tracing = { workspace = true, default-features = true }

# Cumulus
asset-test-utils = { workspace = true, default-features = true }
cumulus-pallet-parachain-system = { workspace = true }
cumulus-pallet-xcmp-queue = { workspace = true }
parachains-common = { workspace = true }
parachains-runtimes-test-utils = { workspace = true }

# Polkadot
pallet-xcm = { workspace = true }
xcm = { workspace = true }
xcm-builder = { workspace = true }
xcm-executor = { workspace = true }

# Bridges
bp-header-chain = { workspace = true }
bp-messages = { workspace = true }
bp-parachains = { workspace = true }
bp-polkadot-core = { workspace = true }
bp-relayers = { workspace = true }
bp-runtime = { workspace = true }
bp-test-utils = { workspace = true }
pallet-bridge-grandpa = { workspace = true }
>>>>>>> ada12be (Bridges small nits/improvements (#7383))
pallet-bridge-messages = { features = ["test-helpers"], workspace = true }
pallet-bridge-relayers.workspace = true
bridge-runtime-common.workspace = true
Expand All @@ -56,7 +95,10 @@ std = [
"bp-relayers/std",
"bp-runtime/std",
"bp-test-utils/std",
<<<<<<< HEAD
"bridge-runtime-common/std",
=======
>>>>>>> ada12be (Bridges small nits/improvements (#7383))
"codec/std",
"cumulus-pallet-parachain-system/std",
"cumulus-pallet-xcmp-queue/std",
Expand All @@ -75,6 +117,7 @@ std = [
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
Expand Down
6 changes: 6 additions & 0 deletions cumulus/parachains/runtimes/bridge-hubs/test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ extern crate alloc;
pub use bp_test_utils::test_header;
pub use parachains_runtimes_test_utils::*;
use sp_runtime::Perbill;
<<<<<<< HEAD
=======
pub use test_cases::helpers::for_pallet_xcm_bridge_hub::{
ensure_opened_bridge, open_bridge_with_extrinsic, open_bridge_with_storage,
};
>>>>>>> ada12be (Bridges small nits/improvements (#7383))

/// A helper function for comparing the actual value of a fee constant with its estimated value. The
/// estimated value can be overestimated (`overestimate_in_percent`), and if the difference to the
Expand Down
Loading
Loading