mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
Assign DB weights for node runtime (#5703)
This commit is contained in:
@@ -34,7 +34,7 @@ pub use sp_runtime::{Permill, Perbill};
|
||||
pub use frame_support::{
|
||||
StorageValue, construct_runtime, parameter_types,
|
||||
traits::Randomness,
|
||||
weights::Weight,
|
||||
weights::{Weight, RuntimeDbWeight},
|
||||
};
|
||||
|
||||
/// Importing a template pallet
|
||||
@@ -126,6 +126,12 @@ parameter_types! {
|
||||
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
|
||||
pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
|
||||
pub const Version: RuntimeVersion = VERSION;
|
||||
/// This probably should not be changed unless you have specific
|
||||
/// disk i/o conditions for the node.
|
||||
pub const DbWeight: RuntimeDbWeight = RuntimeDbWeight {
|
||||
read: 60_000_000, // ~0.06 ms = ~60 µs
|
||||
write: 200_000_000, // ~0.2 ms = 200 µs
|
||||
};
|
||||
}
|
||||
|
||||
impl system::Trait for Runtime {
|
||||
@@ -154,7 +160,7 @@ impl system::Trait for Runtime {
|
||||
/// Maximum weight of each block.
|
||||
type MaximumBlockWeight = MaximumBlockWeight;
|
||||
/// The weight of database operations that the runtime can invoke.
|
||||
type DbWeight = ();
|
||||
type DbWeight = DbWeight;
|
||||
/// Maximum size of all encoded transactions (in bytes) that are allowed in one block.
|
||||
type MaximumBlockLength = MaximumBlockLength;
|
||||
/// Portion of the block weight that is available to all normal transactions.
|
||||
|
||||
Reference in New Issue
Block a user