Skip to content

Commit

Permalink
Change RocksDbWeight to ParityDbWeight everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Feb 26, 2024
1 parent 1549b4e commit c734119
Show file tree
Hide file tree
Showing 13 changed files with 103 additions and 102 deletions.
4 changes: 2 additions & 2 deletions crates/pallet-domains/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use domain_runtime_primitives::opaque::Header as DomainHeader;
use domain_runtime_primitives::BlockNumber as DomainBlockNumber;
use frame_support::dispatch::{DispatchInfo, RawOrigin};
use frame_support::traits::{ConstU16, ConstU32, ConstU64, Currency, Hooks, VariantCount};
use frame_support::weights::constants::RocksDbWeight;
use frame_support::weights::constants::ParityDbWeight;
use frame_support::weights::{IdentityFee, Weight};
use frame_support::{assert_err, assert_ok, parameter_types, PalletId};
use frame_system::mocking::MockUncheckedExtrinsic;
Expand Down Expand Up @@ -80,7 +80,7 @@ impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = RocksDbWeight;
type DbWeight = ParityDbWeight;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeTask = RuntimeTask;
Expand Down
46 changes: 23 additions & 23 deletions crates/pallet-domains/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use frame_support::{traits::Get, weights::{Weight, constants::ParityDbWeight}};
use core::marker::PhantomData;

/// Weight functions needed for pallet_domains.
Expand Down Expand Up @@ -316,8 +316,8 @@ impl WeightInfo for () {
// Estimated: `12367`
// Minimum execution time: 102_000_000 picoseconds.
Weight::from_parts(118_000_000, 12367)
.saturating_add(RocksDbWeight::get().reads(10_u64))
.saturating_add(RocksDbWeight::get().writes(12_u64))
.saturating_add(ParityDbWeight::get().reads(10_u64))
.saturating_add(ParityDbWeight::get().writes(12_u64))
}
/// Storage: Domains DomainStakingSummary (r:1 w:1)
/// Proof Skipped: Domains DomainStakingSummary (max_values: None, max_size: None, mode: Measured)
Expand Down Expand Up @@ -353,8 +353,8 @@ impl WeightInfo for () {
// Estimated: `523490`
// Minimum execution time: 12_571_000_000 picoseconds.
Weight::from_parts(12_688_000_000, 523490)
.saturating_add(RocksDbWeight::get().reads(409_u64))
.saturating_add(RocksDbWeight::get().writes(406_u64))
.saturating_add(ParityDbWeight::get().reads(409_u64))
.saturating_add(ParityDbWeight::get().writes(406_u64))
}
/// Storage: Domains NextRuntimeId (r:1 w:1)
/// Proof Skipped: Domains NextRuntimeId (max_values: Some(1), max_size: None, mode: Measured)
Expand All @@ -366,8 +366,8 @@ impl WeightInfo for () {
// Estimated: `1528`
// Minimum execution time: 14_372_000_000 picoseconds.
Weight::from_parts(14_986_000_000, 1528)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
.saturating_add(ParityDbWeight::get().reads(1_u64))
.saturating_add(ParityDbWeight::get().writes(2_u64))
}
/// Storage: Domains RuntimeRegistry (r:1 w:0)
/// Proof Skipped: Domains RuntimeRegistry (max_values: None, max_size: None, mode: Measured)
Expand All @@ -379,8 +379,8 @@ impl WeightInfo for () {
// Estimated: `442147`
// Minimum execution time: 25_485_000_000 picoseconds.
Weight::from_parts(26_355_000_000, 442147)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
.saturating_add(ParityDbWeight::get().reads(1_u64))
.saturating_add(ParityDbWeight::get().writes(1_u64))
}
/// Storage: Domains RuntimeRegistry (r:1 w:0)
/// Proof Skipped: Domains RuntimeRegistry (max_values: None, max_size: None, mode: Measured)
Expand Down Expand Up @@ -408,8 +408,8 @@ impl WeightInfo for () {
// Estimated: `442304`
// Minimum execution time: 228_000_000 picoseconds.
Weight::from_parts(247_000_000, 442304)
.saturating_add(RocksDbWeight::get().reads(7_u64))
.saturating_add(RocksDbWeight::get().writes(8_u64))
.saturating_add(ParityDbWeight::get().reads(7_u64))
.saturating_add(ParityDbWeight::get().writes(8_u64))
}
/// Storage: Domains PendingStakingOperationCount (r:1 w:1)
/// Proof Skipped: Domains PendingStakingOperationCount (max_values: None, max_size: None, mode: Measured)
Expand All @@ -433,8 +433,8 @@ impl WeightInfo for () {
// Estimated: `6215`
// Minimum execution time: 66_000_000 picoseconds.
Weight::from_parts(70_000_000, 6215)
.saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().writes(8_u64))
.saturating_add(ParityDbWeight::get().reads(5_u64))
.saturating_add(ParityDbWeight::get().writes(8_u64))
}
/// Storage: Domains Operators (r:1 w:0)
/// Proof Skipped: Domains Operators (max_values: None, max_size: None, mode: Measured)
Expand All @@ -456,8 +456,8 @@ impl WeightInfo for () {
// Estimated: `6215`
// Minimum execution time: 65_000_000 picoseconds.
Weight::from_parts(69_000_000, 6215)
.saturating_add(RocksDbWeight::get().reads(7_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
.saturating_add(ParityDbWeight::get().reads(7_u64))
.saturating_add(ParityDbWeight::get().writes(4_u64))
}
/// Storage: Domains OperatorIdOwner (r:1 w:0)
/// Proof Skipped: Domains OperatorIdOwner (max_values: None, max_size: None, mode: Measured)
Expand All @@ -475,8 +475,8 @@ impl WeightInfo for () {
// Estimated: `6517`
// Minimum execution time: 35_000_000 picoseconds.
Weight::from_parts(38_000_000, 6517)
.saturating_add(RocksDbWeight::get().reads(6_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
.saturating_add(ParityDbWeight::get().reads(6_u64))
.saturating_add(ParityDbWeight::get().writes(4_u64))
}
/// Storage: Domains OperatorIdOwner (r:1 w:0)
/// Proof Skipped: Domains OperatorIdOwner (max_values: None, max_size: None, mode: Measured)
Expand All @@ -494,8 +494,8 @@ impl WeightInfo for () {
// Estimated: `4008`
// Minimum execution time: 30_000_000 picoseconds.
Weight::from_parts(33_000_000, 4008)
.saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
.saturating_add(ParityDbWeight::get().reads(5_u64))
.saturating_add(ParityDbWeight::get().writes(4_u64))
}
/// Storage: Domains PendingDeposits (r:1 w:0)
/// Proof Skipped: Domains PendingDeposits (max_values: None, max_size: None, mode: Measured)
Expand All @@ -517,8 +517,8 @@ impl WeightInfo for () {
// Estimated: `4253`
// Minimum execution time: 36_000_000 picoseconds.
Weight::from_parts(38_000_000, 4253)
.saturating_add(RocksDbWeight::get().reads(7_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64))
.saturating_add(ParityDbWeight::get().reads(7_u64))
.saturating_add(ParityDbWeight::get().writes(3_u64))
}
/// Storage: Domains Nominators (r:1 w:0)
/// Proof Skipped: Domains Nominators (max_values: None, max_size: None, mode: Measured)
Expand All @@ -534,7 +534,7 @@ impl WeightInfo for () {
// Estimated: `3979`
// Minimum execution time: 24_000_000 picoseconds.
Weight::from_parts(26_000_000, 3979)
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
.saturating_add(ParityDbWeight::get().reads(3_u64))
.saturating_add(ParityDbWeight::get().writes(2_u64))
}
}
4 changes: 2 additions & 2 deletions crates/pallet-offences-subspace/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate as pallet_offences_subspace;
use crate::Config;
use codec::Encode;
use frame_support::traits::{ConstU32, ConstU64};
use frame_support::weights::constants::RocksDbWeight;
use frame_support::weights::constants::ParityDbWeight;
use frame_support::weights::Weight;
use sp_consensus_subspace::offence::{self, Kind, OffenceDetails};
use sp_consensus_subspace::FarmerPublicKey;
Expand Down Expand Up @@ -63,7 +63,7 @@ impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = RocksDbWeight;
type DbWeight = ParityDbWeight;
type RuntimeOrigin = RuntimeOrigin;
type Nonce = u64;
type RuntimeCall = RuntimeCall;
Expand Down
10 changes: 5 additions & 5 deletions crates/pallet-runtime-configs/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use frame_support::{traits::Get, weights::{Weight, constants::ParityDbWeight}};
use core::marker::PhantomData;

/// Weight functions needed for pallet_runtime_configs.
Expand Down Expand Up @@ -90,7 +90,7 @@ impl WeightInfo for () {
// Estimated: `0`
// Minimum execution time: 5_640_000 picoseconds.
Weight::from_parts(5_782_000, 0)
.saturating_add(RocksDbWeight::get().writes(1_u64))
.saturating_add(ParityDbWeight::get().writes(1_u64))
}
/// Storage: `RuntimeConfigs::EnableDynamicCostOfStorage` (r:0 w:1)
/// Proof: `RuntimeConfigs::EnableDynamicCostOfStorage` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
Expand All @@ -100,7 +100,7 @@ impl WeightInfo for () {
// Estimated: `0`
// Minimum execution time: 5_726_000 picoseconds.
Weight::from_parts(5_890_000, 0)
.saturating_add(RocksDbWeight::get().writes(1_u64))
.saturating_add(ParityDbWeight::get().writes(1_u64))
}
/// Storage: `RuntimeConfigs::EnableBalanceTransfers` (r:0 w:1)
/// Proof: `RuntimeConfigs::EnableBalanceTransfers` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
Expand All @@ -110,7 +110,7 @@ impl WeightInfo for () {
// Estimated: `0`
// Minimum execution time: 5_726_000 picoseconds.
Weight::from_parts(5_890_000, 0)
.saturating_add(RocksDbWeight::get().writes(1_u64))
.saturating_add(ParityDbWeight::get().writes(1_u64))
}
/// Storage: `RuntimeConfigs::EnableNonRootCalls` (r:0 w:1)
/// Proof: `RuntimeConfigs::EnableNonRootCalls` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
Expand All @@ -120,6 +120,6 @@ impl WeightInfo for () {
// Estimated: `0`
// Minimum execution time: 5_726_000 picoseconds.
Weight::from_parts(5_890_000, 0)
.saturating_add(RocksDbWeight::get().writes(1_u64))
.saturating_add(ParityDbWeight::get().writes(1_u64))
}
}
28 changes: 14 additions & 14 deletions crates/pallet-subspace/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use frame_support::{traits::Get, weights::{Weight, constants::ParityDbWeight}};
use core::marker::PhantomData;

/// Weight functions needed for pallet_subspace.
Expand Down Expand Up @@ -151,8 +151,8 @@ impl WeightInfo for () {
// Estimated: `10563`
// Minimum execution time: 22_000_000 picoseconds.
Weight::from_parts(23_000_000, 10563)
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
.saturating_add(ParityDbWeight::get().reads(3_u64))
.saturating_add(ParityDbWeight::get().writes(4_u64))
}
/// Storage: Subspace SegmentCommitment (r:20 w:20)
/// Proof Skipped: Subspace SegmentCommitment (max_values: None, max_size: None, mode: Measured)
Expand All @@ -169,10 +169,10 @@ impl WeightInfo for () {
Weight::from_parts(20_123_871, 4060)
// Standard Error: 1_226_571
.saturating_add(Weight::from_parts(446_050_711, 0).saturating_mul(x.into()))
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(x.into())))
.saturating_add(RocksDbWeight::get().writes(2_u64))
.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(x.into())))
.saturating_add(ParityDbWeight::get().reads(2_u64))
.saturating_add(ParityDbWeight::get().reads((1_u64).saturating_mul(x.into())))
.saturating_add(ParityDbWeight::get().writes(2_u64))
.saturating_add(ParityDbWeight::get().writes((1_u64).saturating_mul(x.into())))
.saturating_add(Weight::from_parts(0, 2475).saturating_mul(x.into()))
}
/// Storage: Subspace ShouldAdjustSolutionRange (r:1 w:1)
Expand All @@ -189,8 +189,8 @@ impl WeightInfo for () {
// Estimated: `4647`
// Minimum execution time: 12_000_000 picoseconds.
Weight::from_parts(12_000_000, 4647)
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
.saturating_add(ParityDbWeight::get().reads(3_u64))
.saturating_add(ParityDbWeight::get().writes(4_u64))
}
/// Storage: Subspace BlockList (r:1 w:0)
/// Proof Skipped: Subspace BlockList (max_values: None, max_size: None, mode: Measured)
Expand All @@ -200,7 +200,7 @@ impl WeightInfo for () {
// Estimated: `3513`
// Minimum execution time: 1_288_000_000 picoseconds.
Weight::from_parts(1_297_000_000, 3513)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(ParityDbWeight::get().reads(1_u64))
}
/// Storage: Subspace EnableRewards (r:1 w:1)
/// Proof Skipped: Subspace EnableRewards (max_values: Some(1), max_size: None, mode: Measured)
Expand All @@ -210,8 +210,8 @@ impl WeightInfo for () {
// Estimated: `1533`
// Minimum execution time: 6_000_000 picoseconds.
Weight::from_parts(6_000_000, 1533)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
.saturating_add(ParityDbWeight::get().reads(1_u64))
.saturating_add(ParityDbWeight::get().writes(1_u64))
}
/// Storage: Subspace RootPlotPublicKey (r:1 w:0)
/// Proof Skipped: Subspace RootPlotPublicKey (max_values: Some(1), max_size: None, mode: Measured)
Expand All @@ -225,7 +225,7 @@ impl WeightInfo for () {
// Estimated: `3114`
// Minimum execution time: 7_000_000 picoseconds.
Weight::from_parts(7_000_000, 3114)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
.saturating_add(ParityDbWeight::get().reads(2_u64))
.saturating_add(ParityDbWeight::get().writes(2_u64))
}
}
4 changes: 2 additions & 2 deletions crates/subspace-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use frame_support::inherent::ProvideInherent;
use frame_support::traits::{
ConstU16, ConstU32, ConstU64, ConstU8, Currency, Everything, Get, VariantCount,
};
use frame_support::weights::constants::{RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND};
use frame_support::weights::constants::{ParityDbWeight, WEIGHT_REF_TIME_PER_SECOND};
use frame_support::weights::{ConstantMultiplier, IdentityFee, Weight};
use frame_support::{construct_runtime, parameter_types, PalletId};
use frame_system::limits::{BlockLength, BlockWeights};
Expand Down Expand Up @@ -283,7 +283,7 @@ impl frame_system::Config for Runtime {
/// Maximum number of block number to block hash mappings to keep (oldest pruned first).
type BlockHashCount = ConstU32<250>;
/// The weight of database operations that the runtime can invoke.
type DbWeight = RocksDbWeight;
type DbWeight = ParityDbWeight;
/// Version of the runtime.
type Version = Version;
/// Converts a module to the index of the module in `construct_runtime!`.
Expand Down
6 changes: 3 additions & 3 deletions domains/pallets/executive/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use frame_support::{traits::Get, weights::{Weight, constants::ParityDbWeight}};
use core::marker::PhantomData;

/// Weight functions needed for domain_pallet_executive.
Expand Down Expand Up @@ -65,7 +65,7 @@ impl WeightInfo for () {
// Estimated: `1485`
// Minimum execution time: 14_298_000_000 picoseconds.
Weight::from_parts(14_475_000_000, 1485)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
.saturating_add(ParityDbWeight::get().reads(1_u64))
.saturating_add(ParityDbWeight::get().writes(2_u64))
}
}
26 changes: 13 additions & 13 deletions domains/pallets/messenger/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use frame_support::{traits::Get, weights::{Weight, constants::ParityDbWeight}};
use core::marker::PhantomData;

/// Weight functions needed for pallet_messenger.
Expand Down Expand Up @@ -178,8 +178,8 @@ impl WeightInfo for () {
// Estimated: `15508`
// Minimum execution time: 34_000_000 picoseconds.
Weight::from_parts(34_000_000, 15508)
.saturating_add(RocksDbWeight::get().reads(6_u64))
.saturating_add(RocksDbWeight::get().writes(6_u64))
.saturating_add(ParityDbWeight::get().reads(6_u64))
.saturating_add(ParityDbWeight::get().writes(6_u64))
}
/// Storage: Messenger Channels (r:1 w:1)
/// Proof Skipped: Messenger Channels (max_values: None, max_size: None, mode: Measured)
Expand All @@ -199,8 +199,8 @@ impl WeightInfo for () {
// Estimated: `16809`
// Minimum execution time: 33_000_000 picoseconds.
Weight::from_parts(34_000_000, 16809)
.saturating_add(RocksDbWeight::get().reads(6_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64))
.saturating_add(ParityDbWeight::get().reads(6_u64))
.saturating_add(ParityDbWeight::get().writes(5_u64))
}
/// Storage: Messenger Channels (r:1 w:1)
/// Proof Skipped: Messenger Channels (max_values: None, max_size: None, mode: Measured)
Expand All @@ -210,8 +210,8 @@ impl WeightInfo for () {
// Estimated: `3779`
// Minimum execution time: 9_000_000 picoseconds.
Weight::from_parts(9_000_000, 3779)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
.saturating_add(ParityDbWeight::get().reads(1_u64))
.saturating_add(ParityDbWeight::get().writes(1_u64))
}
/// Storage: Messenger Channels (r:1 w:1)
/// Proof Skipped: Messenger Channels (max_values: None, max_size: None, mode: Measured)
Expand All @@ -221,8 +221,8 @@ impl WeightInfo for () {
// Estimated: `3779`
// Minimum execution time: 9_000_000 picoseconds.
Weight::from_parts(10_000_000, 3779)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
.saturating_add(ParityDbWeight::get().reads(1_u64))
.saturating_add(ParityDbWeight::get().writes(1_u64))
}
/// Storage: Messenger Inbox (r:1 w:1)
/// Proof Skipped: Messenger Inbox (max_values: Some(1), max_size: None, mode: Measured)
Expand All @@ -244,8 +244,8 @@ impl WeightInfo for () {
// Estimated: `19279`
// Minimum execution time: 31_000_000 picoseconds.
Weight::from_parts(31_000_000, 19279)
.saturating_add(RocksDbWeight::get().reads(7_u64))
.saturating_add(RocksDbWeight::get().writes(6_u64))
.saturating_add(ParityDbWeight::get().reads(7_u64))
.saturating_add(ParityDbWeight::get().writes(6_u64))
}
/// Storage: Messenger OutboxResponses (r:1 w:1)
/// Proof Skipped: Messenger OutboxResponses (max_values: Some(1), max_size: None, mode: Measured)
Expand All @@ -265,7 +265,7 @@ impl WeightInfo for () {
// Estimated: `17930`
// Minimum execution time: 28_000_000 picoseconds.
Weight::from_parts(29_000_000, 17930)
.saturating_add(RocksDbWeight::get().reads(6_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
.saturating_add(ParityDbWeight::get().reads(6_u64))
.saturating_add(ParityDbWeight::get().writes(4_u64))
}
}
Loading

0 comments on commit c734119

Please sign in to comment.