Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derived remote account scheme update #1013

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading