Skip to content

Commit

Permalink
xcm: fix local/remote exports when inner routers return `NotApplicabl…
Browse files Browse the repository at this point in the history
…e` (#6645)

This PR addresses two small fixes:  

1. Fixed a typo ("as as") found on the way.  
2. Resolved a bug in the `local/remote exporters` used for bridging.
Previously, they consumed `dest` and `msg` without returning them when
inner routers/exporters failed with `NotApplicable`. This PR ensures
compliance with the
[`SendXcm`](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/src/v5/traits.rs#L449-L450)
and
[`ExportXcm`](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-executor/src/traits/export.rs#L44-L45)
traits.

---------

Co-authored-by: GitHub Action <action@github.com>
  • Loading branch information
bkontur and actions-user committed Nov 26, 2024
1 parent b7404da commit ea413ca
Show file tree
Hide file tree
Showing 9 changed files with 248 additions and 55 deletions.
2 changes: 1 addition & 1 deletion polkadot/grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ and issue statement or initiate dispute.
- **Assignment delay tranches**. Approval voting is designed such that validators assigned to check a specific
candidate are split up into equal delay tranches (0.5 seconds each). All validators checks are ordered by the delay
tranche index. Early tranches of validators have the opportunity to check the candidate first before later tranches
that act as as backups in case of no shows.
that act as backups in case of no shows.
2 changes: 1 addition & 1 deletion polkadot/grafana/parachains/status.json
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@
"type": "prometheus",
"uid": "$data_source"
},
"description": "Approval voting requires that validators which are assigned to check a specific \ncandidate are split up into delay tranches (0.5s each). Then, all validators checks are ordered by the delay \ntranche index. Early tranches of validators will check the candidate first and later tranches act as as backups in case of no shows.",
"description": "Approval voting requires that validators which are assigned to check a specific \ncandidate are split up into delay tranches (0.5s each). Then, all validators checks are ordered by the delay \ntranche index. Early tranches of validators will check the candidate first and later tranches act as backups in case of no shows.",
"gridPos": {
"h": 9,
"w": 18,
Expand Down
4 changes: 2 additions & 2 deletions polkadot/xcm/src/v3/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,13 +547,13 @@ impl SendXcm for Tuple {
}

/// Convenience function for using a `SendXcm` implementation. Just interprets the `dest` and wraps
/// both in `Some` before passing them as as mutable references into `T::send_xcm`.
/// both in `Some` before passing them as mutable references into `T::send_xcm`.
pub fn validate_send<T: SendXcm>(dest: MultiLocation, msg: Xcm<()>) -> SendResult<T::Ticket> {
T::validate(&mut Some(dest), &mut Some(msg))
}

/// Convenience function for using a `SendXcm` implementation. Just interprets the `dest` and wraps
/// both in `Some` before passing them as as mutable references into `T::send_xcm`.
/// both in `Some` before passing them as mutable references into `T::send_xcm`.
///
/// Returns either `Ok` with the price of the delivery, or `Err` with the reason why the message
/// could not be sent.
Expand Down
4 changes: 2 additions & 2 deletions polkadot/xcm/src/v4/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,13 @@ impl SendXcm for Tuple {
}

/// Convenience function for using a `SendXcm` implementation. Just interprets the `dest` and wraps
/// both in `Some` before passing them as as mutable references into `T::send_xcm`.
/// both in `Some` before passing them as mutable references into `T::send_xcm`.
pub fn validate_send<T: SendXcm>(dest: Location, msg: Xcm<()>) -> SendResult<T::Ticket> {
T::validate(&mut Some(dest), &mut Some(msg))
}

/// Convenience function for using a `SendXcm` implementation. Just interprets the `dest` and wraps
/// both in `Some` before passing them as as mutable references into `T::send_xcm`.
/// both in `Some` before passing them as mutable references into `T::send_xcm`.
///
/// Returns either `Ok` with the price of the delivery, or `Err` with the reason why the message
/// could not be sent.
Expand Down
4 changes: 2 additions & 2 deletions polkadot/xcm/src/v5/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,13 @@ impl SendXcm for Tuple {
}

/// Convenience function for using a `SendXcm` implementation. Just interprets the `dest` and wraps
/// both in `Some` before passing them as as mutable references into `T::send_xcm`.
/// both in `Some` before passing them as mutable references into `T::send_xcm`.
pub fn validate_send<T: SendXcm>(dest: Location, msg: Xcm<()>) -> SendResult<T::Ticket> {
T::validate(&mut Some(dest), &mut Some(msg))
}

/// Convenience function for using a `SendXcm` implementation. Just interprets the `dest` and wraps
/// both in `Some` before passing them as as mutable references into `T::send_xcm`.
/// both in `Some` before passing them as mutable references into `T::send_xcm`.
///
/// Returns either `Ok` with the price of the delivery, or `Err` with the reason why the message
/// could not be sent.
Expand Down
Loading

0 comments on commit ea413ca

Please sign in to comment.