This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
XCM: Automatic Version Negotiation #3736
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…gin in subscription instructions.
KiChjang
reviewed
Sep 2, 2021
KiChjang
reviewed
Sep 2, 2021
KiChjang
reviewed
Sep 2, 2021
KiChjang
reviewed
Sep 2, 2021
KiChjang
reviewed
Sep 2, 2021
KiChjang
reviewed
Sep 2, 2021
KiChjang
reviewed
Sep 2, 2021
KiChjang
reviewed
Sep 2, 2021
KiChjang
reviewed
Sep 2, 2021
KiChjang
reviewed
Sep 2, 2021
KiChjang
reviewed
Sep 2, 2021
KiChjang
reviewed
Sep 2, 2021
KiChjang
reviewed
Sep 2, 2021
KiChjang
reviewed
Sep 2, 2021
KiChjang
reviewed
Sep 2, 2021
ordian
added a commit
that referenced
this pull request
Sep 6, 2021
* master: Add tests and modify as_vec implementation (#3715) Bump structopt from 0.3.22 to 0.3.23 (#3770) bump substrate and beefy (#3789) set `DisputesHandler` in initializer (#3788) Bump futures from 0.3.16 to 0.3.17 (#3742) Convert rococo chainspec to raw chainspec (#3785) feat/overseer: introduce closure init (#3775) comment out bridges runtime modules (broken) and update Rococo chain-spec (#3780) Add VoteLocking config (#3734) Enable disputes on rococo (#3764) XCM: Automatic Version Negotiation (#3736)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
A0-please_review
Pull request needs code review.
C1-low
PR touches the given topic and has a low impact on builders.
D9-needsaudit 👮
PR contains changes to fund-managing logic that should be properly reviewed and externally audited.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This introduces autonomous version negotiation in XCM, removing the need for manual intervention in order to ensure that chains use the most recent common version of XCM which they support.
It introduces a stateful
WrapVersionimplementation through the XCM Pallet, together with a newSubscribeVersioninstruction (as well asUnsubscribeVersion) to provide aQueryResponsewith the latest XCM a runtime supports together with further similar notifications when the version changes. When a message is sent to a destination whose version is unknown, the pallet queues up this destination for version querying and each block drains some number from this queue and posts a query. As they come in, it checks for responses and (assuming it knowingly subscribed for it) records it.The Pallet maintains a list of locations which have asked for version notification subscriptions and whenever there is an upgrade sends them notifications of the new upgrade. This is done through a new trait
VersionChangeNotifier.Migration
XCM Pallet
pallet_xcm::Configtrait get one new constVERSION_DISCOVERY_QUEUE_SIZEand one new typeAdvertizeXcmVersion. A sensible value for the former is 100. For the latter, it's best to just referencepallet_xcm::CurrentXcmVersion. e.g.:XCM Config
Ensure that any
xcm_executor::Configimplementations includes a definition for the new typeSubscriptionService. Generally this should be set toPalletXcm, thepallet_xcmconcrete type. i.e.:Routers &
WrapVersionAny routers (XCM transport methods) which have a
WrapVersionitem (includingcumulus_pallet_xcmp_queueandParentAsUmp) should have that item set to be implemented byPalletXcm, thepallet_xcmconcrete type. e.g.:would become:
NOTE In addition to this change, you should do at least one of two things to initialize your chain and ensure that XCM messages can be sent:
force_xcm_version(root-callable) extrinsic.force_xcm_default_version(root-callable) extrinsic.If you do the latter, then the automatic XCM version tracking code with work as expected and destination XCM versions will be kept up to date.
Barrier
An additional barrier
AlllowSubscriptionsFromshould be included in yourBarrierstuple. You can probably set the origin filter toEverything, unless you want to filter which locations can ask to be notified of your chain's XCM version changes:TODO
Maybe here or another PR:
top_levelon_runtime_upgradenotifications to happen over multiple blocksfn on_response