Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
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
2 changes: 1 addition & 1 deletion runtime/parachains/src/ump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl<XcmExecutor: xcm::v0::ExecuteXcm<Call>, Call> UmpSink for XcmSink<XcmExecut
let xcm_location: MultiLocation = xcm_junction.into();
match XcmExecutor::execute_xcm(xcm_location, xcm_message, max_weight) {
Outcome::Complete(w) | Outcome::Incomplete(w, _) => Some(w),
Outcome::Error(XcmError::WeightLimitReached) => None,
Outcome::Error(XcmError::WeightLimitReached(..)) => None,
Outcome::Error(_) => Some(0),
}
}
Expand Down
2 changes: 1 addition & 1 deletion xcm/src/v0/multi_location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ impl MultiLocation {
let self_parents = self.parent_count();
let prefix_rest = prefix.len() - prefix.parent_count();
let skipped = self_parents.min(prefix_rest);
if self.len() + prefix.len() - 2 * skipped > 4 {
if self.len() + prefix.len() - 2 * skipped > 8 {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Minor fix since we now have 8 items in MultiLocation, not 4.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We will always need to remember to bump this number?

return Err(prefix);
}

Expand Down
4 changes: 3 additions & 1 deletion xcm/src/v0/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ pub enum Error {
BadOrigin,
ExceedsMaxMessageSize,
FailedToTransactAsset(#[codec(skip)] &'static str),
WeightLimitReached,
/// Execution of the XCM would potentially result in a greater weight used than the pre-specified
/// weight limit. The amount that is potentially required is the parameter.
WeightLimitReached(Weight),
Wildcard,
/// The case where an XCM message has specified a optional weight limit and the weight required for
/// processing is too great.
Expand Down
4 changes: 2 additions & 2 deletions xcm/xcm-executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ impl<Config: config::Config> ExecuteXcm<Config::Call> for XcmExecutor<Config> {
};
let maximum_weight = match shallow_weight.checked_add(deep_weight) {
Some(x) => x,
None => return Outcome::Error(XcmError::WeightLimitReached),
None => return Outcome::Error(XcmError::Overflow),
};
if maximum_weight > weight_limit {
return Outcome::Error(XcmError::WeightLimitReached);
return Outcome::Error(XcmError::WeightLimitReached(maximum_weight));
}
let mut trader = Config::Trader::new();
let result = Self::do_execute_xcm(origin, true, message, &mut 0, Some(shallow_weight), &mut trader);
Expand Down