Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

XCM: Automatic Version Negotiation #3736

Merged
merged 45 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
b77ee8d
XCM: Automatic Version Negotiation
gavofyork Aug 28, 2021
eb367fd
Introduce the version instructions and subscription trait
gavofyork Aug 28, 2021
806f685
Notification and subscription data migration
gavofyork Aug 28, 2021
5fe6ac9
Version change subscriptions
gavofyork Aug 29, 2021
6e8e885
Fixes
gavofyork Aug 29, 2021
3dc6612
Formatting
gavofyork Aug 29, 2021
69da3ee
Spelling
gavofyork Aug 29, 2021
185ccb1
Fixes
gavofyork Aug 29, 2021
8f1b970
Fixes
gavofyork Aug 29, 2021
d63ef5c
Automatic unsubscription
gavofyork Aug 29, 2021
cc93b10
Formatting
gavofyork Aug 30, 2021
332b660
Expose remote origin in VM and ensure it is unchanged from actual ori…
gavofyork Aug 30, 2021
cb0fc45
Barrier
gavofyork Aug 30, 2021
24d0d39
Unsubscription extrinsic
gavofyork Aug 30, 2021
4cc58ab
Remove top_level param
gavofyork Aug 30, 2021
74ea2ff
Formatting
gavofyork Aug 30, 2021
22bb608
Fixes
gavofyork Aug 30, 2021
33aa24d
Automatic subscription
gavofyork Aug 30, 2021
f995f45
Formatting
gavofyork Aug 30, 2021
6c59e8c
Spelling
gavofyork Aug 30, 2021
198e0d5
Unit tests for XCM executor
gavofyork Aug 30, 2021
0a8ab6c
Formatting
gavofyork Aug 30, 2021
d2cc8e4
Spellin
gavofyork Aug 30, 2021
fa0e479
Unit test for XCM pallet subscriber side
gavofyork Aug 30, 2021
dcfb371
Formatting
gavofyork Aug 30, 2021
97439b0
More tests
gavofyork Aug 30, 2021
2cad1c5
Formatting
gavofyork Aug 30, 2021
02ab113
Fixes
gavofyork Aug 31, 2021
2258b45
Subscription-side tests
gavofyork Aug 31, 2021
b2b6c7b
Formatting
gavofyork Aug 31, 2021
5dd7d1a
Unit tests for XCM pallet
gavofyork Aug 31, 2021
ef175d5
Formatting
gavofyork Aug 31, 2021
be9a6ee
Update roadmap/implementers-guide/src/types/overseer-protocol.md
gavofyork Aug 31, 2021
fef43f3
Remove commented code
gavofyork Aug 31, 2021
da5b790
Merge branch 'gav-xcm-version-negotiation' of github.com:paritytech/p…
gavofyork Aug 31, 2021
08197f1
Grumbles
gavofyork Sep 1, 2021
49ff8c4
Multi-stage XCM version migration
gavofyork Sep 1, 2021
314943b
Formatting
gavofyork Sep 1, 2021
d536597
v1 subscriptions backport
gavofyork Sep 1, 2021
c016c36
Warning
gavofyork Sep 1, 2021
3ca4adb
Spelling
gavofyork Sep 2, 2021
fbb59cf
Fix grumbles
gavofyork Sep 2, 2021
c210313
Formatting
gavofyork Sep 2, 2021
3543b4d
Avoid running through old notifications
gavofyork Sep 2, 2021
84ff995
Formatting
gavofyork Sep 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions roadmap/implementers-guide/src/types/overseer-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ enum DisputeCoordinatorMessage {
pending_confirmation: oneshot::Sender<ImportStatementsResult>
},
/// Fetch a list of all recent disputes that the co-ordinator is aware of.
/// These are disputes which have occured any time in recent sessions, which may have already concluded.
/// These are disputes which have occurred any time in recent sessions, which may have already concluded.
RecentDisputes(ResponseChannel<Vec<(SessionIndex, CandidateHash)>>),
/// Fetch a list of all active disputes that the co-ordinator is aware of.
/// These disputes are either unconcluded or recently concluded.
Expand Down Expand Up @@ -699,7 +699,7 @@ The Runtime API subsystem is responsible for providing an interface to the state

This is fueled by an auxiliary type encapsulating all request types defined in the Runtime API section of the guide.

> TODO: link to the Runtime API section. Not possible currently because of https://github.com/Michael-F-Bryan/mdbook-linkcheck/issues/25. Once v0.7.1 is released it will work.
> To do: link to the Runtime API section. Not possible currently because of https://github.com/Michael-F-Bryan/mdbook-linkcheck/issues/25. Once v0.7.1 is released it will work.

```rust
enum RuntimeApiRequest {
Expand Down
4 changes: 3 additions & 1 deletion runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,7 @@ impl xcm_executor::Config for XcmConfig {
type ResponseHandler = XcmPallet;
type AssetTrap = XcmPallet;
type AssetClaims = XcmPallet;
type SubscriptionService = XcmPallet;
}

parameter_types! {
Expand All @@ -1318,7 +1319,6 @@ pub type LocalOriginToLocation = (
// And a usual Signed origin to be used in XCM as a corresponding AccountId32
SignedToAccountId32<Origin, AccountId, KusamaNetwork>,
);

impl pallet_xcm::Config for Runtime {
type Event = Event;
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<Origin, LocalOriginToLocation>;
Expand All @@ -1334,6 +1334,8 @@ impl pallet_xcm::Config for Runtime {
type LocationInverter = LocationInverter<Ancestry>;
type Origin = Origin;
type Call = Call;
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
}

parameter_types! {
Expand Down
3 changes: 3 additions & 0 deletions runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ impl xcm_executor::Config for XcmConfig {
type ResponseHandler = XcmPallet;
type AssetTrap = XcmPallet;
type AssetClaims = XcmPallet;
type SubscriptionService = XcmPallet;
}

parameter_types! {
Expand Down Expand Up @@ -703,6 +704,8 @@ impl pallet_xcm::Config for Runtime {
type LocationInverter = LocationInverter<Ancestry>;
type Origin = Origin;
type Call = Call;
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
}

impl parachains_session_info::Config for Runtime {}
Expand Down
4 changes: 3 additions & 1 deletion runtime/test-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,8 @@ impl pallet_xcm::Config for Runtime {
type XcmReserveTransferFilter = Everything;
type Origin = Origin;
type Call = Call;
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
}

impl parachains_hrmp::Config for Runtime {
Expand All @@ -537,7 +539,7 @@ impl pallet_test_notifier::Config for Runtime {
pub mod pallet_test_notifier {
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;
use pallet_xcm::{ensure_response, QueryId};
use pallet_xcm::ensure_response;
use sp_runtime::DispatchResult;
use xcm::latest::prelude::*;

Expand Down
1 change: 1 addition & 0 deletions runtime/test-runtime/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ impl xcm_executor::Config for XcmConfig {
type ResponseHandler = super::Xcm;
type AssetTrap = super::Xcm;
type AssetClaims = super::Xcm;
type SubscriptionService = super::Xcm;
}
3 changes: 3 additions & 0 deletions runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,7 @@ impl xcm_executor::Config for XcmConfig {
type ResponseHandler = XcmPallet;
type AssetTrap = XcmPallet;
type AssetClaims = XcmPallet;
type SubscriptionService = XcmPallet;
}

/// Type to convert an `Origin` type value into a `MultiLocation` value which represents an interior location
Expand All @@ -965,6 +966,8 @@ impl pallet_xcm::Config for Runtime {
type LocationInverter = LocationInverter<Ancestry>;
type Origin = Origin;
type Call = Call;
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
}

construct_runtime! {
Expand Down
Loading