Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error logging for send xcm to pallet-xcm #6579

Merged
merged 5 commits into from
Nov 25, 2024
Merged
Changes from 2 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
16 changes: 13 additions & 3 deletions polkadot/xcm/pallet-xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,10 @@ pub mod pallet {
let message: Xcm<()> = (*message).try_into().map_err(|()| Error::<T>::BadVersion)?;

let message_id = Self::send_xcm(interior, dest.clone(), message.clone())
.map_err(Error::<T>::from)?;
.map_err(|error| {
tracing::error!(target: "xcm::pallet_xcm::send", ?error, ?dest, ?message, "XCM send failed with error");
Error::<T>::from(error)
})?;
let e = Event::Sent { origin: origin_location, destination: dest, message, message_id };
Self::deposit_event(e);
Ok(message_id)
Expand Down Expand Up @@ -1800,7 +1803,10 @@ impl<T: Config> Pallet<T> {

if let Some(remote_xcm) = remote_xcm {
let (ticket, price) = validate_send::<T::XcmRouter>(dest.clone(), remote_xcm.clone())
.map_err(Error::<T>::from)?;
.map_err(|error| {
tracing::error!(target: "xcm::pallet_xcm::execute_xcm_transfer", ?error, ?dest, ?remote_xcm, "XCM validate_send failed with error");
Error::<T>::from(error)
})?;
if origin != Here.into_location() {
Self::charge_fees(origin.clone(), price.clone()).map_err(|error| {
tracing::error!(
Expand All @@ -1810,7 +1816,11 @@ impl<T: Config> Pallet<T> {
Error::<T>::FeesNotMet
})?;
}
let message_id = T::XcmRouter::deliver(ticket).map_err(Error::<T>::from)?;
let message_id = T::XcmRouter::deliver(ticket)
.map_err(|error| {
tracing::error!(target: "xcm::pallet_xcm::execute_xcm_transfer", ?error, ?dest, ?remote_xcm, "XCM deliver failed with error");
Error::<T>::from(error)
})?;

let e = Event::Sent { origin, destination: dest, message: remote_xcm, message_id };
Self::deposit_event(e);
Expand Down
Loading