Skip to content

Commit

Permalink
Derived remote account scheme update
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinonard committed Aug 28, 2023
1 parent e993fa4 commit 0097dd9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
17 changes: 10 additions & 7 deletions runtime/astar/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ use sp_runtime::traits::Convert;
// Polkadot imports
use xcm::latest::prelude::*;
use xcm_builder::{
Account32Hash, AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter,
EnsureXcmOrigin, FixedWeightBounds, FungiblesAdapter, IsConcrete, NoChecking,
ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WithComputedOrigin,
};
use xcm_executor::{
traits::{Convert as XcmConvert, JustTry, WithOriginFilter},
Expand All @@ -50,8 +50,9 @@ use orml_xcm_support::DisabledParachainFee;

// Astar imports
use astar_primitives::xcm::{
AbsoluteAndRelativeReserveProvider, AccountIdToMultiLocation, FixedRateOfForeignAsset,
ReserveAssetFilter, XcmFungibleFeeHandler,
AbsoluteAndRelativeReserveProvider, AccountIdToMultiLocation, DescribeAllTerminal,
DescribeFamily, FixedRateOfForeignAsset, HashedDescription, ReserveAssetFilter,
XcmFungibleFeeHandler,
};

parameter_types! {
Expand All @@ -73,8 +74,9 @@ pub type LocationToAccountId = (
SiblingParachainConvertsVia<polkadot_parachain::primitives::Sibling, AccountId>,
// Straight up local `AccountId32` origins just alias directly to `AccountId`.
AccountId32Aliases<RelayNetwork, AccountId>,
// Derives a private `Account32` by hashing `("multiloc", received multilocation)`
Account32Hash<RelayNetwork, AccountId>,
// Generates private `AccountId`s from `MultiLocation`s, in a stable & safe way.
// Replaces the old `Account32Hash` approach.
HashedDescription<AccountId, DescribeFamily<DescribeAllTerminal>>,
);

/// Means for transacting the native currency on this chain.
Expand Down Expand Up @@ -222,7 +224,8 @@ impl Contains<RuntimeCall> for SafeCallFilter {

pub type XcmBarrier = (
TakeWeightCredit,
AllowTopLevelPaidExecutionFrom<Everything>,
// This will first calculate the derived origin, before checking it against the barrier implementation
WithComputedOrigin<AllowTopLevelPaidExecutionFrom<Everything>, UniversalLocation, ConstU32<8>>,
// Parent and its plurality get free execution
AllowUnpaidExecutionFrom<ParentOrParentsPlurality>,
// Expected responses are OK.
Expand Down
1 change: 0 additions & 1 deletion runtime/shibuya/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ match_types! {

pub type XcmBarrier = (
TakeWeightCredit,
AllowTopLevelPaidExecutionFrom<Everything>,
// This will first calculate the derived origin, before checking it against the barrier implementation
WithComputedOrigin<AllowTopLevelPaidExecutionFrom<Everything>, UniversalLocation, ConstU32<8>>,
// Parent and its plurality get free execution
Expand Down
1 change: 0 additions & 1 deletion runtime/shiden/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ impl Contains<RuntimeCall> for SafeCallFilter {

pub type XcmBarrier = (
TakeWeightCredit,
AllowTopLevelPaidExecutionFrom<Everything>,
// This will first calculate the derived origin, before checking it against the barrier implementation
WithComputedOrigin<AllowTopLevelPaidExecutionFrom<Everything>, UniversalLocation, ConstU32<8>>,
// Parent and its plurality get free execution
Expand Down

0 comments on commit 0097dd9

Please sign in to comment.