Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Log XCMP Queue Errors #1147

Merged
merged 6 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from 5 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
6 changes: 5 additions & 1 deletion pallets/xcmp-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,11 @@ impl<T: Config> Pallet<T> {
remaining_fragments = last_remaining_fragments;
break
},
Err(_) => {
Err(error) => {
log::info!(
KiChjang marked this conversation as resolved.
Show resolved Hide resolved
"Failed to process XCMP-XCM message, caused by {:?}",
error
);
// Message looks invalid; don't attempt to retry
},
}
Expand Down
12 changes: 12 additions & 0 deletions pallets/xcmp-queue/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ fn handle_blob_message() {
});
}

#[test]
#[should_panic = "Invalid incoming XCMP message data"]
#[cfg(debug_assertions)]
fn handle_invalid_data() {
Doordashcon marked this conversation as resolved.
Show resolved Hide resolved
new_test_ext().execute_with(|| {
let data = Xcm::<Test>(vec![]).encode();
InboundXcmpMessages::<Test>::insert(ParaId::from(1000), 1, data);
let format = XcmpMessageFormat::ConcatenatedVersionedXcm;
XcmpQueue::process_xcmp_message(1000.into(), (1, format), 10_000_000_000, 10_000_000_000);
});
}

#[test]
fn service_overweight_unknown() {
new_test_ext().execute_with(|| {
Expand Down