Crate pallet_xcm_bridge_router
source ·Expand description
A pallet that can be used as an alternative in the XCM router configuration — see the SendXcm
implementation for details.
§Features
This pallet offers several optional features to customize functionality:
§Message Size Fee
An optional fee based on T::FeeAsset
and T::ByteFee
. If T::FeeAsset
is not specified, this
fee is not calculated.
§Dynamic Fees and Congestion
This pallet supports storing the congestion status of bridge outbound queues. The fee increases exponentially if the queue between this chain and a sibling or child bridge hub becomes congested. All other bridge hub queues provide backpressure mechanisms, so if any of these queues are congested, it will eventually lead to increased queuing on this chain.
There are two methods for storing congestion status:
- A dedicated extrinsic
update_bridge_status
, which relies onT::UpdateBridgeStatusOrigin
. This allows the message exporter to send, for example, an XCMTransact
. - An implementation of
bp_xcm_bridge::LocalXcmChannelManager
.
§Usage
This pallet provides several implementations, such as ViaLocalBridgeExporter
and
ViaRemoteBridgeExporter
, which can expose or access these features.
This router can be used in two main scenarios, depending on where the router and message
exporter (e.g., pallet_xcm_bridge_hub
or another pallet with an ExportXcm
implementation)
are deployed:
§On the Same Chain as the Message Exporter
In this setup, the router directly calls an ExportXcm
implementation. In this case,
ViaLocalBridgeExporter
can be used as a wrapper with T::MessageExporter
.
§On a Different Chain than the Message Exporter
In this setup, we need to provide a SendXcm
implementation for T::MessageExporter
, which
sends ExportMessage
. For example, SovereignPaidRemoteExporter
can be used with
ViaRemoteBridgeExporter
.
Note on Terminology: When we refer to the bridge hub, we mean the chain that has the
pallet-bridge-messages
with an ExportXcm
implementation deployed, such as
pallet-xcm-bridge
. Depending on the deployment setup, T::MessageExporter
can be
configured accordingly — see T::MessageExporter
for additional documentation.
Re-exports§
pub use weights::WeightInfo;
pub use pallet::*;
Modules§
- Various implementations supporting easier configuration of the pallet.
- The
pallet
module in each FRAME pallet hosts the most important items needed to construct this pallet. - Autogenerated weights for pallet_xcm_bridge_hub_router
Structs§
- Current status of the bridge.
Constants§
- Maximal size of the XCM message that may be sent over bridge.
- The target that will be used when publishing logs related to this pallet.
- Minimal delivery fee factor.
Traits§
- Trait that resolves a specific
BridgeId
fordest
.