Skip to content

Commit

Permalink
Update slpx weight (#1507)
Browse files Browse the repository at this point in the history
* Add evm create order

* Update Slpx weight
  • Loading branch information
hqwangningbo authored Nov 20, 2024
1 parent 04a6c43 commit 96665fa
Show file tree
Hide file tree
Showing 4 changed files with 216 additions and 479 deletions.
17 changes: 17 additions & 0 deletions pallets/slpx/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,23 @@ mod benchmarks {
_(RawOrigin::Signed(caller), receiver, VKSM, TargetChain::Astar(receiver));
}

#[benchmark]
fn evm_create_order() {
let (caller, receiver) = init_whitelist::<T>();
#[extrinsic_call]
_(
RawOrigin::Signed(caller),
receiver,
592,
0,
KSM,
BalanceOf::<T>::unique_saturated_from(100_000_000_000_000u128),
TargetChain::Astar(receiver),
BoundedVec::default(),
0,
);
}

// `cargo test -p pallet-example-basic --all-features`, you will see one line per case:
impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test);
}
228 changes: 67 additions & 161 deletions pallets/slpx/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,27 @@

//! Autogenerated weights for bifrost_slpx
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-11-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4`
//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024
// Executed Command:
// target/release/bifrost
// ./target/release/bifrost
// benchmark
// pallet
// --chain=bifrost-kusama-local
// --steps=50
// --repeat=20
// --pallet=bifrost_slpx
// --pallet=bifrost-slpx
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --output=./pallets/slpx/src/weights.rs
// --template=./weight-template/pallet-weight-template.hbs
// --header=./HEADER-GPL3
// --output=./weight.rs
// --template
// ./weight-template/pallet-weight-template.hbs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand All @@ -60,199 +62,103 @@ pub trait WeightInfo {
fn mint() -> Weight;
fn mint_with_channel_id() -> Weight;
fn redeem() -> Weight;
fn zenlink_swap() -> Weight;
fn stable_pool_swap() -> Weight;
fn evm_create_order() -> Weight;
}

// For backwards compatibility and tests
impl WeightInfo for () {
/// Storage: Slpx WhitelistAccountId (r:1 w:1)
/// Proof: Slpx WhitelistAccountId (max_values: None, max_size: Some(338), added: 2813, mode: MaxEncodedLen)
/// Storage: `Slpx::WhitelistAccountId` (r:1 w:1)
/// Proof: `Slpx::WhitelistAccountId` (`max_values`: None, `max_size`: Some(338), added: 2813, mode: `MaxEncodedLen`)
fn add_whitelist() -> Weight {
// Proof Size summary in bytes:
// Measured: `4`
// Estimated: `3803`
// Minimum execution time: 33_813_000 picoseconds.
Weight::from_parts(34_425_000, 3803)
// Minimum execution time: 25_376_000 picoseconds.
Weight::from_parts(26_123_000, 3803)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: Slpx WhitelistAccountId (r:1 w:1)
/// Proof: Slpx WhitelistAccountId (max_values: None, max_size: Some(338), added: 2813, mode: MaxEncodedLen)
/// Storage: `Slpx::WhitelistAccountId` (r:1 w:1)
/// Proof: `Slpx::WhitelistAccountId` (`max_values`: None, `max_size`: Some(338), added: 2813, mode: `MaxEncodedLen`)
fn remove_whitelist() -> Weight {
// Proof Size summary in bytes:
// Measured: `81`
// Estimated: `3803`
// Minimum execution time: 36_169_000 picoseconds.
Weight::from_parts(37_581_000, 3803)
// Minimum execution time: 27_460_000 picoseconds.
Weight::from_parts(28_054_000, 3803)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: Slpx ExecutionFee (r:0 w:1)
/// Proof: Slpx ExecutionFee (max_values: None, max_size: Some(46), added: 2521, mode: MaxEncodedLen)
/// Storage: `Slpx::ExecutionFee` (r:0 w:1)
/// Proof: `Slpx::ExecutionFee` (`max_values`: None, `max_size`: Some(46), added: 2521, mode: `MaxEncodedLen`)
fn set_execution_fee() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 24_261_000 picoseconds.
Weight::from_parts(25_400_000, 0)
// Minimum execution time: 15_854_000 picoseconds.
Weight::from_parts(16_280_000, 0)
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: Slpx TransferToFee (r:0 w:1)
/// Proof: Slpx TransferToFee (max_values: None, max_size: Some(33), added: 2508, mode: MaxEncodedLen)
/// Storage: `Slpx::TransferToFee` (r:0 w:1)
/// Proof: `Slpx::TransferToFee` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`)
fn set_transfer_to_fee() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 23_834_000 picoseconds.
Weight::from_parts(24_458_000, 0)
// Minimum execution time: 15_482_000 picoseconds.
Weight::from_parts(15_979_000, 0)
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: Slpx WhitelistAccountId (r:1 w:0)
/// Proof: Slpx WhitelistAccountId (max_values: None, max_size: Some(338), added: 2813, mode: MaxEncodedLen)
/// Storage: Tokens Accounts (r:4 w:4)
/// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen)
/// Storage: Slpx ExecutionFee (r:1 w:0)
/// Proof: Slpx ExecutionFee (max_values: None, max_size: Some(46), added: 2521, mode: MaxEncodedLen)
/// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0)
/// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured)
/// Storage: System Account (r:3 w:2)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// Storage: VtokenMinting MinimumMint (r:1 w:0)
/// Proof: VtokenMinting MinimumMint (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen)
/// Storage: VtokenMinting TokenPool (r:1 w:1)
/// Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen)
/// Storage: Tokens TotalIssuance (r:1 w:1)
/// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen)
/// Storage: VtokenMinting Fees (r:1 w:0)
/// Proof: VtokenMinting Fees (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen)
/// Storage: AssetRegistry CurrencyIdToLocations (r:1 w:0)
/// Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured)
/// Storage: ParachainInfo ParachainId (r:1 w:0)
/// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: `Slpx::WhitelistAccountId` (r:1 w:0)
/// Proof: `Slpx::WhitelistAccountId` (`max_values`: None, `max_size`: Some(338), added: 2813, mode: `MaxEncodedLen`)
/// Storage: `Slpx::OrderQueue` (r:1 w:1)
/// Proof: `Slpx::OrderQueue` (`max_values`: Some(1), `max_size`: Some(113502), added: 113997, mode: `MaxEncodedLen`)
fn mint() -> Weight {
// Proof Size summary in bytes:
// Measured: `2442`
// Estimated: `11362`
// Minimum execution time: 357_850_000 picoseconds.
Weight::from_parts(367_522_000, 11362)
.saturating_add(RocksDbWeight::get().reads(16_u64))
.saturating_add(RocksDbWeight::get().writes(8_u64))
// Measured: `81`
// Estimated: `114987`
// Minimum execution time: 33_529_000 picoseconds.
Weight::from_parts(34_511_000, 114987)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: Slpx WhitelistAccountId (r:1 w:0)
/// Proof: Slpx WhitelistAccountId (max_values: None, max_size: Some(338), added: 2813, mode: MaxEncodedLen)
/// Storage: Tokens Accounts (r:4 w:4)
/// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen)
/// Storage: Slpx ExecutionFee (r:1 w:0)
/// Proof: Slpx ExecutionFee (max_values: None, max_size: Some(46), added: 2521, mode: MaxEncodedLen)
/// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0)
/// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured)
/// Storage: System Account (r:3 w:2)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// Storage: VtokenMinting MinimumMint (r:1 w:0)
/// Proof: VtokenMinting MinimumMint (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen)
/// Storage: VtokenMinting TokenPool (r:1 w:1)
/// Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen)
/// Storage: Tokens TotalIssuance (r:1 w:1)
/// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen)
/// Storage: VtokenMinting Fees (r:1 w:0)
/// Proof: VtokenMinting Fees (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen)
/// Storage: AssetRegistry CurrencyIdToLocations (r:1 w:0)
/// Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured)
/// Storage: ParachainInfo ParachainId (r:1 w:0)
/// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: `Slpx::WhitelistAccountId` (r:1 w:0)
/// Proof: `Slpx::WhitelistAccountId` (`max_values`: None, `max_size`: Some(338), added: 2813, mode: `MaxEncodedLen`)
/// Storage: `Slpx::OrderQueue` (r:1 w:1)
/// Proof: `Slpx::OrderQueue` (`max_values`: Some(1), `max_size`: Some(113502), added: 113997, mode: `MaxEncodedLen`)
fn mint_with_channel_id() -> Weight {
// Proof Size summary in bytes:
// Measured: `2442`
// Estimated: `11362`
// Minimum execution time: 357_850_000 picoseconds.
Weight::from_parts(367_522_000, 11362)
.saturating_add(RocksDbWeight::get().reads(16_u64))
.saturating_add(RocksDbWeight::get().writes(8_u64))
// Measured: `81`
// Estimated: `114987`
// Minimum execution time: 32_901_000 picoseconds.
Weight::from_parts(33_851_000, 114987)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: Slpx WhitelistAccountId (r:1 w:0)
/// Proof: Slpx WhitelistAccountId (max_values: None, max_size: Some(338), added: 2813, mode: MaxEncodedLen)
/// Storage: Tokens Accounts (r:2 w:2)
/// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen)
/// Storage: Slpx ExecutionFee (r:1 w:0)
/// Proof: Slpx ExecutionFee (max_values: None, max_size: Some(46), added: 2521, mode: MaxEncodedLen)
/// Storage: AssetRegistry CurrencyMetadatas (r:2 w:0)
/// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured)
/// Storage: System Account (r:2 w:1)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// Storage: VtokenMinting MinimumRedeem (r:1 w:0)
/// Proof: VtokenMinting MinimumRedeem (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen)
/// Storage: Slp DelegationsOccupied (r:1 w:0)
/// Proof Skipped: Slp DelegationsOccupied (max_values: None, max_size: None, mode: Measured)
/// Storage: VtokenMinting Fees (r:1 w:0)
/// Proof: VtokenMinting Fees (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen)
/// Storage: VtokenMinting TokenPool (r:1 w:0)
/// Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen)
/// Storage: Tokens TotalIssuance (r:1 w:0)
/// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen)
/// Storage: VtokenMinting OngoingTimeUnit (r:1 w:0)
/// Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen)
/// Storage: AssetRegistry CurrencyIdToLocations (r:1 w:0)
/// Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured)
/// Storage: ParachainInfo ParachainId (r:1 w:0)
/// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: `Slpx::WhitelistAccountId` (r:1 w:0)
/// Proof: `Slpx::WhitelistAccountId` (`max_values`: None, `max_size`: Some(338), added: 2813, mode: `MaxEncodedLen`)
/// Storage: `Slpx::OrderQueue` (r:1 w:1)
/// Proof: `Slpx::OrderQueue` (`max_values`: Some(1), `max_size`: Some(113502), added: 113997, mode: `MaxEncodedLen`)
fn redeem() -> Weight {
// Proof Size summary in bytes:
// Measured: `2194`
// Estimated: `8134`
// Minimum execution time: 243_045_000 picoseconds.
Weight::from_parts(247_937_000, 8134)
.saturating_add(RocksDbWeight::get().reads(16_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64))
}
/// Storage: Slpx WhitelistAccountId (r:1 w:0)
/// Proof: Slpx WhitelistAccountId (max_values: None, max_size: Some(338), added: 2813, mode: MaxEncodedLen)
/// Storage: ParachainInfo ParachainId (r:1 w:0)
/// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Tokens Accounts (r:4 w:2)
/// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen)
/// Storage: Slpx ExecutionFee (r:1 w:0)
/// Proof: Slpx ExecutionFee (max_values: None, max_size: Some(46), added: 2521, mode: MaxEncodedLen)
/// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0)
/// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured)
/// Storage: System Account (r:2 w:1)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// Storage: AssetRegistry CurrencyIdToLocations (r:1 w:0)
/// Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured)
fn zenlink_swap() -> Weight {
// Proof Size summary in bytes:
// Measured: `1819`
// Estimated: `11362`
// Minimum execution time: 221_285_000 picoseconds.
Weight::from_parts(225_387_000, 11362)
.saturating_add(RocksDbWeight::get().reads(11_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64))
// Measured: `81`
// Estimated: `114987`
// Minimum execution time: 32_912_000 picoseconds.
Weight::from_parts(33_600_000, 114987)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: Slpx WhitelistAccountId (r:1 w:0)
/// Proof: Slpx WhitelistAccountId (max_values: None, max_size: Some(338), added: 2813, mode: MaxEncodedLen)
/// Storage: StableAsset Pools (r:1 w:0)
/// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured)
/// Storage: Tokens Accounts (r:6 w:2)
/// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen)
/// Storage: Slpx ExecutionFee (r:1 w:0)
/// Proof: Slpx ExecutionFee (max_values: None, max_size: Some(46), added: 2521, mode: MaxEncodedLen)
/// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0)
/// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured)
/// Storage: System Account (r:3 w:1)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// Storage: StableAsset TokenRateCaches (r:2 w:0)
/// Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured)
/// Storage: AssetRegistry CurrencyIdToLocations (r:1 w:0)
/// Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured)
/// Storage: ParachainInfo ParachainId (r:1 w:0)
/// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
fn stable_pool_swap() -> Weight {
/// Storage: `Slpx::WhitelistAccountId` (r:1 w:0)
/// Proof: `Slpx::WhitelistAccountId` (`max_values`: None, `max_size`: Some(338), added: 2813, mode: `MaxEncodedLen`)
/// Storage: `Slpx::OrderQueue` (r:1 w:1)
/// Proof: `Slpx::OrderQueue` (`max_values`: Some(1), `max_size`: Some(113502), added: 113997, mode: `MaxEncodedLen`)
fn evm_create_order() -> Weight {
// Proof Size summary in bytes:
// Measured: `2782`
// Estimated: `16548`
// Minimum execution time: 555_626_000 picoseconds.
Weight::from_parts(568_903_000, 16548)
.saturating_add(RocksDbWeight::get().reads(17_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64))
// Measured: `81`
// Estimated: `114987`
// Minimum execution time: 32_556_000 picoseconds.
Weight::from_parts(33_884_000, 114987)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
}
}
Loading

0 comments on commit 96665fa

Please sign in to comment.