Skip to content

Commit 7d2349a

Browse files
authored
💻 Run new benchmarks (#352)
## What? - Run the added benchmarks on AWS and put them on the pallet and runtime weight files - hrmp benches ended up being lower than assumed XCM constant, so we're safe there. ## How? - Created a new just file to benchmark only certain extrinsics called `benchmark-extrinsics` ## Anything Else? - I saw that the only difference between the pallet and runtime benchmark configurations in our just-file are the flags ``` --no-storage-info \ --no-median-slopes \ --no-min-squares \ ``` And those ones only seem to be affecting the print to console and not the actual benchmarking, so I copy-pasted the generated weights to both the pallet and runtime files
1 parent 2f09cf8 commit 7d2349a

File tree

4 files changed

+522
-44
lines changed

4 files changed

+522
-44
lines changed

integration-tests/src/tests/ct_migration.rs

+24-1
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717
use crate::*;
1818
use frame_support::traits::{fungible::Mutate, fungibles::Inspect};
1919
use itertools::Itertools;
20-
use pallet_funding::{assert_close_enough, types::*, ProjectId};
20+
use pallet_funding::{assert_close_enough, types::*, ProjectId, WeightInfo};
2121
use polimec_common::migration_types::{MigrationStatus, Migrations, ParticipationType};
2222
use polimec_runtime::{Funding, RuntimeOrigin};
2323
use polkadot_service::chain_spec::get_account_id_from_seed;
2424
use sp_runtime::Perquintill;
2525
use std::collections::HashMap;
2626
use tests::defaults::*;
27+
use xcm_executor::traits::WeightBounds;
2728

2829
fn alice() -> AccountId {
2930
get_account_id_from_seed::<sr25519::Public>(ALICE)
@@ -318,3 +319,25 @@ fn cannot_start_pallet_migration_with_unsettled_participations() {
318319
});
319320
}
320321
}
322+
323+
#[test]
324+
fn hrmp_functions_weight_is_under_assumed_maximum() {
325+
type WeightInfo = <PolimecRuntime as pallet_funding::Config>::WeightInfo;
326+
type XcmWeigher = <polimec_runtime::xcm_config::XcmConfig as polimec_xcm_executor::Config>::Weigher;
327+
328+
let open_channel_message = xcm::v3::Instruction::<PolimecCall>::HrmpNewChannelOpenRequest {
329+
sender: 6969,
330+
max_message_size: 102_300,
331+
max_capacity: 1000,
332+
};
333+
let channel_accepted_message = xcm::v3::Instruction::<PolimecCall>::HrmpChannelAccepted { recipient: 6969u32 };
334+
335+
let open_channel_message_real_weight = WeightInfo::do_handle_channel_open_request();
336+
let open_channel_message_deducted_weight = XcmWeigher::instr_weight(&open_channel_message).unwrap();
337+
338+
let channel_accepted_message_real_weight = WeightInfo::do_handle_channel_accepted();
339+
let channel_accepted_message_deducted_weight = XcmWeigher::instr_weight(&channel_accepted_message).unwrap();
340+
341+
assert!(open_channel_message_deducted_weight.all_gte(open_channel_message_real_weight));
342+
assert!(channel_accepted_message_deducted_weight.all_gte(channel_accepted_message_real_weight));
343+
}

integration-tests/src/tests/xcm_config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ fn execution_fees_go_to_treasury() {
110110
assert_reserve_asset_fee_goes_to_treasury(usdt_amount);
111111
assert_reserve_asset_fee_goes_to_treasury(usdc_amount);
112112
assert_plmc_fee_goes_to_treasury();
113-
}
113+
}

0 commit comments

Comments
 (0)