Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 958 #959

Merged
merged 5 commits into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pallets/parachain-staking/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite};
use frame_support::traits::{Currency, Get, OnFinalize, OnInitialize, ReservableCurrency};
use frame_system::RawOrigin;
use pallet_authorship::EventHandler;
use sp_runtime::{Perbill, Percent};
use sp_runtime::{Perbill, Percent, Saturating};
use sp_std::{collections::btree_map::BTreeMap, vec, vec::Vec};

/// Minimum collator candidate stake
Expand Down Expand Up @@ -224,9 +224,11 @@ benchmarks! {
assert_eq!(Pallet::<T>::total_selected(), 100u32);
}

set_collator_commission {}: _(RawOrigin::Root, Perbill::from_percent(33))
set_collator_commission {
let new_perbill = <T as Config>::DefaultCollatorCommission::get().saturating_add(Perbill::from_percent(1));
}: _(RawOrigin::Root, new_perbill)
verify {
assert_eq!(Pallet::<T>::collator_commission(), Perbill::from_percent(33));
assert_eq!(Pallet::<T>::collator_commission(), new_perbill);
}

set_blocks_per_round {}: _(RawOrigin::Root, 1200u32)
Expand Down
2 changes: 1 addition & 1 deletion runtime/litentry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ runtime-benchmarks = [
"pallet-multisig/runtime-benchmarks",
# This module timed out for some reason and had to be commented out temporarily
# https://github.com/litentry/litentry-parachain/actions/runs/3155868677/jobs/5134984739
# "pallet-parachain-staking/runtime-benchmarks",
# "pallet-parachain-staking/runtime-benchmarks",
"pallet-preimage/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
"pallet-scheduler/runtime-benchmarks",
Expand Down
8 changes: 4 additions & 4 deletions runtime/litentry/src/weights/cumulus_pallet_xcmp_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
//! Autogenerated weights for `cumulus_pallet_xcmp_queue`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-11-14, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `parachain-benchmark`, CPU: `Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz`
//! DATE: 2022-11-18, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `parachain-benchmark`, CPU: `Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("litentry-dev"), DB CACHE: 20

// Executed Command:
Expand Down Expand Up @@ -49,13 +49,13 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> cumulus_pallet_xcmp_queue::WeightInfo for WeightInfo<T> {
// Storage: XcmpQueue QueueConfig (r:1 w:1)
fn set_config_with_u32() -> Weight {
Weight::from_ref_time(11_469_000 as u64)
Weight::from_ref_time(10_009_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: XcmpQueue QueueConfig (r:1 w:1)
fn set_config_with_weight() -> Weight {
Weight::from_ref_time(11_409_000 as u64)
Weight::from_ref_time(9_863_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
Expand Down
36 changes: 18 additions & 18 deletions runtime/litentry/src/weights/frame_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
//! Autogenerated weights for `frame_system`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-11-14, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `parachain-benchmark`, CPU: `Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz`
//! DATE: 2022-11-18, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `parachain-benchmark`, CPU: `Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("litentry-dev"), DB CACHE: 20

// Executed Command:
Expand Down Expand Up @@ -49,47 +49,47 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
/// The range of component `b` is `[0, 3932160]`.
fn remark(b: u32, ) -> Weight {
Weight::from_ref_time(6_116_000 as u64)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(580 as u64).saturating_mul(b as u64))
Weight::from_ref_time(5_083_000 as u64)
// Standard Error: 3
.saturating_add(Weight::from_ref_time(798 as u64).saturating_mul(b as u64))
}
/// The range of component `b` is `[0, 3932160]`.
fn remark_with_event(b: u32, ) -> Weight {
Weight::from_ref_time(20_321_000 as u64)
// Standard Error: 1
.saturating_add(Weight::from_ref_time(2_131 as u64).saturating_mul(b as u64))
Weight::from_ref_time(18_371_000 as u64)
// Standard Error: 4
.saturating_add(Weight::from_ref_time(2_489 as u64).saturating_mul(b as u64))
}
// Storage: System Digest (r:1 w:1)
// Storage: unknown [0x3a686561707061676573] (r:0 w:1)
fn set_heap_pages() -> Weight {
Weight::from_ref_time(12_702_000 as u64)
Weight::from_ref_time(11_214_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Skipped Metadata (r:0 w:0)
/// The range of component `i` is `[1, 1000]`.
fn set_storage(i: u32, ) -> Weight {
Weight::from_ref_time(7_371_000 as u64)
// Standard Error: 1_494
.saturating_add(Weight::from_ref_time(1_267_397 as u64).saturating_mul(i as u64))
Weight::from_ref_time(6_886_000 as u64)
// Standard Error: 3_977
.saturating_add(Weight::from_ref_time(989_722 as u64).saturating_mul(i as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64)))
}
// Storage: Skipped Metadata (r:0 w:0)
/// The range of component `i` is `[1, 1000]`.
fn kill_storage(i: u32, ) -> Weight {
Weight::from_ref_time(7_347_000 as u64)
// Standard Error: 1_257
.saturating_add(Weight::from_ref_time(1_073_403 as u64).saturating_mul(i as u64))
Weight::from_ref_time(6_594_000 as u64)
// Standard Error: 11_193
.saturating_add(Weight::from_ref_time(940_885 as u64).saturating_mul(i as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64)))
}
// Storage: Skipped Metadata (r:0 w:0)
/// The range of component `p` is `[1, 1000]`.
fn kill_prefix(p: u32, ) -> Weight {
Weight::from_ref_time(11_081_000 as u64)
// Standard Error: 3_160
.saturating_add(Weight::from_ref_time(2_630_429 as u64).saturating_mul(p as u64))
Weight::from_ref_time(9_478_000 as u64)
// Standard Error: 2_689
.saturating_add(Weight::from_ref_time(1_825_045 as u64).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(p as u64)))
}
Expand Down
14 changes: 7 additions & 7 deletions runtime/litentry/src/weights/pallet_asset_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
//! Autogenerated weights for `pallet_asset_manager`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-11-14, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `parachain-benchmark`, CPU: `Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz`
//! DATE: 2022-11-18, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `parachain-benchmark`, CPU: `Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("litentry-dev"), DB CACHE: 20

// Executed Command:
Expand Down Expand Up @@ -52,35 +52,35 @@ impl<T: frame_system::Config> pallet_asset_manager::WeightInfo for WeightInfo<T>
// Storage: AssetManager AssetIdType (r:0 w:1)
// Storage: AssetManager AssetIdMetadata (r:0 w:1)
fn register_foreign_asset_type() -> Weight {
Weight::from_ref_time(47_892_000 as u64)
Weight::from_ref_time(41_828_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: AssetManager AssetIdType (r:1 w:0)
// Storage: AssetManager AssetIdMetadata (r:0 w:1)
fn update_foreign_asset_metadata() -> Weight {
Weight::from_ref_time(31_969_000 as u64)
Weight::from_ref_time(28_742_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: AssetManager AssetIdType (r:1 w:0)
// Storage: AssetManager AssetIdUnitsPerSecond (r:0 w:1)
fn set_asset_units_per_second() -> Weight {
Weight::from_ref_time(30_582_000 as u64)
Weight::from_ref_time(27_815_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: AssetManager AssetIdType (r:1 w:1)
// Storage: AssetManager AssetTypeId (r:1 w:1)
fn add_asset_type() -> Weight {
Weight::from_ref_time(36_120_000 as u64)
Weight::from_ref_time(33_329_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: AssetManager AssetTypeId (r:2 w:1)
// Storage: AssetManager AssetIdType (r:0 w:1)
fn remove_asset_type() -> Weight {
Weight::from_ref_time(45_108_000 as u64)
Weight::from_ref_time(41_326_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
Expand Down
18 changes: 9 additions & 9 deletions runtime/litentry/src/weights/pallet_balances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
//! Autogenerated weights for `pallet_balances`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-11-14, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `parachain-benchmark`, CPU: `Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz`
//! DATE: 2022-11-18, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `parachain-benchmark`, CPU: `Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("litentry-dev"), DB CACHE: 20

// Executed Command:
Expand Down Expand Up @@ -49,43 +49,43 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
// Storage: System Account (r:1 w:1)
fn transfer() -> Weight {
Weight::from_ref_time(78_976_000 as u64)
Weight::from_ref_time(67_818_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: System Account (r:1 w:1)
fn transfer_keep_alive() -> Weight {
Weight::from_ref_time(56_461_000 as u64)
Weight::from_ref_time(49_707_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: System Account (r:1 w:1)
fn set_balance_creating() -> Weight {
Weight::from_ref_time(41_156_000 as u64)
Weight::from_ref_time(37_701_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: System Account (r:1 w:1)
fn set_balance_killing() -> Weight {
Weight::from_ref_time(47_012_000 as u64)
Weight::from_ref_time(42_468_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: System Account (r:2 w:2)
fn force_transfer() -> Weight {
Weight::from_ref_time(77_931_000 as u64)
Weight::from_ref_time(67_060_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: System Account (r:1 w:1)
fn transfer_all() -> Weight {
Weight::from_ref_time(66_848_000 as u64)
Weight::from_ref_time(58_133_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: System Account (r:1 w:1)
fn force_unreserve() -> Weight {
Weight::from_ref_time(34_528_000 as u64)
Weight::from_ref_time(31_167_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
Expand Down
24 changes: 12 additions & 12 deletions runtime/litentry/src/weights/pallet_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
//! Autogenerated weights for `pallet_bridge`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-11-14, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `parachain-benchmark`, CPU: `Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz`
//! DATE: 2022-11-18, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `parachain-benchmark`, CPU: `Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("litentry-dev"), DB CACHE: 20

// Executed Command:
Expand Down Expand Up @@ -49,42 +49,42 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_bridge::WeightInfo for WeightInfo<T> {
// Storage: ChainBridge RelayerThreshold (r:0 w:1)
fn set_threshold() -> Weight {
Weight::from_ref_time(21_931_000 as u64)
Weight::from_ref_time(19_293_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: ChainBridge Resources (r:0 w:1)
fn set_resource() -> Weight {
Weight::from_ref_time(9_321_000 as u64)
Weight::from_ref_time(7_904_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: ChainBridge Resources (r:0 w:1)
fn remove_resource() -> Weight {
Weight::from_ref_time(8_966_000 as u64)
Weight::from_ref_time(7_593_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: ChainBridge ChainNonces (r:1 w:1)
fn whitelist_chain() -> Weight {
Weight::from_ref_time(26_826_000 as u64)
Weight::from_ref_time(23_559_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: ChainBridge Relayers (r:1 w:1)
// Storage: ChainBridge RelayerCount (r:1 w:1)
fn add_relayer() -> Weight {
Weight::from_ref_time(32_381_000 as u64)
Weight::from_ref_time(27_831_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: ChainBridge Relayers (r:1 w:1)
// Storage: ChainBridge RelayerCount (r:1 w:1)
fn remove_relayer() -> Weight {
Weight::from_ref_time(34_301_000 as u64)
Weight::from_ref_time(30_340_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: ChainBridge BridgeFee (r:0 w:1)
fn update_fee() -> Weight {
Weight::from_ref_time(23_062_000 as u64)
Weight::from_ref_time(20_170_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: ChainBridge Relayers (r:1 w:0)
Expand All @@ -94,7 +94,7 @@ impl<T: frame_system::Config> pallet_bridge::WeightInfo for WeightInfo<T> {
// Storage: ChainBridge RelayerThreshold (r:1 w:0)
// Storage: ChainBridge RelayerCount (r:1 w:0)
fn acknowledge_proposal() -> Weight {
Weight::from_ref_time(73_956_000 as u64)
Weight::from_ref_time(64_635_000 as u64)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
Expand All @@ -105,15 +105,15 @@ impl<T: frame_system::Config> pallet_bridge::WeightInfo for WeightInfo<T> {
// Storage: ChainBridge RelayerThreshold (r:1 w:0)
// Storage: ChainBridge RelayerCount (r:1 w:0)
fn reject_proposal() -> Weight {
Weight::from_ref_time(63_526_000 as u64)
Weight::from_ref_time(55_135_000 as u64)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: ChainBridge Votes (r:1 w:1)
// Storage: ChainBridge RelayerThreshold (r:1 w:0)
// Storage: ChainBridge RelayerCount (r:1 w:0)
fn eval_vote_state() -> Weight {
Weight::from_ref_time(30_148_000 as u64)
Weight::from_ref_time(26_571_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
Expand Down
12 changes: 6 additions & 6 deletions runtime/litentry/src/weights/pallet_bridge_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
//! Autogenerated weights for `pallet_bridge_transfer`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-11-14, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `parachain-benchmark`, CPU: `Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz`
//! DATE: 2022-11-18, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `parachain-benchmark`, CPU: `Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("litentry-dev"), DB CACHE: 20

// Executed Command:
Expand Down Expand Up @@ -53,27 +53,27 @@ impl<T: frame_system::Config> pallet_bridge_transfer::WeightInfo for WeightInfo<
// Storage: System Account (r:2 w:2)
// Storage: ChainBridge BridgeEvents (r:1 w:1)
fn transfer_native() -> Weight {
Weight::from_ref_time(101_124_000 as u64)
Weight::from_ref_time(90_477_000 as u64)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: BridgeTransfer MaximumIssuance (r:1 w:0)
// Storage: BridgeTransfer ExternalBalances (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn transfer() -> Weight {
Weight::from_ref_time(52_182_000 as u64)
Weight::from_ref_time(46_982_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: BridgeTransfer MaximumIssuance (r:1 w:1)
fn set_maximum_issuance() -> Weight {
Weight::from_ref_time(24_693_000 as u64)
Weight::from_ref_time(22_626_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: BridgeTransfer ExternalBalances (r:0 w:1)
fn set_external_balances() -> Weight {
Weight::from_ref_time(7_482_000 as u64)
Weight::from_ref_time(6_555_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
}
Loading