Skip to content

Commit

Permalink
BACKPORT-CONFLICT
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr authored and github-actions[bot] committed Dec 18, 2024
1 parent fb9b95d commit 1483802
Show file tree
Hide file tree
Showing 89 changed files with 2,401 additions and 47 deletions.
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions bridges/bin/runtime-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ runtime-benchmarks = [
"pallet-utility/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"sp-trie",
<<<<<<< HEAD
"xcm-builder/runtime-benchmarks",
=======
"xcm/runtime-benchmarks",
>>>>>>> c10e25aa (dmp: Check that the para exist before delivering a message (#6604))
]
integrity-test = ["static_assertions"]
test-helpers = [
Expand Down
1 change: 1 addition & 0 deletions bridges/modules/xcm-bridge-hub-router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ runtime-benchmarks = [
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
Expand Down
1 change: 1 addition & 0 deletions bridges/modules/xcm-bridge-hub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
Expand Down
1 change: 1 addition & 0 deletions bridges/snowbridge/pallets/inbound-queue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ runtime-benchmarks = [
"snowbridge-router-primitives/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
Expand Down
1 change: 1 addition & 0 deletions bridges/snowbridge/pallets/system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ runtime-benchmarks = [
"snowbridge-core/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
Expand Down
5 changes: 5 additions & 0 deletions bridges/snowbridge/primitives/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,9 @@ 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))
]
1 change: 1 addition & 0 deletions bridges/snowbridge/primitives/router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ runtime-benchmarks = [
"snowbridge-core/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
1 change: 1 addition & 0 deletions bridges/snowbridge/runtime/runtime-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ runtime-benchmarks = [
"snowbridge-core/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
1 change: 1 addition & 0 deletions bridges/snowbridge/runtime/test-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@ runtime-benchmarks = [
"snowbridge-pallet-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
fast-runtime = []
1 change: 1 addition & 0 deletions cumulus/pallets/dmp-queue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm/runtime-benchmarks",
]

try-runtime = [
Expand Down
16 changes: 13 additions & 3 deletions cumulus/pallets/parachain-system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ 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
Expand All @@ -39,6 +40,17 @@ 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 }
Expand Down Expand Up @@ -77,7 +89,6 @@ std = [
"log/std",
"pallet-message-queue/std",
"polkadot-parachain-primitives/std",
"polkadot-runtime-common/std",
"polkadot-runtime-parachains/std",
"scale-info/std",
"sp-core/std",
Expand All @@ -100,17 +111,16 @@ runtime-benchmarks = [
"frame-system/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",
"polkadot-runtime-common/runtime-benchmarks",
"polkadot-runtime-parachains/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm/runtime-benchmarks",
]

try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-message-queue/try-runtime",
"polkadot-runtime-common?/try-runtime",
"polkadot-runtime-parachains/try-runtime",
"sp-runtime/try-runtime",
]
2 changes: 1 addition & 1 deletion cumulus/pallets/parachain-system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,7 @@ impl<T: Config> InspectMessageQueues for Pallet<T> {
}

#[cfg(feature = "runtime-benchmarks")]
impl<T: Config> polkadot_runtime_common::xcm_sender::EnsureForParachain for Pallet<T> {
impl<T: Config> polkadot_runtime_parachains::EnsureForParachain for Pallet<T> {
fn ensure(para_id: ParaId) {
if let ChannelStatus::Closed = Self::get_channel_status(para_id) {
Self::open_outbound_hrmp_channel_for_benchmarks_or_tests(para_id)
Expand Down
1 change: 1 addition & 0 deletions cumulus/pallets/xcmp-queue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
Expand Down
1 change: 1 addition & 0 deletions cumulus/parachains/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@ runtime-benchmarks = [
"polkadot-primitives/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ macro_rules! impl_send_transact_helpers_for_relay_chain {
let destination: $crate::impls::Location = <Self as RelayChain>::child_location_of(recipient);
let xcm = $crate::impls::xcm_transact_unpaid_execution(call, $crate::impls::OriginKind::Superuser);

$crate::impls::dmp::Pallet::<<Self as $crate::impls::Chain>::Runtime>::make_parachain_reachable(recipient);

// Send XCM `Transact`
$crate::impls::assert_ok!(<Self as [<$chain RelayPallet>]>::XcmPallet::send(
root_origin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub use pallet_message_queue;
pub use pallet_xcm;

// Polkadot
pub use polkadot_runtime_parachains::dmp::Pallet as Dmp;
pub use xcm::{
prelude::{
AccountId32, All, Asset, AssetId, BuyExecution, DepositAsset, ExpectTransactStatus,
Expand Down Expand Up @@ -156,6 +157,8 @@ macro_rules! test_relay_is_trusted_teleporter {

// Send XCM message from Relay
<$sender_relay>::execute_with(|| {
$crate::macros::Dmp::<<$sender_relay as $crate::macros::Chain>::Runtime>::make_parachain_reachable(<$receiver_para>::para_id());

assert_ok!(<$sender_relay as [<$sender_relay Pallet>]>::XcmPallet::limited_teleport_assets(
origin.clone(),
bx!(para_destination.clone().into()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use rococo_system_emulated_network::rococo_emulated_chain::rococo_runtime::Dmp;

use super::reserve_transfer::*;
use crate::{
imports::*,
Expand Down Expand Up @@ -768,6 +770,8 @@ fn transfer_native_asset_from_relay_to_para_through_asset_hub() {
xcm: xcm_on_final_dest,
}]);

Dmp::make_parachain_reachable(AssetHubRococo::para_id());

// First leg is a teleport, from there a local-reserve-transfer to final dest
<Rococo as RococoPallet>::XcmPallet::transfer_assets_using_type_and_then(
t.signed_origin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
// 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 = <Rococo as Chain>::RuntimeEvent;
Expand Down Expand Up @@ -437,6 +442,11 @@ pub fn para_to_para_through_hop_receiver_assertions<Hop: Clone>(t: Test<PenpalA,
}

fn relay_to_para_reserve_transfer_assets(t: RelayToParaTest) -> DispatchResult {
let Junction::Parachain(para_id) = *t.args.dest.chain_location().last().unwrap() else {
unimplemented!("Destination is not a parachain?")
};

Dmp::make_parachain_reachable(para_id);
<Rococo as RococoPallet>::XcmPallet::limited_reserve_transfer_assets(
t.signed_origin,
bx!(t.args.dest.into()),
Expand Down Expand Up @@ -483,6 +493,13 @@ fn para_to_system_para_reserve_transfer_assets(t: ParaToSystemParaTest) -> Dispa
fn para_to_para_through_relay_limited_reserve_transfer_assets(
t: ParaToParaThroughRelayTest,
) -> DispatchResult {
let Junction::Parachain(para_id) = *t.args.dest.chain_location().last().unwrap() else {
unimplemented!("Destination is not a parachain?")
};

Rococo::ext_wrapper(|| {
Dmp::make_parachain_reachable(para_id);
});
<PenpalA as PenpalAPallet>::PolkadotXcm::limited_reserve_transfer_assets(
t.signed_origin,
bx!(t.args.dest.into()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use frame_support::{
use parachains_common::AccountId;
use polkadot_runtime_common::impls::VersionedLocatableAsset;
use rococo_runtime_constants::currency::GRAND;
use rococo_system_emulated_network::rococo_emulated_chain::rococo_runtime::Dmp;
use xcm_executor::traits::ConvertLocation;

// Fund Treasury account on Asset Hub from Treasury account on Relay Chain with ROCs.
Expand Down Expand Up @@ -61,6 +62,7 @@ fn spend_roc_on_asset_hub() {
treasury_balance * 2,
));

Dmp::make_parachain_reachable(1000);
let native_asset = Location::here();
let asset_hub_location: Location = [Parachain(1000)].into();
let treasury_location: Location = (Parent, PalletInstance(18)).into();
Expand Down Expand Up @@ -200,6 +202,8 @@ fn create_and_claim_treasury_spend_in_usdt() {
// create a conversion rate from `asset_kind` to the native currency.
assert_ok!(AssetRate::create(root.clone(), Box::new(asset_kind.clone()), 2.into()));

Dmp::make_parachain_reachable(1000);

// create and approve a treasury spend.
assert_ok!(Treasury::spend(
root,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use westend_system_emulated_network::westend_emulated_chain::westend_runtime::Dmp;

use super::reserve_transfer::*;
use crate::{
imports::*,
Expand Down Expand Up @@ -769,6 +771,8 @@ fn transfer_native_asset_from_relay_to_para_through_asset_hub() {
xcm: xcm_on_final_dest,
}]);

Dmp::make_parachain_reachable(AssetHubWestend::para_id());

// First leg is a teleport, from there a local-reserve-transfer to final dest
<Westend as WestendPallet>::XcmPallet::transfer_assets_using_type_and_then(
t.signed_origin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
// 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 = <Westend as Chain>::RuntimeEvent;
Expand Down Expand Up @@ -437,6 +443,11 @@ pub fn para_to_para_through_hop_receiver_assertions<Hop: Clone>(t: Test<PenpalA,
}

fn relay_to_para_reserve_transfer_assets(t: RelayToParaTest) -> DispatchResult {
let Junction::Parachain(para_id) = *t.args.dest.chain_location().last().unwrap() else {
unimplemented!("Destination is not a parachain?")
};

Dmp::make_parachain_reachable(para_id);
<Westend as WestendPallet>::XcmPallet::limited_reserve_transfer_assets(
t.signed_origin,
bx!(t.args.dest.into()),
Expand Down Expand Up @@ -483,6 +494,13 @@ fn para_to_system_para_reserve_transfer_assets(t: ParaToSystemParaTest) -> Dispa
fn para_to_para_through_relay_limited_reserve_transfer_assets(
t: ParaToParaThroughRelayTest,
) -> DispatchResult {
let Junction::Parachain(para_id) = *t.args.dest.chain_location().last().unwrap() else {
unimplemented!("Destination is not a parachain?")
};

Westend::ext_wrapper(|| {
Dmp::make_parachain_reachable(para_id);
});
<PenpalA as PenpalAPallet>::PolkadotXcm::limited_reserve_transfer_assets(
t.signed_origin,
bx!(t.args.dest.into()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::imports::*;
use emulated_integration_tests_common::accounts::{ALICE, BOB};
use frame_support::traits::fungibles::{Create, Inspect, Mutate};
use polkadot_runtime_common::impls::VersionedLocatableAsset;
use westend_system_emulated_network::westend_emulated_chain::westend_runtime::Dmp;
use xcm_executor::traits::ConvertLocation;

#[test]
Expand Down Expand Up @@ -63,6 +64,8 @@ fn create_and_claim_treasury_spend() {
// create a conversion rate from `asset_kind` to the native currency.
assert_ok!(AssetRate::create(root.clone(), Box::new(asset_kind.clone()), 2.into()));

Dmp::make_parachain_reachable(1000);

// create and approve a treasury spend.
assert_ok!(Treasury::spend(
root,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use rococo_system_emulated_network::rococo_emulated_chain::rococo_runtime::Dmp;

use crate::tests::*;

#[test]
Expand All @@ -38,6 +40,8 @@ fn send_xcm_from_rococo_relay_to_westend_asset_hub_should_fail_on_not_applicable
// Rococo Global Consensus
// Send XCM message from Relay Chain to Bridge Hub source Parachain
Rococo::execute_with(|| {
Dmp::make_parachain_reachable(BridgeHubRococo::para_id());

assert_ok!(<Rococo as RococoPallet>::XcmPallet::send(
sudo_origin,
bx!(destination),
Expand Down
Loading

0 comments on commit 1483802

Please sign in to comment.