git.delta.rocks / unique-network / refs/commits / 6c3625540f0f

difftreelog

fix remove AllowUnpaidExecutionFrom from barrier

Daniel Shiposha2022-09-07parent: #13887cf.patch.diff
in: master

3 files changed

modifiedruntime/opal/src/xcm_barrier.rsdiffbeforeafterboth
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17use frame_support::{17use frame_support::{weights::Weight, traits::Everything};
18 {match_types, weights::Weight},
19 traits::Everything,
20};
21use xcm::{18use xcm::{latest::Xcm, v1::MultiLocation};
22 latest::Xcm,
23 v1::{BodyId, Junction::*, Junctions::*, MultiLocation},
24};
25use xcm_builder::{AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, TakeWeightCredit};19use xcm_builder::{AllowTopLevelPaidExecutionFrom, TakeWeightCredit};
26use xcm_executor::traits::ShouldExecute;20use xcm_executor::traits::ShouldExecute;
2721
28use crate::runtime_common::config::xcm::{DenyThenTry, DenyTransact};22use crate::runtime_common::config::xcm::{DenyThenTry, DenyTransact};
29
30match_types! {
31 pub type ParentOrParentsUnitPlurality: impl Contains<MultiLocation> = {
32 MultiLocation { parents: 1, interior: Here } |
33 MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) }
34 };
35}
3623
37/// Execution barrier that just takes `max_weight` from `weight_credit`.24/// Execution barrier that just takes `max_weight` from `weight_credit`.
38///25///
56 (43 (
57 TakeWeightCredit,44 TakeWeightCredit,
58 AllowTopLevelPaidExecutionFrom<Everything>,45 AllowTopLevelPaidExecutionFrom<Everything>,
59 AllowUnpaidExecutionFrom<ParentOrParentsUnitPlurality>,
60 // ^^^ Parent & its unit plurality gets free execution
61 AllowAllDebug,46 AllowAllDebug,
62 ),47 ),
63>;48>;
modifiedruntime/quartz/src/xcm_barrier.rsdiffbeforeafterboth
19 traits::{Get, Everything},19 traits::{Get, Everything},
20};20};
21use sp_std::{vec, vec::Vec};21use sp_std::{vec, vec::Vec};
22use xcm::v1::{BodyId, Junction::*, Junctions::*, MultiLocation};22use xcm::v1::{Junction::*, Junctions::*, MultiLocation};
23use xcm_builder::{23use xcm_builder::{
24 AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowUnpaidExecutionFrom, TakeWeightCredit,24 AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,
25 AllowTopLevelPaidExecutionFrom,25 AllowTopLevelPaidExecutionFrom,
26};26};
2727
31};31};
3232
33match_types! {33match_types! {
34 pub type ParentOrParentsExecutivePlurality: impl Contains<MultiLocation> = {
35 MultiLocation { parents: 1, interior: Here } |
36 MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) }
37 };
38 pub type ParentOrSiblings: impl Contains<MultiLocation> = {34 pub type ParentOrSiblings: impl Contains<MultiLocation> = {
39 MultiLocation { parents: 1, interior: Here } |35 MultiLocation { parents: 1, interior: Here } |
40 MultiLocation { parents: 1, interior: X1(_) }36 MultiLocation { parents: 1, interior: X1(_) }
79 (75 (
80 TakeWeightCredit,76 TakeWeightCredit,
81 AllowTopLevelPaidExecutionFrom<Everything>,77 AllowTopLevelPaidExecutionFrom<Everything>,
82 // Parent and its exec plurality get free execution
83 AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
84 // Expected responses are OK.78 // Expected responses are OK.
85 AllowKnownQueryResponses<PolkadotXcm>,79 AllowKnownQueryResponses<PolkadotXcm>,
86 // Subscriptions for version tracking are OK.80 // Subscriptions for version tracking are OK.
modifiedruntime/unique/src/xcm_barrier.rsdiffbeforeafterboth
19 traits::{Get, Everything},19 traits::{Get, Everything},
20};20};
21use sp_std::{vec, vec::Vec};21use sp_std::{vec, vec::Vec};
22use xcm::v1::{BodyId, Junction::*, Junctions::*, MultiLocation};22use xcm::v1::{Junction::*, Junctions::*, MultiLocation};
23use xcm_builder::{23use xcm_builder::{
24 AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowUnpaidExecutionFrom, TakeWeightCredit,24 AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,
25 AllowTopLevelPaidExecutionFrom,25 AllowTopLevelPaidExecutionFrom,
26};26};
2727
31};31};
3232
33match_types! {33match_types! {
34 pub type ParentOrParentsExecutivePlurality: impl Contains<MultiLocation> = {
35 MultiLocation { parents: 1, interior: Here } |
36 MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) }
37 };
38 pub type ParentOrSiblings: impl Contains<MultiLocation> = {34 pub type ParentOrSiblings: impl Contains<MultiLocation> = {
39 MultiLocation { parents: 1, interior: Here } |35 MultiLocation { parents: 1, interior: Here } |
40 MultiLocation { parents: 1, interior: X1(_) }36 MultiLocation { parents: 1, interior: X1(_) }
79 (75 (
80 TakeWeightCredit,76 TakeWeightCredit,
81 AllowTopLevelPaidExecutionFrom<Everything>,77 AllowTopLevelPaidExecutionFrom<Everything>,
82 // Parent and its exec plurality get free execution
83 AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
84 // Expected responses are OK.78 // Expected responses are OK.
85 AllowKnownQueryResponses<PolkadotXcm>,79 AllowKnownQueryResponses<PolkadotXcm>,
86 // Subscriptions for version tracking are OK.80 // Subscriptions for version tracking are OK.