Skip to content

[xcm] runtime api for LocationToAccount conversions#4857

Merged
bkontur merged 32 commits intomasterfrom
bko-xcm-runtime-api
Jun 26, 2024
Merged

[xcm] runtime api for LocationToAccount conversions#4857
bkontur merged 32 commits intomasterfrom
bko-xcm-runtime-api

Conversation

@bkontur
Copy link
Copy Markdown
Contributor

@bkontur bkontur commented Jun 21, 2024

Closes: #4298

This PR also merges xcm-fee-payment-runtime-api module to the xcm-runtime-api.

TODO

Open questions

  • should we merge xcm-runtime-api and xcm-fee-payment-runtime-api to the one module xcm-runtime-api ?

Usage

Input:

  • location: VersionedLocation

Output:

  • account_id bytes

image

@bkontur bkontur added the T6-XCM This PR/Issue is related to XCM. label Jun 21, 2024
@bkontur bkontur marked this pull request as ready for review June 25, 2024 09:16
@bkontur bkontur requested a review from a team as a code owner June 25, 2024 09:16
Copy link
Copy Markdown
Contributor

@acatangiu acatangiu left a comment

Choose a reason for hiding this comment

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

Looks good!

should we merge xcm-runtime-api and xcm-fee-payment-runtime-api to the one module xcm-runtime-api ?

that sounds good hygiene to me, makes sense to have a structure like:

xcm-runtime-api
|    mod conversions
|    mod dry_run
|    mod fees

@bkontur bkontur disabled auto-merge June 26, 2024 12:45
@bkontur bkontur enabled auto-merge June 26, 2024 13:08
@bkontur bkontur added this pull request to the merge queue Jun 26, 2024
Merged via the queue into master with commit 7506956 Jun 26, 2024
@bkontur bkontur deleted the bko-xcm-runtime-api branch June 26, 2024 14:15
fgamundi pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jul 17, 2024
Closes: paritytech#4298

This PR also merges `xcm-fee-payment-runtime-api` module to the
`xcm-runtime-api`.

## TODO

- [x] rename `convert` to `convert_location` and add new one
`convert_account` (opposite direction)
- [x] add to the all testnet runtimes
- [x] check polkadot-js if supports that automatically or if needs to be
added manually polkadot-js/api#5917
- [ ] backport/patch for fellows and release (asap)

## Open questions
- [x] should we merge `xcm-runtime-api` and
`xcm-fee-payment-runtime-api` to the one module `xcm-runtime-api` ?

## Usage
Input:
 - `location:  VersionedLocation`

Output:
 - account_id bytes

![image](https://github.com/paritytech/polkadot-sdk/assets/8159517/4607b15a-77d2-462b-806c-606107776c0d)

---------

Co-authored-by: Bastian Köcher <[email protected]>
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	cumulus/parachains/integration-tests/emulated/chains/relays/westend/Cargo.toml
#	cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/Cargo.toml
#	cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml
#	cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml
#	cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/Cargo.toml
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs
#	cumulus/parachains/runtimes/collectives/collectives-westend/Cargo.toml
#	cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs
#	cumulus/parachains/runtimes/contracts/contracts-rococo/Cargo.toml
#	cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs
#	cumulus/parachains/runtimes/coretime/coretime-rococo/Cargo.toml
#	cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs
#	cumulus/parachains/runtimes/coretime/coretime-westend/Cargo.toml
#	cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs
#	cumulus/parachains/runtimes/people/people-rococo/Cargo.toml
#	cumulus/parachains/runtimes/people/people-rococo/src/lib.rs
#	cumulus/parachains/runtimes/people/people-westend/Cargo.toml
#	cumulus/parachains/runtimes/people/people-westend/src/lib.rs
#	cumulus/parachains/runtimes/testing/penpal/Cargo.toml
#	cumulus/parachains/runtimes/testing/penpal/src/lib.rs
#	cumulus/polkadot-parachain/Cargo.toml
#	polkadot/node/service/Cargo.toml
#	polkadot/runtime/rococo/Cargo.toml
#	polkadot/runtime/westend/Cargo.toml
#	polkadot/xcm/pallet-xcm/Cargo.toml
#	polkadot/xcm/xcm-runtime-apis/Cargo.toml
#	umbrella/Cargo.toml
#	umbrella/src/lib.rs
fgamundi pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jul 17, 2024
Closes: paritytech#4298

This PR also merges `xcm-fee-payment-runtime-api` module to the
`xcm-runtime-api`.

## TODO

- [x] rename `convert` to `convert_location` and add new one
`convert_account` (opposite direction)
- [x] add to the all testnet runtimes
- [x] check polkadot-js if supports that automatically or if needs to be
added manually polkadot-js/api#5917
- [ ] backport/patch for fellows and release (asap)

## Open questions
- [x] should we merge `xcm-runtime-api` and
`xcm-fee-payment-runtime-api` to the one module `xcm-runtime-api` ?

## Usage
Input:
 - `location:  VersionedLocation`

Output:
 - account_id bytes

![image](https://github.com/paritytech/polkadot-sdk/assets/8159517/4607b15a-77d2-462b-806c-606107776c0d)

---------

Co-authored-by: Bastian Köcher <[email protected]>
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	cumulus/parachains/integration-tests/emulated/chains/relays/westend/Cargo.toml
#	cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/Cargo.toml
#	cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml
#	cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml
#	cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/Cargo.toml
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs
#	cumulus/parachains/runtimes/collectives/collectives-westend/Cargo.toml
#	cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs
#	cumulus/parachains/runtimes/contracts/contracts-rococo/Cargo.toml
#	cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs
#	cumulus/parachains/runtimes/coretime/coretime-rococo/Cargo.toml
#	cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs
#	cumulus/parachains/runtimes/coretime/coretime-westend/Cargo.toml
#	cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs
#	cumulus/parachains/runtimes/people/people-rococo/Cargo.toml
#	cumulus/parachains/runtimes/people/people-rococo/src/lib.rs
#	cumulus/parachains/runtimes/people/people-westend/Cargo.toml
#	cumulus/parachains/runtimes/people/people-westend/src/lib.rs
#	cumulus/parachains/runtimes/testing/penpal/Cargo.toml
#	cumulus/parachains/runtimes/testing/penpal/src/lib.rs
#	cumulus/polkadot-parachain/Cargo.toml
#	polkadot/node/service/Cargo.toml
#	polkadot/runtime/rococo/Cargo.toml
#	polkadot/runtime/westend/Cargo.toml
#	polkadot/xcm/pallet-xcm/Cargo.toml
#	polkadot/xcm/xcm-runtime-apis/Cargo.toml
#	umbrella/Cargo.toml
#	umbrella/src/lib.rs
fgamundi pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jul 17, 2024
Closes: paritytech#4298

This PR also merges `xcm-fee-payment-runtime-api` module to the
`xcm-runtime-api`.

## TODO

- [x] rename `convert` to `convert_location` and add new one
`convert_account` (opposite direction)
- [x] add to the all testnet runtimes
- [x] check polkadot-js if supports that automatically or if needs to be
added manually polkadot-js/api#5917
- [ ] backport/patch for fellows and release (asap)

## Open questions
- [x] should we merge `xcm-runtime-api` and
`xcm-fee-payment-runtime-api` to the one module `xcm-runtime-api` ?

## Usage
Input:
 - `location:  VersionedLocation`

Output:
 - account_id bytes

![image](https://github.com/paritytech/polkadot-sdk/assets/8159517/4607b15a-77d2-462b-806c-606107776c0d)

---------

Co-authored-by: Bastian Köcher <[email protected]>
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	cumulus/parachains/integration-tests/emulated/chains/relays/westend/Cargo.toml
#	cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/Cargo.toml
#	cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml
#	cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml
#	cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/Cargo.toml
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs
#	cumulus/parachains/runtimes/collectives/collectives-westend/Cargo.toml
#	cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs
#	cumulus/parachains/runtimes/contracts/contracts-rococo/Cargo.toml
#	cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs
#	cumulus/parachains/runtimes/coretime/coretime-rococo/Cargo.toml
#	cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs
#	cumulus/parachains/runtimes/coretime/coretime-westend/Cargo.toml
#	cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs
#	cumulus/parachains/runtimes/people/people-rococo/Cargo.toml
#	cumulus/parachains/runtimes/people/people-rococo/src/lib.rs
#	cumulus/parachains/runtimes/people/people-westend/Cargo.toml
#	cumulus/parachains/runtimes/people/people-westend/src/lib.rs
#	cumulus/parachains/runtimes/testing/penpal/Cargo.toml
#	cumulus/parachains/runtimes/testing/penpal/src/lib.rs
#	cumulus/polkadot-parachain/Cargo.toml
#	polkadot/node/service/Cargo.toml
#	polkadot/runtime/rococo/Cargo.toml
#	polkadot/runtime/westend/Cargo.toml
#	polkadot/xcm/pallet-xcm/Cargo.toml
#	polkadot/xcm/xcm-runtime-apis/Cargo.toml
#	umbrella/Cargo.toml
#	umbrella/src/lib.rs
girazoki pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Aug 1, 2024
Closes: paritytech#4298

This PR also merges `xcm-fee-payment-runtime-api` module to the
`xcm-runtime-api`.

## TODO

- [x] rename `convert` to `convert_location` and add new one
`convert_account` (opposite direction)
- [x] add to the all testnet runtimes
- [x] check polkadot-js if supports that automatically or if needs to be
added manually polkadot-js/api#5917
- [ ] backport/patch for fellows and release (asap)

## Open questions
- [x] should we merge `xcm-runtime-api` and
`xcm-fee-payment-runtime-api` to the one module `xcm-runtime-api` ?

## Usage
Input:
 - `location:  VersionedLocation`

Output:
 - account_id bytes

![image](https://github.com/paritytech/polkadot-sdk/assets/8159517/4607b15a-77d2-462b-806c-606107776c0d)

---------

Co-authored-by: Bastian Köcher <[email protected]>
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	cumulus/parachains/integration-tests/emulated/chains/relays/westend/Cargo.toml
#	cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/Cargo.toml
#	cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml
#	cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml
#	cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/Cargo.toml
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs
#	cumulus/parachains/runtimes/collectives/collectives-westend/Cargo.toml
#	cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs
#	cumulus/parachains/runtimes/contracts/contracts-rococo/Cargo.toml
#	cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs
#	cumulus/parachains/runtimes/coretime/coretime-rococo/Cargo.toml
#	cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs
#	cumulus/parachains/runtimes/coretime/coretime-westend/Cargo.toml
#	cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs
#	cumulus/parachains/runtimes/people/people-rococo/Cargo.toml
#	cumulus/parachains/runtimes/people/people-rococo/src/lib.rs
#	cumulus/parachains/runtimes/people/people-westend/Cargo.toml
#	cumulus/parachains/runtimes/people/people-westend/src/lib.rs
#	cumulus/parachains/runtimes/testing/penpal/Cargo.toml
#	cumulus/parachains/runtimes/testing/penpal/src/lib.rs
#	cumulus/polkadot-parachain/Cargo.toml
#	polkadot/node/service/Cargo.toml
#	polkadot/runtime/rococo/Cargo.toml
#	polkadot/runtime/westend/Cargo.toml
#	polkadot/xcm/pallet-xcm/Cargo.toml
#	polkadot/xcm/xcm-runtime-apis/Cargo.toml
#	umbrella/Cargo.toml
#	umbrella/src/lib.rs
TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Aug 2, 2024
Closes: paritytech#4298

This PR also merges `xcm-fee-payment-runtime-api` module to the
`xcm-runtime-api`.


## TODO

- [x] rename `convert` to `convert_location` and add new one
`convert_account` (opposite direction)
- [x] add to the all testnet runtimes
- [x] check polkadot-js if supports that automatically or if needs to be
added manually polkadot-js/api#5917
- [ ] backport/patch for fellows and release (asap)

## Open questions
- [x] should we merge `xcm-runtime-api` and
`xcm-fee-payment-runtime-api` to the one module `xcm-runtime-api` ?

## Usage
Input:
 - `location:  VersionedLocation`
 
Output:
 - account_id bytes


![image](https://github.com/paritytech/polkadot-sdk/assets/8159517/4607b15a-77d2-462b-806c-606107776c0d)

---------

Co-authored-by: Bastian Köcher <[email protected]>
fellowship-merge-bot bot pushed a commit to polkadot-fellows/runtimes that referenced this pull request Aug 7, 2024
…imes (#413)

Relates to: paritytech/polkadot-sdk#4298
Relates to: paritytech/polkadot-sdk#4857


<!-- Remember that you can run `/merge` to enable auto-merge in the PR
-->

<!-- Remember to modify the changelog. If you don't need to modify it,
you can check the following box.
Instead, if you have already modified it, simply delete the following
line. -->

- [ ] Does not require a CHANGELOG entry

---------

Co-authored-by: Adrian Catangiu <[email protected]>
Co-authored-by: Dónal Murray <[email protected]>
aurexav added a commit to darwinia-network/darwinia that referenced this pull request Dec 25, 2024
sfffaaa pushed a commit to peaqnetwork/polkadot-sdk that referenced this pull request Dec 27, 2024
Closes: paritytech#4298

This PR also merges `xcm-fee-payment-runtime-api` module to the
`xcm-runtime-api`.


## TODO

- [x] rename `convert` to `convert_location` and add new one
`convert_account` (opposite direction)
- [x] add to the all testnet runtimes
- [x] check polkadot-js if supports that automatically or if needs to be
added manually polkadot-js/api#5917
- [ ] backport/patch for fellows and release (asap)

## Open questions
- [x] should we merge `xcm-runtime-api` and
`xcm-fee-payment-runtime-api` to the one module `xcm-runtime-api` ?

## Usage
Input:
 - `location:  VersionedLocation`
 
Output:
 - account_id bytes


![image](https://github.com/paritytech/polkadot-sdk/assets/8159517/4607b15a-77d2-462b-806c-606107776c0d)

---------

Co-authored-by: Bastian Köcher <[email protected]>
lrazovic pushed a commit to Polimec/polimec-node that referenced this pull request May 2, 2025
## What?

closes #446

 **Tasks**
 
 * [x]  Review [release notes for stable2412](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-stable2412) for breaking changes. Also check the release notes of the versions before (with a focus on `stable2409` and `1.14.0`).
* [x]  Update Polkadot SDK dependencies to `stable2412`.
* [x]  Update [ORML](https://github.com/open-web3-stack/open-runtime-module-library) dependencies to the according version.
* [x]  Test node and runtime compatibility (e.g., compile-time errors, runtime APIs, storage migrations).
* [x]  Audit custom pallets for deprecated or changed SDK interfaces.
* [x]  Update benchmarks (if applicable) for weight calculations.
 
 **Additional Context**

 * The `Treasury::propose_spend(...)` integrations tests needs a rework, since that extrinsic is now deprecated, and it should be replaced by `Treasury::sped_local(...)`. We can ignore these tests for now and re-add them in a later PR.

## Why?

Release analysis posts [here](https://forum.polkadot.network/tag/release-analysis).

Some notable PRs:

- Replaces `SignedExtra` with new `TransactionExtension`. This requires us to reimplement the custom `CheckNonce` as a follow up PR - paritytech/polkadot-sdk#3685 
- XCM V5 is now `latest`, so `v4` xcm types are replaced with `v5` - paritytech/polkadot-sdk#4826 - 
- merges `xcm-fee-payment-runtime-api` module into the new `xcm-runtime-apis` - paritytech/polkadot-sdk#4857
- remove `sp-std` dependency, replace with `alloc` or `core`
## How?

## Testing?
 
* [x]  Pallet Unit Testing (e.g.  `cargo t -p pallet-funding`)
* [x]  Integration Tests (e.g. `cargo t -p integration-tests`)
* [x] [Try Runtime CLI,](https://github.com/paritytech/try-runtime-cli) to test if we have to run any migration in this upgrade.
 
## Screenshots (optional)

<details>
    <summary>Syncing with mainnet `polimec`</summary>
    <img width="1542" alt="Screenshot 2025-02-06 at 1 16 29" src="https://github.com/user-attachments/assets/7d14b32a-498f-4c4c-be5d-ccbda832d362" />
</details>
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: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

Runtime API for LocationToAccountId Conversion

6 participants