Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update weights for all pallets #164

Merged
merged 5 commits into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .maintain/bench-check/hydradx-bench-data.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"amm": {
"create_pool": 250.0,
"add_liquidity": 239.0,
"remove_liquidity": 240.0,
"sell": 169.0,
"buy": 168.0
"create_pool": 189.0,
"add_liquidity": 171.0,
"remove_liquidity": 170.0,
"sell": 122.0,
"buy": 121.0
},
"exchange": {
"sell_intention": 132.0,
"buy_intention": 131.0,
"sell_extrinsic": 177.0,
"on_finalize_for_one_sell_extrinsic": 232.0,
"buy_extrinsic": 176.0,
"on_finalize_for_one_buy_extrinsic": 257.0
"sell_intention": 109.0,
"buy_intention": 112.0,
"sell_extrinsic": 121.0,
"on_finalize_for_one_sell_extrinsic": 163.0,
"buy_extrinsic": 120.0,
"on_finalize_for_one_buy_extrinsic": 179.0
},
"transaction_multi_payment": {
"swap_currency": 176.0,
"set_currency": 44.0,
"add_currency": 34.0,
"remove_currency": 35.0
"swap_currency": 132.0,
"set_currency": 34.0,
"add_currency": 26.0,
"remove_currency": 26.0
}
}
119 changes: 60 additions & 59 deletions pallets/amm/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

//! Autogenerated weights for amm
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0
//! DATE: 2021-03-03, STEPS: [5, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: []
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-03-18, STEPS: [5, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: []
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

// Executed Command:
Expand All @@ -40,75 +40,76 @@
#![allow(clippy::unnecessary_cast)]

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

/// Weight functions needed for amm.
pub trait WeightInfo {
fn create_pool() -> Weight;
fn add_liquidity() -> Weight;
fn remove_liquidity() -> Weight;
fn sell() -> Weight;
fn buy() -> Weight;
fn create_pool() -> Weight;
fn add_liquidity() -> Weight;
fn remove_liquidity() -> Weight;
fn sell() -> Weight;
fn buy() -> Weight;
}

/// Weights for amm using the hydraDX node and recommended hardware.
pub struct HydraWeight<T>(PhantomData<T>);

impl<T: frame_system::Config> WeightInfo for HydraWeight<T> {
fn create_pool() -> Weight {
(250_200_000 as Weight)
.saturating_add(T::DbWeight::get().reads(11 as Weight))
.saturating_add(T::DbWeight::get().writes(13 as Weight))
}
fn add_liquidity() -> Weight {
(239_134_000 as Weight)
.saturating_add(T::DbWeight::get().reads(9 as Weight))
.saturating_add(T::DbWeight::get().writes(8 as Weight))
}
fn remove_liquidity() -> Weight {
(240_260_000 as Weight)
.saturating_add(T::DbWeight::get().reads(8 as Weight))
.saturating_add(T::DbWeight::get().writes(7 as Weight))
}
fn sell() -> Weight {
(169_053_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn buy() -> Weight {
(168_649_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn create_pool() -> Weight {
(189_645_000 as Weight)
.saturating_add(T::DbWeight::get().reads(11 as Weight))
.saturating_add(T::DbWeight::get().writes(13 as Weight))
}
fn add_liquidity() -> Weight {
(171_602_000 as Weight)
.saturating_add(T::DbWeight::get().reads(9 as Weight))
.saturating_add(T::DbWeight::get().writes(8 as Weight))
}
fn remove_liquidity() -> Weight {
(170_846_000 as Weight)
.saturating_add(T::DbWeight::get().reads(8 as Weight))
.saturating_add(T::DbWeight::get().writes(7 as Weight))
}
fn sell() -> Weight {
(122_125_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn buy() -> Weight {
(121_289_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
}

// For backwards compatibility and tests
impl WeightInfo for () {
fn create_pool() -> Weight {
(250_200_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(11 as Weight))
.saturating_add(RocksDbWeight::get().writes(13 as Weight))
}
fn add_liquidity() -> Weight {
(239_134_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(9 as Weight))
.saturating_add(RocksDbWeight::get().writes(8 as Weight))
}
fn remove_liquidity() -> Weight {
(240_260_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(8 as Weight))
.saturating_add(RocksDbWeight::get().writes(7 as Weight))
}
fn sell() -> Weight {
(169_053_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(5 as Weight))
.saturating_add(RocksDbWeight::get().writes(4 as Weight))
}
fn buy() -> Weight {
(168_649_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(5 as Weight))
.saturating_add(RocksDbWeight::get().writes(4 as Weight))
}
fn create_pool() -> Weight {
(189_645_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(11 as Weight))
.saturating_add(RocksDbWeight::get().writes(13 as Weight))
}
fn add_liquidity() -> Weight {
(171_602_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(9 as Weight))
.saturating_add(RocksDbWeight::get().writes(8 as Weight))
}
fn remove_liquidity() -> Weight {
(170_846_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(8 as Weight))
.saturating_add(RocksDbWeight::get().writes(7 as Weight))
}
fn sell() -> Weight {
(122_125_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(5 as Weight))
.saturating_add(RocksDbWeight::get().writes(4 as Weight))
}
fn buy() -> Weight {
(121_289_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(5 as Weight))
.saturating_add(RocksDbWeight::get().writes(4 as Weight))
}
}
Loading