This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Description
AllowTopLevelPaidExecutionFrom
changed behavior after xcmV3 merge. Before if the message contained a BuyExecution(Limited(bought_weight))
and bought_weight
was greater than the weighed_weight
weighed by the receiving chain, the weight inside BuyExecution was overriden:
match i {
BuyExecution { weight_limit: Limited(ref mut weight), .. } if *weight >= max_weight => {
*weight = max_weight;
Ok(())
},
BuyExecution { ref mut weight_limit, .. } if weight_limit == &Unlimited => {
*weight_limit = Limited(max_weight);
Ok(())
},
_ => Err(()),
}
Now this is no longer the case. The same barrier now has the following check now:
match i {
BuyExecution { weight_limit: Limited(ref mut weight), .. }
if weight.all_gte(max_weight) =>
{
*weight = weight.max(max_weight);
Ok(())
},
BuyExecution { ref mut weight_limit, .. } if weight_limit == &Unlimited => {
*weight_limit = Limited(max_weight);
Ok(())
},
_ => Err(()),
}
Which checks that the bought_weight
is greater or equal than the weighed_weight
. But if it is the case, the weight is overriden by the max of both. Which by definition of the check made before, it will always be bought_weight
.