Skip to content
Snippets Groups Projects
Commit 3eaf47bb authored by Doordashcon's avatar Doordashcon Committed by GitHub
Browse files

Log XCMP Queue Errors (#1147)


* test invalid xcmp data

* proper messaging

* cargo fmt

* Use `error` instead of `info`

Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>

Co-authored-by: default avatarKeith Yeung <kungfukeith11@gmail.com>
Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>
parent 910742bf
No related merge requests found
...@@ -655,7 +655,11 @@ impl<T: Config> Pallet<T> { ...@@ -655,7 +655,11 @@ impl<T: Config> Pallet<T> {
remaining_fragments = last_remaining_fragments; remaining_fragments = last_remaining_fragments;
break break
}, },
Err(_) => { Err(error) => {
log::error!(
"Failed to process XCMP-XCM message, caused by {:?}",
error
);
// Message looks invalid; don't attempt to retry // Message looks invalid; don't attempt to retry
}, },
} }
......
...@@ -65,6 +65,18 @@ fn handle_blob_message() { ...@@ -65,6 +65,18 @@ fn handle_blob_message() {
}); });
} }
#[test]
#[should_panic = "Invalid incoming XCMP message data"]
#[cfg(debug_assertions)]
fn handle_invalid_data() {
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] #[test]
fn service_overweight_unknown() { fn service_overweight_unknown() {
new_test_ext().execute_with(|| { new_test_ext().execute_with(|| {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment