Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 9 additions & 0 deletions prdoc/pr_9047.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
title: Add extra information to the harmless error logs during validate_transaction
doc:
- audience: Node Operator
description: |-
Adds additional information to the harmless error logs "Bad input data provided" during `validate_transaction`.

crates:
- name: sp-api-proc-macro
bump: patch
4 changes: 2 additions & 2 deletions substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn generate_impl_call(
quote!(
if !#input.is_empty() {
panic!(
"Bad input data provided to {}: expected no parameters, but input buffer is not empty.",
"Bad input data provided to {}: expected no parameters, but input buffer is not empty. Nothing bad happened: someone sent an invalid transaction to the node.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it not weird to panic, and say "nothing bad happened"?

#fn_name_str
);
}
Expand All @@ -104,7 +104,7 @@ fn generate_impl_call(
&mut #input,
) {
Ok(res) => res,
Err(e) => panic!("Bad input data provided to {}: {}", #fn_name_str, e),
Err(e) => panic!("Bad input data provided to {}: {}. Nothing bad happened: someone sent an invalid transaction to the node.", #fn_name_str, e),
};
)
};
Expand Down