Skip to content

Commit

Permalink
Remove minimum_validator_count stale const (paritytech#6864)
Browse files Browse the repository at this point in the history
  • Loading branch information
kianenigma authored Aug 10, 2020
1 parent eb0e05e commit 2258733
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 1 addition & 5 deletions frame/staking/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ pub fn create_validator_with_nominators<T: Trait>(
let mut points_total = 0;
let mut points_individual = Vec::new();

MinimumValidatorCount::put(0);

let (v_stash, v_controller) = create_stash_controller::<T>(0, 100)?;
let validator_prefs = ValidatorPrefs {
commission: Perbill::from_percent(50),
Expand Down Expand Up @@ -356,7 +354,7 @@ benchmarks! {
new_era {
let v in 1 .. 10;
let n in 1 .. 100;
MinimumValidatorCount::put(0);

create_validators_with_nominators_for_era::<T>(v, n, MAX_NOMINATIONS, false, None)?;
let session_index = SessionIndex::one();
}: {
Expand Down Expand Up @@ -393,7 +391,6 @@ benchmarks! {
payout_all {
let v in 1 .. 10;
let n in 1 .. 100;
MinimumValidatorCount::put(0);
create_validators_with_nominators_for_era::<T>(v, n, MAX_NOMINATIONS, false, None)?;
// Start a new Era
let new_validators = Staking::<T>::new_era(SessionIndex::one()).unwrap();
Expand Down Expand Up @@ -577,7 +574,6 @@ benchmarks! {
// number of nominator intent
let n in 1000 .. 2000;

MinimumValidatorCount::put(0);
create_validators_with_nominators_for_era::<T>(v, n, MAX_NOMINATIONS, false, None)?;

// needed for the solution to be generates.
Expand Down
4 changes: 1 addition & 3 deletions frame/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ use sp_npos_elections::{
is_score_better, VotingLimit, SupportMap, VoteWeight,
};

const DEFAULT_MINIMUM_VALIDATOR_COUNT: u32 = 4;
const STAKING_ID: LockIdentifier = *b"staking ";
pub const MAX_UNLOCKING_CHUNKS: usize = 32;
pub const MAX_NOMINATIONS: usize = <CompactAssignments as VotingLimit>::LIMIT;
Expand Down Expand Up @@ -1032,8 +1031,7 @@ decl_storage! {
pub ValidatorCount get(fn validator_count) config(): u32;

/// Minimum number of staking participants before emergency conditions are imposed.
pub MinimumValidatorCount get(fn minimum_validator_count) config():
u32 = DEFAULT_MINIMUM_VALIDATOR_COUNT;
pub MinimumValidatorCount get(fn minimum_validator_count) config(): u32;

/// Any validators that may never be slashed or forcibly kicked. It's a Vec since they're
/// easy to initialize and the performance hit is minimal (we expect no more than four
Expand Down

0 comments on commit 2258733

Please sign in to comment.