Assign DB weights for node runtime (#5703)

This commit is contained in:
Nikolay Volf
2020-04-23 12:51:52 +03:00
committed by GitHub
parent e84b06a8c0
commit ff9c88d21c
4 changed files with 18 additions and 8 deletions
+6 -2
View File
@@ -23,7 +23,7 @@
use sp_std::prelude::*;
use frame_support::{
construct_runtime, parameter_types, debug,
weights::Weight,
weights::{Weight, RuntimeDbWeight},
traits::{Currency, Randomness, OnUnbalanced, Imbalance},
};
use sp_core::u32_trait::{_1, _2, _3, _4};
@@ -123,6 +123,10 @@ parameter_types! {
pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
pub const Version: RuntimeVersion = VERSION;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const DbWeight: RuntimeDbWeight = RuntimeDbWeight {
read: 60_000_000, // ~0.06 ms = ~60 µs
write: 200_000_000, // ~0.2 ms = 200 µs
};
}
impl frame_system::Trait for Runtime {
@@ -138,7 +142,7 @@ impl frame_system::Trait for Runtime {
type Event = Event;
type BlockHashCount = BlockHashCount;
type MaximumBlockWeight = MaximumBlockWeight;
type DbWeight = ();
type DbWeight = DbWeight;
type MaximumBlockLength = MaximumBlockLength;
type AvailableBlockRatio = AvailableBlockRatio;
type Version = Version;