Skip to content

pallet-xcm: API changes to use VersionedAssetId instead of u32 to specify asset for fees#10243

Merged
franciscoaguirre merged 14 commits intomasterfrom
kk-fee-asset-id
Nov 12, 2025
Merged

pallet-xcm: API changes to use VersionedAssetId instead of u32 to specify asset for fees#10243
franciscoaguirre merged 14 commits intomasterfrom
kk-fee-asset-id

Conversation

@karolk91
Copy link
Contributor

@karolk91 karolk91 commented Nov 7, 2025

Multiple pallet-xcm calls use u32 index as a way to specify which asset from the assets (also an arg of the call) is to be used for fees purposes. This PR brings major API change (breaking change) that proposes usage of VersionedAssetId instead

Affected pallet-xcm calls: teleport_assets, reserve_transfer_assets, limited_reserve_transfer_assets, limited_teleport_assets, transfer_assets

This is follow-up change to the: #9842, that aims to remove the requirement of the client to provide sorted list of Assets to the APIs (often a point failures). With the mentioned change sorting happens on the runtime side and u32 index (provided by the client) can become invalid after sorting (this PR aims that problem)

Relevant dicussion on XCM public element channel

@karolk91 karolk91 self-assigned this Nov 7, 2025
@karolk91 karolk91 added the T6-XCM This PR/Issue is related to XCM. label Nov 7, 2025
@karolk91
Copy link
Contributor Author

karolk91 commented Nov 7, 2025

/cmd prdoc --audience runtime_dev --audience runtime_user --bump major

…time_dev --audience runtime_user --bump major'
@karolk91 karolk91 changed the title pallet-xcm: API changes to use VersionedAssetId instead of u32 to specify asset for fees [WIP] pallet-xcm: API changes to use VersionedAssetId instead of u32 to specify asset for fees Nov 7, 2025
@karolk91 karolk91 marked this pull request as ready for review November 7, 2025 14:19
@karolk91 karolk91 requested review from a team as code owners November 7, 2025 14:19
@paritytech-review-bot paritytech-review-bot bot requested a review from a team November 7, 2025 14:20
@karolk91 karolk91 changed the title [WIP] pallet-xcm: API changes to use VersionedAssetId instead of u32 to specify asset for fees pallet-xcm: API changes to use VersionedAssetId instead of u32 to specify asset for fees Nov 10, 2025
/// - `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase.
#[pallet::call_index(8)]
#[pallet::weight(T::WeightInfo::reserve_transfer_assets())]
pub fn limited_reserve_transfer_assets(
Copy link
Contributor

Choose a reason for hiding this comment

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

deprecate this API too

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm going to deprecate on another PR since deprecating is not a major bump and there are some places in the codebase where replacing the deprecated function would need some work

/// - `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase.
#[pallet::call_index(9)]
#[pallet::weight(T::WeightInfo::teleport_assets())]
pub fn limited_teleport_assets(
Copy link
Contributor

Choose a reason for hiding this comment

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

deprecate this API too

@xlc
Copy link
Contributor

xlc commented Nov 12, 2025

trying an AI review bot and found some typos xlc#2 (comment)

@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/19306183655
Failed job name: test-linux-stable

@franciscoaguirre franciscoaguirre added this pull request to the merge queue Nov 12, 2025
Merged via the queue into master with commit 14f0e2e Nov 12, 2025
328 of 356 checks passed
@franciscoaguirre franciscoaguirre deleted the kk-fee-asset-id branch November 12, 2025 20:52
0xRVE pushed a commit that referenced this pull request Nov 18, 2025
… specify asset for fees (#10243)

Multiple pallet-xcm calls use `u32` index as a way to specify which
asset from the `assets` (also an arg of the call) is to be used for fees
purposes. This PR brings **major API change (breaking change)** that
proposes usage of `VersionedAssetId` instead

Affected pallet-xcm calls: `teleport_assets`, `reserve_transfer_assets`,
`limited_reserve_transfer_assets`, `limited_teleport_assets`,
`transfer_assets`

This is follow-up change to the:
#9842, that aims to
remove the requirement of the client to provide sorted list of Assets to
the APIs (often a point failures). With the mentioned change sorting
happens on the runtime side and `u32` index (provided by the client) can
become invalid after sorting (this PR aims that problem)

Relevant
[dicussion](https://matrix.to/#/!nYxxyvMNMUaniRIokh:parity.io/$gAcAEznmQL6LhUlvGPHSaePUV4cZtxoco2I6ap8Cn3Q?via=parity.io&via=matrix.org&via=web3.foundation)
on XCM public element channel

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
github-merge-queue bot pushed a commit that referenced this pull request Dec 4, 2025
…`u32` to specify asset for fees" (#10458)

Reverts #10243

Following on the discussion at
#10391, this change may
find its place in future releases so reverting to not affect current
master and to be reverted from stable2512 as well
karolk91 added a commit that referenced this pull request Dec 5, 2025
…`u32` to specify asset for fees" (#10458)

Reverts #10243

Following on the discussion at
#10391, this change may
find its place in future releases so reverting to not affect current
master and to be reverted from stable2512 as well

(cherry picked from commit 613e00e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T6-XCM This PR/Issue is related to XCM.

Projects

Status: To be released (SDK)

Development

Successfully merging this pull request may close these issues.

4 participants