Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d0540a7
Introduce sensible weight constants (#12868)
KiChjang Dec 8, 2022
02a9dea
Checkout to the branch HEAD explicitly in `build-linux-substrate` (#1…
rcny Dec 8, 2022
9a0644c
cli: Improve pruning documentation (#12819)
lexnv Dec 8, 2022
e6bbc53
Revert "Move LockableCurrency trait to fungibles::Lockable and deprec…
tonyalaribe Dec 9, 2022
90ab4fa
Don't indefinitely block on shutting down Tokio (#12885)
bkchr Dec 9, 2022
47bd959
General Message Queue Pallet (#12485)
gavofyork Dec 9, 2022
f0b6e79
zombienet timings adjusted (#12890)
michalkucharczyk Dec 9, 2022
9931220
Move import queue out of `sc-network` (#12764)
altonen Dec 9, 2022
15cfd9c
Trace response payload in default `jsonrpsee` middleware (#12886)
tgmichel Dec 9, 2022
33e6029
Ensure that we inform all tasks to stop before starting the 60 second…
bkchr Dec 10, 2022
2f0d59d
Safe desired targets call (#12826)
Ank4n Dec 10, 2022
0ba5206
Fix typo (#12900)
ltfschoen Dec 11, 2022
9772209
ValidateUnsigned: Improve docs. (#12870)
bkchr Dec 11, 2022
06090ab
rpc server with HTTP/WS on the same socket (#12663)
niklasad1 Dec 12, 2022
e5d5d88
`pallet-message-queue`: Fix license (#12895)
ggwpez Dec 12, 2022
b3d9f3c
Use explicit call indices (#12891)
ggwpez Dec 12, 2022
f3c95e6
Pin canonincalized block (#12902)
arkpar Dec 12, 2022
d4837cb
Remove implicit approval chilling upon slash. (#12420)
kianenigma Dec 12, 2022
2a0eeff
bounties calls docs fix (#12909)
muharem Dec 12, 2022
01efa85
pallet-contracts migration pre-upgrade fix for v8 (#12905)
Dinonard Dec 13, 2022
13664c3
use custom environment for publishing crates (#12912)
joao-paulo-parity Dec 13, 2022
93fa104
[contracts] Add debug buffer limit + enforcement (#12845)
agryaznov Dec 13, 2022
c4fbb12
Merge remote-tracking branch 'origin/master' into HEAD
lexnv Dec 13, 2022
dfd9af0
frame/remote-externalities: Fix clippy
lexnv Dec 13, 2022
1f40715
frame/rpc: Add previous export
lexnv Dec 13, 2022
89498c0
Fixup some wrong dependencies (#12899)
bkchr Dec 13, 2022
b65c9f0
add numerator and denominator to Rational128 Debug impl and increase …
apopiak Dec 14, 2022
59b5903
Fix state-db pinning (#12927)
arkpar Dec 14, 2022
2e21c35
[ci] add job switcher (#12922)
alvicsam Dec 14, 2022
4de625c
Merge remote-tracking branch 'origin/master' into lexnv/kiz-revamp-tr…
lexnv Dec 14, 2022
2f6105b
Use LOG_TARGET in consensus related crates (#12875)
davxy Dec 14, 2022
5efd759
Merge branch 'master' of github.com:paritytech/substrate into lexnv/k…
kianenigma Dec 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Introduce sensible weight constants (#12868)
* Introduce sensible weight constants

* cargo fmt

* Remove unused import

* Add missing import

* ".git/.scripts/bench-bot.sh" pallet dev pallet_lottery

Co-authored-by: command-bot <>
  • Loading branch information
KiChjang authored Dec 8, 2022
commit d0540a79967cb06cd7598a4965c7c06afc788b0c
6 changes: 4 additions & 2 deletions bin/node-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ pub use frame_support::{
ConstU128, ConstU32, ConstU64, ConstU8, KeyOwnerProofSystem, Randomness, StorageInfo,
},
weights::{
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
constants::{
BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND,
},
IdentityFee, Weight,
},
StorageValue,
Expand Down Expand Up @@ -141,7 +143,7 @@ parameter_types! {
/// We allow for 2 seconds of compute with a 6 second average block time.
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::with_sensible_defaults(
(2u64 * WEIGHT_PER_SECOND).set_proof_size(u64::MAX),
Weight::from_parts(2u64 * WEIGHT_REF_TIME_PER_SECOND, u64::MAX),
NORMAL_DISPATCH_RATIO,
);
pub BlockLength: frame_system::limits::BlockLength = frame_system::limits::BlockLength
Expand Down
7 changes: 5 additions & 2 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ use frame_support::{
WithdrawReasons,
},
weights::{
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
constants::{
BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND,
},
ConstantMultiplier, IdentityFee, Weight,
},
PalletId, RuntimeDebug,
Expand Down Expand Up @@ -173,7 +175,8 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);
/// by Operational extrinsics.
const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
/// We allow for 2 seconds of compute with a 6 second average block time, with maximum proof size.
const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_mul(2).set_proof_size(u64::MAX);
const MAXIMUM_BLOCK_WEIGHT: Weight =
Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), u64::MAX);

parameter_types! {
pub const BlockHashCount: BlockNumber = 2400;
Expand Down
4 changes: 2 additions & 2 deletions docs/Upgrading-2.0-to-3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ And update the overall definition for weights on frame and a few related types a
+/// by Operational extrinsics.
+const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
+/// We allow for 2 seconds of compute with a 6 second average block time.
+const MAXIMUM_BLOCK_WEIGHT: Weight = 2u64 * WEIGHT_PER_SECOND;
+const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(2u64 * WEIGHT_REF_TIME_PER_SECOND, u64::MAX);
+
parameter_types! {
pub const BlockHashCount: BlockNumber = 2400;
- /// We allow for 2 seconds of compute with a 6 second average block time.
- pub const MaximumBlockWeight: Weight = 2u64 * WEIGHT_PER_SECOND;
- pub const MaximumBlockWeight: Weight = Weight::from_parts(2u64 * WEIGHT_REF_TIME_PER_SECOND, u64::MAX);
- pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
- /// Assume 10% of weight for average on_initialize calls.
- pub MaximumExtrinsicWeight: Weight =
Expand Down
21 changes: 12 additions & 9 deletions frame/babe/src/default_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! This file was not auto-generated.

use frame_support::weights::{
constants::{RocksDbWeight as DbWeight, WEIGHT_PER_MICROS, WEIGHT_PER_NANOS},
constants::{RocksDbWeight as DbWeight, WEIGHT_REF_TIME_PER_MICROS, WEIGHT_REF_TIME_PER_NANOS},
Weight,
};

Expand All @@ -38,17 +38,20 @@ impl crate::WeightInfo for () {
const MAX_NOMINATORS: u64 = 200;

// checking membership proof
let ref_time_weight = (35u64 * WEIGHT_PER_MICROS)
.saturating_add((175u64 * WEIGHT_PER_NANOS).saturating_mul(validator_count))
Weight::from_ref_time(35u64 * WEIGHT_REF_TIME_PER_MICROS)
.saturating_add(
Weight::from_ref_time(175u64 * WEIGHT_REF_TIME_PER_NANOS)
.saturating_mul(validator_count),
)
.saturating_add(DbWeight::get().reads(5))
// check equivocation proof
.saturating_add(110u64 * WEIGHT_PER_MICROS)
.saturating_add(Weight::from_ref_time(110u64 * WEIGHT_REF_TIME_PER_MICROS))
// report offence
.saturating_add(110u64 * WEIGHT_PER_MICROS)
.saturating_add(25u64 * WEIGHT_PER_MICROS * MAX_NOMINATORS)
.saturating_add(Weight::from_ref_time(110u64 * WEIGHT_REF_TIME_PER_MICROS))
.saturating_add(Weight::from_ref_time(
25u64 * WEIGHT_REF_TIME_PER_MICROS * MAX_NOMINATORS,
))
.saturating_add(DbWeight::get().reads(14 + 3 * MAX_NOMINATORS))
.saturating_add(DbWeight::get().writes(10 + 3 * MAX_NOMINATORS));

ref_time_weight
.saturating_add(DbWeight::get().writes(10 + 3 * MAX_NOMINATORS))
}
}
4 changes: 2 additions & 2 deletions frame/contracts/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use frame_support::{
fungibles::Lockable, BalanceStatus, ConstU32, ConstU64, Contains, Currency, Get, OnIdle,
OnInitialize, ReservableCurrency, WithdrawReasons,
},
weights::{constants::WEIGHT_PER_SECOND, Weight},
weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight},
};
use frame_system::{self as system, EventRecord, Phase};
use pretty_assertions::{assert_eq, assert_ne};
Expand Down Expand Up @@ -285,7 +285,7 @@ impl RegisteredChainExtension<Test> for TempStorageExtension {
parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(
(2u64 * WEIGHT_PER_SECOND).set_proof_size(u64::MAX),
Weight::from_parts(2u64 * WEIGHT_REF_TIME_PER_SECOND, u64::MAX),
);
pub static ExistentialDeposit: u64 = 1;
}
Expand Down
4 changes: 3 additions & 1 deletion frame/democracy/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ impl Contains<RuntimeCall> for BaseFilter {

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::constants::WEIGHT_PER_SECOND.set_proof_size(u64::MAX));
frame_system::limits::BlockWeights::simple_max(
Weight::from_parts(frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND, u64::MAX),
);
}
impl frame_system::Config for Test {
type BaseCallFilter = BaseFilter;
Expand Down
2 changes: 1 addition & 1 deletion frame/election-provider-multi-phase/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ parameter_types! {
pub const ExistentialDeposit: u64 = 1;
pub BlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights
::with_sensible_defaults(
Weight::from_parts(2u64 * constants::WEIGHT_PER_SECOND.ref_time(), u64::MAX),
Weight::from_parts(2u64 * constants::WEIGHT_REF_TIME_PER_SECOND, u64::MAX),
NORMAL_DISPATCH_RATIO,
);
}
Expand Down
4 changes: 2 additions & 2 deletions frame/fast-unstake/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use frame_support::{
pallet_prelude::*,
parameter_types,
traits::{ConstU64, Currency},
weights::constants::WEIGHT_PER_SECOND,
weights::constants::WEIGHT_REF_TIME_PER_SECOND,
};
use sp_runtime::traits::{Convert, IdentityLookup};

Expand All @@ -37,7 +37,7 @@ pub type T = Runtime;
parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(
(2u64 * WEIGHT_PER_SECOND).set_proof_size(u64::MAX),
Weight::from_parts(2u64 * WEIGHT_REF_TIME_PER_SECOND, u64::MAX),
);
}

Expand Down
20 changes: 13 additions & 7 deletions frame/grandpa/src/default_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! This file was not auto-generated.

use frame_support::weights::{
constants::{RocksDbWeight as DbWeight, WEIGHT_PER_MICROS, WEIGHT_PER_NANOS},
constants::{RocksDbWeight as DbWeight, WEIGHT_REF_TIME_PER_MICROS, WEIGHT_REF_TIME_PER_NANOS},
Weight,
};

Expand All @@ -34,21 +34,27 @@ impl crate::WeightInfo for () {
const MAX_NOMINATORS: u64 = 200;

// checking membership proof
(35u64 * WEIGHT_PER_MICROS)
.saturating_add((175u64 * WEIGHT_PER_NANOS).saturating_mul(validator_count))
Weight::from_ref_time(35u64 * WEIGHT_REF_TIME_PER_MICROS)
.saturating_add(
Weight::from_ref_time(175u64 * WEIGHT_REF_TIME_PER_NANOS)
.saturating_mul(validator_count),
)
.saturating_add(DbWeight::get().reads(5))
// check equivocation proof
.saturating_add(95u64 * WEIGHT_PER_MICROS)
.saturating_add(Weight::from_ref_time(95u64 * WEIGHT_REF_TIME_PER_MICROS))
// report offence
.saturating_add(110u64 * WEIGHT_PER_MICROS)
.saturating_add(25u64 * WEIGHT_PER_MICROS * MAX_NOMINATORS)
.saturating_add(Weight::from_ref_time(110u64 * WEIGHT_REF_TIME_PER_MICROS))
.saturating_add(Weight::from_ref_time(
25u64 * WEIGHT_REF_TIME_PER_MICROS * MAX_NOMINATORS,
))
.saturating_add(DbWeight::get().reads(14 + 3 * MAX_NOMINATORS))
.saturating_add(DbWeight::get().writes(10 + 3 * MAX_NOMINATORS))
// fetching set id -> session index mappings
.saturating_add(DbWeight::get().reads(2))
}

fn note_stalled() -> Weight {
(3u64 * WEIGHT_PER_MICROS).saturating_add(DbWeight::get().writes(1))
Weight::from_ref_time(3u64 * WEIGHT_REF_TIME_PER_MICROS)
.saturating_add(DbWeight::get().writes(1))
}
}
58 changes: 29 additions & 29 deletions frame/lottery/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! Autogenerated weights for pallet_lottery
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-11-18, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2022-12-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024

Expand Down Expand Up @@ -67,33 +67,33 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: System Account (r:1 w:1)
// Storage: Lottery Tickets (r:0 w:1)
fn buy_ticket() -> Weight {
// Minimum execution time: 53_735 nanoseconds.
Weight::from_ref_time(54_235_000)
// Minimum execution time: 52_479 nanoseconds.
Weight::from_ref_time(53_225_000)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(4))
}
// Storage: Lottery CallIndices (r:0 w:1)
/// The range of component `n` is `[0, 10]`.
fn set_calls(n: u32, ) -> Weight {
// Minimum execution time: 15_065 nanoseconds.
Weight::from_ref_time(16_467_398)
// Standard Error: 5_392
.saturating_add(Weight::from_ref_time(294_914).saturating_mul(n.into()))
// Minimum execution time: 14_433 nanoseconds.
Weight::from_ref_time(15_660_780)
// Standard Error: 5_894
.saturating_add(Weight::from_ref_time(290_482).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().writes(1))
}
// Storage: Lottery Lottery (r:1 w:1)
// Storage: Lottery LotteryIndex (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn start_lottery() -> Weight {
// Minimum execution time: 45_990 nanoseconds.
Weight::from_ref_time(46_789_000)
// Minimum execution time: 43_683 nanoseconds.
Weight::from_ref_time(44_580_000)
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
// Storage: Lottery Lottery (r:1 w:1)
fn stop_repeat() -> Weight {
// Minimum execution time: 10_783 nanoseconds.
Weight::from_ref_time(11_180_000)
// Minimum execution time: 10_514 nanoseconds.
Weight::from_ref_time(10_821_000)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand All @@ -103,8 +103,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Lottery TicketsCount (r:1 w:1)
// Storage: Lottery Tickets (r:1 w:0)
fn on_initialize_end() -> Weight {
// Minimum execution time: 62_088 nanoseconds.
Weight::from_ref_time(63_670_000)
// Minimum execution time: 60_254 nanoseconds.
Weight::from_ref_time(61_924_000)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(4))
}
Expand All @@ -115,8 +115,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Lottery Tickets (r:1 w:0)
// Storage: Lottery LotteryIndex (r:1 w:1)
fn on_initialize_repeat() -> Weight {
// Minimum execution time: 64_953 nanoseconds.
Weight::from_ref_time(65_465_000)
// Minimum execution time: 61_552 nanoseconds.
Weight::from_ref_time(62_152_000)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(5))
}
Expand All @@ -132,33 +132,33 @@ impl WeightInfo for () {
// Storage: System Account (r:1 w:1)
// Storage: Lottery Tickets (r:0 w:1)
fn buy_ticket() -> Weight {
// Minimum execution time: 53_735 nanoseconds.
Weight::from_ref_time(54_235_000)
// Minimum execution time: 52_479 nanoseconds.
Weight::from_ref_time(53_225_000)
.saturating_add(RocksDbWeight::get().reads(6))
.saturating_add(RocksDbWeight::get().writes(4))
}
// Storage: Lottery CallIndices (r:0 w:1)
/// The range of component `n` is `[0, 10]`.
fn set_calls(n: u32, ) -> Weight {
// Minimum execution time: 15_065 nanoseconds.
Weight::from_ref_time(16_467_398)
// Standard Error: 5_392
.saturating_add(Weight::from_ref_time(294_914).saturating_mul(n.into()))
// Minimum execution time: 14_433 nanoseconds.
Weight::from_ref_time(15_660_780)
// Standard Error: 5_894
.saturating_add(Weight::from_ref_time(290_482).saturating_mul(n.into()))
.saturating_add(RocksDbWeight::get().writes(1))
}
// Storage: Lottery Lottery (r:1 w:1)
// Storage: Lottery LotteryIndex (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn start_lottery() -> Weight {
// Minimum execution time: 45_990 nanoseconds.
Weight::from_ref_time(46_789_000)
// Minimum execution time: 43_683 nanoseconds.
Weight::from_ref_time(44_580_000)
.saturating_add(RocksDbWeight::get().reads(3))
.saturating_add(RocksDbWeight::get().writes(3))
}
// Storage: Lottery Lottery (r:1 w:1)
fn stop_repeat() -> Weight {
// Minimum execution time: 10_783 nanoseconds.
Weight::from_ref_time(11_180_000)
// Minimum execution time: 10_514 nanoseconds.
Weight::from_ref_time(10_821_000)
.saturating_add(RocksDbWeight::get().reads(1))
.saturating_add(RocksDbWeight::get().writes(1))
}
Expand All @@ -168,8 +168,8 @@ impl WeightInfo for () {
// Storage: Lottery TicketsCount (r:1 w:1)
// Storage: Lottery Tickets (r:1 w:0)
fn on_initialize_end() -> Weight {
// Minimum execution time: 62_088 nanoseconds.
Weight::from_ref_time(63_670_000)
// Minimum execution time: 60_254 nanoseconds.
Weight::from_ref_time(61_924_000)
.saturating_add(RocksDbWeight::get().reads(6))
.saturating_add(RocksDbWeight::get().writes(4))
}
Expand All @@ -180,8 +180,8 @@ impl WeightInfo for () {
// Storage: Lottery Tickets (r:1 w:0)
// Storage: Lottery LotteryIndex (r:1 w:1)
fn on_initialize_repeat() -> Weight {
// Minimum execution time: 64_953 nanoseconds.
Weight::from_ref_time(65_465_000)
// Minimum execution time: 61_552 nanoseconds.
Weight::from_ref_time(62_152_000)
.saturating_add(RocksDbWeight::get().reads(7))
.saturating_add(RocksDbWeight::get().writes(5))
}
Expand Down
4 changes: 2 additions & 2 deletions frame/merkle-mountain-range/src/default_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! This file was not auto-generated.

use frame_support::weights::{
constants::{RocksDbWeight as DbWeight, WEIGHT_PER_NANOS},
constants::{RocksDbWeight as DbWeight, WEIGHT_REF_TIME_PER_NANOS},
Weight,
};

Expand All @@ -28,7 +28,7 @@ impl crate::WeightInfo for () {
// Reading the parent hash.
let leaf_weight = DbWeight::get().reads(1);
// Blake2 hash cost.
let hash_weight = 2u64 * WEIGHT_PER_NANOS;
let hash_weight = Weight::from_ref_time(2u64 * WEIGHT_REF_TIME_PER_NANOS);
// No-op hook.
let hook_weight = Weight::zero();

Expand Down
4 changes: 2 additions & 2 deletions frame/offences/benchmarking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use frame_election_provider_support::{onchain, SequentialPhragmen};
use frame_support::{
parameter_types,
traits::{ConstU32, ConstU64},
weights::constants::WEIGHT_PER_SECOND,
weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight},
};
use frame_system as system;
use pallet_session::historical as pallet_session_historical;
Expand All @@ -41,7 +41,7 @@ type Balance = u64;
parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(
2u64 * WEIGHT_PER_SECOND
Weight::from_parts(2u64 * WEIGHT_REF_TIME_PER_SECOND, u64::MAX)
);
}

Expand Down
6 changes: 4 additions & 2 deletions frame/offences/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use frame_support::{
parameter_types,
traits::{ConstU32, ConstU64},
weights::{
constants::{RocksDbWeight, WEIGHT_PER_SECOND},
constants::{RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND},
Weight,
},
};
Expand Down Expand Up @@ -85,7 +85,9 @@ frame_support::construct_runtime!(

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(2u64 * WEIGHT_PER_SECOND);
frame_system::limits::BlockWeights::simple_max(
Weight::from_parts(2u64 * WEIGHT_REF_TIME_PER_SECOND, u64::MAX),
);
}
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
Expand Down
2 changes: 1 addition & 1 deletion frame/staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl FindAuthor<AccountId> for Author11 {
parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(
frame_support::weights::constants::WEIGHT_PER_SECOND * 2
Weight::from_parts(frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND * 2, u64::MAX),
);
pub static SessionsPerEra: SessionIndex = 3;
pub static ExistentialDeposit: Balance = 1;
Expand Down
Loading