Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a37ce6f
Add debug logs
raymondkfcheung May 30, 2025
f2bc0c4
Add debug logs
raymondkfcheung May 30, 2025
9fae961
Merge branch 'master' into ray-add-err-logs
raymondkfcheung Jun 2, 2025
df7c14e
Add debug logs
raymondkfcheung Jun 2, 2025
22ed3f5
Merge branch 'master' into ray-add-err-logs
raymondkfcheung Jun 2, 2025
8cc9a7c
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] Jun 2, 2025
1fe50c8
Update debug logs
raymondkfcheung Jun 2, 2025
5da8217
Update PRDoc
raymondkfcheung Jun 2, 2025
aaf1770
Update PRDoc
raymondkfcheung Jun 2, 2025
fffaba6
Merge branch 'master' into ray-add-err-logs
raymondkfcheung Jun 2, 2025
0479c85
Update PRDoc
raymondkfcheung Jun 2, 2025
0586daf
Merge branch 'master' into ray-add-err-logs
raymondkfcheung Jun 3, 2025
4fde280
Change to debug
raymondkfcheung Jun 3, 2025
91dc578
Add error
raymondkfcheung Jun 3, 2025
da6e4da
Change to debug
raymondkfcheung Jun 3, 2025
45a6f89
Fix Debug
raymondkfcheung Jun 3, 2025
62fcea8
Update PRDoc
raymondkfcheung Jun 3, 2025
872fd82
Remove some logs
raymondkfcheung Jun 3, 2025
5f71fe1
Change logs
raymondkfcheung Jun 3, 2025
52206fe
Update PRDoc
raymondkfcheung Jun 3, 2025
7499f1b
Merge branch 'master' into ray-add-err-logs
raymondkfcheung Jun 3, 2025
6ee98df
Fix fmt
raymondkfcheung Jun 3, 2025
9717549
Merge branch 'paritytech:master' into ray-add-err-logs
raymondkfcheung Jun 3, 2025
15ab385
Merge branch 'master' into ray-add-err-logs
raymondkfcheung Jun 4, 2025
891822c
Address the comments
raymondkfcheung Jun 4, 2025
b818238
Update to tracing
raymondkfcheung Jun 4, 2025
6a14404
Update PRDoc
raymondkfcheung Jun 4, 2025
4eb34d6
Merge branch 'master' into ray-add-err-logs
raymondkfcheung Jun 4, 2025
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
31 changes: 23 additions & 8 deletions cumulus/pallets/xcmp-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,11 @@ impl<T: Config> Pallet<T> {
new_page.extend_from_slice(&encoded_fragment[..]);
let last_page_size = new_page.len();
let number_of_pages = (channel_details.last_index - channel_details.first_index) as u32;
let bounded_page = BoundedVec::<u8, T::MaxPageSize>::try_from(new_page)
.map_err(|_| MessageSendError::TooBig)?;
let bounded_page =
BoundedVec::<u8, T::MaxPageSize>::try_from(new_page).map_err(|error| {
log::debug!(target: LOG_TARGET, "Failed to create bounded message page: {error:?}");
MessageSendError::TooBig
})?;
let bounded_page = WeakBoundedVec::force_from(bounded_page.into_inner(), None);
<OutboundXcmpMessages<T>>::insert(recipient, page_index, bounded_page);
<OutboundXcmpStatus<T>>::put(all_channels);
Expand All @@ -585,14 +588,19 @@ impl<T: Config> Pallet<T> {
if let Some(details) = s.iter_mut().find(|item| item.recipient == dest) {
details.signals_exist = true;
} else {
s.try_push(OutboundChannelDetails::new(dest).with_signals())
.map_err(|_| Error::<T>::TooManyActiveOutboundChannels)?;
s.try_push(OutboundChannelDetails::new(dest).with_signals()).map_err(|error| {
log::debug!(target: LOG_TARGET, "Failed to activate XCMP channel: {error:?}");
Error::<T>::TooManyActiveOutboundChannels
})?;
}

let page = BoundedVec::<u8, T::MaxPageSize>::try_from(
(XcmpMessageFormat::Signals, signal).encode(),
)
.map_err(|_| Error::<T>::TooBig)?;
.map_err(|error| {
log::debug!(target: LOG_TARGET, "Failed to encode signal message: {error:?}");
Error::<T>::TooBig
})?;
let page = WeakBoundedVec::force_from(page.into_inner(), None);

<SignalMessages<T>>::insert(dest, page);
Expand Down Expand Up @@ -699,9 +707,16 @@ impl<T: Config> Pallet<T> {
return Err(())
}

let xcm = VersionedXcm::<()>::decode_with_depth_limit(MAX_XCM_DECODE_DEPTH, data)
.map_err(|_| ())?;
Ok(Some(xcm.encode().try_into().map_err(|_| ())?))
let xcm = VersionedXcm::<()>::decode_with_depth_limit(MAX_XCM_DECODE_DEPTH, data).map_err(
|error| {
log::debug!(target: LOG_TARGET, "Failed to decode XCM with depth limit: {error:?}");
()
},
)?;
Ok(Some(xcm.encode().try_into().map_err(|error| {
log::debug!(target: LOG_TARGET, "Failed to encode XCM after decoding: {error:?}");
()
})?))
}

/// Split concatenated encoded `VersionedXcm`s or `MaybeDoubleEncodedVersionedXcm`s into
Expand Down
10 changes: 9 additions & 1 deletion cumulus/parachains/common/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ where
<Runtime as pallet_assets::Config<AssetInstance>>::AssetId,
<Runtime as pallet_assets::Config<AssetInstance>>::Balance,
>,
<BalanceConverter as ConversionToAssetBalance<
CurrencyBalance,
<Runtime as pallet_assets::Config<AssetInstance>>::AssetId,
<Runtime as pallet_assets::Config<AssetInstance>>::Balance,
>>::Error: core::fmt::Debug,
{
fn charge_weight_in_fungibles(
asset_id: <pallet_assets::Pallet<Runtime, AssetInstance> as Inspect<
Expand All @@ -59,7 +64,10 @@ where
// If the amount gotten is not at least the ED, then make it be the ED of the asset
// This is to avoid burning assets and decreasing the supply
let asset_amount = BalanceConverter::to_asset_balance(amount, asset_id)
.map_err(|_| XcmError::TooExpensive)?;
.map_err(|error| {
log::debug!(target: "xcm::charge_weight_in_fungibles", "AssetFeeAsExistentialDepositMultiplier cannot convert to valid balance (possibly below ED): {error:?}");
XcmError::TooExpensive
})?;
Ok(asset_amount)
}
}
Expand Down
8 changes: 7 additions & 1 deletion polkadot/runtime/common/src/xcm_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,13 @@ where
let hash = sp_io::hashing::blake2_256(&blob[..]);
dmp::Pallet::<T>::queue_downward_message(&config, para, blob)
.map(|()| hash)
.map_err(|_| SendError::Transport(&"Error placing into DMP queue"))
.map_err(|error| {
log::debug!(
target: "xcm::xcm_sender::deliver",
"Failed to place into DMP queue: error: {error:?}, id: {hash:?}",
);
SendError::Transport(&"Error placing into DMP queue")
})
}

#[cfg(feature = "runtime-benchmarks")]
Expand Down
2 changes: 1 addition & 1 deletion polkadot/runtime/parachains/src/dmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ mod tests;
const THRESHOLD_FACTOR: u32 = 2;

/// An error sending a downward message.
#[cfg_attr(test, derive(Debug))]
#[derive(Debug)]
pub enum QueueDownwardMessageError {
/// The message being sent exceeds the configured max message size.
ExceedsMaxMessageSize,
Expand Down
Loading