Skip to content
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.

AllowTopLevelPaidExecutionFrom changed behavior #6770

Closed
@girazoki

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.

Metadata

Assignees

No one assigned

    Labels

    T6-XCMThis PR/Issue is related to XCM.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions