From 3252ba83837c493f2f2ea605fffa8cb4e2a92419 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Sat, 25 Apr 2020 16:47:26 +0300 Subject: [PATCH] assign db weights (#1011) --- polkadot/runtime/kusama/src/lib.rs | 10 +++++++++- polkadot/runtime/polkadot/src/lib.rs | 10 +++++++++- polkadot/runtime/westend/src/lib.rs | 12 ++++++++++-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/polkadot/runtime/kusama/src/lib.rs b/polkadot/runtime/kusama/src/lib.rs index d5b118824e..bb62b50299 100644 --- a/polkadot/runtime/kusama/src/lib.rs +++ b/polkadot/runtime/kusama/src/lib.rs @@ -55,6 +55,7 @@ use sp_staking::SessionIndex; use frame_support::{ parameter_types, construct_runtime, debug, traits::{KeyOwnerProofSystem, SplitTwoWays, Randomness, LockIdentifier}, + weights::RuntimeDbWeight, }; use im_online::sr25519::AuthorityId as ImOnlineId; use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; @@ -131,6 +132,13 @@ parameter_types! { pub const Version: RuntimeVersion = VERSION; } +parameter_types! { + pub const DbWeight: RuntimeDbWeight = RuntimeDbWeight { + read: 60_000_000, + write: 200_000_000, + }; +} + impl system::Trait for Runtime { type Origin = Origin; type Call = Call; @@ -144,7 +152,7 @@ impl system::Trait for Runtime { type Event = Event; type BlockHashCount = BlockHashCount; type MaximumBlockWeight = MaximumBlockWeight; - type DbWeight = (); + type DbWeight = DbWeight; type BlockExecutionWeight = BlockExecutionWeight; type ExtrinsicBaseWeight = ExtrinsicBaseWeight; type MaximumBlockLength = MaximumBlockLength; diff --git a/polkadot/runtime/polkadot/src/lib.rs b/polkadot/runtime/polkadot/src/lib.rs index 8cfdebf1e9..4765809975 100644 --- a/polkadot/runtime/polkadot/src/lib.rs +++ b/polkadot/runtime/polkadot/src/lib.rs @@ -57,6 +57,7 @@ use sp_staking::SessionIndex; use frame_support::{ parameter_types, construct_runtime, debug, traits::{KeyOwnerProofSystem, SplitTwoWays, Randomness, LockIdentifier}, + weights::RuntimeDbWeight, }; use im_online::sr25519::AuthorityId as ImOnlineId; use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; @@ -137,6 +138,13 @@ parameter_types! { pub const Version: RuntimeVersion = VERSION; } +parameter_types! { + pub const DbWeight: RuntimeDbWeight = RuntimeDbWeight { + read: 60_000_000, + write: 200_000_000, + }; +} + impl system::Trait for Runtime { type Origin = Origin; type Call = Call; @@ -150,7 +158,7 @@ impl system::Trait for Runtime { type Event = Event; type BlockHashCount = BlockHashCount; type MaximumBlockWeight = MaximumBlockWeight; - type DbWeight = (); + type DbWeight = DbWeight; type BlockExecutionWeight = BlockExecutionWeight; type ExtrinsicBaseWeight = ExtrinsicBaseWeight; type MaximumBlockLength = MaximumBlockLength; diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index 92ca41fed5..62680bb7b4 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -55,6 +55,7 @@ use sp_staking::SessionIndex; use frame_support::{ parameter_types, construct_runtime, debug, traits::{KeyOwnerProofSystem, Randomness}, + weights::RuntimeDbWeight, }; use im_online::sr25519::AuthorityId as ImOnlineId; use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; @@ -131,6 +132,13 @@ parameter_types! { pub const Version: RuntimeVersion = VERSION; } +parameter_types! { + pub const DbWeight: RuntimeDbWeight = RuntimeDbWeight { + read: 60_000_000, + write: 200_000_000, + }; +} + impl system::Trait for Runtime { type Origin = Origin; type Call = Call; @@ -144,8 +152,8 @@ impl system::Trait for Runtime { type Event = Event; type BlockHashCount = BlockHashCount; type MaximumBlockWeight = MaximumBlockWeight; - type DbWeight = (); - type BlockExecutionWeight = BlockExecutionWeight; + type DbWeight = DbWeight; + type BlockExecutionWeight = BlockExecutionWeight; type ExtrinsicBaseWeight = ExtrinsicBaseWeight; type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio;