diff --git a/Cargo.lock b/Cargo.lock index b53584bb532e..bd3158c233eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4058,64 +4058,11 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", -<<<<<<< HEAD "sp-core", "sp-io", "sp-runtime", "sp-tracing", "staging-xcm", -======= - "sp-io 38.0.0", - "sp-runtime 39.0.2", - "staging-xcm 14.2.0", -] - -[[package]] -name = "cumulus-pallet-parachain-system" -version = "0.7.0" -dependencies = [ - "assert_matches", - "bytes", - "cumulus-pallet-parachain-system-proc-macro 0.6.0", - "cumulus-primitives-core 0.7.0", - "cumulus-primitives-parachain-inherent 0.7.0", - "cumulus-primitives-proof-size-hostfunction 0.2.0", - "cumulus-test-client", - "cumulus-test-relay-sproof-builder 0.7.0", - "cumulus-test-runtime", - "environmental", - "frame-benchmarking 28.0.0", - "frame-support 28.0.0", - "frame-system 28.0.0", - "futures", - "hex-literal", - "impl-trait-for-tuples", - "log", - "pallet-message-queue 31.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 6.0.0", - "polkadot-runtime-parachains 7.0.0", - "rand", - "sc-client-api", - "scale-info", - "sp-consensus-slots 0.32.0", - "sp-core 28.0.0", - "sp-crypto-hashing 0.1.0", - "sp-externalities 0.25.0", - "sp-inherents 26.0.0", - "sp-io 30.0.0", - "sp-keyring 31.0.0", - "sp-runtime 31.0.1", - "sp-state-machine 0.35.0", - "sp-std 14.0.0", - "sp-tracing 16.0.0", - "sp-trie 29.0.0", - "sp-version 29.0.0", - "staging-xcm 7.0.0", - "staging-xcm-builder 7.0.0", - "trie-db", - "trie-standardmap", ->>>>>>> c10e25aa (dmp: Check that the para exist before delivering a message (#6604)) ] [[package]] @@ -24144,21 +24091,14 @@ dependencies = [ name = "xcm-executor-integration-tests" version = "1.0.0" dependencies = [ -<<<<<<< HEAD "frame-support", + "frame-system", "futures", + "pallet-sudo", "pallet-transaction-payment", "pallet-xcm", -======= - "frame-support 28.0.0", - "frame-system 28.0.0", - "futures", - "pallet-sudo 28.0.0", - "pallet-transaction-payment 28.0.0", - "pallet-xcm 7.0.0", ->>>>>>> c10e25aa (dmp: Check that the para exist before delivering a message (#6604)) "parity-scale-codec", - "polkadot-runtime-parachains 7.0.0", + "polkadot-runtime-parachains", "polkadot-test-client", "polkadot-test-runtime", "polkadot-test-service", diff --git a/Cargo.toml b/Cargo.toml index 1e0d2b5f7183..3e686a14f49d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1441,3 +1441,4 @@ wasmi = { opt-level = 3 } x25519-dalek = { opt-level = 3 } yamux = { opt-level = 3 } zeroize = { opt-level = 3 } +tikv-jemalloc-sys = { opt-level = 3 } diff --git a/bridges/snowbridge/primitives/core/Cargo.toml b/bridges/snowbridge/primitives/core/Cargo.toml index 0f931914adb4..bf501a2d4775 100644 --- a/bridges/snowbridge/primitives/core/Cargo.toml +++ b/bridges/snowbridge/primitives/core/Cargo.toml @@ -60,9 +60,6 @@ runtime-benchmarks = [ "polkadot-parachain-primitives/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", -<<<<<<< HEAD -======= "xcm-executor/runtime-benchmarks", "xcm/runtime-benchmarks", ->>>>>>> c10e25aa (dmp: Check that the para exist before delivering a message (#6604)) ] diff --git a/cumulus/pallets/parachain-system/Cargo.toml b/cumulus/pallets/parachain-system/Cargo.toml index 27a96c0eb41e..598dbc412eee 100644 --- a/cumulus/pallets/parachain-system/Cargo.toml +++ b/cumulus/pallets/parachain-system/Cargo.toml @@ -31,26 +31,16 @@ sp-std.workspace = true sp-trie.workspace = true sp-version.workspace = true polkadot-parachain-primitives = { features = ["wasm-api"], workspace = true } -<<<<<<< HEAD polkadot-runtime-parachains.workspace = true polkadot-runtime-common = { optional = true, workspace = true } xcm.workspace = true xcm-builder.workspace = true -cumulus-pallet-parachain-system-proc-macro.workspace = true -cumulus-primitives-core.workspace = true -cumulus-primitives-parachain-inherent.workspace = true -cumulus-primitives-proof-size-hostfunction.workspace = true -======= -polkadot-runtime-parachains = { workspace = true } -xcm = { workspace = true } -xcm-builder = { workspace = true } # Cumulus cumulus-pallet-parachain-system-proc-macro = { workspace = true } cumulus-primitives-core = { workspace = true } cumulus-primitives-parachain-inherent = { workspace = true } cumulus-primitives-proof-size-hostfunction = { workspace = true } ->>>>>>> c10e25aa (dmp: Check that the para exist before delivering a message (#6604)) [dev-dependencies] assert_matches = { workspace = true } diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/reserve_transfer.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/reserve_transfer.rs index c7d0ebdf565b..6039c9baa5c9 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/reserve_transfer.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/reserve_transfer.rs @@ -14,11 +14,7 @@ // limitations under the License. use crate::imports::*; -<<<<<<< HEAD -======= use rococo_system_emulated_network::rococo_emulated_chain::rococo_runtime::Dmp; -use sp_core::{crypto::get_public_from_string_or_panic, sr25519}; ->>>>>>> c10e25aa (dmp: Check that the para exist before delivering a message (#6604)) fn relay_to_para_sender_assertions(t: RelayToParaTest) { type RuntimeEvent = ::RuntimeEvent; diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/reserve_transfer.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/reserve_transfer.rs index 3af2675abdbc..0e4f68e61055 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/reserve_transfer.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/reserve_transfer.rs @@ -13,13 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -<<<<<<< HEAD use crate::imports::*; -======= -use crate::{create_pool_with_wnd_on, foreign_balance_on, imports::*}; -use sp_core::{crypto::get_public_from_string_or_panic, sr25519}; use westend_system_emulated_network::westend_emulated_chain::westend_runtime::Dmp; ->>>>>>> c10e25aa (dmp: Check that the para exist before delivering a message (#6604)) fn relay_to_para_sender_assertions(t: RelayToParaTest) { type RuntimeEvent = ::RuntimeEvent; diff --git a/polkadot/xcm/Cargo.toml b/polkadot/xcm/Cargo.toml index 5914182d2d64..781b9f684850 100644 --- a/polkadot/xcm/Cargo.toml +++ b/polkadot/xcm/Cargo.toml @@ -48,7 +48,4 @@ json-schema = [ "dep:schemars", "sp-weights/json-schema", ] -runtime-benchmarks = [ - "frame-support/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", -] +runtime-benchmarks = ["sp-runtime/runtime-benchmarks"] diff --git a/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index 4486ae8cee58..4faf3ed935d7 100644 --- a/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -321,45 +321,6 @@ benchmarks_instance_pallet! { } } -<<<<<<< HEAD -======= - initiate_transfer { - let (sender_account, sender_location) = account_and_location::(1); - let asset = T::get_asset(); - let mut holding = T::worst_case_holding(1); - let dest_location = T::valid_destination()?; - - // Ensure that origin can send to destination (e.g. setup delivery fees, ensure router setup, ...) - let (_, _) = T::DeliveryHelper::ensure_successful_delivery( - &sender_location, - &dest_location, - FeeReason::ChargeFees, - ); - - let sender_account_balance_before = T::TransactAsset::balance(&sender_account); - - // Add our asset to the holding. - holding.push(asset.clone()); - - let mut executor = new_executor::(sender_location); - executor.set_holding(holding.into()); - let instruction = Instruction::>::InitiateTransfer { - destination: dest_location, - // ReserveDeposit is the most expensive filter. - remote_fees: Some(AssetTransferFilter::ReserveDeposit(asset.clone().into())), - // It's more expensive if we reanchor the origin. - preserve_origin: true, - assets: vec![AssetTransferFilter::ReserveDeposit(asset.into())], - remote_xcm: Xcm::new(), - }; - let xcm = Xcm(vec![instruction]); - }: { - executor.bench_process(xcm)?; - } verify { - assert!(T::TransactAsset::balance(&sender_account) <= sender_account_balance_before); - } - ->>>>>>> c10e25aa (dmp: Check that the para exist before delivering a message (#6604)) impl_benchmark_test_suite!( Pallet, crate::fungible::mock::new_test_ext(), diff --git a/polkadot/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs b/polkadot/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs index 0ae8c22f2c7e..c382f59733ad 100644 --- a/polkadot/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs +++ b/polkadot/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs @@ -293,24 +293,11 @@ benchmarks! { let mut executor = new_executor::(origin.clone()); let instruction = Instruction::SubscribeVersion { query_id, max_response_weight }; let xcm = Xcm(vec![instruction]); -<<<<<<< HEAD + T::DeliveryHelper::ensure_successful_delivery(&origin, &origin, FeeReason::QueryPallet); } : { executor.bench_process(xcm)?; } verify { assert!(::SubscriptionService::is_subscribed(&origin)); -======= - - T::DeliveryHelper::ensure_successful_delivery(&origin, &origin, FeeReason::QueryPallet); - - #[block] - { - executor.bench_process(xcm)?; - } - assert!(::SubscriptionService::is_subscribed( - &origin - )); - Ok(()) ->>>>>>> c10e25aa (dmp: Check that the para exist before delivering a message (#6604)) } unsubscribe_version { diff --git a/polkadot/xcm/src/v4/traits.rs b/polkadot/xcm/src/v4/traits.rs index c4eec522ed03..448d869c19a9 100644 --- a/polkadot/xcm/src/v4/traits.rs +++ b/polkadot/xcm/src/v4/traits.rs @@ -246,6 +246,10 @@ pub trait SendXcm { /// Actually carry out the delivery operation for a previously validated message sending. fn deliver(ticket: Self::Ticket) -> result::Result; + + /// Ensure `[Self::delivery]` is successful for the given `location` when called in benchmarks. + #[cfg(feature = "runtime-benchmarks")] + fn ensure_successful_delivery(_location: Option) {} } #[impl_trait_for_tuples::impl_for_tuples(30)] @@ -286,6 +290,13 @@ impl SendXcm for Tuple { )* ); Err(SendError::Unroutable) } + + #[cfg(feature = "runtime-benchmarks")] + fn ensure_successful_delivery(location: Option) { + for_tuples!( #( + return Tuple::ensure_successful_delivery(location.clone()); + )* ); + } } /// Convenience function for using a `SendXcm` implementation. Just interprets the `dest` and wraps diff --git a/polkadot/xcm/xcm-executor/integration-tests/Cargo.toml b/polkadot/xcm/xcm-executor/integration-tests/Cargo.toml index d6a20993aace..a27b62be533b 100644 --- a/polkadot/xcm/xcm-executor/integration-tests/Cargo.toml +++ b/polkadot/xcm/xcm-executor/integration-tests/Cargo.toml @@ -12,16 +12,18 @@ workspace = true [dependencies] codec = { workspace = true, default-features = true } -<<<<<<< HEAD frame-support.workspace = true +frame-system.workspace = true futures = { workspace = true } pallet-transaction-payment.workspace = true pallet-transaction-payment.default-features = true +pallet-sudo.workspace = true pallet-xcm.workspace = true pallet-xcm.default-features = true polkadot-test-client.workspace = true polkadot-test-runtime.workspace = true polkadot-test-service.workspace = true +polkadot-runtime-parachains.workspace = true sp-consensus.workspace = true sp-consensus.default-features = true sp-keyring.workspace = true @@ -36,27 +38,7 @@ sp-tracing.workspace = true sp-tracing.default-features = true sp-core.workspace = true sp-core.default-features = true -======= -frame-support = { workspace = true } -frame-system = { workspace = true, default-features = true } -futures = { workspace = true } -pallet-transaction-payment = { workspace = true, default-features = true } -pallet-sudo = { workspace = true, default-features = true } -pallet-xcm = { workspace = true, default-features = true } -polkadot-runtime-parachains = { workspace = true, default-features = true } -polkadot-test-client = { workspace = true } -polkadot-test-runtime = { workspace = true } -polkadot-test-service = { workspace = true } -sp-consensus = { workspace = true, default-features = true } -sp-keyring = { workspace = true, default-features = true } -sp-runtime = { workspace = true } -sp-state-machine = { workspace = true, default-features = true } -xcm = { workspace = true } -xcm-executor = { workspace = true, default-features = true } -sp-tracing = { workspace = true, default-features = true } -sp-core = { workspace = true, default-features = true } ->>>>>>> c10e25aa (dmp: Check that the para exist before delivering a message (#6604)) [features] default = ["std"] -std = ["frame-support/std", "frame-system/std", "pallet-sudo/std", "polkadot-runtime-parachains/std", "sp-runtime/std", "xcm/std"] +std = ["sp-runtime/std", "xcm/std"]