This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Improve debuggability #7079
Copy link
Copy link
Closed
Labels
J0-enhancementAn additional feature request.An additional feature request.
Description
I had a hard time to debug the XCM weight issue caused by #6785. All the error message I got is XcmError::Barrier.
I understand why propagate error is hard but we need an alternative.
One way is to add enough logs to indicate why an error is occurred. I think we already drop logging in production build so it shouldn't have any overhead. And then in releases, it will be great to also make a production build with logging and we can use wasm override to use those runtime to debug errors.
For example, we could refactor this code to log weight limit and max weight and say it failed due to under weighted
polkadot/xcm/xcm-builder/src/barriers.rs
Lines 95 to 105 in f1a45b3
| BuyExecution { weight_limit: Limited(ref mut weight), .. } | |
| if weight.all_gte(max_weight) => | |
| { | |
| *weight = max_weight; | |
| Ok(()) | |
| }, | |
| BuyExecution { ref mut weight_limit, .. } if weight_limit == &Unlimited => { | |
| *weight_limit = Limited(max_weight); | |
| Ok(()) | |
| }, | |
| _ => Err(()), |
bkchr
Metadata
Metadata
Assignees
Labels
J0-enhancementAn additional feature request.An additional feature request.