Skip to content

Commit

Permalink
add benchmarkings (those not failed), modify config to use default we…
Browse files Browse the repository at this point in the history
…ight
gianfra-t committed Sep 11, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
amanharwara Aman Harwara
1 parent e37f5b2 commit 79012a1
Showing 43 changed files with 8,797 additions and 3,977 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions runtime/amplitude/src/lib.rs
Original file line number Diff line number Diff line change
@@ -938,7 +938,7 @@ impl parachain_staking::Config for Runtime {
type NetworkRewardStart = NetworkRewardStart;
type NetworkRewardBeneficiary = Treasury;
type CollatorRewardRateDecay = CollatorRewardRateDecay;
type WeightInfo = weights::parachain_staking::SubstrateWeight<Runtime>;
type WeightInfo = ();

const BLOCKS_PER_YEAR: BlockNumber = BLOCKS_PER_YEAR;
}
@@ -1070,7 +1070,7 @@ impl dia_oracle::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type AuthorityId = dia_oracle::crypto::DiaAuthId;
type WeightInfo = weights::dia_oracle::SubstrateWeight<Runtime>;
type WeightInfo = ();
}

impl frame_system::offchain::SigningTypes for Runtime {
@@ -1219,7 +1219,7 @@ cfg_if::cfg_if! {

impl oracle::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::oracle::SubstrateWeight<Runtime>;
type WeightInfo = ();
type DecimalsLookup = DecimalsLookupImpl;
type DataProvider = DataProviderImpl;
#[cfg(feature = "runtime-benchmarks")]
@@ -1238,7 +1238,7 @@ impl stellar_relay::Config for Runtime {
type OrganizationLimit = OrganizationLimit;
type ValidatorLimit = ValidatorLimit;
type IsPublicNetwork = IsPublicNetwork;
type WeightInfo = weights::stellar_relay::SubstrateWeight<Runtime>;
type WeightInfo =();
}

parameter_types! {
@@ -1249,7 +1249,7 @@ parameter_types! {
}
impl fee::Config for Runtime {
type FeePalletId = FeePalletId;
type WeightInfo = weights::fee::SubstrateWeight<Runtime>;
type WeightInfo = ();
type SignedFixedPoint = SignedFixedPoint;
type SignedInner = SignedInner;
type UnsignedFixedPoint = UnsignedFixedPoint;
@@ -1265,13 +1265,13 @@ impl vault_registry::Config for Runtime {
type PalletId = VaultRegistryPalletId;
type RuntimeEvent = RuntimeEvent;
type Balance = Balance;
type WeightInfo = weights::vault_registry::SubstrateWeight<Runtime>;
type WeightInfo = ();
type GetGriefingCollateralCurrencyId = NativeCurrencyId;
}

impl redeem::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::redeem::SubstrateWeight<Runtime>;
type WeightInfo = ();
}

pub struct BlockNumberToBalance;
@@ -1285,17 +1285,17 @@ impl sp_runtime::traits::Convert<BlockNumber, Balance> for BlockNumberToBalance
impl issue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type BlockNumberToBalance = BlockNumberToBalance;
type WeightInfo = weights::issue::SubstrateWeight<Runtime>;
type WeightInfo = ();
}

impl nomination::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::nomination::SubstrateWeight<Runtime>;
type WeightInfo = ();
}

impl replace::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::replace::SubstrateWeight<Runtime>;
type WeightInfo = ();
}

impl clients_info::Config for Runtime {
@@ -1407,7 +1407,7 @@ impl pallet_proxy::Config for Runtime {

impl orml_currencies_allowance_extension::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::orml_currencies_allowance_extension::SubstrateWeight<Runtime>;
type WeightInfo = ();
type MaxAllowedCurrencies = ConstU32<256>;
}

@@ -1443,7 +1443,7 @@ impl treasury_buyout_extension::Config for Runtime {
type DecimalsLookup = DecimalsLookupImpl;
type MinAmountToBuyout = MinAmountToBuyout;
type MaxAllowedBuyoutCurrencies = MaxAllowedBuyoutCurrencies;
type WeightInfo = weights::treasury_buyout_extension::SubstrateWeight<Runtime>;
type WeightInfo = ();
#[cfg(feature = "runtime-benchmarks")]
type RelayChainCurrencyId = RelayChainCurrencyId;
}
130 changes: 120 additions & 10 deletions runtime/amplitude/src/weights/dia_oracle.rs
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@
//! Autogenerated weights for dia_oracle
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2024-08-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-09-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `Gianfrancos-MBP.fritz.box`, CPU: `<UNKNOWN>`
//! HOSTNAME: `Gianfrancos-MacBook-Pro.local`, CPU: `<UNKNOWN>`
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("foucoco"), DB CACHE: 1024
// Executed Command:
@@ -35,9 +35,21 @@
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use core::marker::PhantomData;

/// Weight functions needed for dia_oracle.
pub trait WeightInfo {
fn add_currency() -> Weight;
fn remove_currency() -> Weight;
fn authorize_account() -> Weight;
fn authorize_account_signed() -> Weight;
fn deauthorize_account() -> Weight;
fn deauthorize_account_signed() -> Weight;
fn set_updated_coin_infos() -> Weight;
fn set_batching_api() -> Weight;
}

/// Weights for dia_oracle using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> dia_oracle::WeightInfo for SubstrateWeight<T> {
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Storage: `DiaOracleModule::AuthorizedAccounts` (r:1 w:0)
/// Proof: `DiaOracleModule::AuthorizedAccounts` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `DiaOracleModule::SupportedCurrencies` (r:1 w:1)
@@ -46,7 +58,7 @@ impl<T: frame_system::Config> dia_oracle::WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `472`
// Estimated: `3937`
// Minimum execution time: 15_000_000 picoseconds.
// Minimum execution time: 14_000_000 picoseconds.
Weight::from_parts(15_000_000, 3937)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
@@ -60,7 +72,7 @@ impl<T: frame_system::Config> dia_oracle::WeightInfo for SubstrateWeight<T> {
// Measured: `472`
// Estimated: `3937`
// Minimum execution time: 10_000_000 picoseconds.
Weight::from_parts(11_000_000, 3937)
Weight::from_parts(10_000_000, 3937)
.saturating_add(T::DbWeight::get().reads(2_u64))
}
/// Storage: `DiaOracleModule::AuthorizedAccounts` (r:1 w:1)
@@ -80,8 +92,8 @@ impl<T: frame_system::Config> dia_oracle::WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `358`
// Estimated: `6298`
// Minimum execution time: 13_000_000 picoseconds.
Weight::from_parts(13_000_000, 6298)
// Minimum execution time: 12_000_000 picoseconds.
Weight::from_parts(12_000_000, 6298)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -102,7 +114,7 @@ impl<T: frame_system::Config> dia_oracle::WeightInfo for SubstrateWeight<T> {
// Measured: `358`
// Estimated: `6298`
// Minimum execution time: 12_000_000 picoseconds.
Weight::from_parts(13_000_000, 6298)
Weight::from_parts(12_000_000, 6298)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -114,8 +126,8 @@ impl<T: frame_system::Config> dia_oracle::WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `358`
// Estimated: `3823`
// Minimum execution time: 9_920_000_000 picoseconds.
Weight::from_parts(9_970_000_000, 3823)
// Minimum execution time: 9_498_000_000 picoseconds.
Weight::from_parts(9_560_000_000, 3823)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -132,4 +144,102 @@ impl<T: frame_system::Config> dia_oracle::WeightInfo for SubstrateWeight<T> {
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
}

// For backwards compatibility and tests
impl WeightInfo for () {
/// Storage: `DiaOracleModule::AuthorizedAccounts` (r:1 w:0)
/// Proof: `DiaOracleModule::AuthorizedAccounts` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `DiaOracleModule::SupportedCurrencies` (r:1 w:1)
/// Proof: `DiaOracleModule::SupportedCurrencies` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn add_currency() -> Weight {
// Proof Size summary in bytes:
// Measured: `472`
// Estimated: `3937`
// Minimum execution time: 14_000_000 picoseconds.
Weight::from_parts(15_000_000, 3937)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: `DiaOracleModule::AuthorizedAccounts` (r:1 w:0)
/// Proof: `DiaOracleModule::AuthorizedAccounts` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `DiaOracleModule::SupportedCurrencies` (r:1 w:0)
/// Proof: `DiaOracleModule::SupportedCurrencies` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn remove_currency() -> Weight {
// Proof Size summary in bytes:
// Measured: `472`
// Estimated: `3937`
// Minimum execution time: 10_000_000 picoseconds.
Weight::from_parts(10_000_000, 3937)
.saturating_add(RocksDbWeight::get().reads(2_u64))
}
/// Storage: `DiaOracleModule::AuthorizedAccounts` (r:1 w:1)
/// Proof: `DiaOracleModule::AuthorizedAccounts` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn authorize_account() -> Weight {
// Proof Size summary in bytes:
// Measured: `305`
// Estimated: `3770`
// Minimum execution time: 9_000_000 picoseconds.
Weight::from_parts(10_000_000, 3770)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: `DiaOracleModule::AuthorizedAccounts` (r:2 w:1)
/// Proof: `DiaOracleModule::AuthorizedAccounts` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn authorize_account_signed() -> Weight {
// Proof Size summary in bytes:
// Measured: `358`
// Estimated: `6298`
// Minimum execution time: 12_000_000 picoseconds.
Weight::from_parts(12_000_000, 6298)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: `DiaOracleModule::AuthorizedAccounts` (r:1 w:0)
/// Proof: `DiaOracleModule::AuthorizedAccounts` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn deauthorize_account() -> Weight {
// Proof Size summary in bytes:
// Measured: `305`
// Estimated: `3770`
// Minimum execution time: 5_000_000 picoseconds.
Weight::from_parts(5_000_000, 3770)
.saturating_add(RocksDbWeight::get().reads(1_u64))
}
/// Storage: `DiaOracleModule::AuthorizedAccounts` (r:2 w:1)
/// Proof: `DiaOracleModule::AuthorizedAccounts` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn deauthorize_account_signed() -> Weight {
// Proof Size summary in bytes:
// Measured: `358`
// Estimated: `6298`
// Minimum execution time: 12_000_000 picoseconds.
Weight::from_parts(12_000_000, 6298)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: `DiaOracleModule::AuthorizedAccounts` (r:1 w:0)
/// Proof: `DiaOracleModule::AuthorizedAccounts` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `DiaOracleModule::CoinInfosMap` (r:0 w:1)
/// Proof: `DiaOracleModule::CoinInfosMap` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn set_updated_coin_infos() -> Weight {
// Proof Size summary in bytes:
// Measured: `358`
// Estimated: `3823`
// Minimum execution time: 9_498_000_000 picoseconds.
Weight::from_parts(9_560_000_000, 3823)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: `DiaOracleModule::AuthorizedAccounts` (r:1 w:0)
/// Proof: `DiaOracleModule::AuthorizedAccounts` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `DiaOracleModule::BatchingApi` (r:0 w:1)
/// Proof: `DiaOracleModule::BatchingApi` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn set_batching_api() -> Weight {
// Proof Size summary in bytes:
// Measured: `358`
// Estimated: `3823`
// Minimum execution time: 11_000_000 picoseconds.
Weight::from_parts(11_000_000, 3823)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
}
Loading

0 comments on commit 79012a1

Please sign in to comment.