Skip to content

Commit

Permalink
Allow unpaid execution from system parachains
Browse files Browse the repository at this point in the history
  • Loading branch information
seadanda committed Aug 1, 2024
1 parent 09a73f4 commit 020580f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions relay/polkadot/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ use xcm_builder::{
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative,
ChildParachainConvertsVia, DescribeAllTerminal, DescribeFamily, FrameTransactionalProcessor,
FungibleAdapter, HashedDescription, IsConcrete, MintLocation, OriginToPluralityVoice,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
XcmFeeManagerFromComponents, XcmFeeToAccount,
FungibleAdapter, HashedDescription, IsChildSystemParachain, IsConcrete, MintLocation,
OriginToPluralityVoice, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents,
XcmFeeToAccount,
};

parameter_types! {
Expand Down Expand Up @@ -152,13 +153,12 @@ pub type TrustedTeleporters = (
xcm_builder::Case<DotForPeople>,
);

pub struct CollectivesOrFellows;
impl Contains<Location> for CollectivesOrFellows {
pub struct Fellows;
impl Contains<Location> for Fellows {
fn contains(loc: &Location) -> bool {
matches!(
loc.unpack(),
(0, [Parachain(COLLECTIVES_ID)]) |
(0, [Parachain(COLLECTIVES_ID), Plurality { id: BodyId::Technical, .. }])
(0, [Parachain(COLLECTIVES_ID), Plurality { id: BodyId::Technical, .. }])
)
}
}
Expand Down Expand Up @@ -189,8 +189,8 @@ pub type Barrier = TrailingSetTopicAsId<(
AllowTopLevelPaidExecutionFrom<Everything>,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom<OnlyParachains>,
// Collectives and Fellows plurality get free execution.
AllowExplicitUnpaidExecutionFrom<CollectivesOrFellows>,
// Messages from system parachains or the Fellows plurality need not pay for execution.
AllowExplicitUnpaidExecutionFrom<(IsChildSystemParachain<ParaId>, Fellows)>,
),
UniversalLocation,
ConstU32<8>,
Expand Down

0 comments on commit 020580f

Please sign in to comment.