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

Improve XCM Config #131

Merged
merged 6 commits into from
Aug 30, 2022
Merged
Changes from 2 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
12 changes: 6 additions & 6 deletions polkadot-parachains/integritee-runtime/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use core::marker::PhantomData;
use frame_support::{
pallet_prelude::Get,
parameter_types,
traits::Everything,
traits::{Everything, Nothing},
weights::{IdentityFee, Weight},
RuntimeDebug,
};
Expand Down Expand Up @@ -264,13 +264,13 @@ pub type LocalOriginToLocation = SignedToAccountId32<Origin, AccountId, RelayNet
// See acala and moonbeam example : https://github.com/integritee-network/parachain/issues/103
impl pallet_xcm::Config for Runtime {
type Event = Event;
type SendXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
type SendXcmOrigin = EnsureXcmOrigin<Origin, ()>; //We want to disallow users sending (arbitrary) XCMs from this chain
echevrier marked this conversation as resolved.
Show resolved Hide resolved
type XcmRouter = XcmRouter;
type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
type XcmExecuteFilter = Everything;
type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>; // Anyone can execute XCM messages locally...
echevrier marked this conversation as resolved.
Show resolved Hide resolved
type XcmExecuteFilter = Nothing; // but disallow generic XCM execution. As a result only teleports and reserve transfers can be allowed.
echevrier marked this conversation as resolved.
Show resolved Hide resolved
type XcmExecutor = XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Everything;
type XcmReserveTransferFilter = Everything;
type XcmTeleportFilter = Nothing; // Do not allow teleports
type XcmReserveTransferFilter = Everything; // Transfer are allowed
type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
type LocationInverter = LocationInverter<Ancestry>;
type Origin = Origin;
Expand Down