Weight v1.5 Follow Ups (#12155)

* update api

* update

* remove unused

* remove `one` api

* fix unused

* fmt

* add saturating accrue

* remove `Weight::new()`

* use some macros

* div makes no sense

* Update weight_v2.rs

* missed some

* more patch

* fixes

* more fixes

* more fix

* more fix

* Update frame/support/src/weights/weight_v2.rs

* not needed

* fix weight file
This commit is contained in:
Shawn Tabrizi
2022-09-01 18:48:03 +01:00
committed by GitHub
parent 6be21e0397
commit 1df4561676
80 changed files with 965 additions and 960 deletions
+44 -44
View File
@@ -66,11 +66,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn set_members(m: u32, n: u32, p: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
// Standard Error: 12_000
.saturating_add(Weight::from_ref_time(10_280_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(10_280_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
// Standard Error: 12_000
.saturating_add(Weight::from_ref_time(126_000 as RefTimeWeight).scalar_saturating_mul(n as RefTimeWeight))
.saturating_add(Weight::from_ref_time(126_000 as RefTimeWeight).saturating_mul(n as RefTimeWeight))
// Standard Error: 12_000
.saturating_add(Weight::from_ref_time(13_310_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
.saturating_add(Weight::from_ref_time(13_310_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads((1 as RefTimeWeight).saturating_mul(p as RefTimeWeight)))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
@@ -80,9 +80,9 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn execute(b: u32, m: u32, ) -> Weight {
Weight::from_ref_time(16_819_000 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(2_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
.saturating_add(Weight::from_ref_time(2_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(33_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(33_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
}
// Storage: Council Members (r:1 w:0)
@@ -90,9 +90,9 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn propose_execute(b: u32, m: u32, ) -> Weight {
Weight::from_ref_time(18_849_000 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(2_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
.saturating_add(Weight::from_ref_time(2_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(56_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(56_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
}
// Storage: Council Members (r:1 w:0)
@@ -103,11 +103,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight {
Weight::from_ref_time(22_204_000 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(8_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
.saturating_add(Weight::from_ref_time(8_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(49_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(49_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(180_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
.saturating_add(Weight::from_ref_time(180_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(4 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(4 as RefTimeWeight))
}
@@ -116,7 +116,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn vote(m: u32, ) -> Weight {
Weight::from_ref_time(30_941_000 as RefTimeWeight)
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(77_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(77_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
}
@@ -127,9 +127,9 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn close_early_disapproved(m: u32, p: u32, ) -> Weight {
Weight::from_ref_time(32_485_000 as RefTimeWeight)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(39_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(39_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(124_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
.saturating_add(Weight::from_ref_time(124_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(3 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(3 as RefTimeWeight))
}
@@ -140,11 +140,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight {
Weight::from_ref_time(33_487_000 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(5_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
.saturating_add(Weight::from_ref_time(5_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(66_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(66_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(157_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
.saturating_add(Weight::from_ref_time(157_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(4 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(3 as RefTimeWeight))
}
@@ -156,9 +156,9 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn close_disapproved(m: u32, p: u32, ) -> Weight {
Weight::from_ref_time(33_494_000 as RefTimeWeight)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(58_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(58_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(124_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
.saturating_add(Weight::from_ref_time(124_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(4 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(3 as RefTimeWeight))
}
@@ -170,11 +170,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn close_approved(b: u32, m: u32, p: u32, ) -> Weight {
Weight::from_ref_time(36_566_000 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(5_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
.saturating_add(Weight::from_ref_time(5_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(63_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(63_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(158_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
.saturating_add(Weight::from_ref_time(158_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(5 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(3 as RefTimeWeight))
}
@@ -184,7 +184,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn disapprove_proposal(p: u32, ) -> Weight {
Weight::from_ref_time(20_159_000 as RefTimeWeight)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(173_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
.saturating_add(Weight::from_ref_time(173_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(3 as RefTimeWeight))
}
@@ -199,11 +199,11 @@ impl WeightInfo for () {
fn set_members(m: u32, n: u32, p: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
// Standard Error: 12_000
.saturating_add(Weight::from_ref_time(10_280_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(10_280_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
// Standard Error: 12_000
.saturating_add(Weight::from_ref_time(126_000 as RefTimeWeight).scalar_saturating_mul(n as RefTimeWeight))
.saturating_add(Weight::from_ref_time(126_000 as RefTimeWeight).saturating_mul(n as RefTimeWeight))
// Standard Error: 12_000
.saturating_add(Weight::from_ref_time(13_310_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
.saturating_add(Weight::from_ref_time(13_310_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads((1 as RefTimeWeight).saturating_mul(p as RefTimeWeight)))
.saturating_add(RocksDbWeight::get().writes(2 as RefTimeWeight))
@@ -213,9 +213,9 @@ impl WeightInfo for () {
fn execute(b: u32, m: u32, ) -> Weight {
Weight::from_ref_time(16_819_000 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(2_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
.saturating_add(Weight::from_ref_time(2_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(33_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(33_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
}
// Storage: Council Members (r:1 w:0)
@@ -223,9 +223,9 @@ impl WeightInfo for () {
fn propose_execute(b: u32, m: u32, ) -> Weight {
Weight::from_ref_time(18_849_000 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(2_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
.saturating_add(Weight::from_ref_time(2_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(56_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(56_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(2 as RefTimeWeight))
}
// Storage: Council Members (r:1 w:0)
@@ -236,11 +236,11 @@ impl WeightInfo for () {
fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight {
Weight::from_ref_time(22_204_000 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(8_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
.saturating_add(Weight::from_ref_time(8_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(49_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(49_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(180_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
.saturating_add(Weight::from_ref_time(180_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(4 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(4 as RefTimeWeight))
}
@@ -249,7 +249,7 @@ impl WeightInfo for () {
fn vote(m: u32, ) -> Weight {
Weight::from_ref_time(30_941_000 as RefTimeWeight)
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(77_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(77_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
}
@@ -260,9 +260,9 @@ impl WeightInfo for () {
fn close_early_disapproved(m: u32, p: u32, ) -> Weight {
Weight::from_ref_time(32_485_000 as RefTimeWeight)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(39_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(39_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(124_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
.saturating_add(Weight::from_ref_time(124_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(3 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(3 as RefTimeWeight))
}
@@ -273,11 +273,11 @@ impl WeightInfo for () {
fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight {
Weight::from_ref_time(33_487_000 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(5_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
.saturating_add(Weight::from_ref_time(5_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(66_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(66_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(157_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
.saturating_add(Weight::from_ref_time(157_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(4 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(3 as RefTimeWeight))
}
@@ -289,9 +289,9 @@ impl WeightInfo for () {
fn close_disapproved(m: u32, p: u32, ) -> Weight {
Weight::from_ref_time(33_494_000 as RefTimeWeight)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(58_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(58_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(124_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
.saturating_add(Weight::from_ref_time(124_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(4 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(3 as RefTimeWeight))
}
@@ -303,11 +303,11 @@ impl WeightInfo for () {
fn close_approved(b: u32, m: u32, p: u32, ) -> Weight {
Weight::from_ref_time(36_566_000 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(5_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
.saturating_add(Weight::from_ref_time(5_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(63_000 as RefTimeWeight).scalar_saturating_mul(m as RefTimeWeight))
.saturating_add(Weight::from_ref_time(63_000 as RefTimeWeight).saturating_mul(m as RefTimeWeight))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(158_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
.saturating_add(Weight::from_ref_time(158_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(5 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(3 as RefTimeWeight))
}
@@ -317,7 +317,7 @@ impl WeightInfo for () {
fn disapprove_proposal(p: u32, ) -> Weight {
Weight::from_ref_time(20_159_000 as RefTimeWeight)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(173_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
.saturating_add(Weight::from_ref_time(173_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(3 as RefTimeWeight))
}