Make WeightBounds return Result<Weight, XcmError> to surface XCM weight failures#8549
Merged
raymondkfcheung merged 7 commits intoray-check-weight-with-limitfrom May 22, 2025
Merged
Conversation
WeightBounds return Result<Weight, XcmError> to surface XCM weight failures
Contributor
Author
|
/cmd prdoc --audience runtime_dev --bump patch |
…time_dev --bump patch'
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
kianenigma
reviewed
May 18, 2025
2ea36a9
into
ray-check-weight-with-limit
263 of 265 checks passed
Contributor
Author
|
Merged into #8535 in favour of consolidating the changes there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR continues the work in #8535 and partially addresses #8419 by updating the return types in
WeightBounds(specificallyweightandinstr_weight) to returnResult<Weight, XcmError>. This allows downstream callers to access detailed error context for XCM weight calculation failures.Why change
Previously, XCM weight calculation errors were surfaced only as
Result<Weight, ()>, losing valuable error information and forcing all upstream consumers to treat them as opaque failures. This blocked structured error handling and obscured debugging, especially in message preparation and error handler setup.How change
WeightBounds::weightandinstr_weightto returnResult<Weight, XcmError>instead ofResult<Weight, ()>.XcmExecutor,ExecuteXcm) propagate or handle these structured errors correctly.WeightBoundsreturnXcmErrorto surface failures #8535, which first converted internal logic to returnXcmErrorand added tracing logs.