Improve Staking Limits (#9193)

* only allow `chill_other` near threshold.

* improve test

* skip limit check for existing validators / nominators

* add `ChillThreshold`

* rename to `set` for consistent api

* more tests

* fix some line width
This commit is contained in:
Shawn Tabrizi
2021-06-28 08:54:24 -04:00
committed by GitHub
parent ee192467e2
commit 5cd04820dc
4 changed files with 171 additions and 49 deletions
+3 -3
View File
@@ -70,7 +70,7 @@ pub trait WeightInfo {
fn new_era(v: u32, n: u32, ) -> Weight;
fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight;
fn get_npos_targets(v: u32, ) -> Weight;
fn update_staking_limits() -> Weight;
fn set_staking_limits() -> Weight;
fn chill_other() -> Weight;
}
@@ -252,7 +252,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(v as Weight)))
}
fn update_staking_limits() -> Weight {
fn set_staking_limits() -> Weight {
(5_028_000 as Weight)
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
@@ -440,7 +440,7 @@ impl WeightInfo for () {
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(v as Weight)))
}
fn update_staking_limits() -> Weight {
fn set_staking_limits() -> Weight {
(5_028_000 as Weight)
.saturating_add(RocksDbWeight::get().writes(4 as Weight))
}