mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 15:11:02 +00:00
Configure Statemint and Statemine to Allow Teleports (#912)
* configure pallet-xcm to allow teleports but forbid generic sends * bump spec_version Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
This commit is contained in:
@@ -75,7 +75,8 @@ use xcm_builder::{
|
|||||||
ConvertedConcreteAssetId, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds,
|
ConvertedConcreteAssetId, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds,
|
||||||
FungiblesAdapter, IsConcrete, LocationInverter, NativeAsset, ParentAsSuperuser,
|
FungiblesAdapter, IsConcrete, LocationInverter, NativeAsset, ParentAsSuperuser,
|
||||||
ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
||||||
SignedAccountId32AsNative, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
|
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
|
||||||
|
UsingComponents,
|
||||||
};
|
};
|
||||||
use xcm_executor::{traits::JustTry, Config, XcmExecutor};
|
use xcm_executor::{traits::JustTry, Config, XcmExecutor};
|
||||||
|
|
||||||
@@ -90,7 +91,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
|||||||
spec_name: create_runtime_str!("statemine"),
|
spec_name: create_runtime_str!("statemine"),
|
||||||
impl_name: create_runtime_str!("statemine"),
|
impl_name: create_runtime_str!("statemine"),
|
||||||
authoring_version: 1,
|
authoring_version: 1,
|
||||||
spec_version: 600,
|
spec_version: 601,
|
||||||
impl_version: 0,
|
impl_version: 0,
|
||||||
apis: RUNTIME_API_VERSIONS,
|
apis: RUNTIME_API_VERSIONS,
|
||||||
transaction_version: 4,
|
transaction_version: 4,
|
||||||
@@ -564,8 +565,9 @@ parameter_types! {
|
|||||||
pub const MaxDownwardMessageWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 10;
|
pub const MaxDownwardMessageWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// No local origins on this chain are allowed to dispatch XCM sends/executions.
|
/// Converts a local signed origin into an XCM multilocation.
|
||||||
pub type LocalOriginToLocation = ();
|
/// Forms the basis for local origins sending/executing XCMs.
|
||||||
|
pub type LocalOriginToLocation = SignedToAccountId32<Origin, AccountId, RelayNetwork>;
|
||||||
|
|
||||||
/// The means for routing XCM messages which are not for local execution into the right message
|
/// The means for routing XCM messages which are not for local execution into the right message
|
||||||
/// queues.
|
/// queues.
|
||||||
@@ -578,9 +580,12 @@ pub type XcmRouter = (
|
|||||||
|
|
||||||
impl pallet_xcm::Config for Runtime {
|
impl pallet_xcm::Config for Runtime {
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type SendXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
|
// We want to disallow users sending (arbitrary) XCMs from this chain.
|
||||||
|
type SendXcmOrigin = EnsureXcmOrigin<Origin, ()>;
|
||||||
type XcmRouter = XcmRouter;
|
type XcmRouter = XcmRouter;
|
||||||
|
// We support local origins dispatching XCM executions in principle...
|
||||||
type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
|
type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
|
||||||
|
// ... but disallow generic XCM execution. As a result only teleports and reserve transfers are allowed.
|
||||||
type XcmExecuteFilter = Nothing;
|
type XcmExecuteFilter = Nothing;
|
||||||
type XcmExecutor = XcmExecutor<XcmConfig>;
|
type XcmExecutor = XcmExecutor<XcmConfig>;
|
||||||
type XcmTeleportFilter = Everything;
|
type XcmTeleportFilter = Everything;
|
||||||
|
|||||||
@@ -75,7 +75,8 @@ use xcm_builder::{
|
|||||||
ConvertedConcreteAssetId, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds,
|
ConvertedConcreteAssetId, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds,
|
||||||
FungiblesAdapter, IsConcrete, LocationInverter, NativeAsset, ParentAsSuperuser,
|
FungiblesAdapter, IsConcrete, LocationInverter, NativeAsset, ParentAsSuperuser,
|
||||||
ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
||||||
SignedAccountId32AsNative, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
|
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
|
||||||
|
UsingComponents,
|
||||||
};
|
};
|
||||||
use xcm_executor::{traits::JustTry, Config, XcmExecutor};
|
use xcm_executor::{traits::JustTry, Config, XcmExecutor};
|
||||||
|
|
||||||
@@ -90,7 +91,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
|||||||
spec_name: create_runtime_str!("statemint"),
|
spec_name: create_runtime_str!("statemint"),
|
||||||
impl_name: create_runtime_str!("statemint"),
|
impl_name: create_runtime_str!("statemint"),
|
||||||
authoring_version: 1,
|
authoring_version: 1,
|
||||||
spec_version: 600,
|
spec_version: 601,
|
||||||
impl_version: 0,
|
impl_version: 0,
|
||||||
apis: RUNTIME_API_VERSIONS,
|
apis: RUNTIME_API_VERSIONS,
|
||||||
transaction_version: 4,
|
transaction_version: 4,
|
||||||
@@ -576,8 +577,9 @@ parameter_types! {
|
|||||||
pub const MaxDownwardMessageWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 10;
|
pub const MaxDownwardMessageWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// No local origins on this chain are allowed to dispatch XCM sends/executions.
|
/// Converts a local signed origin into an XCM multilocation.
|
||||||
pub type LocalOriginToLocation = ();
|
/// Forms the basis for local origins sending/executing XCMs.
|
||||||
|
pub type LocalOriginToLocation = SignedToAccountId32<Origin, AccountId, RelayNetwork>;
|
||||||
|
|
||||||
/// The means for routing XCM messages which are not for local execution into the right message
|
/// The means for routing XCM messages which are not for local execution into the right message
|
||||||
/// queues.
|
/// queues.
|
||||||
@@ -590,9 +592,12 @@ pub type XcmRouter = (
|
|||||||
|
|
||||||
impl pallet_xcm::Config for Runtime {
|
impl pallet_xcm::Config for Runtime {
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type SendXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
|
// We want to disallow users sending (arbitrary) XCMs from this chain.
|
||||||
|
type SendXcmOrigin = EnsureXcmOrigin<Origin, ()>;
|
||||||
type XcmRouter = XcmRouter;
|
type XcmRouter = XcmRouter;
|
||||||
|
// We support local origins dispatching XCM executions in principle...
|
||||||
type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
|
type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
|
||||||
|
// ... but disallow generic XCM execution. As a result only teleports and reserve transfers are allowed.
|
||||||
type XcmExecuteFilter = Nothing;
|
type XcmExecuteFilter = Nothing;
|
||||||
type XcmExecutor = XcmExecutor<XcmConfig>;
|
type XcmExecutor = XcmExecutor<XcmConfig>;
|
||||||
type XcmTeleportFilter = Nothing;
|
type XcmTeleportFilter = Nothing;
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
|||||||
spec_name: create_runtime_str!("westmint"),
|
spec_name: create_runtime_str!("westmint"),
|
||||||
impl_name: create_runtime_str!("westmint"),
|
impl_name: create_runtime_str!("westmint"),
|
||||||
authoring_version: 1,
|
authoring_version: 1,
|
||||||
spec_version: 600,
|
spec_version: 601,
|
||||||
impl_version: 0,
|
impl_version: 0,
|
||||||
apis: RUNTIME_API_VERSIONS,
|
apis: RUNTIME_API_VERSIONS,
|
||||||
transaction_version: 4,
|
transaction_version: 4,
|
||||||
|
|||||||
Reference in New Issue
Block a user