Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XCM] META: XCM additions #686

Open
franciscoaguirre opened this issue Mar 21, 2023 · 5 comments
Open

[XCM] META: XCM additions #686

franciscoaguirre opened this issue Mar 21, 2023 · 5 comments
Assignees
Labels
I5-enhancement An additional feature request. I6-meta A specific issue for grouping tasks or bugs of a specific category. T6-XCM This PR/Issue is related to XCM.

Comments

@franciscoaguirre
Copy link
Contributor

franciscoaguirre commented Mar 21, 2023

Rationale

We want to make XCM more powerful, specifically in our journey to get all non-security functionality out of the relay chain.
For this we need to support more and more use cases over XCM, and make them more ergonomic and less error-prone.
A use case this new version aims to attack is staking, looking at a future staking parachain (stakemine? 🤔).

This was originally an issue for tracking the development of v4, but v4 had to be a simple renaming upgrade.
Because of the XCM RFC process, new versions will just be a list of accepted RFCs to be implemented.
The below instructions are intended to be added at some point, but they'll only be added once an approved RFC comes along.
The RFCs live in the xcm-format.

New instructions

Holding and slashing

Instructions for holding assets and freeing them. Similar to the locking instructions introduced in v3 (LockAsset, UnlockAsset, NoteUnlockable, RequestUnlock).

  • HoldAsset
  • ReleaseAsset
  • NoteReleasable
  • RequestRelease
  • SlashAsset

This instructions would allow one system to communicate to another one that they are effectively holding assets and they are allowed to be slashed if the need arises.
While locking might work for proving you can vote on a different chain, holding and slashing allows for things like (but is not limited to) staking.

Good UX would be for voting and staking messages to a different chain (NoteUnlockable and NoteReleasable) to be free given that you've already locked/held a certain amount of assets.
Free always means rate limited.
This might be for locking/holding assets over a certain amount (e. g. 10 DOT).

Setting an agent (controller account) to operate in a different system on behalf of the origin

Instructions to set and reset an agent on another system.
This agent can perform actions on the receiver as if you the origin had an account there.

  • SetAgent
  • ResetAgent

This instructions will be interpreted differently based on the receiver.
For example, if the receiver is a staking parachain, the agent will have the privilege to stake on behalf of the origin who set it.
In this case, you might need to hold assets locally (or via XCM, like on statemint) and let the agent know you have held them.
The agent account can then receive staking rewards and slash your held assets over XCM if necessary.

Another example is the agent lives in a voting parachain.
In that case you'd need to lock some assets locally (or on statemint) and let the agent know so it can vote for you.

Voting instructions

Governance is a really useful and frequent feature of consensus systems.
Because of this, v4 might have specific voting instructions like the following:

  • Vote
  • Unvote
  • Delegate
  • Undelegate

Querying exchange rate

New instruction to query the exchange rate between two assets, could work for NFTs as well.

  • QueryExchange

Might also be something like HintExchangeRate, it won't swap assets, it will just return an estimation of how much of one asset you'd get by swapping some amount of some other asset.

Temporary account

An instruction to create a temporary account on the receiver to be able to add liquidity or transfer assets.

  • SetTempAccount

WithClearOrigin

An instruction to be able to "pop" the latest origin while executing another XCM but then returning to the original origin.
This provides a more ergonomic way to deal with multi-chain interactions.

  • WithClearOrigin

It would be used like:

// Executing Xcm instructions with a particular origin
WithClearOrigin(Xcm(vec![
  // Do things without origin
]))
// Keep on executing Xcm instructions with the same origin as before

Low priority instructions

Adding/removing liquidity

Instruction to add/remove liquidity to a liquidity pool. It's a useful function but specific, many systems wouldn't implement it. Right now can be done via the Transact instruction.

  • AddLiquidity
  • RemoveLiquidity

Sync metadata

An instruction to sync asset metadata, for example for NFTs. Might be too specific, heavy and might be able to be implemented with Transact already.

  • SyncMetadata
@franciscoaguirre franciscoaguirre added J1-meta T6-XCM This PR/Issue is related to XCM. labels Mar 21, 2023
@franciscoaguirre franciscoaguirre self-assigned this Mar 21, 2023
@xlc
Copy link
Contributor

xlc commented Mar 21, 2023

Can I suggest that we have a spec draft before implementation? https://github.com/paritytech/xcm-format
There should be a RFC process for XCM

@franciscoaguirre
Copy link
Contributor Author

Certainly! I created this issue here first for bookkeeping purposes while I figure out an RFC format for the xcm-format repo. Will be creating RFCs in that repo in the following days.

@Polkadot-Forum
Copy link

This issue has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/xcm-rfc-process/2447/1

@kianenigma kianenigma changed the title META: XCM v4 [XCM] META: XCM v4 May 24, 2023
@ntn-x2
Copy link

ntn-x2 commented May 29, 2023

I see the issue has ben put into the project "Deadline Q4 2023". Can we then expect a Polkadot release with XCM v4 by the end of the year?

@KiChjang
Copy link
Contributor

KiChjang commented May 29, 2023

XCM v4 is actually going to be using the new RFC process to make changes to XCM itself. We will in fact be creating RFCs for each and every individual feature that Francisco has written down on this issue.

As such, it's hard to say exactly for sure when we can release XCM v4, as it first depends upon community agreement on the new features that we want to introduce to v4, and then it depends upon the implementation difficulty of said features. However, assuming absolutely everything goes smoothly, we believe that we can release it by the end of the year, but do keep in mind that this is the optimistic happy path.

@Sophia-Gold Sophia-Gold transferred this issue from paritytech/polkadot Aug 24, 2023
@the-right-joyce the-right-joyce added I5-enhancement An additional feature request. I6-meta A specific issue for grouping tasks or bugs of a specific category. and removed J0-enhancement labels Aug 25, 2023
claravanstaden added a commit to Snowfork/polkadot-sdk that referenced this issue Dec 8, 2023
* Benchmarking.

* Benchmarking progress

* Benchmarks progress

* Progress on benchmarking

* Minimal profile benchmarking done

* Almost!

* Benchmarks progress.

* Adds runtime benchmark feature to test

* Finish off benchmarks

* Finish off benchmarks

* Revert enabling run-benchmarks feature by default

* Cleanup

* Fix import.
@franciscoaguirre franciscoaguirre changed the title [XCM] META: XCM v4 [XCM] META: XCM v5 Dec 10, 2023
helin6 pushed a commit to boolnetwork/polkadot-sdk that referenced this issue Feb 5, 2024
Bumps [parity-db](https://github.com/paritytech/parity-db) from 0.3.9 to 0.3.13.
- [Release notes](https://github.com/paritytech/parity-db/releases)
- [Commits](https://github.com/paritytech/parity-db/commits)

---
updated-dependencies:
- dependency-name: parity-db
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@acatangiu acatangiu moved this from Draft to Backlog in Parity Roadmap Mar 28, 2024
bkchr pushed a commit that referenced this issue Apr 10, 2024
* Use more unique prefix when generating account IDs

* Update derived addresses used in tests

* Make `account` prefix more unique

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update test account IDs again

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
@acatangiu acatangiu moved this to High Priority in Bridges + XCM Apr 15, 2024
@franciscoaguirre franciscoaguirre changed the title [XCM] META: XCM v5 [XCM] META: XCM additions May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request. I6-meta A specific issue for grouping tasks or bugs of a specific category. T6-XCM This PR/Issue is related to XCM.
Projects
Status: No status
Status: Backlog
Development

No branches or pull requests

7 participants