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

Improve debuggability #7079

Closed
xlc opened this issue Apr 13, 2023 · 4 comments
Closed

Improve debuggability #7079

xlc opened this issue Apr 13, 2023 · 4 comments
Labels
J0-enhancement An additional feature request.

Comments

@xlc
Copy link
Contributor

xlc commented Apr 13, 2023

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

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 bkchr added the J0-enhancement An additional feature request. label Apr 14, 2023
@bkchr
Copy link
Member

bkchr commented Apr 14, 2023

Good idea!

Cc @KiChjang

@KiChjang
Copy link
Contributor

In #6670, I'm adding a RejectReason to all barriers so that you know exactly why a particular XCM didn't pass the barrier. I could split out the PR so that we get the RejectReason logic in, and leave the blocking barrier implementation for later.

@KiChjang
Copy link
Contributor

KiChjang commented May 3, 2023

Should be fixed by #7098.

@KiChjang KiChjang closed this as completed May 3, 2023
@xlc
Copy link
Contributor Author

xlc commented May 5, 2023

There are other areas needs improvement.
e.g. I am debugging why I am getting MaxWeightInvalid and no idea what's the required weight

ensure!(weight.all_lte(require_weight_at_most), XcmError::MaxWeightInvalid);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J0-enhancement An additional feature request.
Projects
None yet
Development

No branches or pull requests

3 participants