Skip to content

Commit 83dd8e3

Browse files
EleisonCbkonturgithub-actions[bot]karolk91
authored
Update XCM benchmarks delivery to sibling parachains not parent/relay chain (#7321)
### Title: Update XCM benchmarks for sibling parachain delivery (closes #7211) ### Description: This PR updates XCM benchmarking configurations for testnet system parachains to reflect delivery to sibling parachains instead of the Parent relay chain. Integration: Replaced ToParentDeliveryHelper with ToParachainDeliveryHelper. Updated benchmark destinations --------- Co-authored-by: Branislav Kontur <[email protected]> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Karol Kokoszka <[email protected]> Co-authored-by: Karol Kokoszka <[email protected]>
1 parent 5633cf5 commit 83dd8e3

File tree

46 files changed

+3480
-2921
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3480
-2921
lines changed

cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/asset_transfers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ fn do_send_pens_and_wnds_from_penpal_westend_via_ahw_to_asset_hub_rococo(
12431243
ByGenesis(ROCOCO_GENESIS_HASH),
12441244
AssetHubRococo::para_id(),
12451245
);
1246-
let ahw_fee_amount = 100_000_000_000;
1246+
let ahw_fee_amount = 120_000_000_000;
12471247
// send message over bridge
12481248
assert_ok!(PenpalB::execute_with(|| {
12491249
let destination = asset_hub_rococo_location();

cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,43 +1706,46 @@ impl_runtime_apis! {
17061706
Config as XcmBridgeHubRouterConfig,
17071707
};
17081708

1709+
use testnet_parachains_constants::rococo::locations::{PeopleParaId, PeopleLocation};
17091710
parameter_types! {
17101711
pub ExistentialDepositAsset: Option<Asset> = Some((
17111712
TokenLocation::get(),
17121713
ExistentialDeposit::get()
17131714
).into());
1715+
17141716
pub const RandomParaId: ParaId = ParaId::new(43211234);
17151717
}
17161718

17171719
use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
17181720
impl pallet_xcm::benchmarking::Config for Runtime {
17191721
type DeliveryHelper = (
1720-
cumulus_primitives_utility::ToParentDeliveryHelper<
1722+
polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper<
17211723
xcm_config::XcmConfig,
17221724
ExistentialDepositAsset,
1723-
xcm_config::PriceForParentDelivery,
1725+
PriceForSiblingParachainDelivery,
1726+
RandomParaId,
1727+
ParachainSystem
17241728
>,
1725-
polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper<
1729+
polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper<
17261730
xcm_config::XcmConfig,
17271731
ExistentialDepositAsset,
17281732
PriceForSiblingParachainDelivery,
1729-
RandomParaId,
1730-
ParachainSystem,
1731-
>
1732-
);
1733+
PeopleParaId,
1734+
ParachainSystem
1735+
>);
17331736

17341737
fn reachable_dest() -> Option<Location> {
1735-
Some(Parent.into())
1738+
Some(PeopleLocation::get())
17361739
}
17371740

17381741
fn teleportable_asset_and_dest() -> Option<(Asset, Location)> {
17391742
// Relay/native token can be teleported between AH and Relay.
17401743
Some((
17411744
Asset {
17421745
fun: Fungible(ExistentialDeposit::get()),
1743-
id: AssetId(Parent.into())
1746+
id: AssetId(TokenLocation::get())
17441747
},
1745-
Parent.into(),
1748+
PeopleLocation::get(),
17461749
))
17471750
}
17481751

@@ -1759,13 +1762,10 @@ impl_runtime_apis! {
17591762

17601763
fn set_up_complex_asset_transfer(
17611764
) -> Option<(XcmAssets, u32, Location, alloc::boxed::Box<dyn FnOnce()>)> {
1762-
// Transfer to Relay some local AH asset (local-reserve-transfer) while paying
1763-
// fees using teleported native token.
1764-
// (We don't care that Relay doesn't accept incoming unknown AH local asset)
1765-
let dest = Parent.into();
1765+
let dest = PeopleLocation::get();
17661766

17671767
let fee_amount = EXISTENTIAL_DEPOSIT;
1768-
let fee_asset: Asset = (Location::parent(), fee_amount).into();
1768+
let fee_asset: Asset = (TokenLocation::get(), fee_amount).into();
17691769

17701770
let who = frame_benchmarking::whitelisted_caller();
17711771
// Give some multiple of the existential deposit
@@ -1868,13 +1868,15 @@ impl_runtime_apis! {
18681868
impl pallet_xcm_benchmarks::Config for Runtime {
18691869
type XcmConfig = xcm_config::XcmConfig;
18701870
type AccountIdConverter = xcm_config::LocationToAccountId;
1871-
type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper<
1872-
xcm_config::XcmConfig,
1873-
ExistentialDepositAsset,
1874-
xcm_config::PriceForParentDelivery,
1875-
>;
1871+
type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper<
1872+
xcm_config::XcmConfig,
1873+
ExistentialDepositAsset,
1874+
PriceForSiblingParachainDelivery,
1875+
PeopleParaId,
1876+
ParachainSystem
1877+
>;
18761878
fn valid_destination() -> Result<Location, BenchmarkError> {
1877-
Ok(TokenLocation::get())
1879+
Ok(PeopleLocation::get())
18781880
}
18791881
fn worst_case_holding(depositable_count: u32) -> XcmAssets {
18801882
// A mix of fungible, non-fungible, and concrete assets.
@@ -1900,8 +1902,8 @@ impl_runtime_apis! {
19001902
}
19011903

19021904
parameter_types! {
1903-
pub const TrustedTeleporter: Option<(Location, Asset)> = Some((
1904-
TokenLocation::get(),
1905+
pub TrustedTeleporter: Option<(Location, Asset)> = Some((
1906+
PeopleLocation::get(),
19051907
Asset { fun: Fungible(UNITS), id: AssetId(TokenLocation::get()) },
19061908
));
19071909
pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None;
@@ -1964,15 +1966,18 @@ impl_runtime_apis! {
19641966
}
19651967

19661968
fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> {
1967-
Ok((TokenLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into()))
1969+
Ok((
1970+
PeopleLocation::get(),
1971+
frame_system::Call::remark_with_event {remark: vec![]}.into()
1972+
))
19681973
}
19691974

19701975
fn subscribe_origin() -> Result<Location, BenchmarkError> {
1971-
Ok(TokenLocation::get())
1976+
Ok(PeopleLocation::get())
19721977
}
19731978

19741979
fn claimable_asset() -> Result<(Location, Location, XcmAssets), BenchmarkError> {
1975-
let origin = TokenLocation::get();
1980+
let origin = PeopleLocation::get();
19761981
let assets: XcmAssets = (TokenLocation::get(), 1_000 * UNITS).into();
19771982
let ticket = Location { parents: 0, interior: Here };
19781983
Ok((origin, ticket, assets))

0 commit comments

Comments
 (0)