Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit cf4a6ef

Browse files
authored
* Companion for paritytech/polkadot#7098 * Fixes * Add missing benchmarked function * Fix typo * update lockfile for {"polkadot", "substrate"} --------- Co-authored-by: parity-processbot <>
1 parent 56aa147 commit cf4a6ef

File tree

10 files changed

+337
-271
lines changed

10 files changed

+337
-271
lines changed

Cargo.lock

Lines changed: 257 additions & 257 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

parachain-template/runtime/src/xcm_config.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ use super::{
55
use core::{marker::PhantomData, ops::ControlFlow};
66
use frame_support::{
77
log, match_types, parameter_types,
8-
traits::{ConstU32, Everything, Nothing},
8+
traits::{ConstU32, Everything, Nothing, ProcessMessageError},
99
weights::Weight,
1010
};
1111
use frame_system::EnsureRoot;
1212
use pallet_xcm::XcmPassthrough;
1313
use polkadot_parachain::primitives::Sibling;
1414
use polkadot_runtime_common::impls::ToAuthor;
15-
use xcm::{latest::prelude::*, CreateMatcher, MatchXcm};
15+
use xcm::latest::prelude::*;
1616
use xcm_builder::{
1717
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom,
18-
CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds, IsConcrete, NativeAsset, ParentIsPreset,
19-
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
20-
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
21-
UsingComponents, WithComputedOrigin,
18+
CreateMatcher, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds, IsConcrete, MatchXcm,
19+
NativeAsset, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
20+
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
21+
SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WithComputedOrigin,
2222
};
2323
use xcm_executor::{traits::ShouldExecute, XcmExecutor};
2424

@@ -108,7 +108,7 @@ where
108108
message: &mut [Instruction<RuntimeCall>],
109109
max_weight: Weight,
110110
weight_credit: &mut Weight,
111-
) -> Result<(), ()> {
111+
) -> Result<(), ProcessMessageError> {
112112
Deny::should_execute(origin, message, max_weight, weight_credit)?;
113113
Allow::should_execute(origin, message, max_weight, weight_credit)
114114
}
@@ -122,7 +122,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
122122
message: &mut [Instruction<RuntimeCall>],
123123
_max_weight: Weight,
124124
_weight_credit: &mut Weight,
125-
) -> Result<(), ()> {
125+
) -> Result<(), ProcessMessageError> {
126126
message.matcher().match_next_inst_while(
127127
|_| true,
128128
|inst| match inst {
@@ -136,7 +136,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
136136
TransferReserveAsset {
137137
dest: MultiLocation { parents: 1, interior: Here }, ..
138138
} => {
139-
Err(()) // Deny
139+
Err(ProcessMessageError::Unsupported) // Deny
140140
},
141141
// An unexpected reserve transfer has arrived from the Relay Chain. Generally,
142142
// `IsReserve` should not allow this, but we just log it here.

parachains/common/src/xcm_config.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ use crate::impls::AccountIdOf;
22
use core::{marker::PhantomData, ops::ControlFlow};
33
use frame_support::{
44
log,
5-
traits::{fungibles::Inspect, tokens::ConversionToAssetBalance, ContainsPair},
5+
traits::{
6+
fungibles::Inspect, tokens::ConversionToAssetBalance, ContainsPair, ProcessMessageError,
7+
},
68
weights::Weight,
79
};
810
use sp_runtime::traits::Get;
9-
use xcm::{latest::prelude::*, CreateMatcher, MatchXcm};
11+
use xcm::latest::prelude::*;
12+
use xcm_builder::{CreateMatcher, MatchXcm};
1013
use xcm_executor::traits::ShouldExecute;
1114

1215
//TODO: move DenyThenTry to polkadot's xcm module.
@@ -27,7 +30,7 @@ where
2730
message: &mut [Instruction<RuntimeCall>],
2831
max_weight: Weight,
2932
weight_credit: &mut Weight,
30-
) -> Result<(), ()> {
33+
) -> Result<(), ProcessMessageError> {
3134
Deny::should_execute(origin, message, max_weight, weight_credit)?;
3235
Allow::should_execute(origin, message, max_weight, weight_credit)
3336
}
@@ -41,7 +44,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
4144
message: &mut [Instruction<RuntimeCall>],
4245
_max_weight: Weight,
4346
_weight_credit: &mut Weight,
44-
) -> Result<(), ()> {
47+
) -> Result<(), ProcessMessageError> {
4548
message.matcher().match_next_inst_while(
4649
|_| true,
4750
|inst| match inst {
@@ -55,7 +58,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
5558
TransferReserveAsset {
5659
dest: MultiLocation { parents: 1, interior: Here }, ..
5760
} => {
58-
Err(()) // Deny
61+
Err(ProcessMessageError::Unsupported) // Deny
5962
},
6063

6164
// An unexpected reserve transfer has arrived from the Relay Chain. Generally,

parachains/runtimes/assets/statemine/src/weights/pallet_xcm.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,15 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
171171
.saturating_add(T::DbWeight::get().reads(6))
172172
.saturating_add(T::DbWeight::get().writes(4))
173173
}
174+
fn force_suspension() -> Weight {
175+
// Proof Size summary in bytes:
176+
// Measured: `0`
177+
// Estimated: `0`
178+
// Minimum execution time: 3_092_000 picoseconds.
179+
Weight::from_parts(3_217_000, 0)
180+
.saturating_add(Weight::from_parts(0, 0))
181+
.saturating_add(T::DbWeight::get().writes(1))
182+
}
174183
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
175184
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
176185
fn migrate_supported_version() -> Weight {

parachains/runtimes/assets/statemint/src/weights/pallet_xcm.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,15 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
171171
.saturating_add(T::DbWeight::get().reads(6))
172172
.saturating_add(T::DbWeight::get().writes(4))
173173
}
174+
fn force_suspension() -> Weight {
175+
// Proof Size summary in bytes:
176+
// Measured: `0`
177+
// Estimated: `0`
178+
// Minimum execution time: 3_451_000 picoseconds.
179+
Weight::from_parts(3_580_000, 0)
180+
.saturating_add(Weight::from_parts(0, 0))
181+
.saturating_add(T::DbWeight::get().writes(1))
182+
}
174183
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
175184
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
176185
fn migrate_supported_version() -> Weight {

parachains/runtimes/assets/westmint/src/weights/pallet_xcm.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,15 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
169169
.saturating_add(T::DbWeight::get().reads(6))
170170
.saturating_add(T::DbWeight::get().writes(4))
171171
}
172+
fn force_suspension() -> Weight {
173+
// Proof Size summary in bytes:
174+
// Measured: `0`
175+
// Estimated: `0`
176+
// Minimum execution time: 3_144_000 picoseconds.
177+
Weight::from_parts(3_225_000, 0)
178+
.saturating_add(Weight::from_parts(0, 0))
179+
.saturating_add(T::DbWeight::get().writes(1))
180+
}
172181
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
173182
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
174183
fn migrate_supported_version() -> Weight {

parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
170170
.saturating_add(T::DbWeight::get().reads(6))
171171
.saturating_add(T::DbWeight::get().writes(4))
172172
}
173+
fn force_suspension() -> Weight {
174+
// Proof Size summary in bytes:
175+
// Measured: `0`
176+
// Estimated: `0`
177+
// Minimum execution time: 3_073_000 picoseconds.
178+
Weight::from_parts(3_178_000, 0)
179+
.saturating_add(Weight::from_parts(0, 0))
180+
.saturating_add(T::DbWeight::get().writes(1))
181+
}
173182
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
174183
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
175184
fn migrate_supported_version() -> Weight {

parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
170170
.saturating_add(T::DbWeight::get().reads(6))
171171
.saturating_add(T::DbWeight::get().writes(4))
172172
}
173+
fn force_suspension() -> Weight {
174+
// Proof Size summary in bytes:
175+
// Measured: `0`
176+
// Estimated: `0`
177+
// Minimum execution time: 2_994_000 picoseconds.
178+
Weight::from_parts(3_160_000, 0)
179+
.saturating_add(Weight::from_parts(0, 0))
180+
.saturating_add(T::DbWeight::get().writes(1))
181+
}
173182
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
174183
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
175184
fn migrate_supported_version() -> Weight {

parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
170170
.saturating_add(T::DbWeight::get().reads(6))
171171
.saturating_add(T::DbWeight::get().writes(4))
172172
}
173+
fn force_suspension() -> Weight {
174+
// Proof Size summary in bytes:
175+
// Measured: `0`
176+
// Estimated: `0`
177+
// Minimum execution time: 3_218_000 picoseconds.
178+
Weight::from_parts(3_311_000, 0)
179+
.saturating_add(Weight::from_parts(0, 0))
180+
.saturating_add(T::DbWeight::get().writes(1))
181+
}
173182
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
174183
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
175184
fn migrate_supported_version() -> Weight {

parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_xcm.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
170170
.saturating_add(T::DbWeight::get().reads(6))
171171
.saturating_add(T::DbWeight::get().writes(4))
172172
}
173+
fn force_suspension() -> Weight {
174+
// Proof Size summary in bytes:
175+
// Measured: `0`
176+
// Estimated: `0`
177+
// Minimum execution time: 2_994_000 picoseconds.
178+
Weight::from_parts(3_125_000, 0)
179+
.saturating_add(Weight::from_parts(0, 0))
180+
.saturating_add(T::DbWeight::get().writes(1))
181+
}
173182
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
174183
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
175184
fn migrate_supported_version() -> Weight {

0 commit comments

Comments
 (0)