mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 04:01:02 +00:00
Dynamic fees for bridges-v1 (#2294)
* impl backpressure in the XcmBlobHaulerAdapter * LocalXcmQueueManager + more adapters * OnMessageDelviered callback * forbid mesage delivery transactions when the channel between target bridge hub and target asset hub is suspended * pallet-xcm-bridge-hub-router * removed commented code * improvements and tests for palle-xcm-bridge-router * use LocalXcmChannel in XcmBlobMessageDispatch * new tests for logic changes in messages pallet * tests for LocalXcmQueueSuspender * tests for LocalXcmQueueMessageProcessor * tests for new logic in the XcmBlobHaulerAdapter * fix other tests in the bridge-runtime-common * extension_reject_call_when_dispatcher_is_inactive * benchmarks for pallet-xcm-bridge-hub-router * get rid of redundant storage value * add new pallet to verify-pallets-build.sh * fixing spellcheck, clippy and rustdoc * trigger CI * Revert "trigger CI" This reverts commit 48f1ba032334e3c6d8470436483736988aa060ac. * change log target for xcm bridge router pallet * Update modules/xcm-bridge-hub-router/src/lib.rs Co-authored-by: Branislav Kontur <bkontur@gmail.com> * use saturated_len where possible * fmt * (Suggestion) Ability to externalize configuration for `ExporterFor` (#2313) * Ability to externalize configuration for `ExporterFor` (Replaced `BridgedNetworkId/SiblingBridgeHubLocation` with `Bridges: ExporterFor`) * Fix millau * Compile fix * Return back `BridgedNetworkId` but as optional filter * Replaced `BaseFee` with fees from inner `Bridges: ExporterFor` * typo * Clippy * Rename LocalXcmChannel to XcmChannelStatusProvider (#2319) * Rename LocalXcmChannel to XcmChannelStatusProvider * fmt * added/fixed some docs * Dynamic fees v1: report congestion status to sending chain (#2318) * report congestion status: changes at the sending chain * OnMessagesDelivered is back * report congestion status: changes at the bridge hub * moer logging * fix? benchmarks * spelling * tests for XcmBlobHaulerAdapter and LocalXcmQueueManager * tests for messages pallet * fix typo * rustdoc * Update modules/messages/src/lib.rs * apply review suggestions * ".git/.scripts/commands/fmt/fmt.sh" * Added `XcmBridgeHubRouterCall::report_bridge_status` encodings for AHK/P (#2350) * Added `XcmBridgeHubRouterCall::report_bridge_status` encodings for AHK/P * Spellcheck * Added const for `XcmBridgeHubRouterTransactCallMaxWeight` * Cargo.lock * Introduced base delivery fee constants * Congestion messages as Optional to turn on/off `supports_congestion_detection` * Spellcheck * Ability to externalize dest for benchmarks * Ability to externalize dest for benchmarks --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: command-bot <>
This commit is contained in:
committed by
Bastian Köcher
parent
dc8aa5df7d
commit
31a6cbeafb
@@ -42,6 +42,8 @@ parameter_types! {
|
||||
/// chain, we make it synonymous with it and thus it is the `Here` location, which means "equivalent to
|
||||
/// the context".
|
||||
pub const TokenLocation: MultiLocation = Here.into_location();
|
||||
/// Token asset identifier.
|
||||
pub TokenAssetId: AssetId = TokenLocation::get().into();
|
||||
/// The Millau network ID.
|
||||
pub const ThisNetwork: NetworkId = CustomNetworkId::Millau.as_network_id();
|
||||
/// The Rialto network ID.
|
||||
@@ -98,7 +100,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
/// The XCM router. We are not sending messages to sibling/parent/child chains here.
|
||||
pub type XcmRouter = ();
|
||||
pub type XcmRouter = EmulatedSiblingXcmpChannel;
|
||||
|
||||
/// The barriers one of which must be passed for an XCM message to be executed.
|
||||
pub type Barrier = (
|
||||
@@ -235,6 +237,38 @@ impl ExportXcm for ToRialtoOrRialtoParachainSwitchExporter {
|
||||
}
|
||||
}
|
||||
|
||||
/// Emulating XCMP channel with sibling chain. We don't have required infra here, at Millau,
|
||||
/// so we have to provide at least something to be able to run benchmarks.
|
||||
pub struct EmulatedSiblingXcmpChannel;
|
||||
|
||||
impl SendXcm for EmulatedSiblingXcmpChannel {
|
||||
type Ticket = ();
|
||||
|
||||
fn validate(
|
||||
_destination: &mut Option<MultiLocation>,
|
||||
_message: &mut Option<Xcm<()>>,
|
||||
) -> SendResult<Self::Ticket> {
|
||||
Ok(((), Default::default()))
|
||||
}
|
||||
|
||||
fn deliver(_ticket: Self::Ticket) -> Result<XcmHash, SendError> {
|
||||
Ok(XcmHash::default())
|
||||
}
|
||||
}
|
||||
|
||||
impl EmulatedSiblingXcmpChannel {
|
||||
/// Start emulating congested channel.
|
||||
pub fn make_congested() {
|
||||
frame_support::storage::unhashed::put(b"EmulatedSiblingXcmpChannel.Congested", &true);
|
||||
}
|
||||
}
|
||||
|
||||
impl bp_xcm_bridge_hub_router::XcmChannelStatusProvider for EmulatedSiblingXcmpChannel {
|
||||
fn is_congested() -> bool {
|
||||
frame_support::storage::unhashed::get_or_default(b"EmulatedSiblingXcmpChannel.Congested")
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
@@ -357,7 +391,7 @@ mod tests {
|
||||
let dispatch_result = FromRialtoMessageDispatch::dispatch(incoming_message);
|
||||
assert!(matches!(
|
||||
dispatch_result.dispatch_level_result,
|
||||
XcmBlobMessageDispatchResult::NotDispatched(_),
|
||||
XcmBlobMessageDispatchResult::Dispatched,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -370,7 +404,7 @@ mod tests {
|
||||
let dispatch_result = FromRialtoMessageDispatch::dispatch(incoming_message);
|
||||
assert!(matches!(
|
||||
dispatch_result.dispatch_level_result,
|
||||
XcmBlobMessageDispatchResult::NotDispatched(_),
|
||||
XcmBlobMessageDispatchResult::Dispatched,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user