@@ -75,7 +75,8 @@ use xcm_builder::{
75
75
ConvertedConcreteAssetId , CurrencyAdapter , EnsureXcmOrigin , FixedWeightBounds ,
76
76
FungiblesAdapter , IsConcrete , LocationInverter , NativeAsset , ParentAsSuperuser ,
77
77
ParentIsDefault , RelayChainAsNative , SiblingParachainAsNative , SiblingParachainConvertsVia ,
78
- SignedAccountId32AsNative , SovereignSignedViaLocation , TakeWeightCredit , UsingComponents ,
78
+ SignedAccountId32AsNative , SignedToAccountId32 , SovereignSignedViaLocation , TakeWeightCredit ,
79
+ UsingComponents ,
79
80
} ;
80
81
use xcm_executor:: { traits:: JustTry , Config , XcmExecutor } ;
81
82
@@ -90,7 +91,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
90
91
spec_name : create_runtime_str ! ( "statemine" ) ,
91
92
impl_name : create_runtime_str ! ( "statemine" ) ,
92
93
authoring_version : 1 ,
93
- spec_version : 600 ,
94
+ spec_version : 601 ,
94
95
impl_version : 0 ,
95
96
apis : RUNTIME_API_VERSIONS ,
96
97
transaction_version : 4 ,
@@ -560,8 +561,9 @@ parameter_types! {
560
561
pub const MaxDownwardMessageWeight : Weight = MAXIMUM_BLOCK_WEIGHT / 10 ;
561
562
}
562
563
563
- /// No local origins on this chain are allowed to dispatch XCM sends/executions.
564
- pub type LocalOriginToLocation = ( ) ;
564
+ /// Converts a local signed origin into an XCM multilocation.
565
+ /// Forms the basis for local origins sending/executing XCMs.
566
+ pub type LocalOriginToLocation = SignedToAccountId32 < Origin , AccountId , RelayNetwork > ;
565
567
566
568
/// The means for routing XCM messages which are not for local execution into the right message
567
569
/// queues.
@@ -574,9 +576,12 @@ pub type XcmRouter = (
574
576
575
577
impl pallet_xcm:: Config for Runtime {
576
578
type Event = Event ;
577
- type SendXcmOrigin = EnsureXcmOrigin < Origin , LocalOriginToLocation > ;
579
+ // We want to disallow users sending (arbitrary) XCMs from this chain.
580
+ type SendXcmOrigin = EnsureXcmOrigin < Origin , ( ) > ;
578
581
type XcmRouter = XcmRouter ;
582
+ // We support local origins dispatching XCM executions in principle...
579
583
type ExecuteXcmOrigin = EnsureXcmOrigin < Origin , LocalOriginToLocation > ;
584
+ // ... but disallow generic XCM execution. As a result only teleports and reserve transfers are allowed.
580
585
type XcmExecuteFilter = Nothing ;
581
586
type XcmExecutor = XcmExecutor < XcmConfig > ;
582
587
type XcmTeleportFilter = Everything ;
0 commit comments