Fixes PoV over-estimation (#13766)

* Align log

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use max instead of sum

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make comment ordering deterministic

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Dont add Pov overhead when all is ignored

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update test pallet weights

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Re-run weights on bm2

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Actually use new weights

Fucked up the merge for this file...

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update contract weights

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Oliver Tale-Yazdi
2023-04-13 15:11:58 +02:00
committed by GitHub
parent 46e2d3e5f8
commit ebfe00d590
54 changed files with 5526 additions and 5534 deletions
+80 -67
View File
@@ -18,9 +18,9 @@
//! Autogenerated weights for pallet_conviction_voting
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-03-16, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-04-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
// Executed Command:
@@ -31,9 +31,6 @@
// --steps=50
// --repeat=20
// --pallet=pallet_conviction_voting
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
@@ -71,15 +68,17 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(107022), added: 109497, mode: MaxEncodedLen)
fn vote_new() -> Weight {
// Proof Size summary in bytes:
// Measured: `13074`
// Estimated: `262809`
// Minimum execution time: 94_493_000 picoseconds.
Weight::from_parts(96_510_000, 262809)
.saturating_add(T::DbWeight::get().reads(6_u64))
// Estimated: `219984`
// Minimum execution time: 99_130_000 picoseconds.
Weight::from_parts(100_355_000, 219984)
.saturating_add(T::DbWeight::get().reads(7_u64))
.saturating_add(T::DbWeight::get().writes(6_u64))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
@@ -90,15 +89,17 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(107022), added: 109497, mode: MaxEncodedLen)
fn vote_existing() -> Weight {
// Proof Size summary in bytes:
// Measured: `20216`
// Estimated: `262809`
// Minimum execution time: 252_717_000 picoseconds.
Weight::from_parts(255_200_000, 262809)
.saturating_add(T::DbWeight::get().reads(6_u64))
// Estimated: `219984`
// Minimum execution time: 276_420_000 picoseconds.
Weight::from_parts(277_433_000, 219984)
.saturating_add(T::DbWeight::get().reads(7_u64))
.saturating_add(T::DbWeight::get().writes(6_u64))
}
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
@@ -110,9 +111,9 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn remove_vote() -> Weight {
// Proof Size summary in bytes:
// Measured: `19968`
// Estimated: `254521`
// Minimum execution time: 244_844_000 picoseconds.
Weight::from_parts(247_433_000, 254521)
// Estimated: `219984`
// Minimum execution time: 241_058_000 picoseconds.
Weight::from_parts(242_235_000, 219984)
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
}
@@ -123,9 +124,9 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn remove_other_vote() -> Weight {
// Proof Size summary in bytes:
// Measured: `12675`
// Estimated: `34537`
// Minimum execution time: 46_271_000 picoseconds.
Weight::from_parts(47_639_000, 34537)
// Estimated: `30706`
// Minimum execution time: 46_385_000 picoseconds.
Weight::from_parts(46_709_000, 30706)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -139,20 +140,22 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// The range of component `r` is `[0, 1]`.
fn delegate(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `240 + r * (1627 ±0)`
// Estimated: `180617 + r * (111908 ±0)`
// Minimum execution time: 37_578_000 picoseconds.
Weight::from_parts(39_035_446, 180617)
// Standard Error: 160_560
.saturating_add(Weight::from_parts(39_642_553, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(4_u64))
// Estimated: `109992 + r * (109992 ±0)`
// Minimum execution time: 48_947_000 picoseconds.
Weight::from_parts(50_219_593, 109992)
// Standard Error: 70_238
.saturating_add(Weight::from_parts(40_509_706, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(r.into())))
.saturating_add(T::DbWeight::get().writes(4_u64))
.saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(r.into())))
.saturating_add(Weight::from_parts(0, 111908).saturating_mul(r.into()))
.saturating_add(Weight::from_parts(0, 109992).saturating_mul(r.into()))
}
/// Storage: ConvictionVoting VotingFor (r:2 w:2)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
@@ -164,16 +167,16 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn undelegate(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `406 + r * (1376 ±0)`
// Estimated: `172329 + r * (111908 ±0)`
// Minimum execution time: 22_997_000 picoseconds.
Weight::from_parts(24_180_222, 172329)
// Standard Error: 87_723
.saturating_add(Weight::from_parts(36_189_677, 0).saturating_mul(r.into()))
// Estimated: `109992 + r * (109992 ±0)`
// Minimum execution time: 23_408_000 picoseconds.
Weight::from_parts(24_087_793, 109992)
// Standard Error: 31_776
.saturating_add(Weight::from_parts(36_594_606, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(r.into())))
.saturating_add(T::DbWeight::get().writes(2_u64))
.saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(r.into())))
.saturating_add(Weight::from_parts(0, 111908).saturating_mul(r.into()))
.saturating_add(Weight::from_parts(0, 109992).saturating_mul(r.into()))
}
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
@@ -181,13 +184,15 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
fn unlock() -> Weight {
// Proof Size summary in bytes:
// Measured: `11734`
// Estimated: `38994`
// Minimum execution time: 55_906_000 picoseconds.
Weight::from_parts(56_819_000, 38994)
.saturating_add(T::DbWeight::get().reads(3_u64))
// Estimated: `30706`
// Minimum execution time: 65_903_000 picoseconds.
Weight::from_parts(66_460_000, 30706)
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(3_u64))
}
}
@@ -202,15 +207,17 @@ impl WeightInfo for () {
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(107022), added: 109497, mode: MaxEncodedLen)
fn vote_new() -> Weight {
// Proof Size summary in bytes:
// Measured: `13074`
// Estimated: `262809`
// Minimum execution time: 94_493_000 picoseconds.
Weight::from_parts(96_510_000, 262809)
.saturating_add(RocksDbWeight::get().reads(6_u64))
// Estimated: `219984`
// Minimum execution time: 99_130_000 picoseconds.
Weight::from_parts(100_355_000, 219984)
.saturating_add(RocksDbWeight::get().reads(7_u64))
.saturating_add(RocksDbWeight::get().writes(6_u64))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
@@ -221,15 +228,17 @@ impl WeightInfo for () {
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(107022), added: 109497, mode: MaxEncodedLen)
fn vote_existing() -> Weight {
// Proof Size summary in bytes:
// Measured: `20216`
// Estimated: `262809`
// Minimum execution time: 252_717_000 picoseconds.
Weight::from_parts(255_200_000, 262809)
.saturating_add(RocksDbWeight::get().reads(6_u64))
// Estimated: `219984`
// Minimum execution time: 276_420_000 picoseconds.
Weight::from_parts(277_433_000, 219984)
.saturating_add(RocksDbWeight::get().reads(7_u64))
.saturating_add(RocksDbWeight::get().writes(6_u64))
}
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
@@ -241,9 +250,9 @@ impl WeightInfo for () {
fn remove_vote() -> Weight {
// Proof Size summary in bytes:
// Measured: `19968`
// Estimated: `254521`
// Minimum execution time: 244_844_000 picoseconds.
Weight::from_parts(247_433_000, 254521)
// Estimated: `219984`
// Minimum execution time: 241_058_000 picoseconds.
Weight::from_parts(242_235_000, 219984)
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
}
@@ -254,9 +263,9 @@ impl WeightInfo for () {
fn remove_other_vote() -> Weight {
// Proof Size summary in bytes:
// Measured: `12675`
// Estimated: `34537`
// Minimum execution time: 46_271_000 picoseconds.
Weight::from_parts(47_639_000, 34537)
// Estimated: `30706`
// Minimum execution time: 46_385_000 picoseconds.
Weight::from_parts(46_709_000, 30706)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -270,20 +279,22 @@ impl WeightInfo for () {
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// The range of component `r` is `[0, 1]`.
fn delegate(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `240 + r * (1627 ±0)`
// Estimated: `180617 + r * (111908 ±0)`
// Minimum execution time: 37_578_000 picoseconds.
Weight::from_parts(39_035_446, 180617)
// Standard Error: 160_560
.saturating_add(Weight::from_parts(39_642_553, 0).saturating_mul(r.into()))
.saturating_add(RocksDbWeight::get().reads(4_u64))
// Estimated: `109992 + r * (109992 ±0)`
// Minimum execution time: 48_947_000 picoseconds.
Weight::from_parts(50_219_593, 109992)
// Standard Error: 70_238
.saturating_add(Weight::from_parts(40_509_706, 0).saturating_mul(r.into()))
.saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(r.into())))
.saturating_add(RocksDbWeight::get().writes(4_u64))
.saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(r.into())))
.saturating_add(Weight::from_parts(0, 111908).saturating_mul(r.into()))
.saturating_add(Weight::from_parts(0, 109992).saturating_mul(r.into()))
}
/// Storage: ConvictionVoting VotingFor (r:2 w:2)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
@@ -295,16 +306,16 @@ impl WeightInfo for () {
fn undelegate(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `406 + r * (1376 ±0)`
// Estimated: `172329 + r * (111908 ±0)`
// Minimum execution time: 22_997_000 picoseconds.
Weight::from_parts(24_180_222, 172329)
// Standard Error: 87_723
.saturating_add(Weight::from_parts(36_189_677, 0).saturating_mul(r.into()))
// Estimated: `109992 + r * (109992 ±0)`
// Minimum execution time: 23_408_000 picoseconds.
Weight::from_parts(24_087_793, 109992)
// Standard Error: 31_776
.saturating_add(Weight::from_parts(36_594_606, 0).saturating_mul(r.into()))
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(r.into())))
.saturating_add(RocksDbWeight::get().writes(2_u64))
.saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(r.into())))
.saturating_add(Weight::from_parts(0, 111908).saturating_mul(r.into()))
.saturating_add(Weight::from_parts(0, 109992).saturating_mul(r.into()))
}
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
@@ -312,13 +323,15 @@ impl WeightInfo for () {
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
fn unlock() -> Weight {
// Proof Size summary in bytes:
// Measured: `11734`
// Estimated: `38994`
// Minimum execution time: 55_906_000 picoseconds.
Weight::from_parts(56_819_000, 38994)
.saturating_add(RocksDbWeight::get().reads(3_u64))
// Estimated: `30706`
// Minimum execution time: 65_903_000 picoseconds.
Weight::from_parts(66_460_000, 30706)
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64))
}
}