Skip to content

Commit b242c20

Browse files
authored
passkeys: calculate weights (#2077)
# Goal The goal of this PR is to calculate accurate weights for passkey pallet Related to #2032 # Checklist - [x] Weights updated --------- Co-authored-by: aramikm <[email protected]>
1 parent 7d58412 commit b242c20

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

pallets/passkey/src/benchmarking.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn generate_payload<T: Config>() -> PasskeyPayload<T> {
3131
let test_account_1_pk = SignerId::generate_pair(None);
3232
let test_account_1_account_id =
3333
T::AccountId::decode(&mut &test_account_1_pk.encode()[..]).unwrap();
34-
T::Currency::set_balance(&test_account_1_account_id.clone().into(), 2000000000u32.into());
34+
T::Currency::set_balance(&test_account_1_account_id.clone().into(), 4_000_000_000u32.into());
3535
let secret = p256::SecretKey::from_slice(&[
3636
1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8,
3737
])

pallets/passkey/src/weights.rs

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22
//! Autogenerated weights for `pallet_passkey`
33
//!
4-
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
5-
//! DATE: 2024-07-08, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
4+
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
5+
//! DATE: 2024-07-15, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
66
//! WORST CASE MAP SIZE: `1000000`
7-
//! HOSTNAME: `ip-10-99-10-9.us-east-2.compute.internal`, CPU: `<UNKNOWN>`
7+
//! HOSTNAME: `ip-10-173-4-155`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
88
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("frequency-bench")`, DB CACHE: `1024`
99
1010
// Executed Command:
@@ -42,59 +42,67 @@ pub struct SubstrateWeight<T>(PhantomData<T>);
4242
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
4343
/// Storage: `System::Account` (r:1 w:1)
4444
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
45+
/// Storage: `System::AllExtrinsicsLen` (r:1 w:0)
46+
/// Proof: `System::AllExtrinsicsLen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
4547
/// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0)
4648
/// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
4749
fn validate() -> Weight {
4850
// Proof Size summary in bytes:
49-
// Measured: `178`
51+
// Measured: `235`
5052
// Estimated: `5078`
51-
// Minimum execution time: 1_002_000_000 picoseconds.
52-
Weight::from_parts(1_011_000_000, 5078)
53-
.saturating_add(T::DbWeight::get().reads(2_u64))
53+
// Minimum execution time: 1_728_647_000 picoseconds.
54+
Weight::from_parts(1_741_351_000, 5078)
55+
.saturating_add(T::DbWeight::get().reads(3_u64))
5456
.saturating_add(T::DbWeight::get().writes(1_u64))
5557
}
5658
/// Storage: `System::Account` (r:1 w:1)
5759
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
60+
/// Storage: `System::AllExtrinsicsLen` (r:1 w:1)
61+
/// Proof: `System::AllExtrinsicsLen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
5862
/// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0)
5963
/// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
6064
fn pre_dispatch() -> Weight {
6165
// Proof Size summary in bytes:
62-
// Measured: `178`
66+
// Measured: `131`
6367
// Estimated: `5078`
64-
// Minimum execution time: 1_001_000_000 picoseconds.
65-
Weight::from_parts(1_015_000_000, 5078)
66-
.saturating_add(T::DbWeight::get().reads(2_u64))
67-
.saturating_add(T::DbWeight::get().writes(1_u64))
68+
// Minimum execution time: 1_745_366_000 picoseconds.
69+
Weight::from_parts(1_756_751_000, 5078)
70+
.saturating_add(T::DbWeight::get().reads(3_u64))
71+
.saturating_add(T::DbWeight::get().writes(2_u64))
6872
}
6973
}
7074

7175
// For backwards compatibility and tests.
7276
impl WeightInfo for () {
7377
/// Storage: `System::Account` (r:1 w:1)
7478
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
79+
/// Storage: `System::AllExtrinsicsLen` (r:1 w:0)
80+
/// Proof: `System::AllExtrinsicsLen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
7581
/// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0)
7682
/// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
7783
fn validate() -> Weight {
7884
// Proof Size summary in bytes:
79-
// Measured: `178`
85+
// Measured: `235`
8086
// Estimated: `5078`
81-
// Minimum execution time: 1_002_000_000 picoseconds.
82-
Weight::from_parts(1_011_000_000, 5078)
83-
.saturating_add(RocksDbWeight::get().reads(2_u64))
87+
// Minimum execution time: 1_728_647_000 picoseconds.
88+
Weight::from_parts(1_741_351_000, 5078)
89+
.saturating_add(RocksDbWeight::get().reads(3_u64))
8490
.saturating_add(RocksDbWeight::get().writes(1_u64))
8591
}
8692
/// Storage: `System::Account` (r:1 w:1)
8793
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
94+
/// Storage: `System::AllExtrinsicsLen` (r:1 w:1)
95+
/// Proof: `System::AllExtrinsicsLen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
8896
/// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0)
8997
/// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
9098
fn pre_dispatch() -> Weight {
9199
// Proof Size summary in bytes:
92-
// Measured: `178`
100+
// Measured: `131`
93101
// Estimated: `5078`
94-
// Minimum execution time: 1_001_000_000 picoseconds.
95-
Weight::from_parts(1_015_000_000, 5078)
96-
.saturating_add(RocksDbWeight::get().reads(2_u64))
97-
.saturating_add(RocksDbWeight::get().writes(1_u64))
102+
// Minimum execution time: 1_745_366_000 picoseconds.
103+
Weight::from_parts(1_756_751_000, 5078)
104+
.saturating_add(RocksDbWeight::get().reads(3_u64))
105+
.saturating_add(RocksDbWeight::get().writes(2_u64))
98106
}
99107
}
100108

0 commit comments

Comments
 (0)