From 84128070f5a7250319756c0ad3b66c46854227ef Mon Sep 17 00:00:00 2001 From: Roznovjak Date: Thu, 29 Feb 2024 14:06:51 +0100 Subject: [PATCH 1/2] fix benchmarks --- Cargo.lock | 8 +++---- pallets/dca/Cargo.toml | 2 +- pallets/dca/src/tests/mock.rs | 2 +- pallets/ema-oracle/Cargo.toml | 2 +- pallets/ema-oracle/src/benchmarking.rs | 8 +++++-- pallets/ema-oracle/src/lib.rs | 6 ++--- pallets/ema-oracle/src/tests/mock.rs | 7 +++--- pallets/omnipool-liquidity-mining/Cargo.toml | 2 +- .../src/tests/mock.rs | 2 +- runtime/hydradx/Cargo.toml | 2 +- runtime/hydradx/src/assets.rs | 23 ++++++++++--------- runtime/hydradx/src/lib.rs | 2 +- 12 files changed, 35 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 147584418..dbd7ce9e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4621,7 +4621,7 @@ dependencies = [ [[package]] name = "hydradx-runtime" -version = "219.0.0" +version = "220.0.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", @@ -7401,7 +7401,7 @@ dependencies = [ [[package]] name = "pallet-dca" -version = "1.3.6" +version = "1.3.7" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -7603,7 +7603,7 @@ dependencies = [ [[package]] name = "pallet-ema-oracle" -version = "1.2.0" +version = "1.2.1" dependencies = [ "frame-benchmarking", "frame-support", @@ -8149,7 +8149,7 @@ dependencies = [ [[package]] name = "pallet-omnipool-liquidity-mining" -version = "2.1.1" +version = "2.1.2" dependencies = [ "frame-benchmarking", "frame-support", diff --git a/pallets/dca/Cargo.toml b/pallets/dca/Cargo.toml index 7c4401e02..5d018ccf7 100644 --- a/pallets/dca/Cargo.toml +++ b/pallets/dca/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-dca' -version = "1.3.6" +version = "1.3.7" description = 'A pallet to manage DCA scheduling' authors = ['GalacticCouncil'] edition = '2021' diff --git a/pallets/dca/src/tests/mock.rs b/pallets/dca/src/tests/mock.rs index b412d1644..f5ab5a1bc 100644 --- a/pallets/dca/src/tests/mock.rs +++ b/pallets/dca/src/tests/mock.rs @@ -149,7 +149,7 @@ impl pallet_ema_oracle::Config for Test { type WeightInfo = (); type BlockNumberProvider = MockBlockNumberProvider; type SupportedPeriods = SupportedPeriods; - type OracleFilter = Everything; + type OracleWhitelist = Everything; type MaxUniqueEntries = ConstU32<20>; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = (); diff --git a/pallets/ema-oracle/Cargo.toml b/pallets/ema-oracle/Cargo.toml index c00b39c92..63dbcaf16 100644 --- a/pallets/ema-oracle/Cargo.toml +++ b/pallets/ema-oracle/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-ema-oracle' -version = '1.2.0' +version = '1.2.1' description = 'Exponential moving average oracle for AMM pools' authors = ['GalacticCouncil'] edition = '2021' diff --git a/pallets/ema-oracle/src/benchmarking.rs b/pallets/ema-oracle/src/benchmarking.rs index 040884ac3..bbf47e954 100644 --- a/pallets/ema-oracle/src/benchmarking.rs +++ b/pallets/ema-oracle/src/benchmarking.rs @@ -207,6 +207,8 @@ benchmarks! { } let asset_a = b * 1_000; let asset_b = asset_a + 500; + T::BenchmarkHelper::register_asset(asset_a)?; + T::BenchmarkHelper::register_asset(asset_b)?; let res = core::cell::RefCell::new(Err(DispatchError::Other("Not initialized"))); }: { @@ -267,6 +269,8 @@ benchmarks! { } let asset_a = b * 1_000; let asset_b = asset_a + 500; + T::BenchmarkHelper::register_asset(asset_a)?; + T::BenchmarkHelper::register_asset(asset_b)?; let res = core::cell::RefCell::new(Err(DispatchError::Other("Not initialized"))); }: { @@ -302,8 +306,8 @@ benchmarks! { let asset_a = 1_000; let asset_b = asset_a + 500; - T::BenchmarkHelper::register_asset(asset_a)?; - T::BenchmarkHelper::register_asset(asset_b)?; + T::BenchmarkHelper::register_asset(asset_a)?; + T::BenchmarkHelper::register_asset(asset_b)?; assert_ok!(OnActivityHandler::::on_trade( SOURCE, asset_a, asset_b, amount_in, amount_out, liquidity_asset_in, liquidity_asset_out, diff --git a/pallets/ema-oracle/src/lib.rs b/pallets/ema-oracle/src/lib.rs index e23c3d55f..aba2fb22d 100644 --- a/pallets/ema-oracle/src/lib.rs +++ b/pallets/ema-oracle/src/lib.rs @@ -134,8 +134,8 @@ pub mod pallet { /// The periods supported by the pallet. I.e. which oracles to track. type SupportedPeriods: Get>>; - /// Filter determining what oracles are tracked by the pallet. - type OracleFilter: Contains<(Source, AssetId, AssetId)>; + /// Whitelist determining what oracles are tracked by the pallet. + type OracleWhitelist: Contains<(Source, AssetId, AssetId)>; /// Maximum number of unique oracle entries expected in one block. #[pallet::constant] @@ -243,7 +243,7 @@ impl Pallet { assets: (AssetId, AssetId), oracle_entry: OracleEntry>, ) -> Result<(), ()> { - if !T::OracleFilter::contains(&(src, assets.0, assets.1)) { + if !T::OracleWhitelist::contains(&(src, assets.0, assets.1)) { return Ok(()); } diff --git a/pallets/ema-oracle/src/tests/mock.rs b/pallets/ema-oracle/src/tests/mock.rs index ad8db1154..e076b485c 100644 --- a/pallets/ema-oracle/src/tests/mock.rs +++ b/pallets/ema-oracle/src/tests/mock.rs @@ -124,9 +124,8 @@ parameter_types! { pub SupportedPeriods: BoundedVec> = bounded_vec![LastBlock, TenMinutes, Day, Week]; } -pub struct OracleFilter; - -impl Contains<(Source, AssetId, AssetId)> for OracleFilter { +pub struct SufficientAssetsFilter; +impl Contains<(Source, AssetId, AssetId)> for SufficientAssetsFilter { fn contains(t: &(Source, AssetId, AssetId)) -> bool { t.1 != INSUFFICIENT_ASSET && t.2 != INSUFFICIENT_ASSET } @@ -137,7 +136,7 @@ impl Config for Test { type WeightInfo = (); type BlockNumberProvider = System; type SupportedPeriods = SupportedPeriods; - type OracleFilter = OracleFilter; + type OracleWhitelist = SufficientAssetsFilter; type MaxUniqueEntries = ConstU32<45>; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = (); diff --git a/pallets/omnipool-liquidity-mining/Cargo.toml b/pallets/omnipool-liquidity-mining/Cargo.toml index a4a994b26..692a5e726 100644 --- a/pallets/omnipool-liquidity-mining/Cargo.toml +++ b/pallets/omnipool-liquidity-mining/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-omnipool-liquidity-mining" -version = "2.1.1" +version = "2.1.2" authors = ['GalacticCouncil'] edition = "2021" license = "Apache-2.0" diff --git a/pallets/omnipool-liquidity-mining/src/tests/mock.rs b/pallets/omnipool-liquidity-mining/src/tests/mock.rs index 649175923..267c39cd4 100644 --- a/pallets/omnipool-liquidity-mining/src/tests/mock.rs +++ b/pallets/omnipool-liquidity-mining/src/tests/mock.rs @@ -250,7 +250,7 @@ impl pallet_ema_oracle::Config for Test { type WeightInfo = (); type BlockNumberProvider = MockBlockNumberProvider; type SupportedPeriods = SupportedPeriods; - type OracleFilter = Everything; + type OracleWhitelist = Everything; type MaxUniqueEntries = ConstU32<20>; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = (); diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index cae647349..e82095ada 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "219.0.0" +version = "220.0.0" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" diff --git a/runtime/hydradx/src/assets.rs b/runtime/hydradx/src/assets.rs index 2692694ae..bd072b388 100644 --- a/runtime/hydradx/src/assets.rs +++ b/runtime/hydradx/src/assets.rs @@ -512,11 +512,12 @@ impl pallet_ema_oracle::Config for Runtime { /// to which smoothing factor. type BlockNumberProvider = System; type SupportedPeriods = SupportedPeriods; - type OracleFilter = SufficientAssetsFilter; + type OracleWhitelist = SufficientAssetsFilter; /// With every asset trading against LRNA we will only have as many pairs as there will be assets, so /// 40 seems a decent upper bound for the foreseeable future. type MaxUniqueEntries = ConstU32<40>; #[cfg(feature = "runtime-benchmarks")] + /// Should take care of the overhead introduced by `OracleWhitelist`. type BenchmarkHelper = RegisterAsset; } @@ -1082,25 +1083,25 @@ impl BenchmarkHelper for RegisterAsse #[cfg(feature = "runtime-benchmarks")] impl pallet_ema_oracle::BenchmarkHelper for RegisterAsset { fn register_asset(asset_id: AssetId) -> DispatchResult { - let asset_name: BoundedVec = asset_id - .to_le_bytes() - .to_vec() - .try_into() - .map_err(|_| "BoundedConversionFailed")?; - - with_transaction(|| { + let result = with_transaction(|| { TransactionOutcome::Commit(AssetRegistry::register_sufficient_asset( Some(asset_id), - Some(asset_name.clone()), + None, AssetKind::Token, 1, - Some(asset_name), + None, Some(12), None, None, )) - })?; + }); + + // don't throw error if the asset is already registered + if result.is_err_and(|e| e == pallet_asset_registry::Error::::AssetAlreadyRegistered.into()) { + return Ok(()) + }; + let _ = result?; Ok(()) } } diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index 12c71594c..858d6ef36 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -107,7 +107,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("hydradx"), impl_name: create_runtime_str!("hydradx"), authoring_version: 1, - spec_version: 219, + spec_version: 220, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From 3520ea110e2e9935c08c99fd92ad732ae589c0a9 Mon Sep 17 00:00:00 2001 From: Roznovjak Date: Thu, 29 Feb 2024 14:25:16 +0100 Subject: [PATCH 2/2] rebenchmark ema oracle pallet --- pallets/ema-oracle/src/weights.rs | 104 ++++++++++++---------- runtime/hydradx/src/assets.rs | 2 +- runtime/hydradx/src/weights/ema_oracle.rs | 48 +++++----- 3 files changed, 83 insertions(+), 71 deletions(-) diff --git a/pallets/ema-oracle/src/weights.rs b/pallets/ema-oracle/src/weights.rs index 0e3fc21c0..56c3c5b5c 100644 --- a/pallets/ema-oracle/src/weights.rs +++ b/pallets/ema-oracle/src/weights.rs @@ -67,8 +67,8 @@ impl WeightInfo for BasiliskWeight { // Proof Size summary in bytes: // Measured: `208` // Estimated: `7406` - // Minimum execution time: 3_108_000 picoseconds. - Weight::from_parts(3_213_000, 7406).saturating_add(T::DbWeight::get().reads(1_u64)) + // Minimum execution time: 3_261_000 picoseconds. + Weight::from_parts(3_342_000, 7406).saturating_add(T::DbWeight::get().reads(1)) } /// Storage: `EmaOracle::Accumulator` (r:1 w:1) /// Proof: `EmaOracle::Accumulator` (`max_values`: Some(1), `max_size`: Some(5921), added: 6416, mode: `MaxEncodedLen`) @@ -79,43 +79,47 @@ impl WeightInfo for BasiliskWeight { // Proof Size summary in bytes: // Measured: `270 + b * (626 ±0)` // Estimated: `7406 + b * (7956 ±0)` - // Minimum execution time: 46_197_000 picoseconds. - Weight::from_parts(6_894_077, 7406) - // Standard Error: 58_512 - .saturating_add(Weight::from_parts(36_389_579, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Minimum execution time: 49_005_000 picoseconds. + Weight::from_parts(11_980_224, 7406) + // Standard Error: 17_790 + .saturating_add(Weight::from_parts(36_916_571, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(b.into()))) - .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(b.into()))) .saturating_add(Weight::from_parts(0, 7956).saturating_mul(b.into())) } + /// Storage: `AssetRegistry::Assets` (r:2 w:0) + /// Proof: `AssetRegistry::Assets` (`max_values`: None, `max_size`: Some(125), added: 2600, mode: `MaxEncodedLen`) /// Storage: `EmaOracle::Accumulator` (r:1 w:1) /// Proof: `EmaOracle::Accumulator` (`max_values`: Some(1), `max_size`: Some(5921), added: 6416, mode: `MaxEncodedLen`) /// The range of component `b` is `[1, 39]`. fn on_trade_multiple_tokens(b: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `270 + b * (148 ±0)` + // Measured: `718 + b * (163 ±0)` // Estimated: `7406` - // Minimum execution time: 9_225_000 picoseconds. - Weight::from_parts(9_309_132, 7406) - // Standard Error: 2_681 - .saturating_add(Weight::from_parts(395_788, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 18_948_000 picoseconds. + Weight::from_parts(19_508_272, 7406) + // Standard Error: 3_859 + .saturating_add(Weight::from_parts(435_799, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `AssetRegistry::Assets` (r:2 w:0) + /// Proof: `AssetRegistry::Assets` (`max_values`: None, `max_size`: Some(125), added: 2600, mode: `MaxEncodedLen`) /// Storage: `EmaOracle::Accumulator` (r:1 w:1) /// Proof: `EmaOracle::Accumulator` (`max_values`: Some(1), `max_size`: Some(5921), added: 6416, mode: `MaxEncodedLen`) /// The range of component `b` is `[1, 39]`. fn on_liquidity_changed_multiple_tokens(b: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `270 + b * (148 ±0)` + // Measured: `718 + b * (163 ±0)` // Estimated: `7406` - // Minimum execution time: 9_353_000 picoseconds. - Weight::from_parts(9_378_483, 7406) - // Standard Error: 1_820 - .saturating_add(Weight::from_parts(397_535, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 18_875_000 picoseconds. + Weight::from_parts(19_397_429, 7406) + // Standard Error: 4_124 + .saturating_add(Weight::from_parts(438_627, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `EmaOracle::Oracles` (r:2 w:0) /// Proof: `EmaOracle::Oracles` (`max_values`: None, `max_size`: Some(177), added: 2652, mode: `MaxEncodedLen`) @@ -123,8 +127,8 @@ impl WeightInfo for BasiliskWeight { // Proof Size summary in bytes: // Measured: `604` // Estimated: `6294` - // Minimum execution time: 18_642_000 picoseconds. - Weight::from_parts(19_015_000, 6294).saturating_add(T::DbWeight::get().reads(2_u64)) + // Minimum execution time: 18_746_000 picoseconds. + Weight::from_parts(19_158_000, 6294).saturating_add(T::DbWeight::get().reads(2)) } } @@ -136,8 +140,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `208` // Estimated: `7406` - // Minimum execution time: 3_108_000 picoseconds. - Weight::from_parts(3_213_000, 7406).saturating_add(RocksDbWeight::get().reads(1_u64)) + // Minimum execution time: 3_261_000 picoseconds. + Weight::from_parts(3_342_000, 7406).saturating_add(RocksDbWeight::get().reads(1)) } /// Storage: `EmaOracle::Accumulator` (r:1 w:1) /// Proof: `EmaOracle::Accumulator` (`max_values`: Some(1), `max_size`: Some(5921), added: 6416, mode: `MaxEncodedLen`) @@ -148,43 +152,47 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `270 + b * (626 ±0)` // Estimated: `7406 + b * (7956 ±0)` - // Minimum execution time: 46_197_000 picoseconds. - Weight::from_parts(6_894_077, 7406) - // Standard Error: 58_512 - .saturating_add(Weight::from_parts(36_389_579, 0).saturating_mul(b.into())) - .saturating_add(RocksDbWeight::get().reads(1_u64)) + // Minimum execution time: 49_005_000 picoseconds. + Weight::from_parts(11_980_224, 7406) + // Standard Error: 17_790 + .saturating_add(Weight::from_parts(36_916_571, 0).saturating_mul(b.into())) + .saturating_add(RocksDbWeight::get().reads(1)) .saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(b.into()))) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1)) .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(b.into()))) .saturating_add(Weight::from_parts(0, 7956).saturating_mul(b.into())) } + /// Storage: `AssetRegistry::Assets` (r:2 w:0) + /// Proof: `AssetRegistry::Assets` (`max_values`: None, `max_size`: Some(125), added: 2600, mode: `MaxEncodedLen`) /// Storage: `EmaOracle::Accumulator` (r:1 w:1) /// Proof: `EmaOracle::Accumulator` (`max_values`: Some(1), `max_size`: Some(5921), added: 6416, mode: `MaxEncodedLen`) /// The range of component `b` is `[1, 39]`. fn on_trade_multiple_tokens(b: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `270 + b * (148 ±0)` + // Measured: `718 + b * (163 ±0)` // Estimated: `7406` - // Minimum execution time: 9_225_000 picoseconds. - Weight::from_parts(9_309_132, 7406) - // Standard Error: 2_681 - .saturating_add(Weight::from_parts(395_788, 0).saturating_mul(b.into())) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + // Minimum execution time: 18_948_000 picoseconds. + Weight::from_parts(19_508_272, 7406) + // Standard Error: 3_859 + .saturating_add(Weight::from_parts(435_799, 0).saturating_mul(b.into())) + .saturating_add(RocksDbWeight::get().reads(3)) + .saturating_add(RocksDbWeight::get().writes(1)) } + /// Storage: `AssetRegistry::Assets` (r:2 w:0) + /// Proof: `AssetRegistry::Assets` (`max_values`: None, `max_size`: Some(125), added: 2600, mode: `MaxEncodedLen`) /// Storage: `EmaOracle::Accumulator` (r:1 w:1) /// Proof: `EmaOracle::Accumulator` (`max_values`: Some(1), `max_size`: Some(5921), added: 6416, mode: `MaxEncodedLen`) /// The range of component `b` is `[1, 39]`. fn on_liquidity_changed_multiple_tokens(b: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `270 + b * (148 ±0)` + // Measured: `718 + b * (163 ±0)` // Estimated: `7406` - // Minimum execution time: 9_353_000 picoseconds. - Weight::from_parts(9_378_483, 7406) - // Standard Error: 1_820 - .saturating_add(Weight::from_parts(397_535, 0).saturating_mul(b.into())) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + // Minimum execution time: 18_875_000 picoseconds. + Weight::from_parts(19_397_429, 7406) + // Standard Error: 4_124 + .saturating_add(Weight::from_parts(438_627, 0).saturating_mul(b.into())) + .saturating_add(RocksDbWeight::get().reads(3)) + .saturating_add(RocksDbWeight::get().writes(1)) } /// Storage: `EmaOracle::Oracles` (r:2 w:0) /// Proof: `EmaOracle::Oracles` (`max_values`: None, `max_size`: Some(177), added: 2652, mode: `MaxEncodedLen`) @@ -192,7 +200,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `604` // Estimated: `6294` - // Minimum execution time: 18_642_000 picoseconds. - Weight::from_parts(19_015_000, 6294).saturating_add(RocksDbWeight::get().reads(2_u64)) + // Minimum execution time: 18_746_000 picoseconds. + Weight::from_parts(19_158_000, 6294).saturating_add(RocksDbWeight::get().reads(2)) } } diff --git a/runtime/hydradx/src/assets.rs b/runtime/hydradx/src/assets.rs index bd072b388..9659c2b7b 100644 --- a/runtime/hydradx/src/assets.rs +++ b/runtime/hydradx/src/assets.rs @@ -1098,7 +1098,7 @@ impl pallet_ema_oracle::BenchmarkHelper f // don't throw error if the asset is already registered if result.is_err_and(|e| e == pallet_asset_registry::Error::::AssetAlreadyRegistered.into()) { - return Ok(()) + return Ok(()); }; let _ = result?; diff --git a/runtime/hydradx/src/weights/ema_oracle.rs b/runtime/hydradx/src/weights/ema_oracle.rs index 621a35424..e0e7ee958 100644 --- a/runtime/hydradx/src/weights/ema_oracle.rs +++ b/runtime/hydradx/src/weights/ema_oracle.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for `pallet_ema_oracle` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-02-15, STEPS: `10`, REPEAT: `30`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-29, STEPS: `10`, REPEAT: `30`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bench-bot`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --template=.maintain/pallet-weight-template-no-back.hbs // --pallet=pallet-ema-oracle -// --output=./weights/ema_oracle.rs +// --output=weights-1.1.0/oracle.rs // --extrinsic=* #![cfg_attr(rustfmt, rustfmt_skip)] @@ -56,8 +56,8 @@ impl WeightInfo for HydraWeight { // Proof Size summary in bytes: // Measured: `208` // Estimated: `7406` - // Minimum execution time: 3_140_000 picoseconds. - Weight::from_parts(3_253_000, 7406) + // Minimum execution time: 3_261_000 picoseconds. + Weight::from_parts(3_342_000, 7406) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: `EmaOracle::Accumulator` (r:1 w:1) @@ -69,42 +69,46 @@ impl WeightInfo for HydraWeight { // Proof Size summary in bytes: // Measured: `270 + b * (626 ±0)` // Estimated: `7406 + b * (7956 ±0)` - // Minimum execution time: 46_946_000 picoseconds. - Weight::from_parts(9_495_798, 7406) - // Standard Error: 18_892 - .saturating_add(Weight::from_parts(36_363_503, 0).saturating_mul(b.into())) + // Minimum execution time: 49_005_000 picoseconds. + Weight::from_parts(11_980_224, 7406) + // Standard Error: 17_790 + .saturating_add(Weight::from_parts(36_916_571, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(b.into()))) .saturating_add(Weight::from_parts(0, 7956).saturating_mul(b.into())) } + /// Storage: `AssetRegistry::Assets` (r:2 w:0) + /// Proof: `AssetRegistry::Assets` (`max_values`: None, `max_size`: Some(125), added: 2600, mode: `MaxEncodedLen`) /// Storage: `EmaOracle::Accumulator` (r:1 w:1) /// Proof: `EmaOracle::Accumulator` (`max_values`: Some(1), `max_size`: Some(5921), added: 6416, mode: `MaxEncodedLen`) /// The range of component `b` is `[1, 39]`. fn on_trade_multiple_tokens(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `270 + b * (148 ±0)` + // Measured: `718 + b * (163 ±0)` // Estimated: `7406` - // Minimum execution time: 9_605_000 picoseconds. - Weight::from_parts(9_734_841, 7406) - // Standard Error: 1_636 - .saturating_add(Weight::from_parts(368_579, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(1)) + // Minimum execution time: 18_948_000 picoseconds. + Weight::from_parts(19_508_272, 7406) + // Standard Error: 3_859 + .saturating_add(Weight::from_parts(435_799, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `AssetRegistry::Assets` (r:2 w:0) + /// Proof: `AssetRegistry::Assets` (`max_values`: None, `max_size`: Some(125), added: 2600, mode: `MaxEncodedLen`) /// Storage: `EmaOracle::Accumulator` (r:1 w:1) /// Proof: `EmaOracle::Accumulator` (`max_values`: Some(1), `max_size`: Some(5921), added: 6416, mode: `MaxEncodedLen`) /// The range of component `b` is `[1, 39]`. fn on_liquidity_changed_multiple_tokens(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `270 + b * (148 ±0)` + // Measured: `718 + b * (163 ±0)` // Estimated: `7406` - // Minimum execution time: 9_580_000 picoseconds. - Weight::from_parts(9_817_291, 7406) - // Standard Error: 1_899 - .saturating_add(Weight::from_parts(364_892, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(1)) + // Minimum execution time: 18_875_000 picoseconds. + Weight::from_parts(19_397_429, 7406) + // Standard Error: 4_124 + .saturating_add(Weight::from_parts(438_627, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `EmaOracle::Oracles` (r:2 w:0) @@ -113,8 +117,8 @@ impl WeightInfo for HydraWeight { // Proof Size summary in bytes: // Measured: `604` // Estimated: `6294` - // Minimum execution time: 18_804_000 picoseconds. - Weight::from_parts(19_169_000, 6294) + // Minimum execution time: 18_746_000 picoseconds. + Weight::from_parts(19_158_000, 6294) .saturating_add(T::DbWeight::get().reads(2)) } }