Revamp some of the weights (#4759)

* Remove free transaction dos vectors.

* Bump spec version

* Indentation.

* Update frame/support/src/weights.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Gavin Wood
2020-01-29 13:38:46 +01:00
committed by GitHub
parent 556c80e792
commit 5c1c31ccd4
8 changed files with 22 additions and 27 deletions
+7 -7
View File
@@ -1150,7 +1150,7 @@ decl_module! {
}
/// The ideal number of validators.
#[weight = SimpleDispatchInfo::FreeOperational]
#[weight = SimpleDispatchInfo::FixedNormal(5_000)]
fn set_validator_count(origin, #[compact] new: u32) {
ensure_root(origin)?;
ValidatorCount::put(new);
@@ -1163,7 +1163,7 @@ decl_module! {
/// # <weight>
/// - No arguments.
/// # </weight>
#[weight = SimpleDispatchInfo::FreeOperational]
#[weight = SimpleDispatchInfo::FixedNormal(5_000)]
fn force_no_eras(origin) {
ensure_root(origin)?;
ForceEra::put(Forcing::ForceNone);
@@ -1175,21 +1175,21 @@ decl_module! {
/// # <weight>
/// - No arguments.
/// # </weight>
#[weight = SimpleDispatchInfo::FreeOperational]
#[weight = SimpleDispatchInfo::FixedNormal(5_000)]
fn force_new_era(origin) {
ensure_root(origin)?;
ForceEra::put(Forcing::ForceNew);
}
/// Set the validators who cannot be slashed (if any).
#[weight = SimpleDispatchInfo::FreeOperational]
#[weight = SimpleDispatchInfo::FixedNormal(5_000)]
fn set_invulnerables(origin, validators: Vec<T::AccountId>) {
ensure_root(origin)?;
<Invulnerables<T>>::put(validators);
}
/// Force a current staker to become completely unstaked, immediately.
#[weight = SimpleDispatchInfo::FreeOperational]
#[weight = SimpleDispatchInfo::FixedNormal(10_000)]
fn force_unstake(origin, stash: T::AccountId) {
ensure_root(origin)?;
@@ -1204,7 +1204,7 @@ decl_module! {
/// # <weight>
/// - One storage write
/// # </weight>
#[weight = SimpleDispatchInfo::FreeOperational]
#[weight = SimpleDispatchInfo::FixedNormal(5_000)]
fn force_new_era_always(origin) {
ensure_root(origin)?;
ForceEra::put(Forcing::ForceAlways);
@@ -1217,7 +1217,7 @@ decl_module! {
/// # <weight>
/// - One storage write.
/// # </weight>
#[weight = SimpleDispatchInfo::FreeOperational]
#[weight = SimpleDispatchInfo::FixedNormal(1_000_000)]
fn cancel_deferred_slash(origin, era: EraIndex, slash_indices: Vec<u32>) {
T::SlashCancelOrigin::try_origin(origin)
.map(|_| ())