diff --git a/Cargo.lock b/Cargo.lock index 420da9c26..e8a6504ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1061,6 +1061,8 @@ dependencies = [ "bifrost-salp-rpc-runtime-api", "bifrost-slp", "bifrost-slpx", + "bifrost-stable-pool", + "bifrost-stable-pool-rpc-runtime-api", "bifrost-system-maker", "bifrost-system-staking", "bifrost-ve-minting", @@ -1088,6 +1090,7 @@ dependencies = [ "log", "merkle-distributor", "node-primitives", + "nutsfinance-stable-asset", "orml-tokens", "orml-traits", "orml-unknown-tokens", @@ -1322,11 +1325,14 @@ dependencies = [ "frame-system", "hex-literal 0.3.4", "node-primitives", + "nutsfinance-stable-asset", "orml-tokens", "orml-traits", "orml-xtokens", "pallet-balances", + "pallet-collective", "pallet-xcm", + "parachain-info", "parity-scale-codec", "scale-info", "serde", diff --git a/Makefile b/Makefile index 66fd1f143..394a17bbf 100644 --- a/Makefile +++ b/Makefile @@ -25,19 +25,22 @@ build-bifrost-polkadot-release: build-all-release: copy-genesis-config-release cargo build -p node-cli --locked --features "with-all-runtime" --release -.PHONY: build-bifrost-rococo-fast-release # build bifrost rococo fast release -build-bifrost-rococo-fast-release: - cargo build -p node-cli --locked --features "with-bifrost-kusama-runtime,fast-runtime" --release - - .PHONY: check-all # cargo check all runtime check-all: format SKIP_WASM_BUILD= cargo check -p node-cli --locked --features "with-all-runtime,runtime-benchmarks,try-runtime" -.PHONY: test-all # cargo test all runtime -test-all: +.PHONY: test-all # cargo test all +test-all: integration-test test-runtimes test-benchmarks + + +.PHONY: test-runtimes +test-runtimes: SKIP_WASM_BUILD= cargo test --features "with-all-runtime" --lib +.PHONY: test-benchmarks +test-benchmarks: + cargo test --all benchmarking --features="with-all-runtime,runtime-benchmarks, polkadot" --exclude "*-integration-tests" + .PHONY: integration-test # integration test integration-test: SKIP_WASM_BUILD= cargo test -p *-integration-tests @@ -67,10 +70,6 @@ format: clippy: cargo clippy --all --all-targets --features=with-all-runtime -- -D warnings -.PHONY: test-benchmarking # test with benchmarking -test-benchmarking: - cargo test --features runtime-benchmarks --features with-all-runtime --features --all benchmarking - .PHONY: benchmarking-staking # benchmarking staking pallet benchmarking-staking: cargo run -p node-cli --locked --features "with-bifrost-kusama-runtime,runtime-benchmarks" --release \ @@ -117,10 +116,6 @@ build-bifrost-polkadot-wasm: build-bifrost-rococo-fast-wasm: .maintain/build-wasm.sh bifrost-kusama fast -.PHONY: check-try-runtime # check try runtime -check-try-runtime: - SKIP_WASM_BUILD= cargo check --features try-runtime --features with-bifrost-runtime - .PHONY: try-kusama-runtime-upgrade # try kusama runtime upgrade try-kusama-runtime-upgrade: cargo run --features try-runtime --features with-bifrost-kusama-runtime --release \ diff --git a/node/primitives/src/lib.rs b/node/primitives/src/lib.rs index a1ea7001f..7a65c86c6 100644 --- a/node/primitives/src/lib.rs +++ b/node/primitives/src/lib.rs @@ -21,6 +21,7 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::MaxEncodedLen; +use frame_support::dispatch::Weight; use scale_info::TypeInfo; use sp_core::{Decode, Encode, RuntimeDebug, H160}; use sp_runtime::{ @@ -257,6 +258,54 @@ impl SendXcm for DoNothingRouter { } } +pub struct Weightless; +impl PreparedMessage for Weightless { + fn weight_of(&self) -> Weight { + Weight::default() + } +} + +pub struct DoNothingExecuteXcm; +impl ExecuteXcm for DoNothingExecuteXcm { + type Prepared = Weightless; + + fn prepare(_message: Xcm) -> Result> { + Ok(Weightless) + } + + fn execute( + _origin: impl Into, + _pre: Self::Prepared, + _hash: XcmHash, + _weight_credit: Weight, + ) -> Outcome { + Outcome::Complete(Weight::default()) + } + + fn execute_xcm( + _origin: impl Into, + _message: Xcm, + _hash: XcmHash, + _weight_limit: Weight, + ) -> Outcome { + Outcome::Complete(Weight::default()) + } + + fn execute_xcm_in_credit( + _origin: impl Into, + _message: Xcm, + _hash: XcmHash, + _weight_limit: Weight, + _weight_credit: Weight, + ) -> Outcome { + Outcome::Complete(Weight::default()) + } + + fn charge_fees(_location: impl Into, _fees: MultiAssets) -> XcmResult { + Ok(()) + } +} + #[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, TypeInfo)] pub enum XcmOperationType { // SALP operations diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index 7bf5f22ac..851a3e160 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -131,6 +131,7 @@ where C::Api: SalpRuntimeApi, C::Api: VeMintingRuntimeApi, C::Api: ZenlinkProtocolRuntimeApi, + C::Api: StablePoolRuntimeApi, C::Api: BlockBuilder, P: TransactionPool + Sync + Send + 'static, { @@ -144,7 +145,8 @@ where module.merge(FlexibleFeeRpc::new(client.clone()).into_rpc())?; module.merge(SalpRpc::new(client.clone()).into_rpc())?; module.merge(VeMintingRpc::new(client.clone()).into_rpc())?; - module.merge(ZenlinkProtocol::new(client).into_rpc())?; + module.merge(ZenlinkProtocol::new(client.clone()).into_rpc())?; + module.merge(StablePoolRpc::new(client).into_rpc())?; Ok(module) } diff --git a/pallets/asset-registry/src/weights.rs b/pallets/asset-registry/src/weights.rs index eaf56cc09..4d5a56813 100644 --- a/pallets/asset-registry/src/weights.rs +++ b/pallets/asset-registry/src/weights.rs @@ -25,10 +25,9 @@ //! Autogenerated weights for bifrost_asset_registry //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: // target/release/bifrost @@ -43,15 +42,14 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/asset-registry/src/weights.rs -// --template=./frame-weight-template.hbs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_asset_registry. pub trait WeightInfo { @@ -65,121 +63,6 @@ pub trait WeightInfo { fn force_set_multilocation() -> Weight; } -/// Weights for bifrost_asset_registry using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: AssetRegistry LocationToCurrencyIds (r:1 w:1) - /// Proof Skipped: AssetRegistry LocationToCurrencyIds (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyIdToLocations (r:1 w:1) - /// Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry AssetMetadatas (r:1 w:1) - /// Proof Skipped: AssetRegistry AssetMetadatas (max_values: None, max_size: None, mode: Measured) - fn register_native_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `80` - // Estimated: `7665` - // Minimum execution time: 48_093_000 picoseconds. - Weight::from_parts(49_225_000, 7665) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: AssetRegistry LocationToCurrencyIds (r:1 w:1) - /// Proof Skipped: AssetRegistry LocationToCurrencyIds (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyIdToLocations (r:1 w:1) - /// Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry AssetMetadatas (r:1 w:1) - /// Proof Skipped: AssetRegistry AssetMetadatas (max_values: None, max_size: None, mode: Measured) - fn update_native_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `212` - // Estimated: `8061` - // Minimum execution time: 49_877_000 picoseconds. - Weight::from_parts(50_828_000, 8061) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: AssetRegistry NextTokenId (r:1 w:1) - /// Proof Skipped: AssetRegistry NextTokenId (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:1) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - fn register_token_metadata() -> Weight { - // Proof Size summary in bytes: - // Measured: `569` - // Estimated: `4108` - // Minimum execution time: 38_037_000 picoseconds. - Weight::from_parts(39_203_000, 4108) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - fn register_vtoken_metadata() -> Weight { - // Proof Size summary in bytes: - // Measured: `772` - // Estimated: `5722` - // Minimum execution time: 44_673_000 picoseconds. - Weight::from_parts(46_256_000, 5722) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - fn register_vstoken_metadata() -> Weight { - // Proof Size summary in bytes: - // Measured: `698` - // Estimated: `5648` - // Minimum execution time: 42_165_000 picoseconds. - Weight::from_parts(43_326_000, 5648) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - fn register_vsbond_metadata() -> Weight { - // Proof Size summary in bytes: - // Measured: `756` - // Estimated: `5706` - // Minimum execution time: 46_508_000 picoseconds. - Weight::from_parts(47_756_000, 5706) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry LocationToCurrencyIds (r:1 w:1) - /// Proof Skipped: AssetRegistry LocationToCurrencyIds (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyIdToLocations (r:1 w:1) - /// Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyIdToWeights (r:0 w:1) - /// Proof Skipped: AssetRegistry CurrencyIdToWeights (max_values: None, max_size: None, mode: Measured) - fn register_multilocation() -> Weight { - // Proof Size summary in bytes: - // Measured: `676` - // Estimated: `10129` - // Minimum execution time: 38_426_000 picoseconds. - Weight::from_parts(39_937_000, 10129) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry LocationToCurrencyIds (r:0 w:1) - /// Proof Skipped: AssetRegistry LocationToCurrencyIds (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyIdToWeights (r:0 w:1) - /// Proof Skipped: AssetRegistry CurrencyIdToWeights (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyIdToLocations (r:0 w:1) - /// Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) - fn force_set_multilocation() -> Weight { - // Proof Size summary in bytes: - // Measured: `676` - // Estimated: `5179` - // Minimum execution time: 44_818_000 picoseconds. - Weight::from_parts(46_431_000, 5179) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } -} - // For backwards compatibility and tests impl WeightInfo for () { /// Storage: AssetRegistry LocationToCurrencyIds (r:1 w:1) @@ -190,10 +73,10 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry AssetMetadatas (max_values: None, max_size: None, mode: Measured) fn register_native_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `80` - // Estimated: `7665` - // Minimum execution time: 48_093_000 picoseconds. - Weight::from_parts(49_225_000, 7665) + // Measured: `118` + // Estimated: `3583` + // Minimum execution time: 52_056_000 picoseconds. + Weight::from_parts(53_012_000, 3583) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -205,10 +88,10 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry AssetMetadatas (max_values: None, max_size: None, mode: Measured) fn update_native_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `212` - // Estimated: `8061` - // Minimum execution time: 49_877_000 picoseconds. - Weight::from_parts(50_828_000, 8061) + // Measured: `250` + // Estimated: `3715` + // Minimum execution time: 59_891_000 picoseconds. + Weight::from_parts(60_869_000, 3715) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -218,10 +101,10 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) fn register_token_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `569` - // Estimated: `4108` - // Minimum execution time: 38_037_000 picoseconds. - Weight::from_parts(39_203_000, 4108) + // Measured: `607` + // Estimated: `4072` + // Minimum execution time: 46_860_000 picoseconds. + Weight::from_parts(48_151_000, 4072) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -229,10 +112,10 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) fn register_vtoken_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `772` - // Estimated: `5722` - // Minimum execution time: 44_673_000 picoseconds. - Weight::from_parts(46_256_000, 5722) + // Measured: `779` + // Estimated: `6719` + // Minimum execution time: 53_699_000 picoseconds. + Weight::from_parts(54_646_000, 6719) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -240,10 +123,10 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) fn register_vstoken_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `698` - // Estimated: `5648` - // Minimum execution time: 42_165_000 picoseconds. - Weight::from_parts(43_326_000, 5648) + // Measured: `705` + // Estimated: `6645` + // Minimum execution time: 52_491_000 picoseconds. + Weight::from_parts(53_682_000, 6645) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -251,10 +134,10 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) fn register_vsbond_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `756` - // Estimated: `5706` - // Minimum execution time: 46_508_000 picoseconds. - Weight::from_parts(47_756_000, 5706) + // Measured: `763` + // Estimated: `6703` + // Minimum execution time: 55_589_000 picoseconds. + Weight::from_parts(56_804_000, 6703) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -268,10 +151,10 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry CurrencyIdToWeights (max_values: None, max_size: None, mode: Measured) fn register_multilocation() -> Weight { // Proof Size summary in bytes: - // Measured: `676` - // Estimated: `10129` - // Minimum execution time: 38_426_000 picoseconds. - Weight::from_parts(39_937_000, 10129) + // Measured: `683` + // Estimated: `4148` + // Minimum execution time: 45_469_000 picoseconds. + Weight::from_parts(48_623_000, 4148) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -285,10 +168,10 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) fn force_set_multilocation() -> Weight { // Proof Size summary in bytes: - // Measured: `676` - // Estimated: `5179` - // Minimum execution time: 44_818_000 picoseconds. - Weight::from_parts(46_431_000, 5179) + // Measured: `683` + // Estimated: `4148` + // Minimum execution time: 52_878_000 picoseconds. + Weight::from_parts(55_012_000, 4148) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } diff --git a/pallets/call-switchgear/src/weights.rs b/pallets/call-switchgear/src/weights.rs index c4eb88ebd..ef73315fe 100644 --- a/pallets/call-switchgear/src/weights.rs +++ b/pallets/call-switchgear/src/weights.rs @@ -25,10 +25,9 @@ //! Autogenerated weights for bifrost_call_switchgear //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: // target/release/bifrost @@ -43,15 +42,14 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/call-switchgear/src/weights.rs -// --template=./frame-weight-template.hbs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_call_switchgear. pub trait WeightInfo { @@ -61,55 +59,6 @@ pub trait WeightInfo { fn enable_transfers() -> Weight; } -/// Weights for bifrost_call_switchgear using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: CallSwitchgear SwitchedOffTransactions (r:1 w:1) - /// Proof Skipped: CallSwitchgear SwitchedOffTransactions (max_values: None, max_size: None, mode: Measured) - fn switchoff_transaction() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 25_829_000 picoseconds. - Weight::from_parts(26_761_000, 2479) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: CallSwitchgear SwitchedOffTransactions (r:1 w:1) - /// Proof Skipped: CallSwitchgear SwitchedOffTransactions (max_values: None, max_size: None, mode: Measured) - fn switchon_transaction() -> Weight { - // Proof Size summary in bytes: - // Measured: `55` - // Estimated: `2530` - // Minimum execution time: 28_754_000 picoseconds. - Weight::from_parts(29_384_000, 2530) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: CallSwitchgear DisabledTransfers (r:1 w:1) - /// Proof Skipped: CallSwitchgear DisabledTransfers (max_values: None, max_size: None, mode: Measured) - fn disable_transfers() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 23_537_000 picoseconds. - Weight::from_parts(24_228_000, 2479) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: CallSwitchgear DisabledTransfers (r:1 w:1) - /// Proof Skipped: CallSwitchgear DisabledTransfers (max_values: None, max_size: None, mode: Measured) - fn enable_transfers() -> Weight { - // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `2513` - // Minimum execution time: 25_424_000 picoseconds. - Weight::from_parts(26_489_000, 2513) - .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: CallSwitchgear SwitchedOffTransactions (r:1 w:1) @@ -117,9 +66,9 @@ impl WeightInfo for () { fn switchoff_transaction() -> Weight { // Proof Size summary in bytes: // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 25_829_000 picoseconds. - Weight::from_parts(26_761_000, 2479) + // Estimated: `3469` + // Minimum execution time: 29_920_000 picoseconds. + Weight::from_parts(30_793_000, 3469) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -128,9 +77,9 @@ impl WeightInfo for () { fn switchon_transaction() -> Weight { // Proof Size summary in bytes: // Measured: `55` - // Estimated: `2530` - // Minimum execution time: 28_754_000 picoseconds. - Weight::from_parts(29_384_000, 2530) + // Estimated: `3520` + // Minimum execution time: 32_844_000 picoseconds. + Weight::from_parts(33_838_000, 3520) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -139,9 +88,9 @@ impl WeightInfo for () { fn disable_transfers() -> Weight { // Proof Size summary in bytes: // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 23_537_000 picoseconds. - Weight::from_parts(24_228_000, 2479) + // Estimated: `3469` + // Minimum execution time: 27_301_000 picoseconds. + Weight::from_parts(28_491_000, 3469) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -150,9 +99,9 @@ impl WeightInfo for () { fn enable_transfers() -> Weight { // Proof Size summary in bytes: // Measured: `38` - // Estimated: `2513` - // Minimum execution time: 25_424_000 picoseconds. - Weight::from_parts(26_489_000, 2513) + // Estimated: `3503` + // Minimum execution time: 29_133_000 picoseconds. + Weight::from_parts(30_271_000, 3503) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/pallets/cross-in-out/src/mock.rs b/pallets/cross-in-out/src/mock.rs index 20279312c..8cbe0c77e 100644 --- a/pallets/cross-in-out/src/mock.rs +++ b/pallets/cross-in-out/src/mock.rs @@ -198,13 +198,6 @@ impl ExtBuilder { ]) } - #[cfg(feature = "runtime-benchmarks")] - pub fn one_hundred_precision_for_each_currency_type_for_whitelist_account(self) -> Self { - use frame_benchmarking::whitelisted_caller; - let whitelist_caller: AccountId = whitelisted_caller(); - self.balances(vec![(whitelist_caller.clone(), KSM, 100_000_000_000_000)]) - } - pub fn build(self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); diff --git a/pallets/cross-in-out/src/weights.rs b/pallets/cross-in-out/src/weights.rs index 2911de994..c6b33e419 100644 --- a/pallets/cross-in-out/src/weights.rs +++ b/pallets/cross-in-out/src/weights.rs @@ -25,10 +25,9 @@ //! Autogenerated weights for bifrost_cross_in_out //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: // target/release/bifrost @@ -43,15 +42,14 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/cross-in-out/src/weights.rs -// --template=./frame-weight-template.hbs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_cross_in_out. pub trait WeightInfo { @@ -68,173 +66,16 @@ pub trait WeightInfo { fn change_outer_linked_account() -> Weight; } -/// Weights for bifrost_cross_in_out using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: CrossInOut CrossCurrencyRegistry (r:1 w:1) - /// Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) - fn register_currency_for_cross_in_out() -> Weight { - // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `2517` - // Minimum execution time: 27_005_000 picoseconds. - Weight::from_parts(28_306_000, 2517) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: CrossInOut CrossCurrencyRegistry (r:1 w:1) - /// Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) - fn deregister_currency_for_cross_in_out() -> Weight { - // Proof Size summary in bytes: - // Measured: `85` - // Estimated: `2560` - // Minimum execution time: 33_028_000 picoseconds. - Weight::from_parts(33_854_000, 2560) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: CrossInOut CrossingMinimumAmount (r:0 w:1) - /// Proof Skipped: CrossInOut CrossingMinimumAmount (max_values: None, max_size: None, mode: Measured) - fn set_crossing_minimum_amount() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 23_549_000 picoseconds. - Weight::from_parts(23_959_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: CrossInOut IssueWhiteList (r:1 w:1) - /// Proof Skipped: CrossInOut IssueWhiteList (max_values: None, max_size: None, mode: Measured) - fn add_to_issue_whitelist() -> Weight { - // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `2517` - // Minimum execution time: 37_476_000 picoseconds. - Weight::from_parts(38_673_000, 2517) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: CrossInOut IssueWhiteList (r:1 w:1) - /// Proof Skipped: CrossInOut IssueWhiteList (max_values: None, max_size: None, mode: Measured) - fn remove_from_issue_whitelist() -> Weight { - // Proof Size summary in bytes: - // Measured: `152` - // Estimated: `2627` - // Minimum execution time: 35_871_000 picoseconds. - Weight::from_parts(36_621_000, 2627) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: CrossInOut RegisterWhiteList (r:1 w:1) - /// Proof Skipped: CrossInOut RegisterWhiteList (max_values: None, max_size: None, mode: Measured) - fn add_to_register_whitelist() -> Weight { - // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `2517` - // Minimum execution time: 37_414_000 picoseconds. - Weight::from_parts(38_725_000, 2517) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: CrossInOut RegisterWhiteList (r:1 w:1) - /// Proof Skipped: CrossInOut RegisterWhiteList (max_values: None, max_size: None, mode: Measured) - fn remove_from_register_whitelist() -> Weight { - // Proof Size summary in bytes: - // Measured: `152` - // Estimated: `2627` - // Minimum execution time: 31_095_000 picoseconds. - Weight::from_parts(32_027_000, 2627) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: CrossInOut CrossCurrencyRegistry (r:1 w:0) - /// Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) - /// Storage: CrossInOut CrossingMinimumAmount (r:1 w:0) - /// Proof Skipped: CrossInOut CrossingMinimumAmount (max_values: None, max_size: None, mode: Measured) - /// Storage: CrossInOut IssueWhiteList (r:1 w:0) - /// Proof Skipped: CrossInOut IssueWhiteList (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - fn cross_in() -> Weight { - // Proof Size summary in bytes: - // Measured: `1685` - // Estimated: `24349` - // Minimum execution time: 128_596_000 picoseconds. - Weight::from_parts(130_717_000, 24349) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: CrossInOut RegisterWhiteList (r:1 w:0) - /// Proof Skipped: CrossInOut RegisterWhiteList (max_values: None, max_size: None, mode: Measured) - /// Storage: CrossInOut CrossCurrencyRegistry (r:1 w:0) - /// Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) - /// Storage: CrossInOut AccountToOuterMultilocation (r:1 w:1) - /// Proof Skipped: CrossInOut AccountToOuterMultilocation (max_values: None, max_size: None, mode: Measured) - /// Storage: CrossInOut OuterMultilocationToAccount (r:0 w:1) - /// Proof Skipped: CrossInOut OuterMultilocationToAccount (max_values: None, max_size: None, mode: Measured) - fn register_linked_account() -> Weight { - // Proof Size summary in bytes: - // Measured: `191` - // Estimated: `8189` - // Minimum execution time: 51_323_000 picoseconds. - Weight::from_parts(52_251_000, 8189) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: CrossInOut CrossCurrencyRegistry (r:1 w:0) - /// Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) - /// Storage: CrossInOut CrossingMinimumAmount (r:1 w:0) - /// Proof Skipped: CrossInOut CrossingMinimumAmount (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: CrossInOut AccountToOuterMultilocation (r:1 w:0) - /// Proof Skipped: CrossInOut AccountToOuterMultilocation (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - fn cross_out() -> Weight { - // Proof Size summary in bytes: - // Measured: `1739` - // Estimated: `21962` - // Minimum execution time: 108_862_000 picoseconds. - Weight::from_parts(109_900_000, 21962) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: CrossInOut CrossCurrencyRegistry (r:1 w:0) - /// Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) - /// Storage: CrossInOut AccountToOuterMultilocation (r:1 w:1) - /// Proof Skipped: CrossInOut AccountToOuterMultilocation (max_values: None, max_size: None, mode: Measured) - /// Storage: CrossInOut OuterMultilocationToAccount (r:0 w:1) - /// Proof Skipped: CrossInOut OuterMultilocationToAccount (max_values: None, max_size: None, mode: Measured) - fn change_outer_linked_account() -> Weight { - // Proof Size summary in bytes: - // Measured: `309` - // Estimated: `5877` - // Minimum execution time: 51_122_000 picoseconds. - Weight::from_parts(52_439_000, 5877) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } -} - // For backwards compatibility and tests impl WeightInfo for () { /// Storage: CrossInOut CrossCurrencyRegistry (r:1 w:1) /// Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) fn register_currency_for_cross_in_out() -> Weight { // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `2517` - // Minimum execution time: 27_005_000 picoseconds. - Weight::from_parts(28_306_000, 2517) + // Measured: `76` + // Estimated: `3541` + // Minimum execution time: 29_633_000 picoseconds. + Weight::from_parts(30_578_000, 3541) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -242,10 +83,10 @@ impl WeightInfo for () { /// Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) fn deregister_currency_for_cross_in_out() -> Weight { // Proof Size summary in bytes: - // Measured: `85` - // Estimated: `2560` - // Minimum execution time: 33_028_000 picoseconds. - Weight::from_parts(33_854_000, 2560) + // Measured: `119` + // Estimated: `3584` + // Minimum execution time: 32_833_000 picoseconds. + Weight::from_parts(34_234_000, 3584) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -255,18 +96,18 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 23_549_000 picoseconds. - Weight::from_parts(23_959_000, 0) + // Minimum execution time: 23_847_000 picoseconds. + Weight::from_parts(24_439_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: CrossInOut IssueWhiteList (r:1 w:1) /// Proof Skipped: CrossInOut IssueWhiteList (max_values: None, max_size: None, mode: Measured) fn add_to_issue_whitelist() -> Weight { // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `2517` - // Minimum execution time: 37_476_000 picoseconds. - Weight::from_parts(38_673_000, 2517) + // Measured: `76` + // Estimated: `3541` + // Minimum execution time: 34_191_000 picoseconds. + Weight::from_parts(35_236_000, 3541) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -274,10 +115,10 @@ impl WeightInfo for () { /// Proof Skipped: CrossInOut IssueWhiteList (max_values: None, max_size: None, mode: Measured) fn remove_from_issue_whitelist() -> Weight { // Proof Size summary in bytes: - // Measured: `152` - // Estimated: `2627` - // Minimum execution time: 35_871_000 picoseconds. - Weight::from_parts(36_621_000, 2627) + // Measured: `154` + // Estimated: `3619` + // Minimum execution time: 35_934_000 picoseconds. + Weight::from_parts(37_252_000, 3619) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -285,10 +126,10 @@ impl WeightInfo for () { /// Proof Skipped: CrossInOut RegisterWhiteList (max_values: None, max_size: None, mode: Measured) fn add_to_register_whitelist() -> Weight { // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `2517` - // Minimum execution time: 37_414_000 picoseconds. - Weight::from_parts(38_725_000, 2517) + // Measured: `76` + // Estimated: `3541` + // Minimum execution time: 37_554_000 picoseconds. + Weight::from_parts(38_949_000, 3541) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -296,10 +137,10 @@ impl WeightInfo for () { /// Proof Skipped: CrossInOut RegisterWhiteList (max_values: None, max_size: None, mode: Measured) fn remove_from_register_whitelist() -> Weight { // Proof Size summary in bytes: - // Measured: `152` - // Estimated: `2627` - // Minimum execution time: 31_095_000 picoseconds. - Weight::from_parts(32_027_000, 2627) + // Measured: `154` + // Estimated: `3619` + // Minimum execution time: 35_639_000 picoseconds. + Weight::from_parts(36_505_000, 3619) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -319,10 +160,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn cross_in() -> Weight { // Proof Size summary in bytes: - // Measured: `1685` - // Estimated: `24349` - // Minimum execution time: 128_596_000 picoseconds. - Weight::from_parts(130_717_000, 24349) + // Measured: `1758` + // Estimated: `5223` + // Minimum execution time: 146_488_000 picoseconds. + Weight::from_parts(150_867_000, 5223) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -336,10 +177,10 @@ impl WeightInfo for () { /// Proof Skipped: CrossInOut OuterMultilocationToAccount (max_values: None, max_size: None, mode: Measured) fn register_linked_account() -> Weight { // Proof Size summary in bytes: - // Measured: `191` - // Estimated: `8189` - // Minimum execution time: 51_323_000 picoseconds. - Weight::from_parts(52_251_000, 8189) + // Measured: `193` + // Estimated: `3658` + // Minimum execution time: 58_046_000 picoseconds. + Weight::from_parts(60_005_000, 3658) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -357,10 +198,10 @@ impl WeightInfo for () { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) fn cross_out() -> Weight { // Proof Size summary in bytes: - // Measured: `1739` - // Estimated: `21962` - // Minimum execution time: 108_862_000 picoseconds. - Weight::from_parts(109_900_000, 21962) + // Measured: `1781` + // Estimated: `5246` + // Minimum execution time: 121_998_000 picoseconds. + Weight::from_parts(125_151_000, 5246) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -372,10 +213,10 @@ impl WeightInfo for () { /// Proof Skipped: CrossInOut OuterMultilocationToAccount (max_values: None, max_size: None, mode: Measured) fn change_outer_linked_account() -> Weight { // Proof Size summary in bytes: - // Measured: `309` - // Estimated: `5877` - // Minimum execution time: 51_122_000 picoseconds. - Weight::from_parts(52_439_000, 5877) + // Measured: `312` + // Estimated: `3777` + // Minimum execution time: 56_481_000 picoseconds. + Weight::from_parts(57_253_000, 3777) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } diff --git a/pallets/farming/src/mock.rs b/pallets/farming/src/mock.rs index b26033366..9a377203b 100644 --- a/pallets/farming/src/mock.rs +++ b/pallets/farming/src/mock.rs @@ -249,13 +249,6 @@ impl ExtBuilder { ]) } - #[cfg(feature = "runtime-benchmarks")] - pub fn one_hundred_precision_for_each_currency_type_for_whitelist_account(self) -> Self { - use frame_benchmarking::whitelisted_caller; - let whitelist_caller: AccountId = whitelisted_caller(); - self.balances(vec![(whitelist_caller.clone(), KSM, 100_000_000_000_000)]) - } - pub fn build(self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); diff --git a/pallets/farming/src/weights.rs b/pallets/farming/src/weights.rs index e3fca7f5e..1b582cbdd 100644 --- a/pallets/farming/src/weights.rs +++ b/pallets/farming/src/weights.rs @@ -25,10 +25,9 @@ //! Autogenerated weights for bifrost_farming //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: // target/release/bifrost @@ -43,15 +42,14 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/farming/src/weights.rs -// --template=./frame-weight-template.hbs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_farming. pub trait WeightInfo { @@ -78,313 +76,6 @@ pub trait WeightInfo { fn charge_boost() -> Weight; } -/// Weights for bifrost_farming using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: Farming PoolInfos (r:1 w:0) - /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming GaugePoolInfos (r:1 w:0) - /// Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming BoostPoolInfos (r:1 w:0) - /// Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) - fn on_initialize() -> Weight { - // Proof Size summary in bytes: - // Measured: `79` - // Estimated: `5682` - // Minimum execution time: 19_305_000 picoseconds. - Weight::from_parts(20_191_000, 5682) - .saturating_add(T::DbWeight::get().reads(3_u64)) - } - /// Storage: Farming PoolNextId (r:1 w:1) - /// Proof Skipped: Farming PoolNextId (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Farming GaugePoolNextId (r:1 w:1) - /// Proof Skipped: Farming GaugePoolNextId (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Farming GaugePoolInfos (r:0 w:1) - /// Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming PoolInfos (r:0 w:1) - /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) - fn create_farming_pool() -> Weight { - // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `1294` - // Minimum execution time: 43_677_000 picoseconds. - Weight::from_parts(44_694_000, 1294) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// Storage: Farming PoolInfos (r:1 w:1) - /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Farming SharesAndWithdrawnRewards (r:1 w:1) - /// Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) - fn deposit() -> Weight { - // Proof Size summary in bytes: - // Measured: `1743` - // Estimated: `20443` - // Minimum execution time: 155_642_000 picoseconds. - Weight::from_parts(157_747_000, 20443) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) - } - /// Storage: Farming PoolInfos (r:1 w:1) - /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming SharesAndWithdrawnRewards (r:1 w:1) - /// Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) - fn withdraw() -> Weight { - // Proof Size summary in bytes: - // Measured: `540` - // Estimated: `6030` - // Minimum execution time: 67_647_000 picoseconds. - Weight::from_parts(68_944_000, 6030) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: Farming PoolInfos (r:1 w:1) - /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming SharesAndWithdrawnRewards (r:1 w:1) - /// Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming GaugeInfos (r:1 w:0) - /// Proof Skipped: Farming GaugeInfos (max_values: None, max_size: None, mode: Measured) - fn claim() -> Weight { - // Proof Size summary in bytes: - // Measured: `577` - // Estimated: `9156` - // Minimum execution time: 73_923_000 picoseconds. - Weight::from_parts(74_891_000, 9156) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: Farming GaugePoolInfos (r:1 w:1) - /// Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming GaugeInfos (r:1 w:1) - /// Proof Skipped: Farming GaugeInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming PoolInfos (r:1 w:0) - /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming SharesAndWithdrawnRewards (r:1 w:0) - /// Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) - fn gauge_withdraw() -> Weight { - // Proof Size summary in bytes: - // Measured: `925` - // Estimated: `13600` - // Minimum execution time: 70_886_000 picoseconds. - Weight::from_parts(73_156_000, 13600) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: Farming PoolInfos (r:1 w:0) - /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming SharesAndWithdrawnRewards (r:1 w:1) - /// Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) - fn withdraw_claim() -> Weight { - // Proof Size summary in bytes: - // Measured: `540` - // Estimated: `6030` - // Minimum execution time: 51_916_000 picoseconds. - Weight::from_parts(52_547_000, 6030) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Farming PoolInfos (r:1 w:1) - /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming GaugePoolNextId (r:1 w:1) - /// Proof Skipped: Farming GaugePoolNextId (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Farming GaugePoolInfos (r:0 w:1) - /// Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) - fn reset_pool() -> Weight { - // Proof Size summary in bytes: - // Measured: `435` - // Estimated: `4275` - // Minimum execution time: 56_518_000 picoseconds. - Weight::from_parts(57_441_000, 4275) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: Farming PoolInfos (r:1 w:1) - /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming RetireLimit (r:1 w:0) - /// Proof Skipped: Farming RetireLimit (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Farming SharesAndWithdrawnRewards (r:1 w:0) - /// Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming GaugePoolInfos (r:1 w:1) - /// Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) - fn force_retire_pool() -> Weight { - // Proof Size summary in bytes: - // Measured: `657` - // Estimated: `10548` - // Minimum execution time: 61_347_000 picoseconds. - Weight::from_parts(62_069_000, 10548) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: Farming PoolInfos (r:1 w:1) - /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) - fn kill_pool() -> Weight { - // Proof Size summary in bytes: - // Measured: `379` - // Estimated: `2854` - // Minimum execution time: 49_008_000 picoseconds. - Weight::from_parts(50_066_000, 2854) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Farming PoolInfos (r:1 w:1) - /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming GaugePoolInfos (r:1 w:1) - /// Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) - fn edit_pool() -> Weight { - // Proof Size summary in bytes: - // Measured: `544` - // Estimated: `6038` - // Minimum execution time: 46_003_000 picoseconds. - Weight::from_parts(47_284_000, 6038) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: Farming PoolInfos (r:1 w:1) - /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) - fn close_pool() -> Weight { - // Proof Size summary in bytes: - // Measured: `416` - // Estimated: `2891` - // Minimum execution time: 38_774_000 picoseconds. - Weight::from_parts(39_329_000, 2891) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Farming PoolInfos (r:1 w:1) - /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - fn charge() -> Weight { - // Proof Size summary in bytes: - // Measured: `2081` - // Estimated: `16901` - // Minimum execution time: 151_181_000 picoseconds. - Weight::from_parts(153_395_000, 16901) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// Storage: Farming RetireLimit (r:1 w:0) - /// Proof Skipped: Farming RetireLimit (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Farming GaugeInfos (r:2 w:1) - /// Proof Skipped: Farming GaugeInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming GaugePoolInfos (r:1 w:1) - /// Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming PoolInfos (r:1 w:0) - /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming SharesAndWithdrawnRewards (r:1 w:0) - /// Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) - fn force_gauge_claim() -> Weight { - // Proof Size summary in bytes: - // Measured: `948` - // Estimated: `17610` - // Minimum execution time: 89_967_000 picoseconds. - Weight::from_parts(91_798_000, 17610) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: Farming RetireLimit (r:1 w:1) - /// Proof Skipped: Farming RetireLimit (max_values: Some(1), max_size: None, mode: Measured) - fn set_retire_limit() -> Weight { - // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `571` - // Minimum execution time: 29_222_000 picoseconds. - Weight::from_parts(29_879_000, 571) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Farming BoostWhitelist (r:0 w:1) - /// Proof Skipped: Farming BoostWhitelist (max_values: None, max_size: None, mode: Measured) - fn add_boost_pool_whitelist() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 8_881_000 picoseconds. - Weight::from_parts(9_147_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Farming BoostNextRoundWhitelist (r:0 w:1) - /// Proof Skipped: Farming BoostNextRoundWhitelist (max_values: None, max_size: None, mode: Measured) - fn set_next_round_whitelist() -> Weight { - // Proof Size summary in bytes: - // Measured: `112` - // Estimated: `112` - // Minimum execution time: 14_347_000 picoseconds. - Weight::from_parts(15_074_000, 112) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Farming BoostPoolInfos (r:1 w:1) - /// Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Farming UserBoostInfos (r:1 w:1) - /// Proof Skipped: Farming UserBoostInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming BoostWhitelist (r:1 w:0) - /// Proof Skipped: Farming BoostWhitelist (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming BoostVotingPools (r:1 w:1) - /// Proof Skipped: Farming BoostVotingPools (max_values: None, max_size: None, mode: Measured) - fn vote() -> Weight { - // Proof Size summary in bytes: - // Measured: `112` - // Estimated: `8368` - // Minimum execution time: 42_834_000 picoseconds. - Weight::from_parts(44_033_000, 8368) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: Farming BoostPoolInfos (r:1 w:1) - /// Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Farming BoostNextRoundWhitelist (r:1 w:0) - /// Proof Skipped: Farming BoostNextRoundWhitelist (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming BoostWhitelist (r:2 w:0) - /// Proof Skipped: Farming BoostWhitelist (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming BoostVotingPools (r:1 w:0) - /// Proof Skipped: Farming BoostVotingPools (max_values: None, max_size: None, mode: Measured) - fn start_boost_round() -> Weight { - // Proof Size summary in bytes: - // Measured: `115` - // Estimated: `10855` - // Minimum execution time: 55_528_000 picoseconds. - Weight::from_parts(57_185_000, 10855) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Farming BoostPoolInfos (r:1 w:1) - /// Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) - fn end_boost_round() -> Weight { - // Proof Size summary in bytes: - // Measured: `162` - // Estimated: `657` - // Minimum execution time: 36_780_000 picoseconds. - Weight::from_parts(37_654_000, 657) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - fn charge_boost() -> Weight { - // Proof Size summary in bytes: - // Measured: `1437` - // Estimated: `11701` - // Minimum execution time: 101_756_000 picoseconds. - Weight::from_parts(103_351_000, 11701) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } -} - // For backwards compatibility and tests impl WeightInfo for () { /// Storage: Farming PoolInfos (r:1 w:0) @@ -395,10 +86,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) fn on_initialize() -> Weight { // Proof Size summary in bytes: - // Measured: `79` - // Estimated: `5682` - // Minimum execution time: 19_305_000 picoseconds. - Weight::from_parts(20_191_000, 5682) + // Measured: `113` + // Estimated: `3578` + // Minimum execution time: 22_196_000 picoseconds. + Weight::from_parts(22_819_000, 3578) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: Farming PoolNextId (r:1 w:1) @@ -411,10 +102,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) fn create_farming_pool() -> Weight { // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `1294` - // Minimum execution time: 43_677_000 picoseconds. - Weight::from_parts(44_694_000, 1294) + // Measured: `109` + // Estimated: `1594` + // Minimum execution time: 52_258_000 picoseconds. + Weight::from_parts(53_256_000, 1594) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -430,10 +121,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) fn deposit() -> Weight { // Proof Size summary in bytes: - // Measured: `1743` - // Estimated: `20443` - // Minimum execution time: 155_642_000 picoseconds. - Weight::from_parts(157_747_000, 20443) + // Measured: `1752` + // Estimated: `6176` + // Minimum execution time: 167_051_000 picoseconds. + Weight::from_parts(168_516_000, 6176) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -443,10 +134,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) fn withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `540` - // Estimated: `6030` - // Minimum execution time: 67_647_000 picoseconds. - Weight::from_parts(68_944_000, 6030) + // Measured: `510` + // Estimated: `3975` + // Minimum execution time: 78_421_000 picoseconds. + Weight::from_parts(79_506_000, 3975) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -458,10 +149,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming GaugeInfos (max_values: None, max_size: None, mode: Measured) fn claim() -> Weight { // Proof Size summary in bytes: - // Measured: `577` - // Estimated: `9156` - // Minimum execution time: 73_923_000 picoseconds. - Weight::from_parts(74_891_000, 9156) + // Measured: `547` + // Estimated: `4012` + // Minimum execution time: 76_622_000 picoseconds. + Weight::from_parts(78_830_000, 4012) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -475,10 +166,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) fn gauge_withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `925` - // Estimated: `13600` - // Minimum execution time: 70_886_000 picoseconds. - Weight::from_parts(73_156_000, 13600) + // Measured: `832` + // Estimated: `4297` + // Minimum execution time: 82_741_000 picoseconds. + Weight::from_parts(83_538_000, 4297) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -488,10 +179,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) fn withdraw_claim() -> Weight { // Proof Size summary in bytes: - // Measured: `540` - // Estimated: `6030` - // Minimum execution time: 51_916_000 picoseconds. - Weight::from_parts(52_547_000, 6030) + // Measured: `510` + // Estimated: `3975` + // Minimum execution time: 52_996_000 picoseconds. + Weight::from_parts(53_551_000, 3975) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -503,10 +194,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) fn reset_pool() -> Weight { // Proof Size summary in bytes: - // Measured: `435` - // Estimated: `4275` - // Minimum execution time: 56_518_000 picoseconds. - Weight::from_parts(57_441_000, 4275) + // Measured: `436` + // Estimated: `3901` + // Minimum execution time: 57_942_000 picoseconds. + Weight::from_parts(59_389_000, 3901) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -520,10 +211,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) fn force_retire_pool() -> Weight { // Proof Size summary in bytes: - // Measured: `657` - // Estimated: `10548` - // Minimum execution time: 61_347_000 picoseconds. - Weight::from_parts(62_069_000, 10548) + // Measured: `627` + // Estimated: `4092` + // Minimum execution time: 71_364_000 picoseconds. + Weight::from_parts(72_102_000, 4092) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -531,10 +222,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) fn kill_pool() -> Weight { // Proof Size summary in bytes: - // Measured: `379` - // Estimated: `2854` - // Minimum execution time: 49_008_000 picoseconds. - Weight::from_parts(50_066_000, 2854) + // Measured: `380` + // Estimated: `3845` + // Minimum execution time: 50_351_000 picoseconds. + Weight::from_parts(51_472_000, 3845) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -544,10 +235,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) fn edit_pool() -> Weight { // Proof Size summary in bytes: - // Measured: `544` - // Estimated: `6038` - // Minimum execution time: 46_003_000 picoseconds. - Weight::from_parts(47_284_000, 6038) + // Measured: `513` + // Estimated: `3978` + // Minimum execution time: 54_633_000 picoseconds. + Weight::from_parts(55_902_000, 3978) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -555,10 +246,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) fn close_pool() -> Weight { // Proof Size summary in bytes: - // Measured: `416` - // Estimated: `2891` - // Minimum execution time: 38_774_000 picoseconds. - Weight::from_parts(39_329_000, 2891) + // Measured: `417` + // Estimated: `3882` + // Minimum execution time: 44_443_000 picoseconds. + Weight::from_parts(45_086_000, 3882) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -572,10 +263,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn charge() -> Weight { // Proof Size summary in bytes: - // Measured: `2081` - // Estimated: `16901` - // Minimum execution time: 151_181_000 picoseconds. - Weight::from_parts(153_395_000, 16901) + // Measured: `2059` + // Estimated: `6176` + // Minimum execution time: 161_356_000 picoseconds. + Weight::from_parts(164_649_000, 6176) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -591,10 +282,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) fn force_gauge_claim() -> Weight { // Proof Size summary in bytes: - // Measured: `948` - // Estimated: `17610` - // Minimum execution time: 89_967_000 picoseconds. - Weight::from_parts(91_798_000, 17610) + // Measured: `855` + // Estimated: `6795` + // Minimum execution time: 99_412_000 picoseconds. + Weight::from_parts(100_812_000, 6795) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -602,10 +293,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming RetireLimit (max_values: Some(1), max_size: None, mode: Measured) fn set_retire_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `571` - // Minimum execution time: 29_222_000 picoseconds. - Weight::from_parts(29_879_000, 571) + // Measured: `109` + // Estimated: `1594` + // Minimum execution time: 25_870_000 picoseconds. + Weight::from_parts(30_230_000, 1594) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -615,18 +306,18 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_881_000 picoseconds. - Weight::from_parts(9_147_000, 0) + // Minimum execution time: 11_929_000 picoseconds. + Weight::from_parts(12_452_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Farming BoostNextRoundWhitelist (r:0 w:1) /// Proof Skipped: Farming BoostNextRoundWhitelist (max_values: None, max_size: None, mode: Measured) fn set_next_round_whitelist() -> Weight { // Proof Size summary in bytes: - // Measured: `112` - // Estimated: `112` - // Minimum execution time: 14_347_000 picoseconds. - Weight::from_parts(15_074_000, 112) + // Measured: `145` + // Estimated: `145` + // Minimum execution time: 19_845_000 picoseconds. + Weight::from_parts(20_682_000, 145) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Farming BoostPoolInfos (r:1 w:1) @@ -639,10 +330,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming BoostVotingPools (max_values: None, max_size: None, mode: Measured) fn vote() -> Weight { // Proof Size summary in bytes: - // Measured: `112` - // Estimated: `8368` - // Minimum execution time: 42_834_000 picoseconds. - Weight::from_parts(44_033_000, 8368) + // Measured: `145` + // Estimated: `3610` + // Minimum execution time: 48_923_000 picoseconds. + Weight::from_parts(51_057_000, 3610) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -656,10 +347,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming BoostVotingPools (max_values: None, max_size: None, mode: Measured) fn start_boost_round() -> Weight { // Proof Size summary in bytes: - // Measured: `115` - // Estimated: `10855` - // Minimum execution time: 55_528_000 picoseconds. - Weight::from_parts(57_185_000, 10855) + // Measured: `149` + // Estimated: `6089` + // Minimum execution time: 62_858_000 picoseconds. + Weight::from_parts(64_382_000, 6089) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -667,10 +358,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) fn end_boost_round() -> Weight { // Proof Size summary in bytes: - // Measured: `162` - // Estimated: `657` - // Minimum execution time: 36_780_000 picoseconds. - Weight::from_parts(37_654_000, 657) + // Measured: `195` + // Estimated: `1680` + // Minimum execution time: 42_902_000 picoseconds. + Weight::from_parts(43_451_000, 1680) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -682,10 +373,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn charge_boost() -> Weight { // Proof Size summary in bytes: - // Measured: `1437` - // Estimated: `11701` - // Minimum execution time: 101_756_000 picoseconds. - Weight::from_parts(103_351_000, 11701) + // Measured: `1477` + // Estimated: `6176` + // Minimum execution time: 124_495_000 picoseconds. + Weight::from_parts(127_177_000, 6176) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } diff --git a/pallets/fee-share/src/mock.rs b/pallets/fee-share/src/mock.rs index f81d06a2d..8f744fa8f 100644 --- a/pallets/fee-share/src/mock.rs +++ b/pallets/fee-share/src/mock.rs @@ -204,7 +204,7 @@ impl bifrost_fee_share::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Currencies; type ControlOrigin = EnsureSignedBy; - type WeightInfo = bifrost_fee_share::weights::BifrostWeight; + type WeightInfo = (); type FeeSharePalletId = FeeSharePalletId; } @@ -305,8 +305,6 @@ impl bifrost_slp::Config for Runtime { type BifrostSlpx = SlpxInterface; type AccountConverter = SubAccountIndexMultiLocationConvertor; type ParachainId = ParachainId; - type XcmRouter = (); - type XcmExecutor = (); type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; type MaxRefundPerBlock = MaxRefundPerBlock; @@ -550,13 +548,6 @@ impl ExtBuilder { ]) } - #[cfg(feature = "runtime-benchmarks")] - pub fn one_hundred_precision_for_each_currency_type_for_whitelist_account(self) -> Self { - use frame_benchmarking::whitelisted_caller; - let whitelist_caller: AccountId = whitelisted_caller(); - self.balances(vec![(whitelist_caller.clone(), KSM, 100_000_000_000_000)]) - } - pub fn build(self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); diff --git a/pallets/fee-share/src/weights.rs b/pallets/fee-share/src/weights.rs index c6516d108..ce493aaec 100644 --- a/pallets/fee-share/src/weights.rs +++ b/pallets/fee-share/src/weights.rs @@ -25,10 +25,9 @@ //! Autogenerated weights for bifrost_fee_share //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: // target/release/bifrost @@ -43,15 +42,14 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/fee-share/src/weights.rs -// --template=./frame-weight-template.hbs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_fee_share. pub trait WeightInfo { @@ -63,84 +61,6 @@ pub trait WeightInfo { fn delete_distribution() -> Weight; } -/// Weights for bifrost_fee_share using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: FeeShare AutoEra (r:1 w:0) - /// Proof Skipped: FeeShare AutoEra (max_values: Some(1), max_size: None, mode: Measured) - fn on_initialize() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `499` - // Minimum execution time: 6_362_000 picoseconds. - Weight::from_parts(6_784_000, 499) - .saturating_add(T::DbWeight::get().reads(1_u64)) - } - /// Storage: FeeShare DistributionNextId (r:1 w:1) - /// Proof Skipped: FeeShare DistributionNextId (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: FeeShare DistributionInfos (r:0 w:1) - /// Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) - fn create_distribution() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `503` - // Minimum execution time: 36_282_000 picoseconds. - Weight::from_parts(36_773_000, 503) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: FeeShare DistributionInfos (r:1 w:1) - /// Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) - fn edit_distribution() -> Weight { - // Proof Size summary in bytes: - // Measured: `171` - // Estimated: `2646` - // Minimum execution time: 33_330_000 picoseconds. - Weight::from_parts(34_492_000, 2646) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: FeeShare AutoEra (r:0 w:1) - /// Proof Skipped: FeeShare AutoEra (max_values: Some(1), max_size: None, mode: Measured) - fn set_era_length() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 18_812_000 picoseconds. - Weight::from_parts(19_497_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: FeeShare DistributionInfos (r:1 w:0) - /// Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:0) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - fn execute_distribute() -> Weight { - // Proof Size summary in bytes: - // Measured: `1608` - // Estimated: `13352` - // Minimum execution time: 68_546_000 picoseconds. - Weight::from_parts(70_462_000, 13352) - .saturating_add(T::DbWeight::get().reads(4_u64)) - } - /// Storage: FeeShare DistributionInfos (r:1 w:1) - /// Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:0) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - fn delete_distribution() -> Weight { - // Proof Size summary in bytes: - // Measured: `1608` - // Estimated: `13352` - // Minimum execution time: 72_210_000 picoseconds. - Weight::from_parts(73_580_000, 13352) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } -} - // For backwards compatibility and tests impl WeightInfo for () { /// Storage: FeeShare AutoEra (r:1 w:0) @@ -148,9 +68,9 @@ impl WeightInfo for () { fn on_initialize() -> Weight { // Proof Size summary in bytes: // Measured: `4` - // Estimated: `499` - // Minimum execution time: 6_362_000 picoseconds. - Weight::from_parts(6_784_000, 499) + // Estimated: `1489` + // Minimum execution time: 6_481_000 picoseconds. + Weight::from_parts(6_774_000, 1489) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: FeeShare DistributionNextId (r:1 w:1) @@ -160,9 +80,9 @@ impl WeightInfo for () { fn create_distribution() -> Weight { // Proof Size summary in bytes: // Measured: `4` - // Estimated: `503` - // Minimum execution time: 36_282_000 picoseconds. - Weight::from_parts(36_773_000, 503) + // Estimated: `1489` + // Minimum execution time: 37_036_000 picoseconds. + Weight::from_parts(38_003_000, 1489) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -170,10 +90,10 @@ impl WeightInfo for () { /// Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) fn edit_distribution() -> Weight { // Proof Size summary in bytes: - // Measured: `171` - // Estimated: `2646` - // Minimum execution time: 33_330_000 picoseconds. - Weight::from_parts(34_492_000, 2646) + // Measured: `139` + // Estimated: `3604` + // Minimum execution time: 38_459_000 picoseconds. + Weight::from_parts(39_181_000, 3604) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -183,8 +103,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_812_000 picoseconds. - Weight::from_parts(19_497_000, 0) + // Minimum execution time: 22_953_000 picoseconds. + Weight::from_parts(23_565_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: FeeShare DistributionInfos (r:1 w:0) @@ -195,10 +115,10 @@ impl WeightInfo for () { /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) fn execute_distribute() -> Weight { // Proof Size summary in bytes: - // Measured: `1608` - // Estimated: `13352` - // Minimum execution time: 68_546_000 picoseconds. - Weight::from_parts(70_462_000, 13352) + // Measured: `1616` + // Estimated: `6176` + // Minimum execution time: 76_615_000 picoseconds. + Weight::from_parts(78_181_000, 6176) .saturating_add(RocksDbWeight::get().reads(4_u64)) } /// Storage: FeeShare DistributionInfos (r:1 w:1) @@ -209,10 +129,10 @@ impl WeightInfo for () { /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) fn delete_distribution() -> Weight { // Proof Size summary in bytes: - // Measured: `1608` - // Estimated: `13352` - // Minimum execution time: 72_210_000 picoseconds. - Weight::from_parts(73_580_000, 13352) + // Measured: `1616` + // Estimated: `6176` + // Minimum execution time: 79_367_000 picoseconds. + Weight::from_parts(80_687_000, 6176) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/pallets/flexible-fee/src/benchmarking.rs b/pallets/flexible-fee/src/benchmarking.rs index 820ba265c..e86e75e04 100644 --- a/pallets/flexible-fee/src/benchmarking.rs +++ b/pallets/flexible-fee/src/benchmarking.rs @@ -37,7 +37,7 @@ benchmarks! { }: _(RawOrigin::Root,default_list) impl_benchmark_test_suite!( - FlexibleFee, - crate::mock::ExtBuilder::default().build(), + Pallet, + crate::mock::new_test_ext(), crate::mock::Test) } diff --git a/pallets/flexible-fee/src/mock.rs b/pallets/flexible-fee/src/mock.rs index c3731884b..3dec5be1e 100644 --- a/pallets/flexible-fee/src/mock.rs +++ b/pallets/flexible-fee/src/mock.rs @@ -24,8 +24,6 @@ use balances::Call as BalancesCall; use bifrost_asset_registry::AssetIdMaps; use bifrost_vtoken_voting::AccountVote; use cumulus_primitives_core::ParaId as Pid; -#[cfg(feature = "runtime-benchmarks")] -use frame_benchmarking::whitelisted_caller; use frame_support::{ ord_parameter_types, parameter_types, sp_runtime::{DispatchError, DispatchResult}, @@ -361,55 +359,6 @@ where } } -#[cfg(feature = "runtime-benchmarks")] -pub struct ExtBuilder { - endowed_accounts: Vec<(AccountId, CurrencyId, Balance)>, -} - -#[cfg(feature = "runtime-benchmarks")] -impl Default for ExtBuilder { - fn default() -> Self { - Self { endowed_accounts: vec![] } - } -} - -#[cfg(feature = "runtime-benchmarks")] -impl ExtBuilder { - pub fn balances(mut self, endowed_accounts: Vec<(AccountId32, CurrencyId, Balance)>) -> Self { - self.endowed_accounts = endowed_accounts; - self - } - - pub fn one_hundred_precision_for_each_currency_type_for_whitelist_account(self) -> Self { - let whitelist_caller: AccountId32 = whitelisted_caller(); - let c0 = CurrencyId::Token(TokenSymbol::try_from(0u8).unwrap_or_default()); - let c1 = CurrencyId::Token(TokenSymbol::try_from(1u8).unwrap_or_default()); - let c2 = CurrencyId::Token(TokenSymbol::try_from(2u8).unwrap_or_default()); - let c3 = CurrencyId::Token(TokenSymbol::try_from(3u8).unwrap_or_default()); - let c4 = CurrencyId::Token(TokenSymbol::try_from(4u8).unwrap_or_default()); - let c5 = CurrencyId::Token(TokenSymbol::try_from(5u8).unwrap_or_default()); - - self.balances(vec![ - (whitelist_caller.clone(), c0, 100_000_000_000_000), - (whitelist_caller.clone(), c1, 100_000_000_000_000), - (whitelist_caller.clone(), c2, 100_000_000_000_000), - (whitelist_caller.clone(), c3, 100_000_000_000_000), - (whitelist_caller.clone(), c4, 100_000_000_000_000), - (whitelist_caller.clone(), c5, 100_000_000_000_000), - ]) - } - - pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - - orml_tokens::GenesisConfig:: { balances: self.endowed_accounts } - .assimilate_storage(&mut t) - .unwrap(); - - t.into() - } -} - // Build genesis storage according to the mock runtime. pub(crate) fn new_test_ext() -> sp_io::TestExternalities { system::GenesisConfig::default().build_storage::().unwrap().into() @@ -591,6 +540,15 @@ impl DerivativeAccountHandler for DerivativeAccount { Self::get_multilocation(token, derivative_index) .and_then(|_location| Some((u32::MAX.into(), u32::MAX.into()))) } + + #[cfg(feature = "runtime-benchmarks")] + fn init_minimums_and_maximums(_token: CurrencyId) {} + + #[cfg(feature = "runtime-benchmarks")] + fn new_delegator_ledger(_token: CurrencyId, _who: MultiLocation) {} + + #[cfg(feature = "runtime-benchmarks")] + fn add_delegator(_token: CurrencyId, _index: DerivativeIndex, _who: MultiLocation) {} } parameter_types! { diff --git a/pallets/flexible-fee/src/weights.rs b/pallets/flexible-fee/src/weights.rs index 57a135be9..a67119b94 100644 --- a/pallets/flexible-fee/src/weights.rs +++ b/pallets/flexible-fee/src/weights.rs @@ -25,10 +25,9 @@ //! Autogenerated weights for bifrost_flexible_fee //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: // target/release/bifrost @@ -43,15 +42,14 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/flexible-fee/src/weights.rs -// --template=./frame-weight-template.hbs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_flexible_fee. pub trait WeightInfo { @@ -59,31 +57,6 @@ pub trait WeightInfo { fn set_universal_fee_currency_order_list() -> Weight; } -/// Weights for bifrost_flexible_fee using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: FlexibleFee UserDefaultFeeCurrency (r:0 w:1) - /// Proof Skipped: FlexibleFee UserDefaultFeeCurrency (max_values: None, max_size: None, mode: Measured) - fn set_user_default_fee_currency() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 11_306_000 picoseconds. - Weight::from_parts(11_794_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: FlexibleFee UniversalFeeCurrencyOrderList (r:0 w:1) - /// Proof Skipped: FlexibleFee UniversalFeeCurrencyOrderList (max_values: Some(1), max_size: None, mode: Measured) - fn set_universal_fee_currency_order_list() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 8_747_000 picoseconds. - Weight::from_parts(8_971_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } -} - // For backwards compatibility and tests impl WeightInfo for () { /// Storage: FlexibleFee UserDefaultFeeCurrency (r:0 w:1) @@ -92,8 +65,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_306_000 picoseconds. - Weight::from_parts(11_794_000, 0) + // Minimum execution time: 11_322_000 picoseconds. + Weight::from_parts(11_925_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: FlexibleFee UniversalFeeCurrencyOrderList (r:0 w:1) @@ -102,8 +75,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_747_000 picoseconds. - Weight::from_parts(8_971_000, 0) + // Minimum execution time: 10_424_000 picoseconds. + Weight::from_parts(10_846_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } } diff --git a/pallets/prices/Cargo.toml b/pallets/prices/Cargo.toml index 0f5c33ae7..e0145ce0c 100644 --- a/pallets/prices/Cargo.toml +++ b/pallets/prices/Cargo.toml @@ -51,7 +51,5 @@ std = [ ] try-runtime = ['frame-support/try-runtime'] -runtime-benchmarks = ['pallet-assets/runtime-benchmarks'] - [lib] doctest = false diff --git a/pallets/prices/src/mock.rs b/pallets/prices/src/mock.rs index 3a73e58aa..1b8daa8e6 100644 --- a/pallets/prices/src/mock.rs +++ b/pallets/prices/src/mock.rs @@ -170,8 +170,6 @@ impl pallet_assets::Config for Test { type WeightInfo = (); type RemoveItemsLimit = frame_support::traits::ConstU32<1000>; type CallbackHandle = (); - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = (); } parameter_types! { diff --git a/pallets/salp/src/benchmarking.rs b/pallets/salp/src/benchmarking.rs index efe556191..af27e0f85 100644 --- a/pallets/salp/src/benchmarking.rs +++ b/pallets/salp/src/benchmarking.rs @@ -20,15 +20,16 @@ #[cfg(feature = "runtime-benchmarks")] pub use crate::{Pallet as Salp, *}; use bifrost_stable_pool::AtLeast64BitUnsignedOf; -use frame_benchmarking::v1::{account, benchmarks, whitelisted_caller, BenchmarkError}; +use frame_benchmarking::v2::*; use frame_support::assert_ok; use frame_system::RawOrigin; -use node_primitives::{CurrencyId, ParaId, KSM, VSKSM}; +use node_primitives::{CurrencyId, ParaId, XcmOperationType, KSM, VSKSM}; use sp_runtime::{ - traits::{AccountIdConversion, Bounded, StaticLookup, UniqueSaturatedFrom}, + traits::{AccountIdConversion, Bounded, UniqueSaturatedFrom}, SaturatedConversion, }; use sp_std::prelude::*; +use xcm_interface::XcmWeightAndFee; fn assert_last_event(generic_event: ::RuntimeEvent) { let events = frame_system::Pallet::::events(); @@ -40,8 +41,8 @@ fn assert_last_event(generic_event: ::RuntimeEvent) { fn create_fund(id: u32) -> ParaId { let cap = BalanceOf::::max_value(); - let first_period = (0 as u32).into(); - let last_period = (7 as u32).into(); + let first_period = 0u32.into(); + let last_period = 7u32.into(); let para_id = id; assert_ok!(Salp::::create(RawOrigin::Root.into(), para_id, cap, first_period, last_period)); @@ -49,299 +50,360 @@ fn create_fund(id: u32) -> ParaId { para_id } -#[allow(dead_code)] -fn contribute_fund(who: &T::AccountId, index: ParaId) { +fn contribute_fund(index: ParaId) -> (T::AccountId, BalanceOf) +where + <::MultiCurrency as MultiCurrency< + ::AccountId, + >>::CurrencyId: From, +{ + let who: T::AccountId = whitelisted_caller(); let value = T::MinContribution::get(); - assert_ok!(Salp::::set_balance(who, value)); + assert_ok!(Salp::::set_balance(&who, value)); + XcmWeightAndFee::::insert( + xcm_interface::CurrencyIdOf::::from(KSM.into()), + XcmOperationType::UmpContributeTransact, + ( + Weight::from_parts(4000000000, 100000), + xcm_interface::BalanceOf::::from(4000000000u32), + ), + ); assert_ok!(Salp::::contribute(RawOrigin::Signed(who.clone()).into(), index, value)); + QueryIdContributionInfo::::insert(0u64, (index, who.clone(), value)); + MultisigConfirmAccount::::put(who.clone()); + (who, value) } -fn kusama_setup< - T: Config - + bifrost_stable_pool::Config - + nutsfinance_stable_asset::Config - + orml_tokens::Config - + bifrost_vtoken_minting::Config, ->() -> Result<(), BenchmarkError> { - Ok(()) -} - -pub fn lookup_of_account( - who: T::AccountId, -) -> <::Lookup as StaticLookup>::Source { - ::Lookup::unlookup(who) -} +#[benchmarks( +where T: Config + bifrost_stable_pool::Config + nutsfinance_stable_asset::Config + orml_tokens::Config + bifrost_vtoken_minting::Config + xcm_interface::Config + zenlink_protocol::Config, +<::MultiCurrency as MultiCurrency<::AccountId>>::CurrencyId: From +)] +mod benchmarks { + use super::*; + use frame_benchmarking::impl_benchmark_test_suite; -benchmarks! { - where_clause { - where - T: Config + bifrost_stable_pool::Config + nutsfinance_stable_asset::Config + orml_tokens::Config + bifrost_vtoken_minting::Config - } - contribute { + #[benchmark] + fn contribute() { let fund_index = create_fund::(1); let caller: T::AccountId = whitelisted_caller(); let contribution = T::MinContribution::get(); + XcmWeightAndFee::::insert( + xcm_interface::CurrencyIdOf::::from(KSM.into()), + XcmOperationType::UmpContributeTransact, + ( + Weight::from_parts(4000000000, 100000), + xcm_interface::BalanceOf::::from(4000000000u32), + ), + ); assert_ok!(Salp::::set_balance(&caller, contribution)); - }: _(RawOrigin::Signed(caller.clone()), fund_index, contribution) - verify { - let fund = Salp::::funds(fund_index).unwrap(); - let (_, status) = Salp::::contribution(fund.trie_index, &caller); - assert_eq!(status, ContributionStatus::Contributing(contribution)); + + #[extrinsic_call] + _(RawOrigin::Signed(caller.clone()), fund_index, contribution); } - refund { + #[benchmark] + fn refund() { let fund_index = create_fund::(1); - let caller: T::AccountId = whitelisted_caller(); - let caller_origin: ::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let contribution = T::MinContribution::get(); - contribute_fund::(&caller,fund_index); - let confirmer: ::RuntimeOrigin = RawOrigin::Signed(Salp::::multisig_confirm_account().unwrap()).into(); - assert_ok!(Salp::::confirm_contribute( - confirmer, - 0, + let (caller, contribution) = contribute_fund::(fund_index); + assert_ok!(Pallet::::confirm_contribute( + RawOrigin::Signed(caller.clone()).into(), + 0u64, true )); + assert_ok!(Salp::::fund_fail(RawOrigin::Root.into(), fund_index)); assert_ok!(Salp::::withdraw(RawOrigin::Root.into(), fund_index)); let fund = Salp::::funds(fund_index).unwrap(); let (_, status) = Salp::::contribution(fund.trie_index, &caller); assert_eq!(status, ContributionStatus::Idle); - }: _(RawOrigin::Signed(caller.clone()), fund_index,(0 as u32).into(),(7 as u32).into(),contribution) - verify { + + #[extrinsic_call] + _(RawOrigin::Signed(caller.clone()), fund_index, 0u32.into(), 7u32.into(), contribution); + let (_, status) = Salp::::contribution(fund.trie_index, &caller); assert_eq!(status, ContributionStatus::Idle); - assert_last_event::(Event::::Refunded(caller.clone(), fund_index, (0 as u32).into(),(7 as u32).into(),contribution).into()) + assert_last_event::( + Event::::Refunded( + caller.clone(), + fund_index, + 0u32.into(), + 7u32.into(), + contribution, + ) + .into(), + ) } - unlock { + #[benchmark] + fn unlock() { let fund_index = create_fund::(1); - let caller: T::AccountId = whitelisted_caller(); - let caller_origin: ::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let contribution = T::MinContribution::get(); - contribute_fund::(&caller,fund_index); - let confirmer: ::RuntimeOrigin = RawOrigin::Signed(Salp::::multisig_confirm_account().unwrap()).into(); - assert_ok!(Salp::::confirm_contribute( - confirmer, - 0, + let (caller, _) = contribute_fund::(fund_index); + assert_ok!(Pallet::::confirm_contribute( + RawOrigin::Signed(caller.clone()).into(), + 0u64, true )); + assert_ok!(Salp::::fund_success(RawOrigin::Root.into(), fund_index)); - }: _(RawOrigin::Signed(caller.clone()), caller.clone(),fund_index) - verify { - let fund = Salp::::funds(fund_index).unwrap(); - let (_, status) = Salp::::contribution(fund.trie_index, &caller); - assert_eq!(status, ContributionStatus::Idle); + + #[extrinsic_call] + _(RawOrigin::Signed(caller.clone()), caller.clone(), fund_index); } - batch_unlock { - let k in 1 .. 5; + #[benchmark] + fn batch_unlock() { let fund_index = create_fund::(1); - let contribution = T::MinContribution::get(); - let mut caller: T::AccountId = whitelisted_caller(); - let confirmer: ::RuntimeOrigin = RawOrigin::Signed(Salp::::multisig_confirm_account().unwrap()).into(); - for i in 0 .. k { - caller = account("contributor", i, 0); - contribute_fund::(&caller,fund_index); - let _ = Salp::::confirm_contribute( - confirmer.clone(), - 0, - true - ); + let caller: T::AccountId = whitelisted_caller(); + for _ in 0..5 { + let (caller, _) = contribute_fund::(fund_index); + assert_ok!(Pallet::::confirm_contribute( + RawOrigin::Signed(caller.clone()).into(), + 0u64, + true + )); } + assert_ok!(Salp::::fund_success(RawOrigin::Root.into(), fund_index)); - }: _(RawOrigin::Signed(caller.clone()), fund_index) - verify { - let fund = Salp::::funds(fund_index).unwrap(); - let (_, status) = Salp::::contribution(fund.trie_index, &caller); - assert_eq!(status, ContributionStatus::Idle); - assert_last_event::(Event::::AllUnlocked(fund_index).into()); + + #[extrinsic_call] + _(RawOrigin::Signed(caller.clone()), fund_index); } - redeem { + #[benchmark] + fn redeem() { let fund_index = create_fund::(1); - let caller: T::AccountId = whitelisted_caller(); - let caller_origin: ::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let contribution = T::MinContribution::get(); - contribute_fund::(&caller,fund_index); - let confirmer: ::RuntimeOrigin = RawOrigin::Signed(Salp::::multisig_confirm_account().unwrap()).into(); - assert_ok!(Salp::::confirm_contribute( - confirmer, - 0, + let (caller, contribution) = contribute_fund::(fund_index); + assert_ok!(Pallet::::confirm_contribute( + RawOrigin::Signed(caller.clone()).into(), + 0u64, true )); + assert_ok!(Salp::::fund_success(RawOrigin::Root.into(), fund_index)); - assert_ok!(Salp::::unlock(caller_origin.clone(), caller.clone(), fund_index)); + assert_ok!(Salp::::unlock( + RawOrigin::Signed(caller.clone()).into(), + caller.clone(), + fund_index + )); assert_ok!(Salp::::fund_retire(RawOrigin::Root.into(), fund_index)); assert_ok!(Salp::::withdraw(RawOrigin::Root.into(), fund_index)); assert_eq!(Salp::::redeem_pool(), T::MinContribution::get()); - }: _(RawOrigin::Signed(caller.clone()), fund_index,contribution) - verify { + + #[extrinsic_call] + _(RawOrigin::Signed(caller.clone()), fund_index, contribution); + assert_eq!(Salp::::redeem_pool(), 0_u32.saturated_into()); - assert_last_event::(Event::::Redeemed(caller.clone(), fund_index, (0 as u32).into(),(7 as u32).into(),contribution).into()) } - set_multisig_confirm_account { - let caller: T::AccountId = whitelisted_caller(); - }: _(RawOrigin::Root,caller) + #[benchmark] + fn set_multisig_confirm_account() { + #[extrinsic_call] + _(RawOrigin::Root, whitelisted_caller()); + } - fund_success { + #[benchmark] + fn fund_success() { let fund_index = create_fund::(1); - let caller: T::AccountId = whitelisted_caller(); - let caller_origin: ::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let contribution = T::MinContribution::get(); - contribute_fund::(&caller,fund_index); - let confirmer: ::RuntimeOrigin = RawOrigin::Signed(Salp::::multisig_confirm_account().unwrap()).into(); - assert_ok!(Salp::::confirm_contribute( - confirmer, - 0, + let (caller, _) = contribute_fund::(fund_index); + assert_ok!(Pallet::::confirm_contribute( + RawOrigin::Signed(caller.clone()).into(), + 0u64, true )); - }: _(RawOrigin::Root,fund_index) - fund_fail { + #[extrinsic_call] + _(RawOrigin::Root, fund_index); + } + + #[benchmark] + fn fund_fail() { let fund_index = create_fund::(1); - let caller: T::AccountId = whitelisted_caller(); - let caller_origin: ::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let contribution = T::MinContribution::get(); - contribute_fund::(&caller,fund_index); - let confirmer: ::RuntimeOrigin = RawOrigin::Signed(Salp::::multisig_confirm_account().unwrap()).into(); - assert_ok!(Salp::::confirm_contribute( - confirmer, - 0, + let (caller, _) = contribute_fund::(fund_index); + assert_ok!(Pallet::::confirm_contribute( + RawOrigin::Signed(caller.clone()).into(), + 0u64, true )); - }: _(RawOrigin::Root,fund_index) - continue_fund { + #[extrinsic_call] + _(RawOrigin::Root, fund_index); + } + + #[benchmark] + fn continue_fund() { let fund_index = create_fund::(1); - let caller: T::AccountId = whitelisted_caller(); - let caller_origin: ::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let contribution = T::MinContribution::get(); - contribute_fund::(&caller,fund_index); - let confirmer: ::RuntimeOrigin = RawOrigin::Signed(Salp::::multisig_confirm_account().unwrap()).into(); - assert_ok!(Salp::::confirm_contribute( - confirmer, - 0, + let (caller, _) = contribute_fund::(fund_index); + assert_ok!(Pallet::::confirm_contribute( + RawOrigin::Signed(caller.clone()).into(), + 0u64, true )); + assert_ok!(Salp::::fund_fail(RawOrigin::Root.into(), fund_index)); assert_ok!(Salp::::withdraw(RawOrigin::Root.into(), fund_index)); - }: _(RawOrigin::Root,fund_index,0u32.into(),8u32.into()) + #[extrinsic_call] + _(RawOrigin::Root, fund_index, 0u32.into(), 3u32.into()); + } - fund_retire { + #[benchmark] + fn fund_retire() { let fund_index = create_fund::(1); - let caller: T::AccountId = whitelisted_caller(); - let caller_origin: ::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let contribution = T::MinContribution::get(); - contribute_fund::(&caller,fund_index); - let confirmer: ::RuntimeOrigin = RawOrigin::Signed(Salp::::multisig_confirm_account().unwrap()).into(); - assert_ok!(Salp::::confirm_contribute( - confirmer, - 0, + let (caller, _) = contribute_fund::(fund_index); + assert_ok!(Pallet::::confirm_contribute( + RawOrigin::Signed(caller.clone()).into(), + 0u64, true )); + assert_ok!(Salp::::fund_success(RawOrigin::Root.into(), fund_index)); - assert_ok!(Salp::::unlock(caller_origin.clone(), caller.clone(), fund_index)); - }: _(RawOrigin::Root, fund_index) + assert_ok!(Salp::::unlock( + RawOrigin::Signed(caller.clone()).into(), + caller.clone(), + fund_index + )); + #[extrinsic_call] + _(RawOrigin::Root, fund_index); + } - fund_end { + #[benchmark] + fn fund_end() { let fund_index = create_fund::(1); - let caller: T::AccountId = whitelisted_caller(); - let caller_origin: ::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let contribution = T::MinContribution::get(); - contribute_fund::(&caller,fund_index); - let confirmer: ::RuntimeOrigin = RawOrigin::Signed(Salp::::multisig_confirm_account().unwrap()).into(); - assert_ok!(Salp::::confirm_contribute( - confirmer, - 0, + let (caller, _) = contribute_fund::(fund_index); + assert_ok!(Pallet::::confirm_contribute( + RawOrigin::Signed(caller.clone()).into(), + 0u64, true )); + assert_ok!(Salp::::fund_fail(RawOrigin::Root.into(), fund_index)); assert_ok!(Salp::::withdraw(RawOrigin::Root.into(), fund_index)); - }: _(RawOrigin::Root, fund_index) + #[extrinsic_call] + _(RawOrigin::Root, fund_index); + } - create { - let cap = BalanceOf::::max_value(); - let first_period = (0 as u32).into(); - let last_period = (7 as u32).into(); - let para_id = 2001u32; - }: _(RawOrigin::Root, para_id, cap, first_period, last_period) + #[benchmark] + fn create() { + #[extrinsic_call] + _(RawOrigin::Root, 2001u32, BalanceOf::::max_value(), 0u32.into(), 3u32.into()); + } - edit { - let fund_index = create_fund::(1); - let cap = BalanceOf::::max_value(); - let raised = BalanceOf::::max_value(); - let first_period = (0 as u32).into(); - let last_period = (7 as u32).into(); - let para_id = 1u32; - }: _(RawOrigin::Root, para_id, cap, raised,first_period, last_period,None) - - confirm_contribute { + #[benchmark] + fn edit() { + create_fund::(2001u32); + #[extrinsic_call] + _( + RawOrigin::Root, + 2001u32, + BalanceOf::::max_value(), + BalanceOf::::max_value(), + 0u32.into(), + 8u32.into(), + None, + ); + } + + #[benchmark] + fn confirm_contribute() { let fund_index = create_fund::(1); - let caller: T::AccountId = whitelisted_caller(); - let caller_origin: ::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let contribution = T::MinContribution::get(); - contribute_fund::(&caller,fund_index); - }: _(RawOrigin::Signed(Salp::::multisig_confirm_account().unwrap()), 0, true) + let (caller, _) = contribute_fund::(fund_index); + + #[extrinsic_call] + _(RawOrigin::Signed(caller), 0, true) + } - withdraw { + #[benchmark] + fn withdraw() { let fund_index = create_fund::(1); - let caller: T::AccountId = whitelisted_caller(); - let caller_origin: ::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let contribution = T::MinContribution::get(); - contribute_fund::(&caller,fund_index); - let confirmer: ::RuntimeOrigin = RawOrigin::Signed(Salp::::multisig_confirm_account().unwrap()).into(); - assert_ok!(Salp::::confirm_contribute( - confirmer, - 0, - true - )); - assert_ok!(Salp::::fund_fail(RawOrigin::Root.into(), fund_index)); - }: _(RawOrigin::Root, fund_index) + contribute_fund::(fund_index); + assert_ok!(Salp::::fund_fail(RawOrigin::Root.into(), fund_index)); + #[extrinsic_call] + _(RawOrigin::Root, fund_index) + } - dissolve_refunded { + #[benchmark] + fn dissolve_refunded() { let fund_index = create_fund::(1); - let caller: T::AccountId = whitelisted_caller(); - let caller_origin: ::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let contribution = T::MinContribution::get(); - contribute_fund::(&caller,fund_index); - let confirmer: ::RuntimeOrigin = RawOrigin::Signed(Salp::::multisig_confirm_account().unwrap()).into(); - assert_ok!(Salp::::confirm_contribute( - confirmer.clone(), - 0, + let (caller, _) = contribute_fund::(fund_index); + assert_ok!(Pallet::::confirm_contribute( + RawOrigin::Signed(caller.clone()).into(), + 0u64, true )); + assert_ok!(Salp::::fund_fail(RawOrigin::Root.into(), fund_index)); assert_ok!(Salp::::withdraw(RawOrigin::Root.into(), fund_index)); - assert_ok!(Salp::::continue_fund(RawOrigin::Root.into(), fund_index, 2, T::SlotLength::get() + 1)); - }: _(RawOrigin::Root, fund_index,0,7) + assert_ok!(Salp::::continue_fund( + RawOrigin::Root.into(), + fund_index, + 2, + T::SlotLength::get() + 1 + )); + #[extrinsic_call] + _(RawOrigin::Root, fund_index, 0, 7) + } - dissolve { + #[benchmark] + fn dissolve() { let fund_index = create_fund::(1); - let caller: T::AccountId = whitelisted_caller(); - let caller_origin: ::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let contribution = T::MinContribution::get(); - contribute_fund::(&caller,fund_index); - let confirmer: ::RuntimeOrigin = RawOrigin::Signed(Salp::::multisig_confirm_account().unwrap()).into(); - assert_ok!(Salp::::confirm_contribute( - confirmer, - 0, + let (caller, _) = contribute_fund::(fund_index); + assert_ok!(Pallet::::confirm_contribute( + RawOrigin::Signed(caller.clone()).into(), + 0u64, true )); + assert_ok!(Salp::::fund_success(RawOrigin::Root.into(), fund_index)); assert_ok!(Salp::::fund_retire(RawOrigin::Root.into(), fund_index)); assert_ok!(Salp::::withdraw(RawOrigin::Root.into(), fund_index)); assert_ok!(Salp::::fund_end(RawOrigin::Root.into(), fund_index)); - }: _(RawOrigin::Root, fund_index) + #[extrinsic_call] + _(RawOrigin::Root, fund_index) + } + + #[benchmark] + fn buyback() { + let caller: T::AccountId = whitelisted_caller(); + let relay_currency_id = ::RelayChainToken::get(); + let relay_vstoken_id = + ::CurrencyIdConversion::convert_to_vstoken(relay_currency_id).unwrap(); + + assert_ok!(zenlink_protocol::Pallet::::create_pair( + RawOrigin::Root.into(), + zenlink_protocol::AssetId { chain_id: 2001, asset_type: 2, asset_index: 516 }, + zenlink_protocol::AssetId { chain_id: 2001, asset_type: 2, asset_index: 1028 }, + )); + + let buybck_caller = T::BuybackPalletId::get().into_account_truncating(); + assert_ok!(::MultiCurrency::deposit( + relay_currency_id, + &buybck_caller, + BalanceOf::::unique_saturated_from(1_000_000_000_000_000u128) + )); + assert_ok!(::MultiCurrency::deposit( + relay_vstoken_id, + &buybck_caller, + BalanceOf::::unique_saturated_from(1_000_000_000_000_000u128) + )); + + assert_ok!(zenlink_protocol::Pallet::::add_liquidity( + RawOrigin::Signed(buybck_caller).into(), + zenlink_protocol::AssetId { chain_id: 2001, asset_type: 2, asset_index: 516 }, + zenlink_protocol::AssetId { chain_id: 2001, asset_type: 2, asset_index: 1028 }, + 1_000_000_000_000u128, + 100_000_000_000_000u128, + 0u128, + 0u128, + T::BlockNumber::from(10u32), + )); - buyback { - }: _(RawOrigin::Root, 100u32.into()) + #[extrinsic_call] + _(RawOrigin::Signed(caller), BalanceOf::::unique_saturated_from(1000u128)) + } - buyback_vstoken_by_stable_pool { - kusama_setup::()?; + #[benchmark] + fn buyback_vstoken_by_stable_pool() { let caller: T::AccountId = whitelisted_caller(); - let fee_account: T::AccountId = account("seed",1,1); + let fee_account: T::AccountId = account("seed", 1, 1); let buyback_account: T::AccountId = T::BuybackPalletId::get().into_account_truncating(); let amounts1: AtLeast64BitUnsignedOf = 1_000_000_000_000u128.into(); @@ -361,40 +423,53 @@ benchmarks! { assert_ok!(bifrost_stable_pool::Pallet::::edit_token_rate( RawOrigin::Root.into(), 0, - vec![(VSKSM.into(), (1u128.into(), 1u128.into())), (KSM.into(), (10u128.into(), 30u128.into()))] + vec![ + (VSKSM.into(), (1u128.into(), 1u128.into())), + (KSM.into(), (10u128.into(), 30u128.into())) + ] )); - assert_ok!(orml_tokens::Pallet::::set_balance( - RawOrigin::Root.into(), - lookup_of_account::(buyback_account.clone()), + assert_ok!(::MultiCurrency::deposit( KSM, - ::Balance::unique_saturated_from(1_000_000_000_000_000_000u128), - ::Balance::unique_saturated_from(0u128) + &buyback_account, + BalanceOf::::unique_saturated_from(1_000_000_000_000_000_000u128) )); - assert_ok!(orml_tokens::Pallet::::set_balance( - RawOrigin::Root.into(), - lookup_of_account::(caller.clone()), + assert_ok!(::MultiCurrency::deposit( KSM, - ::Balance::unique_saturated_from(1_000_000_000_000_000_000u128), - ::Balance::unique_saturated_from(0u128) + &caller, + BalanceOf::::unique_saturated_from(1_000_000_000_000_000_000u128) )); - assert_ok!(orml_tokens::Pallet::::set_balance( - RawOrigin::Root.into(), - lookup_of_account::(caller.clone()), + assert_ok!(::MultiCurrency::deposit( VSKSM, - ::Balance::unique_saturated_from(1_000_000_000_000_000_000u128), - ::Balance::unique_saturated_from(0u128) + &caller, + BalanceOf::::unique_saturated_from(1_000_000_000_000_000_000u128) )); - assert_eq!( - orml_tokens::Pallet::::total_balance(KSM, &caller.clone()), - ::Balance::unique_saturated_from(1_000_000_000_000_000_000u128) - ); - assert_ok!(bifrost_stable_pool::Pallet::::add_liquidity(RawOrigin::Signed(caller.clone()).into(), 0, vec![amounts, amounts], amounts)); - let minimum_mint_value = bifrost_vtoken_minting::BalanceOf::::unique_saturated_from(0u128); - let token_amount = bifrost_vtoken_minting::BalanceOf::::unique_saturated_from(1_000_000_000_000u128); - assert_ok!(bifrost_vtoken_minting::Pallet::::set_minimum_mint(RawOrigin::Root.into(), KSM, minimum_mint_value)); - assert_ok!(bifrost_vtoken_minting::Pallet::::mint(RawOrigin::Signed(caller.clone()).into(), KSM, token_amount, BoundedVec::default())); - }: _(RawOrigin::Root, 0, KSM, 1_000_000_000u32.into()) - - impl_benchmark_test_suite!(Salp, crate::mock::new_test_ext(), crate::mock::Test); + + assert_ok!(bifrost_stable_pool::Pallet::::add_liquidity( + RawOrigin::Signed(caller.clone()).into(), + 0, + vec![amounts, amounts], + amounts + )); + let minimum_mint_value = + bifrost_vtoken_minting::BalanceOf::::unique_saturated_from(0u128); + let token_amount = + bifrost_vtoken_minting::BalanceOf::::unique_saturated_from(1_000_000_000_000u128); + assert_ok!(bifrost_vtoken_minting::Pallet::::set_minimum_mint( + RawOrigin::Root.into(), + KSM, + minimum_mint_value + )); + assert_ok!(bifrost_vtoken_minting::Pallet::::mint( + RawOrigin::Signed(caller.clone()).into(), + KSM, + token_amount, + BoundedVec::default() + )); + #[extrinsic_call] + _(RawOrigin::Root, 0, KSM, 1_000_000_000u32.into()) + } + + // `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); } diff --git a/pallets/salp/src/lib.rs b/pallets/salp/src/lib.rs index 260653335..87d828129 100644 --- a/pallets/salp/src/lib.rs +++ b/pallets/salp/src/lib.rs @@ -863,7 +863,7 @@ pub mod pallet { /// Unlock the reserved vsToken/vsBond after fund success #[pallet::call_index(13)] - #[pallet::weight(T::WeightInfo::batch_unlock(T::RemoveKeysLimit::get()))] + #[pallet::weight(T::WeightInfo::batch_unlock())] pub fn batch_unlock( origin: OriginFor, #[pallet::compact] index: ParaId, diff --git a/pallets/salp/src/mock.rs b/pallets/salp/src/mock.rs index 334068277..a0a2315c3 100644 --- a/pallets/salp/src/mock.rs +++ b/pallets/salp/src/mock.rs @@ -32,8 +32,8 @@ use frame_support::{ }; use frame_system::{EnsureRoot, EnsureSignedBy, RawOrigin}; use node_primitives::{ - Amount, Balance, CurrencyId, CurrencyId::*, MessageId, ParaId, SlpOperator, SlpxOperator, - TokenSymbol, TokenSymbol::*, VKSM, + Amount, Balance, CurrencyId, CurrencyId::*, DoNothingExecuteXcm, MessageId, ParaId, + SlpOperator, SlpxOperator, TokenSymbol, TokenSymbol::*, VKSM, }; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key, MultiCurrency}; use sp_arithmetic::Percent; @@ -41,7 +41,7 @@ use sp_core::{ConstU32, H256}; pub use sp_runtime::Perbill; use sp_runtime::{ generic, - traits::{BlakeTwo256, IdentityLookup, UniqueSaturatedInto}, + traits::{BlakeTwo256, Convert, IdentityLookup, UniqueSaturatedInto}, }; use xcm::prelude::*; use xcm_builder::FixedWeightBounds; @@ -52,7 +52,6 @@ use zenlink_protocol::{ }; use crate as salp; -use crate::WeightInfo; pub(crate) type AccountId = <::Signer as sp_runtime::traits::IdentifyAccount>::AccountId; pub(crate) type Block = frame_system::mocking::MockBlock; @@ -81,6 +80,7 @@ construct_runtime!( StableAsset: nutsfinance_stable_asset::{Pallet, Storage, Event}, StablePool: bifrost_stable_pool::{Pallet, Call, Storage}, VtokenMinting: bifrost_vtoken_minting::{Pallet, Call, Storage, Event}, + XcmInterface: xcm_interface::{Pallet, Call, Storage, Event}, } ); @@ -471,7 +471,7 @@ impl salp::Config for Test { type SlotLength = SlotLength; type VSBondValidPeriod = VSBondValidPeriod; type EnsureConfirmAsGovernance = EnsureConfirmAsGovernance; - type WeightInfo = SalpWeightInfo; + type WeightInfo = (); type XcmInterface = MockXcmExecutor; type TreasuryAccount = TreasuryAccount; type BuybackPalletId = BuybackPalletId; @@ -488,6 +488,7 @@ parameter_types! { pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0); pub const MaxInstructions: u32 = 100; pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + pub const RelayNetwork: NetworkId = NetworkId::Kusama; } pub struct XcmConfig; @@ -548,89 +549,31 @@ impl pallet_xcm::Config for Test { type AdminOrigin = EnsureRoot; } -pub struct ParaInfo; -impl Get for ParaInfo { - fn get() -> Pid { - Pid::from(2001) +pub struct BifrostAccountIdToMultiLocation; +impl Convert for BifrostAccountIdToMultiLocation { + fn convert(account: AccountId) -> MultiLocation { + X1(AccountId32 { network: None, id: account.into() }).into() } } -pub struct SalpWeightInfo; -impl WeightInfo for SalpWeightInfo { - fn contribute() -> Weight { - Weight::zero() - } - - fn unlock() -> Weight { - Weight::zero() - } - - fn redeem() -> Weight { - Weight::zero() - } - - fn refund() -> Weight { - Weight::zero() - } - - fn batch_unlock(_k: u32) -> Weight { - Weight::zero() - } - - fn set_multisig_confirm_account() -> Weight { - Weight::zero() - } - - fn fund_success() -> Weight { - Weight::zero() - } - - fn fund_fail() -> Weight { - Weight::zero() - } - - fn continue_fund() -> Weight { - Weight::zero() - } - - fn fund_retire() -> Weight { - Weight::zero() - } - - fn fund_end() -> Weight { - Weight::zero() - } - - fn create() -> Weight { - Weight::zero() - } - - fn edit() -> Weight { - Weight::zero() - } - - fn confirm_contribute() -> Weight { - Weight::zero() - } - - fn withdraw() -> Weight { - Weight::zero() - } - - fn dissolve_refunded() -> Weight { - Weight::zero() - } - - fn dissolve() -> Weight { - Weight::zero() - } - - fn buyback() -> Weight { - Weight::zero() - } +impl xcm_interface::Config for Test { + type RuntimeEvent = RuntimeEvent; + type UpdateOrigin = EnsureRoot; + type MultiCurrency = Currencies; + type RelayNetwork = RelayNetwork; + type RelaychainCurrencyId = RelayCurrencyId; + type ParachainSovereignAccount = TreasuryAccount; + type XcmExecutor = DoNothingExecuteXcm; + type AccountIdToMultiLocation = BifrostAccountIdToMultiLocation; + type SalpHelper = Salp; + type ParachainId = ParaInfo; + type CallBackTimeOut = ConstU32<10>; +} - fn buyback_vstoken_by_stable_pool() -> Weight { - Weight::zero() +pub struct ParaInfo; +impl Get for ParaInfo { + fn get() -> Pid { + Pid::from(2001) } } diff --git a/pallets/salp/src/weights.rs b/pallets/salp/src/weights.rs index 699f51183..83d248640 100644 --- a/pallets/salp/src/weights.rs +++ b/pallets/salp/src/weights.rs @@ -25,10 +25,9 @@ //! Autogenerated weights for bifrost_salp //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: // target/release/bifrost @@ -43,22 +42,21 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/salp/src/weights.rs -// --template=./frame-weight-template.hbs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_salp. pub trait WeightInfo { fn contribute() -> Weight; fn refund() -> Weight; fn unlock() -> Weight; - fn batch_unlock(k: u32, ) -> Weight; + fn batch_unlock() -> Weight; fn redeem() -> Weight; fn set_multisig_confirm_account() -> Weight; fn fund_success() -> Weight; @@ -76,324 +74,6 @@ pub trait WeightInfo { fn buyback_vstoken_by_stable_pool() -> Weight; } -/// Weights for bifrost_salp using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: Salp Funds (r:1 w:0) - /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: XcmInterface XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: XcmInterface XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), 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: Salp QueryIdContributionInfo (r:0 w:1) - /// Proof Skipped: Salp QueryIdContributionInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - /// Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) - /// Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) - fn contribute() -> Weight { - // Proof Size summary in bytes: - // Measured: `2191` - // Estimated: `28824` - // Minimum execution time: 164_243_000 picoseconds. - Weight::from_parts(166_460_000, 28824) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) - } - /// Storage: Salp FailedFundsToRefund (r:1 w:0) - /// Proof Skipped: Salp FailedFundsToRefund (max_values: None, max_size: None, mode: Measured) - /// Storage: Salp Funds (r:1 w:1) - /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) - /// Storage: Salp RedeemPool (r:1 w:1) - /// Proof Skipped: Salp RedeemPool (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:4 w:4) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:2 w:2) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - fn refund() -> Weight { - // Proof Size summary in bytes: - // Measured: `2527` - // Estimated: `36029` - // Minimum execution time: 238_416_000 picoseconds. - Weight::from_parts(241_068_000, 36029) - .saturating_add(T::DbWeight::get().reads(11_u64)) - .saturating_add(T::DbWeight::get().writes(9_u64)) - } - /// Storage: Salp Funds (r:1 w:0) - /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:0) - /// Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:0) - fn unlock() -> Weight { - // Proof Size summary in bytes: - // Measured: `2019` - // Estimated: `18668` - // Minimum execution time: 117_833_000 picoseconds. - Weight::from_parts(118_930_000, 18668) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: Salp Funds (r:1 w:0) - /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:10 w:10) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: unknown `0x` (r:1 w:0) - /// Proof Skipped: unknown `0x` (r:1 w:0) - /// Storage: unknown `0xb2233113701bdbed1e43339a304e77ade52c7b0204a5366dba4c12c9c1a90811` (r:1 w:0) - /// Proof Skipped: unknown `0xb2233113701bdbed1e43339a304e77ade52c7b0204a5366dba4c12c9c1a90811` (r:1 w:0) - /// Storage: unknown `0xbcf11cdfc92c4bf5c40d1adc80e83b0c91148a8079347419a0890363e3e0186c` (r:1 w:0) - /// Proof Skipped: unknown `0xbcf11cdfc92c4bf5c40d1adc80e83b0c91148a8079347419a0890363e3e0186c` (r:1 w:0) - /// Storage: unknown `0xbfb77688785d1f34aaea15726de0f743afd4cd1eb8a9b2f03ec8f6cfcd2c1a8a` (r:1 w:0) - /// Proof Skipped: unknown `0xbfb77688785d1f34aaea15726de0f743afd4cd1eb8a9b2f03ec8f6cfcd2c1a8a` (r:1 w:0) - /// Storage: unknown `0xc85982571aa615c788ef9b2c16f54f25773fd439e8ee1ed2aa3ae43d48e880f0` (r:1 w:0) - /// Proof Skipped: unknown `0xc85982571aa615c788ef9b2c16f54f25773fd439e8ee1ed2aa3ae43d48e880f0` (r:1 w:0) - /// Storage: unknown `0xecc728efb63d13c538d0122cd7dba2964c47c6750030158f57908845b086ca70` (r:1 w:0) - /// Proof Skipped: unknown `0xecc728efb63d13c538d0122cd7dba2964c47c6750030158f57908845b086ca70` (r:1 w:0) - /// The range of component `k` is `[1, 5]`. - fn batch_unlock(k: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1546 + k * (339 ±0)` - // Estimated: `7723336068740308509 + k * (7546 ±0)` - // Minimum execution time: 127_011_000 picoseconds. - Weight::from_parts(88_013_651, 7723336068740308509) - // Standard Error: 400_257 - .saturating_add(Weight::from_parts(49_880_142, 0).saturating_mul(k.into())) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(k.into()))) - .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(k.into()))) - .saturating_add(Weight::from_parts(0, 7546).saturating_mul(k.into())) - } - /// Storage: Salp Funds (r:1 w:1) - /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) - /// Storage: Salp RedeemPool (r:1 w:1) - /// Proof Skipped: Salp RedeemPool (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:4 w:4) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:2 w:2) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - fn redeem() -> Weight { - // Proof Size summary in bytes: - // Measured: `2508` - // Estimated: `30970` - // Minimum execution time: 226_166_000 picoseconds. - Weight::from_parts(229_370_000, 30970) - .saturating_add(T::DbWeight::get().reads(10_u64)) - .saturating_add(T::DbWeight::get().writes(9_u64)) - } - /// Storage: Salp MultisigConfirmAccount (r:0 w:1) - /// Proof Skipped: Salp MultisigConfirmAccount (max_values: Some(1), max_size: None, mode: Measured) - fn set_multisig_confirm_account() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 7_848_000 picoseconds. - Weight::from_parts(8_337_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Salp Funds (r:1 w:1) - /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) - fn fund_success() -> Weight { - // Proof Size summary in bytes: - // Measured: `357` - // Estimated: `2832` - // Minimum execution time: 38_873_000 picoseconds. - Weight::from_parts(39_557_000, 2832) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Salp Funds (r:1 w:1) - /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) - fn fund_fail() -> Weight { - // Proof Size summary in bytes: - // Measured: `357` - // Estimated: `2832` - // Minimum execution time: 38_716_000 picoseconds. - Weight::from_parts(39_428_000, 2832) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Salp Funds (r:1 w:1) - /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: Salp FailedFundsToRefund (r:0 w:1) - /// Proof Skipped: Salp FailedFundsToRefund (max_values: None, max_size: None, mode: Measured) - fn continue_fund() -> Weight { - // Proof Size summary in bytes: - // Measured: `1077` - // Estimated: `10656` - // Minimum execution time: 86_859_000 picoseconds. - Weight::from_parts(88_185_000, 10656) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: Salp Funds (r:1 w:1) - /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) - fn fund_retire() -> Weight { - // Proof Size summary in bytes: - // Measured: `357` - // Estimated: `2832` - // Minimum execution time: 42_943_000 picoseconds. - Weight::from_parts(43_620_000, 2832) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Salp Funds (r:1 w:1) - /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) - fn fund_end() -> Weight { - // Proof Size summary in bytes: - // Measured: `390` - // Estimated: `2865` - // Minimum execution time: 38_508_000 picoseconds. - Weight::from_parts(39_210_000, 2865) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Salp Funds (r:1 w:1) - /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) - /// Storage: Salp CurrentTrieIndex (r:1 w:1) - /// Proof Skipped: Salp CurrentTrieIndex (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - fn create() -> Weight { - // Proof Size summary in bytes: - // Measured: `891` - // Estimated: `10593` - // Minimum execution time: 75_051_000 picoseconds. - Weight::from_parts(76_531_000, 10593) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: Salp Funds (r:1 w:1) - /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) - fn edit() -> Weight { - // Proof Size summary in bytes: - // Measured: `324` - // Estimated: `2799` - // Minimum execution time: 36_061_000 picoseconds. - Weight::from_parts(36_875_000, 2799) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Salp MultisigConfirmAccount (r:1 w:0) - /// Proof Skipped: Salp MultisigConfirmAccount (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Salp Funds (r:1 w:1) - /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:4 w:4) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:2 w:2) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) - /// Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) - fn confirm_contribute() -> Weight { - // Proof Size summary in bytes: - // Measured: `2608` - // Estimated: `36353` - // Minimum execution time: 243_625_000 picoseconds. - Weight::from_parts(246_811_000, 36353) - .saturating_add(T::DbWeight::get().reads(11_u64)) - .saturating_add(T::DbWeight::get().writes(9_u64)) - } - /// Storage: Salp Funds (r:1 w:1) - /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) - /// Storage: Salp RedeemPool (r:1 w:1) - /// Proof Skipped: Salp RedeemPool (max_values: Some(1), max_size: None, mode: Measured) - fn withdraw() -> Weight { - // Proof Size summary in bytes: - // Measured: `357` - // Estimated: `3684` - // Minimum execution time: 47_292_000 picoseconds. - Weight::from_parts(48_164_000, 3684) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: Salp FailedFundsToRefund (r:1 w:1) - /// Proof Skipped: Salp FailedFundsToRefund (max_values: None, max_size: None, mode: Measured) - fn dissolve_refunded() -> Weight { - // Proof Size summary in bytes: - // Measured: `467` - // Estimated: `2942` - // Minimum execution time: 48_556_000 picoseconds. - Weight::from_parts(49_162_000, 2942) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Salp Funds (r:1 w:1) - /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:3 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:3) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: unknown `0x` (r:1 w:0) - /// Proof Skipped: unknown `0x` (r:1 w:0) - /// Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) - /// Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) - fn dissolve() -> Weight { - // Proof Size summary in bytes: - // Measured: `2153` - // Estimated: `34100` - // Minimum execution time: 249_126_000 picoseconds. - Weight::from_parts(254_698_000, 34100) - .saturating_add(T::DbWeight::get().reads(10_u64)) - .saturating_add(T::DbWeight::get().writes(8_u64)) - } - /// Storage: ParachainInfo ParachainId (r:1 w:0) - /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn buyback() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `499` - // Minimum execution time: 32_127_000 picoseconds. - Weight::from_parts(32_722_000, 499) - .saturating_add(T::DbWeight::get().reads(1_u64)) - } - /// Storage: StableAsset Pools (r:1 w:1) - /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:4 w:4) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: StableAsset TokenRateCaches (r:2 w:0) - /// Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) - /// 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) - fn buyback_vstoken_by_stable_pool() -> Weight { - // Proof Size summary in bytes: - // Measured: `2331` - // Estimated: `11362` - // Minimum execution time: 89_049_000 picoseconds. - Weight::from_parts(89_820_000, 0) - .saturating_add(Weight::from_parts(0, 11362)) - .saturating_add(T::DbWeight::get().reads(10)) - .saturating_add(T::DbWeight::get().writes(6)) - } -} - // For backwards compatibility and tests impl WeightInfo for () { /// Storage: Salp Funds (r:1 w:0) @@ -402,8 +82,8 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: XcmInterface XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: XcmInterface XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) + /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + /// Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) /// Storage: PolkadotXcm QueryCounter (r:1 w:1) /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) /// Storage: ParachainInfo ParachainId (r:1 w:0) @@ -416,10 +96,10 @@ impl WeightInfo for () { /// Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) fn contribute() -> Weight { // Proof Size summary in bytes: - // Measured: `2191` - // Estimated: `28824` - // Minimum execution time: 164_243_000 picoseconds. - Weight::from_parts(166_460_000, 28824) + // Measured: `2252` + // Estimated: `5717` + // Minimum execution time: 175_000_000 picoseconds. + Weight::from_parts(177_879_000, 5717) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -439,10 +119,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn refund() -> Weight { // Proof Size summary in bytes: - // Measured: `2527` - // Estimated: `36029` - // Minimum execution time: 238_416_000 picoseconds. - Weight::from_parts(241_068_000, 36029) + // Measured: `2375` + // Estimated: `11362` + // Minimum execution time: 267_454_000 picoseconds. + Weight::from_parts(270_319_000, 11362) .saturating_add(RocksDbWeight::get().reads(11_u64)) .saturating_add(RocksDbWeight::get().writes(9_u64)) } @@ -456,44 +136,31 @@ impl WeightInfo for () { /// Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:0) fn unlock() -> Weight { // Proof Size summary in bytes: - // Measured: `2019` - // Estimated: `18668` - // Minimum execution time: 117_833_000 picoseconds. - Weight::from_parts(118_930_000, 18668) + // Measured: `1962` + // Estimated: `6176` + // Minimum execution time: 129_578_000 picoseconds. + Weight::from_parts(130_658_000, 6176) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: Salp Funds (r:1 w:0) /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:10 w:10) + /// Storage: Tokens Accounts (r:2 w:2) /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) /// Storage: unknown `0x` (r:1 w:0) /// Proof Skipped: unknown `0x` (r:1 w:0) - /// Storage: unknown `0xb2233113701bdbed1e43339a304e77ade52c7b0204a5366dba4c12c9c1a90811` (r:1 w:0) - /// Proof Skipped: unknown `0xb2233113701bdbed1e43339a304e77ade52c7b0204a5366dba4c12c9c1a90811` (r:1 w:0) - /// Storage: unknown `0xbcf11cdfc92c4bf5c40d1adc80e83b0c91148a8079347419a0890363e3e0186c` (r:1 w:0) - /// Proof Skipped: unknown `0xbcf11cdfc92c4bf5c40d1adc80e83b0c91148a8079347419a0890363e3e0186c` (r:1 w:0) - /// Storage: unknown `0xbfb77688785d1f34aaea15726de0f743afd4cd1eb8a9b2f03ec8f6cfcd2c1a8a` (r:1 w:0) - /// Proof Skipped: unknown `0xbfb77688785d1f34aaea15726de0f743afd4cd1eb8a9b2f03ec8f6cfcd2c1a8a` (r:1 w:0) - /// Storage: unknown `0xc85982571aa615c788ef9b2c16f54f25773fd439e8ee1ed2aa3ae43d48e880f0` (r:1 w:0) - /// Proof Skipped: unknown `0xc85982571aa615c788ef9b2c16f54f25773fd439e8ee1ed2aa3ae43d48e880f0` (r:1 w:0) - /// Storage: unknown `0xecc728efb63d13c538d0122cd7dba2964c47c6750030158f57908845b086ca70` (r:1 w:0) - /// Proof Skipped: unknown `0xecc728efb63d13c538d0122cd7dba2964c47c6750030158f57908845b086ca70` (r:1 w:0) - /// The range of component `k` is `[1, 5]`. - fn batch_unlock(k: u32, ) -> Weight { + /// Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:0) + /// Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:0) + fn batch_unlock() -> Weight { // Proof Size summary in bytes: - // Measured: `1546 + k * (339 ±0)` - // Estimated: `7723336068740308509 + k * (7546 ±0)` - // Minimum execution time: 127_011_000 picoseconds. - Weight::from_parts(88_013_651, 7723336068740308509) - // Standard Error: 400_257 - .saturating_add(Weight::from_parts(49_880_142, 0).saturating_mul(k.into())) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(k.into()))) - .saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(k.into()))) - .saturating_add(Weight::from_parts(0, 7546).saturating_mul(k.into())) + // Measured: `1995` + // Estimated: `6176` + // Minimum execution time: 143_054_000 picoseconds. + Weight::from_parts(146_914_000, 6176) + .saturating_add(RocksDbWeight::get().reads(6_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: Salp Funds (r:1 w:1) /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) @@ -509,10 +176,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn redeem() -> Weight { // Proof Size summary in bytes: - // Measured: `2508` - // Estimated: `30970` - // Minimum execution time: 226_166_000 picoseconds. - Weight::from_parts(229_370_000, 30970) + // Measured: `2356` + // Estimated: `11362` + // Minimum execution time: 255_416_000 picoseconds. + Weight::from_parts(257_010_000, 11362) .saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().writes(9_u64)) } @@ -522,18 +189,18 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_848_000 picoseconds. - Weight::from_parts(8_337_000, 0) + // Minimum execution time: 10_258_000 picoseconds. + Weight::from_parts(10_624_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Salp Funds (r:1 w:1) /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) fn fund_success() -> Weight { // Proof Size summary in bytes: - // Measured: `357` - // Estimated: `2832` - // Minimum execution time: 38_873_000 picoseconds. - Weight::from_parts(39_557_000, 2832) + // Measured: `292` + // Estimated: `3757` + // Minimum execution time: 42_399_000 picoseconds. + Weight::from_parts(43_690_000, 3757) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -541,10 +208,10 @@ impl WeightInfo for () { /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) fn fund_fail() -> Weight { // Proof Size summary in bytes: - // Measured: `357` - // Estimated: `2832` - // Minimum execution time: 38_716_000 picoseconds. - Weight::from_parts(39_428_000, 2832) + // Measured: `292` + // Estimated: `3757` + // Minimum execution time: 42_250_000 picoseconds. + Weight::from_parts(42_892_000, 3757) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -556,10 +223,10 @@ impl WeightInfo for () { /// Proof Skipped: Salp FailedFundsToRefund (max_values: None, max_size: None, mode: Measured) fn continue_fund() -> Weight { // Proof Size summary in bytes: - // Measured: `1077` - // Estimated: `10656` - // Minimum execution time: 86_859_000 picoseconds. - Weight::from_parts(88_185_000, 10656) + // Measured: `1061` + // Estimated: `7001` + // Minimum execution time: 99_887_000 picoseconds. + Weight::from_parts(101_067_000, 7001) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -567,10 +234,10 @@ impl WeightInfo for () { /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) fn fund_retire() -> Weight { // Proof Size summary in bytes: - // Measured: `357` - // Estimated: `2832` - // Minimum execution time: 42_943_000 picoseconds. - Weight::from_parts(43_620_000, 2832) + // Measured: `292` + // Estimated: `3757` + // Minimum execution time: 40_648_000 picoseconds. + Weight::from_parts(43_146_000, 3757) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -578,10 +245,10 @@ impl WeightInfo for () { /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) fn fund_end() -> Weight { // Proof Size summary in bytes: - // Measured: `390` - // Estimated: `2865` - // Minimum execution time: 38_508_000 picoseconds. - Weight::from_parts(39_210_000, 2865) + // Measured: `325` + // Estimated: `3790` + // Minimum execution time: 41_871_000 picoseconds. + Weight::from_parts(42_961_000, 3790) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -593,10 +260,10 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) fn create() -> Weight { // Proof Size summary in bytes: - // Measured: `891` - // Estimated: `10593` - // Minimum execution time: 75_051_000 picoseconds. - Weight::from_parts(76_531_000, 10593) + // Measured: `833` + // Estimated: `6773` + // Minimum execution time: 81_834_000 picoseconds. + Weight::from_parts(84_230_000, 6773) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -604,15 +271,17 @@ impl WeightInfo for () { /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) fn edit() -> Weight { // Proof Size summary in bytes: - // Measured: `324` - // Estimated: `2799` - // Minimum execution time: 36_061_000 picoseconds. - Weight::from_parts(36_875_000, 2799) + // Measured: `292` + // Estimated: `3757` + // Minimum execution time: 39_217_000 picoseconds. + Weight::from_parts(39_954_000, 3757) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Salp MultisigConfirmAccount (r:1 w:0) /// Proof Skipped: Salp MultisigConfirmAccount (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Salp QueryIdContributionInfo (r:1 w:1) + /// Proof Skipped: Salp QueryIdContributionInfo (max_values: None, max_size: None, mode: Measured) /// Storage: Salp Funds (r:1 w:1) /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) /// Storage: Tokens Accounts (r:4 w:4) @@ -627,12 +296,12 @@ impl WeightInfo for () { /// Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) fn confirm_contribute() -> Weight { // Proof Size summary in bytes: - // Measured: `2608` - // Estimated: `36353` - // Minimum execution time: 243_625_000 picoseconds. - Weight::from_parts(246_811_000, 36353) - .saturating_add(RocksDbWeight::get().reads(11_u64)) - .saturating_add(RocksDbWeight::get().writes(9_u64)) + // Measured: `2556` + // Estimated: `11362` + // Minimum execution time: 278_991_000 picoseconds. + Weight::from_parts(282_446_000, 11362) + .saturating_add(RocksDbWeight::get().reads(12_u64)) + .saturating_add(RocksDbWeight::get().writes(10_u64)) } /// Storage: Salp Funds (r:1 w:1) /// Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) @@ -640,10 +309,10 @@ impl WeightInfo for () { /// Proof Skipped: Salp RedeemPool (max_values: Some(1), max_size: None, mode: Measured) fn withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `357` - // Estimated: `3684` - // Minimum execution time: 47_292_000 picoseconds. - Weight::from_parts(48_164_000, 3684) + // Measured: `325` + // Estimated: `3790` + // Minimum execution time: 40_979_000 picoseconds. + Weight::from_parts(46_708_000, 3790) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -651,10 +320,10 @@ impl WeightInfo for () { /// Proof Skipped: Salp FailedFundsToRefund (max_values: None, max_size: None, mode: Measured) fn dissolve_refunded() -> Weight { // Proof Size summary in bytes: - // Measured: `467` - // Estimated: `2942` - // Minimum execution time: 48_556_000 picoseconds. - Weight::from_parts(49_162_000, 2942) + // Measured: `403` + // Estimated: `3868` + // Minimum execution time: 53_494_000 picoseconds. + Weight::from_parts(54_236_000, 3868) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -672,22 +341,31 @@ impl WeightInfo for () { /// Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) fn dissolve() -> Weight { // Proof Size summary in bytes: - // Measured: `2153` - // Estimated: `34100` - // Minimum execution time: 249_126_000 picoseconds. - Weight::from_parts(254_698_000, 34100) + // Measured: `2063` + // Estimated: `8799` + // Minimum execution time: 253_989_000 picoseconds. + Weight::from_parts(256_988_000, 8799) .saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().writes(8_u64)) } /// 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:4) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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: ZenlinkProtocol PairStatuses (r:1 w:0) + /// Proof Skipped: ZenlinkProtocol PairStatuses (max_values: None, max_size: None, mode: Measured) fn buyback() -> Weight { // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `499` - // Minimum execution time: 32_127_000 picoseconds. - Weight::from_parts(32_722_000, 499) - .saturating_add(RocksDbWeight::get().reads(1_u64)) + // Measured: `2284` + // Estimated: `11362` + // Minimum execution time: 241_398_000 picoseconds. + Weight::from_parts(244_975_000, 11362) + .saturating_add(RocksDbWeight::get().reads(10_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64)) } /// Storage: StableAsset Pools (r:1 w:1) /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) @@ -701,12 +379,11 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn buyback_vstoken_by_stable_pool() -> Weight { // Proof Size summary in bytes: - // Measured: `2331` + // Measured: `2438` // Estimated: `11362` - // Minimum execution time: 89_049_000 picoseconds. - Weight::from_parts(89_820_000, 0) - .saturating_add(Weight::from_parts(0, 11362)) - .saturating_add(RocksDbWeight::get().reads(10)) - .saturating_add(RocksDbWeight::get().writes(6)) + // Minimum execution time: 361_674_000 picoseconds. + Weight::from_parts(370_099_000, 11362) + .saturating_add(RocksDbWeight::get().reads(10_u64)) + .saturating_add(RocksDbWeight::get().writes(6_u64)) } } diff --git a/pallets/slp/src/agents/polkadot_agent/agent.rs b/pallets/slp/src/agents/polkadot_agent/agent.rs index 0f2d3cf30..9db9142b2 100644 --- a/pallets/slp/src/agents/polkadot_agent/agent.rs +++ b/pallets/slp/src/agents/polkadot_agent/agent.rs @@ -1169,10 +1169,7 @@ impl PolkadotAgent { DelegatorLedgerXcmUpdateQueue::::remove(query_id); // Delete the query in pallet_xcm. - ensure!( - T::SubstrateResponseManager::remove_query_record(query_id), - Error::::QueryResponseRemoveError - ); + T::SubstrateResponseManager::remove_query_record(query_id); Ok(()) } diff --git a/pallets/slp/src/benchmarking.rs b/pallets/slp/src/benchmarking.rs index 2992df2b9..bc9408281 100644 --- a/pallets/slp/src/benchmarking.rs +++ b/pallets/slp/src/benchmarking.rs @@ -19,924 +19,958 @@ // Ensure we're `no_std` when compiling for Wasm. #![cfg(feature = "runtime-benchmarks")] -use frame_benchmarking::{benchmarks, v1::BenchmarkError, whitelisted_caller}; -use frame_support::{assert_ok, dispatch::UnfilteredDispatchable}; -use frame_system::RawOrigin; -use node_primitives::TokenSymbol; -use sp_runtime::traits::{AccountIdConversion, StaticLookup, UniqueSaturatedFrom}; +use crate::*; +use frame_benchmarking::v2::*; +use frame_support::assert_ok; -#[allow(unused_imports)] -pub use crate::{Pallet as Slp, *}; +const DELEGATOR1: MultiLocation = + MultiLocation { parents: 1, interior: X1(AccountId32 { network: None, id: [1u8; 32] }) }; +const DELEGATOR2: MultiLocation = + MultiLocation { parents: 1, interior: X1(AccountId32 { network: None, id: [2u8; 32] }) }; -use crate::KSM; +pub fn set_mins_and_maxs(origin: ::RuntimeOrigin) { + let mins_and_maxs = MinimumsMaximums { + delegator_bonded_minimum: 0u32.into(), -pub fn lookup_of_account( - who: T::AccountId, -) -> <::Lookup as StaticLookup>::Source { - ::Lookup::unlookup(who) + bond_extra_minimum: 0u32.into(), + unbond_minimum: 0u32.into(), + rebond_minimum: 0u32.into(), + unbond_record_maximum: 5u32, + validators_back_maximum: 100u32, + delegator_active_staking_maximum: 1_000_000_000u32.into(), + validators_reward_maximum: 300u32, + delegation_amount_minimum: 0u32.into(), + delegators_maximum: 10, + validators_maximum: 10, + }; + + // Set minimums and maximums + assert_ok!(Pallet::::set_minimums_and_maximums(origin, KSM, Some(mins_and_maxs))); } -fn kusama_setup< - T: Config + orml_tokens::Config + bifrost_vtoken_minting::Config, ->() -> Result<(), BenchmarkError> { - let origin = ::ControlOrigin::try_successful_origin() - .map_err(|_| BenchmarkError::Weightless)?; - let caller: T::AccountId = whitelisted_caller(); - - let validator_0_account_id_20: [u8; 20] = - hex_literal::hex!["3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0"].into(); - - let validator_0_location = MultiLocation { - parents: 1, - interior: X2( - Parachain(2023), - AccountKey20 { network: None, key: validator_0_account_id_20 }, - ), - }; +pub fn init_bond(origin: ::RuntimeOrigin) { + set_mins_and_maxs::(origin.clone()); + DelegatorsMultilocation2Index::::insert(KSM, DELEGATOR1, 0); - let treasury_account_id_32: [u8; 32] = - hex_literal::hex!["6d6f646c62662f74727372790000000000000000000000000000000000000000"] - .into(); - // let treasury_account :T::AccountId = - // sp_core::crypto::AccountId32::new(treasury_account_id_32); - let treasury_location = MultiLocation { - parents: 0, - interior: X1(AccountId32 { network: None, id: treasury_account_id_32 }), - }; + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + KSM, + XcmOperationType::Bond, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + ) + .unwrap(); - // set operate_origins - assert_ok!(Slp::::set_operate_origin(origin.clone(), KSM, Some(caller.clone()))); + assert_ok!(Pallet::::bond(origin, KSM, Box::new(DELEGATOR1), 10u32.into(), None)); +} - // Set OngoingTimeUnitUpdateInterval as 1/3 round(600 blocks per round, 12 seconds per block) - assert_ok!(Slp::::set_ongoing_time_unit_update_interval( +pub fn init_ongoing_time(origin: ::RuntimeOrigin) { + assert_ok!(Pallet::::set_ongoing_time_unit_update_interval( origin.clone(), KSM, - Some(BlockNumberFor::::from(200u32)) + Some(0u32.into()) )); - >::set_block_number(BlockNumberFor::::from(300u32)); - // Initialize ongoing timeunit as 1. - assert_ok!(Slp::::update_ongoing_time_unit( - RawOrigin::Signed(caller.clone()).into(), - KSM, - TimeUnit::Era(0) - )); + assert_ok!(Pallet::::update_ongoing_time_unit(origin.clone(), KSM, TimeUnit::Era(0))); - // Initialize currency delays. let delay = Delays { unlock_delay: TimeUnit::Era(0), leave_delegators_delay: Default::default() }; - assert_ok!(Slp::::set_currency_delays(origin.clone(), KSM, Some(delay))); + assert_ok!(Pallet::::set_currency_delays(origin.clone(), KSM, Some(delay))); +} - let mins_and_maxs = MinimumsMaximums { - delegator_bonded_minimum: BalanceOf::::unique_saturated_from(0u128), +#[benchmarks(where T: Config + orml_tokens::Config + bifrost_vtoken_minting::Config)] +mod benchmarks { + use super::*; + use crate::primitives::{PhalaLedger, SubstrateValidatorsByDelegatorUpdateEntry}; + use frame_benchmarking::impl_benchmark_test_suite; + use node_primitives::VKSM; + use sp_arithmetic::traits::SaturatedConversion; - bond_extra_minimum: BalanceOf::::unique_saturated_from(0u128), - unbond_minimum: BalanceOf::::unique_saturated_from(0u128), - rebond_minimum: BalanceOf::::unique_saturated_from(0u128), - unbond_record_maximum: 1u32, - validators_back_maximum: 100u32, - delegator_active_staking_maximum: BalanceOf::::unique_saturated_from( - 200_000_000_000_000_000_000u128, - ), - validators_reward_maximum: 300u32, - delegation_amount_minimum: BalanceOf::::unique_saturated_from(0u128), - delegators_maximum: 10, - validators_maximum: 10, - }; + #[benchmark] + fn initialize_delegator() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + set_mins_and_maxs::(origin.clone()); - // Set minimums and maximums - assert_ok!(Slp::::set_minimums_and_maximums(origin.clone(), KSM, Some(mins_and_maxs))); + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, None); - // First to setup index-multilocation relationship of subaccount_0 - assert_ok!(Slp::::initialize_delegator(origin.clone(), KSM, None)); - //DelegatorNotExist + Ok(()) + } - // update some KSM balance to treasury account - assert_ok!(orml_tokens::Pallet::::set_balance( - RawOrigin::Root.into(), - lookup_of_account::(T::EntranceAccount::get().into_account_truncating()), - KSM, - // BalanceOf::::unique_saturated_from(1_000_000_000_000_000_000u128), - // BalanceOf::::unique_saturated_from(0u128) - // 1_000_000_000_000_000_000u128.into(), - ::Balance::unique_saturated_from(1_000_000_000_000_000_000u128), - ::Balance::unique_saturated_from(0u128) - )); + #[benchmark] + fn bond() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + set_mins_and_maxs::(origin.clone()); + DelegatorsMultilocation2Index::::insert(KSM, DELEGATOR1, 0); - // Set fee source - assert_ok!(Slp::::set_fee_source( - origin.clone(), - KSM, - Some((treasury_location, BalanceOf::::unique_saturated_from(1_000_000_000_000u128))), - )); + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + KSM, + XcmOperationType::Bond, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::Bond, - Some((Weight::from_parts(0, u64::MAX), BalanceOf::::unique_saturated_from(0u128))), - )); + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, + KSM, + Box::new(DELEGATOR1), + 10u32.into(), + None, + ); - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::BondExtra, - Some(( - Weight::from_parts(20_000_000_000, u64::MAX), - BalanceOf::::unique_saturated_from(10_000_000_000u128) - )), - )); + Ok(()) + } - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::Unbond, - Some(( - Weight::from_parts(20_000_000_000, u64::MAX), - BalanceOf::::unique_saturated_from(10_000_000_000u128) - )), - )); + #[benchmark] + fn bond_extra() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_bond::(origin.clone()); - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::Chill, - Some(( - Weight::from_parts(20_000_000_000, u64::MAX), - BalanceOf::::unique_saturated_from(10_000_000_000u128) - )), - )); + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + KSM, + XcmOperationType::BondExtra, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::Rebond, - Some(( - Weight::from_parts(20_000_000_000, u64::MAX), - BalanceOf::::unique_saturated_from(10_000_000_000u128) - )), - )); + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, + KSM, + Box::new(DELEGATOR1), + None, + 10u32.into(), + ); - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::Undelegate, - Some(( - Weight::from_parts(20_000_000_000, u64::MAX), - BalanceOf::::unique_saturated_from(10_000_000_000u128) - )), - )); + Ok(()) + } - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::Delegate, - Some(( - Weight::from_parts(20_000_000_000, u64::MAX), - BalanceOf::::unique_saturated_from(10_000_000_000u128) - )), - )); + #[benchmark] + fn unbond() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_bond::(origin.clone()); + init_ongoing_time::(origin.clone()); - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::Payout, - Some(( - Weight::from_parts(20_000_000_000, u64::MAX), - BalanceOf::::unique_saturated_from(10_000_000_000u128) - )), - )); + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + KSM, + XcmOperationType::Unbond, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::CancelLeave, - Some(( - Weight::from_parts(20_000_000_000, u64::MAX), - BalanceOf::::unique_saturated_from(10_000_000_000u128) - )), - )); + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, + KSM, + Box::new(DELEGATOR1), + None, + 0u32.into(), + ); - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::Liquidize, - Some(( - Weight::from_parts(20_000_000_000, u64::MAX), - BalanceOf::::unique_saturated_from(10_000_000_000u128) - )), - )); + Ok(()) + } - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::ExecuteLeave, - Some(( - Weight::from_parts(20_000_000_000, u64::MAX), - BalanceOf::::unique_saturated_from(10_000_000_000u128) - )), - )); + #[benchmark] + fn unbond_all() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_bond::(origin.clone()); + init_ongoing_time::(origin.clone()); - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::TransferBack, - Some(( - Weight::from_parts(20_000_000_000, u64::MAX), - BalanceOf::::unique_saturated_from(10_000_000_000u128) - )), - )); + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + KSM, + XcmOperationType::Unbond, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::XtokensTransferBack, - Some(( - Weight::from_parts(20_000_000_000, u64::MAX), - BalanceOf::::unique_saturated_from(10_000_000_000u128) - )), - )); + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, Box::new(DELEGATOR1)); - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::TransferTo, - Some(( - Weight::from_parts(20_000_000_000, u64::MAX), - BalanceOf::::unique_saturated_from(10_000_000_000u128) - )), - )); + Ok(()) + } - // Set delegator ledger - assert_ok!(Slp::::add_validator( - origin.clone(), - KSM, - Box::new(validator_0_location.clone()), - )); + #[benchmark] + fn rebond() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_bond::(origin.clone()); + init_ongoing_time::(origin.clone()); - // initialize delegator - Ok(()) -} + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + KSM, + XcmOperationType::Rebond, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; -benchmarks! { - where_clause { - where - T: Config + orml_tokens::Config + bifrost_vtoken_minting::Config + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, + KSM, + Box::new(DELEGATOR1), + None, + Some(0u32.into()), + ); + + Ok(()) } - initialize_delegator { - kusama_setup::()?; - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let call = Call::::initialize_delegator { - currency_id:KSM, - delegator_location: None - }; - }: {call.dispatch_bypass_filter(origin)?} - - bond { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let who:T::AccountId = whitelisted_caller(); - let who: T::AccountId = whitelisted_caller(); - let subaccount_0_32: [u8; 32] = Pallet::::account_id_to_account_32(who.clone()).unwrap(); - let subaccount_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(subaccount_0_32).unwrap(); - let validator_0_account_id_20: [u8; 20] = - hex_literal::hex!["3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0"].into(); - let validator_0_location = MultiLocation { - parents: 1, - interior: X2( - Parachain(2023), - AccountKey20 { network: None, key: validator_0_account_id_20 }, - ), - }; - kusama_setup::()?; - assert_ok!(Slp::::add_delegator(origin.clone(), KSM, 1u16,Box::new(subaccount_0_location.clone()))); - let call = Call::::bond { - currency_id:KSM, - who:Box::new(subaccount_0_location.clone()), - amount:BalanceOf::::unique_saturated_from(5_000_000_000_000_000_000u128), - validator:Some(validator_0_location.clone()) - }; - }: {call.dispatch_bypass_filter(RawOrigin::Signed(who.clone()).into())?} - - bond_extra { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let who: T::AccountId = whitelisted_caller(); - let subaccount_0_32: [u8; 32] = Pallet::::account_id_to_account_32(who.clone()).unwrap(); - let subaccount_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(subaccount_0_32).unwrap(); - let validator_0_account_id_20: [u8; 20] = - hex_literal::hex!["3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0"].into(); - let validator_0_location = MultiLocation { - parents: 1, - interior: X2( - Parachain(2023), - AccountKey20 { network: None, key: validator_0_account_id_20 }, - ), - }; - kusama_setup::()?; - assert_ok!(Slp::::add_delegator(origin.clone(), KSM, 1u16,Box::new(subaccount_0_location.clone()))); - assert_ok!(Slp::::bond( - RawOrigin::Signed(who.clone()).into(), - KSM, - Box::new(subaccount_0_location.clone()), - BalanceOf::::unique_saturated_from(5_000_000_000_000_000_000u128), - Some(validator_0_location.clone()), - )); - let call = Call::::bond_extra { - currency_id:KSM, - who:Box::new(subaccount_0_location.clone()), - validator:Some(validator_0_location.clone()), - amount:BalanceOf::::unique_saturated_from(5_000_000_000_000_000_000u128), - }; - }: {call.dispatch_bypass_filter(RawOrigin::Signed(who.clone()).into())?} - - rebond { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let who: T::AccountId = whitelisted_caller(); - let subaccount_0_32: [u8; 32] = Pallet::::account_id_to_account_32(who.clone()).unwrap(); - let subaccount_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(subaccount_0_32).unwrap(); - let validator_0_account_id_20: [u8; 20] = - hex_literal::hex!["3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0"].into(); - let validator_0_location = MultiLocation { - parents: 1, - interior: X2( - Parachain(2023), - AccountKey20 { network: None, key: validator_0_account_id_20 }, - ), - }; - kusama_setup::()?; - assert_ok!(Slp::::add_delegator(origin.clone(), KSM, 1u16,Box::new(subaccount_0_location.clone()))); - assert_ok!(Slp::::bond( - RawOrigin::Signed(who.clone()).into(), - KSM, - Box::new(subaccount_0_location.clone()), - BalanceOf::::unique_saturated_from(5_000_000_000_000_000_000u128), - Some(validator_0_location.clone()), - )); - let call = Call::::rebond { - currency_id:KSM, - who:Box::new(subaccount_0_location.clone()), - validator:Some(validator_0_location.clone()), - amount:Some(BalanceOf::::unique_saturated_from(0u128)), - }; - }: {call.dispatch_bypass_filter(RawOrigin::Signed(who.clone()).into())?} - - delegate { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let who: T::AccountId = whitelisted_caller(); - let subaccount_0_32: [u8; 32] = Pallet::::account_id_to_account_32(who.clone()).unwrap(); - let subaccount_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(subaccount_0_32).unwrap(); - let who2: T::AccountId = whitelisted_caller(); - let validator_0_account_id_20: [u8; 32] = Pallet::::account_id_to_account_32(who2.clone()).unwrap(); - let validator_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(validator_0_account_id_20).unwrap(); - kusama_setup::()?; - assert_ok!(Slp::::add_delegator(origin.clone(), KSM, 1u16,Box::new(subaccount_0_location.clone()))); - assert_ok!(Slp::::add_validator(origin.clone(), KSM,Box::new(validator_0_location.clone()))); - assert_ok!(Slp::::bond( - RawOrigin::Signed(who.clone()).into(), - KSM, - Box::new(subaccount_0_location.clone()), - BalanceOf::::unique_saturated_from(5_000_000_000_000_000_000u128), - Some(validator_0_location.clone()), - )); - let call = Call::::delegate { - currency_id:KSM, - who:Box::new(subaccount_0_location.clone()), - targets:vec![validator_0_location.clone()], - }; - }: {call.dispatch_bypass_filter(RawOrigin::Signed(who.clone()).into())?} - - redelegate { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let who: T::AccountId = whitelisted_caller(); - let subaccount_0_32: [u8; 32] = Pallet::::account_id_to_account_32(who.clone()).unwrap(); - let subaccount_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(subaccount_0_32).unwrap(); - let who2: T::AccountId = whitelisted_caller(); - let validator_0_account_id_20: [u8; 32] = Pallet::::account_id_to_account_32(who2.clone()).unwrap(); - let validator_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(validator_0_account_id_20).unwrap(); - kusama_setup::()?; - assert_ok!(Slp::::add_delegator(origin.clone(), KSM, 1u16,Box::new(subaccount_0_location.clone()))); - assert_ok!(Slp::::add_validator(origin.clone(), KSM,Box::new(validator_0_location.clone()))); - assert_ok!(Slp::::bond( - RawOrigin::Signed(who.clone()).into(), - KSM, - Box::new(subaccount_0_location.clone()), - BalanceOf::::unique_saturated_from(5_000_000_000_000_000_000u128), - Some(validator_0_location.clone()), - )); - let call = Call::::redelegate { - currency_id:KSM, - who:Box::new(subaccount_0_location.clone()), - targets:Some(vec![validator_0_location.clone()]), - }; - }: {call.dispatch_bypass_filter(RawOrigin::Signed(who.clone()).into())?} - - payout { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let who: T::AccountId = whitelisted_caller(); - let subaccount_0_32: [u8; 32] = Pallet::::account_id_to_account_32(who.clone()).unwrap(); - let subaccount_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(subaccount_0_32).unwrap(); - let who2: T::AccountId = whitelisted_caller(); - let validator_0_account_id_20: [u8; 32] = Pallet::::account_id_to_account_32(who2.clone()).unwrap(); - let validator_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(validator_0_account_id_20).unwrap(); - kusama_setup::()?; - assert_ok!(Slp::::add_delegator(origin.clone(), KSM, 1u16,Box::new(subaccount_0_location.clone()))); - assert_ok!(Slp::::add_validator(origin.clone(), KSM,Box::new(validator_0_location.clone()))); - let call = Call::::payout { - currency_id:KSM, - who:Box::new(subaccount_0_location.clone()), - validator:Box::new(validator_0_location.clone()), - when:Some(TimeUnit::Era(27)) - }; - }: {call.dispatch_bypass_filter(RawOrigin::Signed(who.clone()).into())?} - - liquidize { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let who: T::AccountId = whitelisted_caller(); - let subaccount_0_32: [u8; 32] = Pallet::::account_id_to_account_32(who.clone()).unwrap(); - let subaccount_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(subaccount_0_32).unwrap(); - let who2: T::AccountId = whitelisted_caller(); - let validator_0_account_id_20: [u8; 32] = Pallet::::account_id_to_account_32(who2.clone()).unwrap(); - let validator_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(validator_0_account_id_20).unwrap(); - kusama_setup::()?; - assert_ok!(Slp::::add_delegator(origin.clone(), KSM, 1u16,Box::new(subaccount_0_location.clone()))); - assert_ok!(Slp::::add_validator(origin.clone(), KSM,Box::new(validator_0_location.clone()))); - assert_ok!(Slp::::bond( - RawOrigin::Signed(who.clone()).into(), - KSM, - Box::new(subaccount_0_location.clone()), - BalanceOf::::unique_saturated_from(5_000_000_000_000_000_000u128), - Some(validator_0_location.clone()), - )); - >::set_block_number(BlockNumberFor::::from(101_000u32)); - let call = Call::::liquidize { - currency_id:KSM, - who:Box::new(subaccount_0_location.clone()), - when:Some(TimeUnit::SlashingSpan(5)), - validator:None, - amount:None - }; - }: {call.dispatch_bypass_filter(RawOrigin::Signed(who.clone()).into())?} - - transfer_back { - kusama_setup::()?; - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let who: T::AccountId = whitelisted_caller(); - - let subaccount_0_32: [u8; 32] = Pallet::::account_id_to_account_32(who.clone()).unwrap(); - let subaccount_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(subaccount_0_32).unwrap(); - - let exit_account_id_32: [u8; 32] = - hex_literal::hex!["6d6f646c62662f76746f75740000000000000000000000000000000000000000"] - .into(); - let exit_account_location = MultiLocation { - parents: 0, - interior: X1(Junction::AccountId32 { network: None, id: exit_account_id_32 }), - }; + #[benchmark] + fn delegate() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_bond::(origin.clone()); + Validators::::insert(KSM, BoundedVec::try_from(vec![DELEGATOR1]).unwrap()); - assert_ok!(Slp::::set_operate_origin(origin.clone(), KSM, Some(who.clone()))); - assert_ok!(Slp::::add_delegator(origin.clone(), KSM, 1u16,Box::new(subaccount_0_location.clone()))); - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::TransferBack, - Some((Weight::from_parts(20_000_000_000, u64::MAX), BalanceOf::::unique_saturated_from(10_000_000_000u128))), - )); - let call = Call::::transfer_back { - currency_id:KSM, - from:Box::new(subaccount_0_location.clone()), - to:Box::new(exit_account_location.clone()), - amount: BalanceOf::::unique_saturated_from(10_000_000_000u128) - }; - }: {call.dispatch_bypass_filter(RawOrigin::Signed(who.clone()).into())?} + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + KSM, + XcmOperationType::Delegate, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; - increase_token_pool { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let call = Call::::increase_token_pool { - currency_id:KSM, - amount: BalanceOf::::unique_saturated_from(10_000_000_000u128) - }; - }: {call.dispatch_bypass_filter(origin)?} - - decrease_token_pool { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - assert_ok!(Slp::::increase_token_pool(origin.clone(), KSM, BalanceOf::::unique_saturated_from(10_000_000_000u128))); - let call = Call::::decrease_token_pool { - currency_id:KSM, - amount: BalanceOf::::unique_saturated_from(10_000_000u128) - }; - }: {call.dispatch_bypass_filter(origin)?} + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, + KSM, + Box::new(DELEGATOR1), + vec![DELEGATOR1], + ); - update_ongoing_time_unit { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - assert_ok!(Slp::::set_ongoing_time_unit_update_interval(origin.clone(), KSM, Some(BlockNumberFor::::from(0u32)))); + Ok(()) + } - let call = Call::::update_ongoing_time_unit { - currency_id:KSM, - time_unit: TimeUnit::Era(27) - }; - }: {call.dispatch_bypass_filter(origin)?} + #[benchmark] + fn undelegate() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_bond::(origin.clone()); + ValidatorsByDelegator::::insert( + KSM, + DELEGATOR1, + BoundedVec::try_from(vec![DELEGATOR1, DELEGATOR2]).unwrap(), + ); - refund_currency_due_unbond { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - assert_ok!(Slp::::set_ongoing_time_unit_update_interval(origin.clone(), KSM, Some(BlockNumberFor::::from(0u32)))); + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + KSM, + XcmOperationType::Delegate, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; - let call = Call::::refund_currency_due_unbond { - currency_id:KSM, - }; - }: {call.dispatch_bypass_filter(origin)?} - - charge_host_fee_and_tune_vtoken_exchange_rate { - kusama_setup::()?; - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let who: T::AccountId = whitelisted_caller(); - let subaccount_0_32: [u8; 32] = Pallet::::account_id_to_account_32(who.clone()).unwrap(); - let subaccount_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(subaccount_0_32).unwrap(); - let who2: T::AccountId = whitelisted_caller(); - let validator_0_account_id_20: [u8; 32] = Pallet::::account_id_to_account_32(who2.clone()).unwrap(); - let validator_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(validator_0_account_id_20).unwrap(); - assert_ok!(Slp::::add_delegator(origin.clone(), KSM, 1u16,Box::new(subaccount_0_location.clone()))); - assert_ok!(Slp::::add_validator(origin.clone(), KSM,Box::new(validator_0_location.clone()))); - - let pct_100 = Permill::from_percent(100); - let treasury_32: [u8; 32] = - hex_literal::hex!["6d6f646c62662f74727372790000000000000000000000000000000000000000"]; - let pct = Permill::from_percent(20); - let treasury_location = MultiLocation { - parents: 0, - interior: X1(AccountId32 { network: None, id: treasury_32 }), - }; - assert_ok!(Slp::::set_hosting_fees(origin.clone(), KSM, Some((pct, treasury_location)))); - assert_ok!(Slp::::set_currency_tune_exchange_rate_limit(origin.clone(), KSM,Some((1, pct_100)))); - assert_ok!(::MultiCurrency::deposit(CurrencyId::VToken(TokenSymbol::KSM), &who, BalanceOf::::unique_saturated_from(1000000000000u128))); - assert_ok!(::MultiCurrency::deposit(CurrencyId::Token(TokenSymbol::KSM), &who, BalanceOf::::unique_saturated_from(1000000000000u128))); - - assert_ok!(Slp::::increase_token_pool(origin.clone(), KSM,BalanceOf::::unique_saturated_from(10_000_000_000u128))); - assert_ok!(Slp::::bond( - RawOrigin::Signed(who.clone()).into(), - KSM, - Box::new(subaccount_0_location.clone()), - BalanceOf::::unique_saturated_from(100_000_000_000_000u128), - Some(validator_0_location.clone()), - )); + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, + KSM, + Box::new(DELEGATOR1), + vec![DELEGATOR1], + ); - let call = Call::::charge_host_fee_and_tune_vtoken_exchange_rate { - currency_id:KSM, - value: BalanceOf::::unique_saturated_from(100_000_000_000u128), - who:Some(subaccount_0_location.clone()), - }; - }: {call.dispatch_bypass_filter(RawOrigin::Signed(who.clone()).into())?} - - confirm_delegator_ledger_query_response { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let who: T::AccountId = whitelisted_caller(); - let subaccount_0_32: [u8; 32] = Pallet::::account_id_to_account_32(who.clone()).unwrap(); - let subaccount_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(subaccount_0_32).unwrap(); - let who2: T::AccountId = whitelisted_caller(); - let validator_0_account_id_20: [u8; 32] = Pallet::::account_id_to_account_32(who2.clone()).unwrap(); - let validator_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(validator_0_account_id_20).unwrap(); - kusama_setup::()?; - assert_ok!(Slp::::add_delegator(origin.clone(), KSM, 1u16,Box::new(subaccount_0_location.clone()))); - assert_ok!(Slp::::add_validator(origin.clone(), KSM,Box::new(validator_0_location.clone()))); - - assert_ok!(Slp::::bond( - RawOrigin::Signed(who.clone()).into(), - KSM, - Box::new(subaccount_0_location.clone()), - BalanceOf::::unique_saturated_from(5_000_000_000_000_000_000u128), - Some(validator_0_location.clone()), - )); - let call = Call::::confirm_delegator_ledger_query_response { - currency_id:KSM, - query_id: 0, - }; - }: {call.dispatch_bypass_filter(RawOrigin::Signed(who.clone()).into())?} - - - fail_delegator_ledger_query_response { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let who: T::AccountId = whitelisted_caller(); - let subaccount_0_32: [u8; 32] = Pallet::::account_id_to_account_32(who.clone()).unwrap(); - let subaccount_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(subaccount_0_32).unwrap(); - let who2: T::AccountId = whitelisted_caller(); - let validator_0_account_id_20: [u8; 32] = Pallet::::account_id_to_account_32(who2.clone()).unwrap(); - let validator_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(validator_0_account_id_20).unwrap(); - kusama_setup::()?; - assert_ok!(Slp::::add_delegator(origin.clone(), KSM, 1u16,Box::new(subaccount_0_location.clone()))); - assert_ok!(Slp::::add_validator(origin.clone(), KSM,Box::new(validator_0_location.clone()))); - - assert_ok!(Slp::::bond( - RawOrigin::Signed(who.clone()).into(), - KSM, - Box::new(subaccount_0_location.clone()), - BalanceOf::::unique_saturated_from(5_000_000_000_000_000_000u128), - Some(validator_0_location.clone()), - )); - let call = Call::::fail_delegator_ledger_query_response { - currency_id:KSM, - query_id:0, - }; - }: {call.dispatch_bypass_filter(RawOrigin::Signed(who.clone()).into())?} + Ok(()) + } - chill { - kusama_setup::()?; - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let who: T::AccountId = whitelisted_caller(); + #[benchmark] + fn redelegate() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_bond::(origin.clone()); + Validators::::insert(KSM, BoundedVec::try_from(vec![DELEGATOR1]).unwrap()); - let subaccount_0_32: [u8; 32] = Pallet::::account_id_to_account_32(who.clone()).unwrap(); + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + KSM, + XcmOperationType::Delegate, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; - let subaccount_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(subaccount_0_32).unwrap(); + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, + KSM, + Box::new(DELEGATOR1), + Some(vec![DELEGATOR1]), + ); - let entrance_account: T::AccountId = T::EntranceAccount::get().into_account_truncating(); + Ok(()) + } - assert_ok!(orml_tokens::Pallet::::set_balance( - RawOrigin::Root.into(), - lookup_of_account::(entrance_account.clone()), - KSM, - ::Balance::unique_saturated_from(1_000_000_000_000_000_000u128), - ::Balance::unique_saturated_from(0u128) - )); + #[benchmark] + fn payout() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + DelegatorsMultilocation2Index::::insert(KSM, DELEGATOR1, 0); - assert_eq!(orml_tokens::Pallet::::total_balance(KSM, &entrance_account), - ::Balance::unique_saturated_from(1_000_000_000_000_000_000u128) - ); + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + KSM, + XcmOperationType::Payout, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, + KSM, + Box::new(DELEGATOR1), + Box::new(DELEGATOR1), + Some(TimeUnit::Era(0)), + ); - let entrance_account_32 = Slp::::account_id_to_account_32(entrance_account.clone()).unwrap(); - let entrance_account_location: MultiLocation = - Slp::::account_32_to_local_location(entrance_account_32).unwrap(); + Ok(()) + } - assert_ok!(Slp::::set_operate_origin(origin.clone(), KSM, Some(who.clone()))); - assert_ok!(Slp::::add_delegator(origin.clone(), KSM, 1u16,Box::new(subaccount_0_location.clone()))); - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::Chill, - Some((Weight::from_parts(20_000_000_000, u64::MAX), BalanceOf::::unique_saturated_from(10_000_000_000u128))), - )); - let sb_ledger = SubstrateLedger { - account: subaccount_0_location.clone(), - total: BalanceOf::::unique_saturated_from(1000_000_000_000u128), - active: BalanceOf::::unique_saturated_from(500_000_000_000u128), - unlocking: vec![], - }; - let ledger = Ledger::Substrate(sb_ledger); - DelegatorLedgers::::insert(KSM, subaccount_0_location.clone(), ledger); + #[benchmark] + fn liquidize() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + set_mins_and_maxs::(origin.clone()); + DelegatorsMultilocation2Index::::insert(KSM, DELEGATOR1, 0); + + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + KSM, + XcmOperationType::Liquidize, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; + + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, + KSM, + Box::new(DELEGATOR1), + Some(TimeUnit::SlashingSpan(0)), + None, + None, + ); + + Ok(()) + } + + #[benchmark] + fn chill() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_bond::(origin.clone()); + init_ongoing_time::(origin.clone()); + + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + KSM, + XcmOperationType::Chill, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; - assert_ok!(Slp::::set_ongoing_time_unit_update_interval(origin.clone(), KSM, Some(BlockNumberFor::::from(0u32)))); + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, Box::new(DELEGATOR1)); - assert_ok!(Slp::::update_ongoing_time_unit( - origin.clone(),KSM,TimeUnit::Era(27) + Ok(()) + } + + #[benchmark] + fn transfer_back() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + set_mins_and_maxs::(origin.clone()); + DelegatorsMultilocation2Index::::insert(KSM, DELEGATOR1, 0); + + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + KSM, + XcmOperationType::TransferBack, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; + + let (_, exit_account) = ::VtokenMinting::get_entrance_and_exit_accounts(); + let exit_account_32 = Pallet::::account_id_to_account_32(exit_account).unwrap(); + let to = Pallet::::account_32_to_parent_location(exit_account_32).unwrap(); + + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, + KSM, + Box::new(DELEGATOR1), + Box::new(to), + 10u32.into(), + ); + + Ok(()) + } + + #[benchmark] + fn transfer_to() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + set_mins_and_maxs::(origin.clone()); + DelegatorsMultilocation2Index::::insert(KSM, DELEGATOR1, 0); + + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + KSM, + XcmOperationType::TransferTo, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; + + let (entrance_account, _) = ::VtokenMinting::get_entrance_and_exit_accounts(); + let entrance_account_32 = Pallet::::account_id_to_account_32(entrance_account).unwrap(); + let from = Pallet::::account_32_to_local_location(entrance_account_32).unwrap(); + + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, + KSM, + Box::new(from), + Box::new(DELEGATOR1), + 10u32.into(), + ); + + Ok(()) + } + + #[benchmark] + fn convert_asset() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + DelegatorsMultilocation2Index::::insert(PHA, DELEGATOR1, 0); + + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + PHA, + XcmOperationType::ConvertAsset, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; + + DelegatorLedgers::::insert( + PHA, + DELEGATOR1, + Ledger::Phala(PhalaLedger { + account: DELEGATOR1, + active_shares: 10u32.into(), + unlocking_shares: 10u32.into(), + unlocking_time_unit: None, + bonded_pool_id: None, + bonded_pool_collection_id: None, + }), + ); + + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, + PHA, + Box::new(DELEGATOR1), + 10u32.into(), + true, + ); + + Ok(()) + } + + #[benchmark] + fn increase_token_pool() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, 10u32.into()); + + Ok(()) + } + + #[benchmark] + fn decrease_token_pool() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + + assert_ok!(Pallet::::increase_token_pool( + origin.clone() as ::RuntimeOrigin, + KSM, + 10u32.into() )); - let delay = - Delays { unlock_delay: TimeUnit::Era(24), leave_delegators_delay: TimeUnit::Era(24) }; + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, 10u32.into()); + Ok(()) + } - CurrencyDelays::::insert(KSM, delay); + #[benchmark] + fn update_ongoing_time_unit() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; - let call = Call::::chill { - currency_id:KSM, - who:Box::new(subaccount_0_location.clone()), - }; - }: {call.dispatch_bypass_filter(RawOrigin::Signed(who.clone()).into())?} + OngoingTimeUnitUpdateInterval::::insert(KSM, T::BlockNumber::from(0u32)); + LastTimeUpdatedOngoingTimeUnit::::insert(KSM, T::BlockNumber::from(0u32)); - supplement_fee_reserve { - kusama_setup::()?; - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let who: T::AccountId = whitelisted_caller(); + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, TimeUnit::Era(0)); - let subaccount_0_32: [u8; 32] = Pallet::::account_id_to_account_32(who.clone()).unwrap(); + Ok(()) + } - let subaccount_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(subaccount_0_32).unwrap(); + #[benchmark] + fn refund_currency_due_unbond() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_ongoing_time::(origin.clone()); - let entrance_account: T::AccountId = T::EntranceAccount::get().into_account_truncating(); + let (_, exit_account) = T::VtokenMinting::get_entrance_and_exit_accounts(); + orml_tokens::Pallet::::deposit( + KSM, + &exit_account, + ::Balance::saturated_from(1_000_000_000_000u128), + ) + .unwrap(); - assert_ok!(orml_tokens::Pallet::::set_balance( - RawOrigin::Root.into(), - lookup_of_account::(entrance_account.clone()), - KSM, - ::Balance::unique_saturated_from(1_000_000_000_000_000_000u128), - ::Balance::unique_saturated_from(0u128) - )); + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM); - assert_eq!(orml_tokens::Pallet::::total_balance(KSM, &entrance_account), - ::Balance::unique_saturated_from(1_000_000_000_000_000_000u128) - ); + Ok(()) + } + #[benchmark] + fn supplement_fee_reserve() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + set_mins_and_maxs::(origin.clone()); - let entrance_account_32 = Slp::::account_id_to_account_32(entrance_account.clone()).unwrap(); - let entrance_account_location: MultiLocation = - Slp::::account_32_to_local_location(entrance_account_32).unwrap(); + let (entrance_account, _) = ::VtokenMinting::get_entrance_and_exit_accounts(); + let entrance_account_32 = Pallet::::account_id_to_account_32(entrance_account).unwrap(); + let from = Pallet::::account_32_to_local_location(entrance_account_32).unwrap(); - assert_ok!(Slp::::set_operate_origin(origin.clone(), KSM, Some(who.clone()))); - assert_ok!(Slp::::add_delegator(origin.clone(), KSM, 1u16,Box::new(subaccount_0_location.clone()))); - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::TransferTo, - Some((Weight::from_parts(20_000_000_000, u64::MAX), BalanceOf::::unique_saturated_from(10_000_000_000u128))), - )); - let sb_ledger = SubstrateLedger { - account: subaccount_0_location.clone(), - total: BalanceOf::::unique_saturated_from(1000_000_000_000u128), - active: BalanceOf::::unique_saturated_from(500_000_000_000u128), - unlocking: vec![], - }; - let ledger = Ledger::Substrate(sb_ledger); - DelegatorLedgers::::insert(KSM, subaccount_0_location.clone(), ledger); + DelegatorsMultilocation2Index::::insert(KSM, DELEGATOR1, 0); + + FeeSources::::insert(KSM, (from, BalanceOf::::from(1000u32))); + + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + KSM, + XcmOperationType::TransferTo, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; + + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, Box::new(DELEGATOR1)); + Ok(()) + } - assert_ok!(Slp::::set_ongoing_time_unit_update_interval(origin.clone(), KSM, Some(BlockNumberFor::::from(0u32)))); + #[benchmark] + fn charge_host_fee_and_tune_vtoken_exchange_rate() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_bond::(origin.clone()); + init_ongoing_time::(origin.clone()); - assert_ok!(Slp::::update_ongoing_time_unit( - origin.clone(),KSM,TimeUnit::Era(27) + assert_ok!(Pallet::::increase_token_pool( + origin.clone() as ::RuntimeOrigin, + KSM, + 1000u32.into() )); - let delay = - Delays { unlock_delay: TimeUnit::Era(24), leave_delegators_delay: TimeUnit::Era(24) }; + CurrencyTuneExchangeRateLimit::::insert( + KSM, + (1000u32, Permill::from_parts(100_0000u32)), + ); + HostingFees::::insert(KSM, (Permill::from_parts(100_0000u32), DELEGATOR1)); + + orml_tokens::Pallet::::deposit( + VKSM, + &whitelisted_caller(), + ::Balance::saturated_from(1_000_000_000_000u128), + ) + .unwrap(); + + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, + KSM, + 10u32.into(), + Some(DELEGATOR1), + ); + Ok(()) + } + + #[benchmark] + fn set_operate_origin() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, Some(whitelisted_caller())); + + Ok(()) + } - CurrencyDelays::::insert(KSM, delay); + #[benchmark] + fn set_fee_source() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; - assert_ok!(Slp::::set_fee_source ( - origin.clone(), + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, KSM, - Some((entrance_account_location.clone(),BalanceOf::::unique_saturated_from(5_000_000_000u128))) + Some((DELEGATOR1, 10u32.into())), + ); + + Ok(()) + } + + #[benchmark] + fn add_delegator() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + set_mins_and_maxs::(origin.clone()); + + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, 0u16, Box::new(DELEGATOR1)); + + Ok(()) + } + + #[benchmark] + fn remove_delegator() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_bond::(origin.clone()); + + assert_ok!(Pallet::::add_delegator( + origin.clone() as ::RuntimeOrigin, + KSM, + 0, + Box::new(DELEGATOR1) )); - let call = Call::::supplement_fee_reserve { - currency_id:KSM, - dest:Box::new(subaccount_0_location.clone()), - }; - }: {call.dispatch_bypass_filter(RawOrigin::Signed(who.clone()).into())?} + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, Box::new(DELEGATOR1)); + Ok(()) + } - confirm_validators_by_delegator_query_response { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let who: T::AccountId = whitelisted_caller(); + #[benchmark] + fn add_validator() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + set_mins_and_maxs::(origin.clone()); - let subaccount_0_32: [u8; 32] = Pallet::::account_id_to_account_32(who.clone()).unwrap(); + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, Box::new(DELEGATOR1)); - let subaccount_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(subaccount_0_32).unwrap(); + Ok(()) + } - let who2: T::AccountId = whitelisted_caller(); - let validator_0_account_id_20: [u8; 32] = Pallet::::account_id_to_account_32(who2.clone()).unwrap(); - let validator_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(validator_0_account_id_20).unwrap(); + #[benchmark] + fn remove_validator() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + set_mins_and_maxs::(origin.clone()); - let entrance_account: T::AccountId = T::EntranceAccount::get().into_account_truncating(); + assert_ok!(Pallet::::add_validator( + origin.clone() as ::RuntimeOrigin, + KSM, + Box::new(DELEGATOR1) + )); - kusama_setup::()?; - assert_ok!(orml_tokens::Pallet::::set_balance( - RawOrigin::Root.into(), - lookup_of_account::(entrance_account.clone()), - KSM, - ::Balance::unique_saturated_from(1_000_000_000_000_000_000u128), - ::Balance::unique_saturated_from(0u128) - )); + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, Box::new(DELEGATOR1)); - assert_eq!(orml_tokens::Pallet::::total_balance(KSM, &entrance_account), - ::Balance::unique_saturated_from(1_000_000_000_000_000_000u128) - ); + Ok(()) + } + #[benchmark] + fn set_validators_by_delegator() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_bond::(origin.clone()); + Validators::::insert(KSM, BoundedVec::try_from(vec![DELEGATOR2]).unwrap()); - let entrance_account_32 = Slp::::account_id_to_account_32(entrance_account.clone()).unwrap(); - let entrance_account_location: MultiLocation = - Slp::::account_32_to_local_location(entrance_account_32).unwrap(); + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, + KSM, + Box::new(DELEGATOR1), + vec![DELEGATOR2], + ); - assert_ok!(Slp::::set_operate_origin(origin.clone(), KSM, Some(who.clone()))); - assert_ok!(Slp::::add_delegator(origin.clone(), KSM, 1u16,Box::new(subaccount_0_location.clone()))); - assert_ok!(Slp::::add_validator(origin.clone(), KSM,Box::new(validator_0_location.clone()))); - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::TransferTo, - Some((Weight::from_parts(20_000_000_000, u64::MAX), BalanceOf::::unique_saturated_from(10_000_000_000u128))), - )); - let sb_ledger = SubstrateLedger { - account: subaccount_0_location.clone(), - total: BalanceOf::::unique_saturated_from(1000_000_000_000u128), - active: BalanceOf::::unique_saturated_from(500_000_000_000u128), + Ok(()) + } + + #[benchmark] + fn set_delegator_ledger() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_bond::(origin.clone()); + + let ledger = Box::new(Some(Ledger::Substrate(SubstrateLedger { + account: Default::default(), + total: 1000u32.into(), + active: 1000u32.into(), unlocking: vec![], + }))); + + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, Box::new(DELEGATOR1), ledger); + + Ok(()) + } + + #[benchmark] + fn set_minimums_and_maximums() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + let mins_and_maxs = MinimumsMaximums { + delegator_bonded_minimum: 0u32.into(), + + bond_extra_minimum: 0u32.into(), + unbond_minimum: 0u32.into(), + rebond_minimum: 0u32.into(), + unbond_record_maximum: 5u32, + validators_back_maximum: 100u32, + delegator_active_staking_maximum: 1_000_000_000u32.into(), + validators_reward_maximum: 300u32, + delegation_amount_minimum: 0u32.into(), + delegators_maximum: 10, + validators_maximum: 10, }; - let ledger = Ledger::Substrate(sb_ledger); - DelegatorLedgers::::insert(KSM, subaccount_0_location.clone(), ledger); - assert_ok!(Slp::::set_ongoing_time_unit_update_interval(origin.clone(), KSM, Some(BlockNumberFor::::from(0u32)))); + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, Some(mins_and_maxs)); - assert_ok!(Slp::::update_ongoing_time_unit( - origin.clone(),KSM,TimeUnit::Era(27) - )); + Ok(()) + } + #[benchmark] + fn set_currency_delays() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; let delay = - Delays { unlock_delay: TimeUnit::Era(24), leave_delegators_delay: TimeUnit::Era(24) }; + Delays { unlock_delay: TimeUnit::Era(0), leave_delegators_delay: Default::default() }; + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, Some(delay)); - CurrencyDelays::::insert(KSM, delay); - assert_ok!(Slp::::delegate ( - origin.clone(), + Ok(()) + } + + #[benchmark] + fn set_hosting_fees() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, KSM, - Box::new(subaccount_0_location.clone()), - vec![validator_0_location.clone()], - )); + Some((Permill::from_parts(100_0000u32), DELEGATOR1)), + ); - assert_ok!(Slp::::set_fee_source ( - origin.clone(), + Ok(()) + } + + #[benchmark] + fn set_currency_tune_exchange_rate_limit() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, KSM, - Some((entrance_account_location.clone(),BalanceOf::::unique_saturated_from(5_000_000_000u128))) - )); + Some((1000u32, Permill::from_parts(100_0000u32))), + ); - let call = Call::::confirm_validators_by_delegator_query_response { - currency_id:KSM, - query_id:0, - }; - }: {call.dispatch_bypass_filter(RawOrigin::Signed(who.clone()).into())?} + Ok(()) + } - fail_validators_by_delegator_query_response { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let who: T::AccountId = whitelisted_caller(); + #[benchmark] + fn set_ongoing_time_unit_update_interval() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; - let subaccount_0_32: [u8; 32] = Pallet::::account_id_to_account_32(who.clone()).unwrap(); + #[extrinsic_call] + _( + origin as ::RuntimeOrigin, + KSM, + Some(T::BlockNumber::from(100u32)), + ); - let subaccount_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(subaccount_0_32).unwrap(); + Ok(()) + } - let who2: T::AccountId = whitelisted_caller(); - let validator_0_account_id_20: [u8; 32] = Pallet::::account_id_to_account_32(who2.clone()).unwrap(); - let validator_0_location: MultiLocation = - Pallet::::account_32_to_parent_location(validator_0_account_id_20).unwrap(); + #[benchmark] + fn add_supplement_fee_account_to_whitelist() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; - let entrance_account: T::AccountId = T::EntranceAccount::get().into_account_truncating(); + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, Box::new(DELEGATOR1)); - kusama_setup::()?; - assert_ok!(orml_tokens::Pallet::::set_balance( - RawOrigin::Root.into(), - lookup_of_account::(entrance_account.clone()), - KSM, - ::Balance::unique_saturated_from(1_000_000_000_000_000_000u128), - ::Balance::unique_saturated_from(0u128) - )); + Ok(()) + } - assert_eq!(orml_tokens::Pallet::::total_balance(KSM, &entrance_account), - ::Balance::unique_saturated_from(1_000_000_000_000_000_000u128) - ); + #[benchmark] + fn remove_supplement_fee_account_from_whitelist() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + assert_ok!(Pallet::::add_supplement_fee_account_to_whitelist( + origin.clone() as ::RuntimeOrigin, + KSM, + Box::new(DELEGATOR1) + )); + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, Box::new(DELEGATOR1)); - let entrance_account_32 = Slp::::account_id_to_account_32(entrance_account.clone()).unwrap(); - let entrance_account_location: MultiLocation = - Slp::::account_32_to_local_location(entrance_account_32).unwrap(); + Ok(()) + } - assert_ok!(Slp::::set_operate_origin(origin.clone(), KSM, Some(who.clone()))); - assert_ok!(Slp::::add_delegator(origin.clone(), KSM, 1u16,Box::new(subaccount_0_location.clone()))); - assert_ok!(Slp::::add_validator(origin.clone(), KSM,Box::new(validator_0_location.clone()))); - assert_ok!(::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::TransferTo, - Some((Weight::from_parts(20_000_000_000, u64::MAX), BalanceOf::::unique_saturated_from(10_000_000_000u128))), - )); - let sb_ledger = SubstrateLedger { - account: subaccount_0_location.clone(), - total: BalanceOf::::unique_saturated_from(1000_000_000_000u128), - active: BalanceOf::::unique_saturated_from(500_000_000_000u128), - unlocking: vec![], - }; - let ledger = Ledger::Substrate(sb_ledger); - DelegatorLedgers::::insert(KSM, subaccount_0_location.clone(), ledger); + #[benchmark] + fn confirm_delegator_ledger_query_response() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_bond::(origin.clone()); + + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, 0u64); + + Ok(()) + } + + #[benchmark] + fn fail_delegator_ledger_query_response() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_bond::(origin.clone()); + + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, 0u64); + + Ok(()) + } + + #[benchmark] + fn confirm_validators_by_delegator_query_response() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_bond::(origin.clone()); + Validators::::insert(KSM, BoundedVec::try_from(vec![DELEGATOR1]).unwrap()); - assert_ok!(Slp::::set_ongoing_time_unit_update_interval(origin.clone(), KSM, Some(BlockNumberFor::::from(0u32)))); + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + KSM, + XcmOperationType::Delegate, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; - assert_ok!(Slp::::update_ongoing_time_unit( - origin.clone(),KSM,TimeUnit::Era(27) + assert_ok!(Pallet::::delegate( + origin.clone() as ::RuntimeOrigin, + KSM, + Box::new(DELEGATOR1), + vec![DELEGATOR1] )); + ValidatorsByDelegatorXcmUpdateQueue::::insert( + 1u64, + ( + ValidatorsByDelegatorUpdateEntry::Substrate( + SubstrateValidatorsByDelegatorUpdateEntry { + currency_id: KSM, + delegator_id: Default::default(), + validators: vec![], + }, + ), + T::BlockNumber::from(10u32), + ), + ); + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, 1u64); - let delay = - Delays { unlock_delay: TimeUnit::Era(24), leave_delegators_delay: TimeUnit::Era(24) }; + Ok(()) + } + #[benchmark] + fn fail_validators_by_delegator_query_response() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + init_bond::(origin.clone()); + Validators::::insert(KSM, BoundedVec::try_from(vec![DELEGATOR1]).unwrap()); - CurrencyDelays::::insert(KSM, delay); - assert_ok!(Slp::::delegate ( - origin.clone(), + T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( KSM, - Box::new(subaccount_0_location.clone()), - vec![validator_0_location.clone()], + XcmOperationType::Delegate, + Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), + )?; + + assert_ok!(Pallet::::delegate( + origin.clone() as ::RuntimeOrigin, + KSM, + Box::new(DELEGATOR1), + vec![DELEGATOR1] )); - // DelegatorLedgerXcmUpdateQueue::::insert(0, (update_entry.clone(), 1000)); + ValidatorsByDelegatorXcmUpdateQueue::::insert( + 1u64, + ( + ValidatorsByDelegatorUpdateEntry::Substrate( + SubstrateValidatorsByDelegatorUpdateEntry { + currency_id: KSM, + delegator_id: Default::default(), + validators: vec![], + }, + ), + T::BlockNumber::from(10u32), + ), + ); + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, 1u64); - assert_ok!(Slp::::set_fee_source ( - origin.clone(), + Ok(()) + } + + #[benchmark] + fn reset_validators() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + set_mins_and_maxs::(origin.clone()); + + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, vec![DELEGATOR1]); + + Ok(()) + } + + #[benchmark] + fn set_validator_boost_list() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + set_mins_and_maxs::(origin.clone()); + + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, vec![DELEGATOR1]); + + Ok(()) + } + + #[benchmark] + fn add_to_validator_boost_list() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + set_mins_and_maxs::(origin.clone()); + + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, Box::new(DELEGATOR1)); + + Ok(()) + } + + #[benchmark] + fn remove_from_validator_boot_list() -> Result<(), BenchmarkError> { + let origin = ::ControlOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Weightless)?; + set_mins_and_maxs::(origin.clone()); + + assert_ok!(Pallet::::add_to_validator_boost_list( + origin.clone() as ::RuntimeOrigin, KSM, - Some((entrance_account_location.clone(),BalanceOf::::unique_saturated_from(5_000_000_000u128))) + Box::new(DELEGATOR1) )); - let call = Call::::fail_validators_by_delegator_query_response { - currency_id:KSM, - query_id:0, - }; - }: {call.dispatch_bypass_filter(RawOrigin::Signed(who.clone()).into())?} + #[extrinsic_call] + _(origin as ::RuntimeOrigin, KSM, Box::new(DELEGATOR1)); - impl_benchmark_test_suite!(Slp, crate::mocks::mock_kusama::ExtBuilder::default().build(), crate::mocks::mock_kusama::Runtime); + Ok(()) + } + // `cargo test -p bifrost-slp --all-features` + impl_benchmark_test_suite!( + Pallet, + crate::mocks::mock_kusama::ExtBuilder::default().build(), + crate::mocks::mock_kusama::Runtime + ); } diff --git a/pallets/slp/src/lib.rs b/pallets/slp/src/lib.rs index 078b20ab1..3b5f43d89 100644 --- a/pallets/slp/src/lib.rs +++ b/pallets/slp/src/lib.rs @@ -54,7 +54,7 @@ use sp_std::{boxed::Box, vec, vec::Vec}; pub use weights::WeightInfo; use xcm::{ prelude::*, - v3::{ExecuteXcm, Junction, Junctions, MultiLocation, SendXcm, Weight as XcmWeight, Xcm}, + v3::{Junction, Junctions, MultiLocation, Weight as XcmWeight, Xcm}, }; mod agents; @@ -100,7 +100,7 @@ pub mod pallet { use xcm::v3::{MaybeErrorCode, Response}; #[pallet::config] - pub trait Config: frame_system::Config { + pub trait Config: frame_system::Config + pallet_xcm::Config { type RuntimeEvent: From> + IsType<::RuntimeEvent>; type RuntimeOrigin: IsType<::RuntimeOrigin> + Into::RuntimeOrigin>>; @@ -135,12 +135,6 @@ pub mod pallet { /// Parachain Id which is gotten from the runtime. type ParachainId: Get; - /// Routes the XCM message outbound. - type XcmRouter: SendXcm; - - /// XCM executor. - type XcmExecutor: ExecuteXcm<::RuntimeCall>; - /// Substrate response manager. type SubstrateResponseManager: QueryResponseManager< QueryId, @@ -705,7 +699,7 @@ pub mod pallet { /// /// Delegator initialization work. Generate a new delegator and return its ID. #[pallet::call_index(0)] - #[pallet::weight(T::WeightInfo::initialize_delegator())] + #[pallet::weight(::WeightInfo::initialize_delegator())] pub fn initialize_delegator( origin: OriginFor, currency_id: CurrencyId, @@ -725,7 +719,7 @@ pub mod pallet { /// First time bonding some amount to a delegator. #[pallet::call_index(1)] - #[pallet::weight(T::WeightInfo::bond())] + #[pallet::weight(::WeightInfo::bond())] pub fn bond( origin: OriginFor, currency_id: CurrencyId, @@ -754,7 +748,7 @@ pub mod pallet { /// Bond extra amount to a delegator. #[pallet::call_index(2)] - #[pallet::weight(T::WeightInfo::bond_extra())] + #[pallet::weight(::WeightInfo::bond_extra())] pub fn bond_extra( origin: OriginFor, currency_id: CurrencyId, @@ -784,7 +778,7 @@ pub mod pallet { /// Decrease some amount to a delegator. Leave no less than the minimum delegator /// requirement. #[pallet::call_index(3)] - #[pallet::weight(T::WeightInfo::unbond())] + #[pallet::weight(::WeightInfo::unbond())] pub fn unbond( origin: OriginFor, currency_id: CurrencyId, @@ -813,7 +807,7 @@ pub mod pallet { /// Unbond all the active amount of a delegator. #[pallet::call_index(4)] - #[pallet::weight(T::WeightInfo::unbond_all())] + #[pallet::weight(::WeightInfo::unbond_all())] pub fn unbond_all( origin: OriginFor, currency_id: CurrencyId, @@ -838,7 +832,7 @@ pub mod pallet { /// Rebond some unlocking amount to a delegator. #[pallet::call_index(5)] - #[pallet::weight(T::WeightInfo::rebond())] + #[pallet::weight(::WeightInfo::rebond())] pub fn rebond( origin: OriginFor, currency_id: CurrencyId, @@ -867,7 +861,7 @@ pub mod pallet { /// Delegate to some validator set. #[pallet::call_index(6)] - #[pallet::weight(T::WeightInfo::delegate())] + #[pallet::weight(::WeightInfo::delegate())] pub fn delegate( origin: OriginFor, currency_id: CurrencyId, @@ -894,7 +888,7 @@ pub mod pallet { /// Re-delegate existing delegation to a new validator set. #[pallet::call_index(7)] - #[pallet::weight(T::WeightInfo::undelegate())] + #[pallet::weight(::WeightInfo::undelegate())] pub fn undelegate( origin: OriginFor, currency_id: CurrencyId, @@ -921,7 +915,7 @@ pub mod pallet { /// Re-delegate existing delegation to a new validator set. #[pallet::call_index(8)] - #[pallet::weight(T::WeightInfo::redelegate())] + #[pallet::weight(::WeightInfo::redelegate())] pub fn redelegate( origin: OriginFor, currency_id: CurrencyId, @@ -948,7 +942,7 @@ pub mod pallet { /// Initiate payout for a certain delegator. #[pallet::call_index(9)] - #[pallet::weight(T::WeightInfo::payout())] + #[pallet::weight(::WeightInfo::payout())] pub fn payout( origin: OriginFor, currency_id: CurrencyId, @@ -973,7 +967,7 @@ pub mod pallet { /// Withdraw the due payout into free balance. #[pallet::call_index(10)] - #[pallet::weight(T::WeightInfo::liquidize())] + #[pallet::weight(::WeightInfo::liquidize())] pub fn liquidize( origin: OriginFor, currency_id: CurrencyId, @@ -1003,7 +997,7 @@ pub mod pallet { /// Initiate payout for a certain delegator. #[pallet::call_index(11)] - #[pallet::weight(T::WeightInfo::chill())] + #[pallet::weight(::WeightInfo::chill())] pub fn chill( origin: OriginFor, currency_id: CurrencyId, @@ -1027,7 +1021,7 @@ pub mod pallet { } #[pallet::call_index(12)] - #[pallet::weight(T::WeightInfo::transfer_back())] + #[pallet::weight(::WeightInfo::transfer_back())] pub fn transfer_back( origin: OriginFor, currency_id: CurrencyId, @@ -1053,7 +1047,7 @@ pub mod pallet { } #[pallet::call_index(13)] - #[pallet::weight(T::WeightInfo::transfer_to())] + #[pallet::weight(::WeightInfo::transfer_to())] pub fn transfer_to( origin: OriginFor, currency_id: CurrencyId, @@ -1083,7 +1077,7 @@ pub mod pallet { // true. if we convert from some other currency to currency_id, then if_from_currency should // be false. #[pallet::call_index(14)] - #[pallet::weight(T::WeightInfo::convert_asset())] + #[pallet::weight(::WeightInfo::convert_asset())] pub fn convert_asset( origin: OriginFor, currency_id: CurrencyId, @@ -1104,7 +1098,7 @@ pub mod pallet { } #[pallet::call_index(15)] - #[pallet::weight(T::WeightInfo::increase_token_pool())] + #[pallet::weight(::WeightInfo::increase_token_pool())] pub fn increase_token_pool( origin: OriginFor, currency_id: CurrencyId, @@ -1124,7 +1118,7 @@ pub mod pallet { } #[pallet::call_index(16)] - #[pallet::weight(T::WeightInfo::decrease_token_pool())] + #[pallet::weight(::WeightInfo::decrease_token_pool())] pub fn decrease_token_pool( origin: OriginFor, currency_id: CurrencyId, @@ -1144,7 +1138,7 @@ pub mod pallet { } #[pallet::call_index(17)] - #[pallet::weight(T::WeightInfo::update_ongoing_time_unit())] + #[pallet::weight(::WeightInfo::update_ongoing_time_unit())] pub fn update_ongoing_time_unit( origin: OriginFor, currency_id: CurrencyId, @@ -1188,7 +1182,7 @@ pub mod pallet { } #[pallet::call_index(18)] - #[pallet::weight(T::WeightInfo::refund_currency_due_unbond())] + #[pallet::weight(::WeightInfo::refund_currency_due_unbond())] pub fn refund_currency_due_unbond( origin: OriginFor, currency_id: CurrencyId, @@ -1357,7 +1351,7 @@ pub mod pallet { if extra_weight != 0 { Ok(Some( - T::WeightInfo::refund_currency_due_unbond() + + ::WeightInfo::refund_currency_due_unbond() + Weight::from_parts(extra_weight, 0), ) .into()) @@ -1367,7 +1361,7 @@ pub mod pallet { } #[pallet::call_index(19)] - #[pallet::weight(T::WeightInfo::supplement_fee_reserve())] + #[pallet::weight(::WeightInfo::supplement_fee_reserve())] pub fn supplement_fee_reserve( origin: OriginFor, currency_id: CurrencyId, @@ -1447,7 +1441,7 @@ pub mod pallet { } #[pallet::call_index(20)] - #[pallet::weight(T::WeightInfo::charge_host_fee_and_tune_vtoken_exchange_rate())] + #[pallet::weight(::WeightInfo::charge_host_fee_and_tune_vtoken_exchange_rate())] /// Charge staking host fee, tune vtoken/token exchange rate, and update delegator ledger /// for single delegator. pub fn charge_host_fee_and_tune_vtoken_exchange_rate( @@ -1536,9 +1530,10 @@ pub mod pallet { /// ***************************** /// ****** Storage Setters ****** /// ***************************** + /// Update storage OperateOrigins. #[pallet::call_index(22)] - #[pallet::weight(T::WeightInfo::set_operate_origin())] + #[pallet::weight(::WeightInfo::set_operate_origin())] pub fn set_operate_origin( origin: OriginFor, currency_id: CurrencyId, @@ -1559,7 +1554,7 @@ pub mod pallet { /// Update storage FeeSources. #[pallet::call_index(23)] - #[pallet::weight(T::WeightInfo::set_fee_source())] + #[pallet::weight(::WeightInfo::set_fee_source())] pub fn set_fee_source( origin: OriginFor, currency_id: CurrencyId, @@ -1580,7 +1575,7 @@ pub mod pallet { /// Update storage DelegatorsIndex2Multilocation 和 DelegatorsMultilocation2Index. #[pallet::call_index(24)] - #[pallet::weight(T::WeightInfo::add_delegator())] + #[pallet::weight(::WeightInfo::add_delegator())] pub fn add_delegator( origin: OriginFor, currency_id: CurrencyId, @@ -1603,7 +1598,7 @@ pub mod pallet { /// Update storage DelegatorsIndex2Multilocation 和 DelegatorsMultilocation2Index. #[pallet::call_index(25)] - #[pallet::weight(T::WeightInfo::remove_delegator())] + #[pallet::weight(::WeightInfo::remove_delegator())] pub fn remove_delegator( origin: OriginFor, currency_id: CurrencyId, @@ -1622,7 +1617,7 @@ pub mod pallet { /// Update storage Validators. #[pallet::call_index(26)] - #[pallet::weight(T::WeightInfo::add_validator())] + #[pallet::weight(::WeightInfo::add_validator())] pub fn add_validator( origin: OriginFor, currency_id: CurrencyId, @@ -1650,7 +1645,7 @@ pub mod pallet { /// Update storage Validators. #[pallet::call_index(27)] - #[pallet::weight(T::WeightInfo::remove_validator())] + #[pallet::weight(::WeightInfo::remove_validator())] pub fn remove_validator( origin: OriginFor, currency_id: CurrencyId, @@ -1666,7 +1661,7 @@ pub mod pallet { /// Update storage ValidatorsByDelegator. #[pallet::call_index(28)] - #[pallet::weight(T::WeightInfo::set_validators_by_delegator())] + #[pallet::weight(::WeightInfo::set_validators_by_delegator())] pub fn set_validators_by_delegator( origin: OriginFor, currency_id: CurrencyId, @@ -1721,7 +1716,7 @@ pub mod pallet { /// Update storage DelegatorLedgers. #[pallet::call_index(29)] - #[pallet::weight(T::WeightInfo::set_delegator_ledger())] + #[pallet::weight(::WeightInfo::set_delegator_ledger())] pub fn set_delegator_ledger( origin: OriginFor, currency_id: CurrencyId, @@ -1748,7 +1743,7 @@ pub mod pallet { /// Update storage MinimumsAndMaximums. #[pallet::call_index(30)] - #[pallet::weight(T::WeightInfo::set_minimums_and_maximums())] + #[pallet::weight(::WeightInfo::set_minimums_and_maximums())] pub fn set_minimums_and_maximums( origin: OriginFor, currency_id: CurrencyId, @@ -1772,7 +1767,7 @@ pub mod pallet { /// Update storage Delays. #[pallet::call_index(31)] - #[pallet::weight(T::WeightInfo::set_currency_delays())] + #[pallet::weight(::WeightInfo::set_currency_delays())] pub fn set_currency_delays( origin: OriginFor, currency_id: CurrencyId, @@ -1796,7 +1791,7 @@ pub mod pallet { /// Set HostingFees storage. #[pallet::call_index(32)] - #[pallet::weight(T::WeightInfo::set_hosting_fees())] + #[pallet::weight(::WeightInfo::set_hosting_fees())] pub fn set_hosting_fees( origin: OriginFor, currency_id: CurrencyId, @@ -1816,7 +1811,7 @@ pub mod pallet { /// Set CurrencyTuneExchangeRateLimit storage. #[pallet::call_index(33)] - #[pallet::weight(T::WeightInfo::set_currency_tune_exchange_rate_limit())] + #[pallet::weight(::WeightInfo::set_currency_tune_exchange_rate_limit())] pub fn set_currency_tune_exchange_rate_limit( origin: OriginFor, currency_id: CurrencyId, @@ -1839,7 +1834,7 @@ pub mod pallet { /// Set OngoingTimeUnitUpdateInterval storage. #[pallet::call_index(34)] - #[pallet::weight(T::WeightInfo::set_ongoing_time_unit_update_interval())] + #[pallet::weight(::WeightInfo::set_ongoing_time_unit_update_interval())] pub fn set_ongoing_time_unit_update_interval( origin: OriginFor, currency_id: CurrencyId, @@ -1873,7 +1868,7 @@ pub mod pallet { // Add an account to SupplementFeeAccountWhitelist #[pallet::call_index(35)] - #[pallet::weight(T::WeightInfo::add_supplement_fee_account_to_whitelist())] + #[pallet::weight(::WeightInfo::add_supplement_fee_account_to_whitelist())] pub fn add_supplement_fee_account_to_whitelist( origin: OriginFor, currency_id: CurrencyId, @@ -1919,7 +1914,7 @@ pub mod pallet { // Add an account to SupplementFeeAccountWhitelist #[pallet::call_index(36)] - #[pallet::weight(T::WeightInfo::remove_supplement_fee_account_from_whitelist())] + #[pallet::weight(::WeightInfo::remove_supplement_fee_account_from_whitelist())] pub fn remove_supplement_fee_account_from_whitelist( origin: OriginFor, currency_id: CurrencyId, @@ -1964,7 +1959,7 @@ pub mod pallet { /// *************Outer Confirming Xcm queries functions **************** /// ******************************************************************** #[pallet::call_index(37)] - #[pallet::weight(T::WeightInfo::confirm_delegator_ledger_query_response())] + #[pallet::weight(::WeightInfo::confirm_delegator_ledger_query_response())] pub fn confirm_delegator_ledger_query_response( origin: OriginFor, currency_id: CurrencyId, @@ -1977,7 +1972,7 @@ pub mod pallet { } #[pallet::call_index(38)] - #[pallet::weight(T::WeightInfo::fail_delegator_ledger_query_response())] + #[pallet::weight(::WeightInfo::fail_delegator_ledger_query_response())] pub fn fail_delegator_ledger_query_response( origin: OriginFor, currency_id: CurrencyId, @@ -1991,7 +1986,7 @@ pub mod pallet { } #[pallet::call_index(39)] - #[pallet::weight(T::WeightInfo::confirm_validators_by_delegator_query_response())] + #[pallet::weight(::WeightInfo::confirm_validators_by_delegator_query_response())] pub fn confirm_validators_by_delegator_query_response( origin: OriginFor, currency_id: CurrencyId, @@ -2005,7 +2000,7 @@ pub mod pallet { } #[pallet::call_index(40)] - #[pallet::weight(T::WeightInfo::fail_validators_by_delegator_query_response())] + #[pallet::weight(::WeightInfo::fail_validators_by_delegator_query_response())] pub fn fail_validators_by_delegator_query_response( origin: OriginFor, currency_id: CurrencyId, @@ -2019,7 +2014,7 @@ pub mod pallet { } #[pallet::call_index(41)] - #[pallet::weight(T::WeightInfo::confirm_delegator_ledger_query_response())] + #[pallet::weight(::WeightInfo::confirm_delegator_ledger_query_response())] pub fn confirm_delegator_ledger( origin: OriginFor, query_id: QueryId, @@ -2036,7 +2031,7 @@ pub mod pallet { } #[pallet::call_index(42)] - #[pallet::weight(T::WeightInfo::confirm_validators_by_delegator_query_response())] + #[pallet::weight(::WeightInfo::confirm_validators_by_delegator_query_response())] pub fn confirm_validators_by_delegator( origin: OriginFor, query_id: QueryId, @@ -2054,7 +2049,7 @@ pub mod pallet { /// Reset the whole storage Validators. #[pallet::call_index(43)] - #[pallet::weight(T::WeightInfo::reset_validators())] + #[pallet::weight(::WeightInfo::reset_validators())] pub fn reset_validators( origin: OriginFor, currency_id: CurrencyId, @@ -2083,7 +2078,7 @@ pub mod pallet { /// Reset the whole storage Validator_boost_list. #[pallet::call_index(44)] - #[pallet::weight(T::WeightInfo::set_validator_boost_list())] + #[pallet::weight(::WeightInfo::set_validator_boost_list())] pub fn set_validator_boost_list( origin: OriginFor, currency_id: CurrencyId, @@ -2158,7 +2153,7 @@ pub mod pallet { } #[pallet::call_index(45)] - #[pallet::weight(T::WeightInfo::add_to_validator_boost_list())] + #[pallet::weight(::WeightInfo::add_to_validator_boost_list())] pub fn add_to_validator_boost_list( origin: OriginFor, currency_id: CurrencyId, @@ -2258,7 +2253,7 @@ pub mod pallet { /// Update storage Validator_boost_list. #[pallet::call_index(46)] - #[pallet::weight(T::WeightInfo::remove_from_validator_boot_list())] + #[pallet::weight(::WeightInfo::remove_from_validator_boot_list())] pub fn remove_from_validator_boot_list( origin: OriginFor, currency_id: CurrencyId, diff --git a/pallets/slp/src/mocks/mock.rs b/pallets/slp/src/mocks/mock.rs index 70e24a120..68d1a4a29 100644 --- a/pallets/slp/src/mocks/mock.rs +++ b/pallets/slp/src/mocks/mock.rs @@ -34,8 +34,6 @@ use frame_support::{ }; use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; -#[cfg(feature = "runtime-benchmarks")] -use node_primitives::currency::VKSM; use node_primitives::{ currency::{BNC, KSM}, Amount, Balance, CurrencyId, SlpxOperator, TokenSymbol, XcmOperationType, @@ -460,8 +458,6 @@ impl Config for Runtime { type BifrostSlpx = SlpxInterface; type AccountConverter = SubAccountIndexMultiLocationConvertor; type ParachainId = ParachainId; - type XcmRouter = (); - type XcmExecutor = (); type SubstrateResponseManager = (); type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; type MaxRefundPerBlock = MaxRefundPerBlock; @@ -587,20 +583,6 @@ impl ExtBuilder { ]) } - #[cfg(feature = "runtime-benchmarks")] - pub fn one_hundred_precision_for_each_currency_type_for_whitelist_account(self) -> Self { - use frame_benchmarking::whitelisted_caller; - use sp_runtime::traits::AccountIdConversion; - let whitelist_caller: AccountId = whitelisted_caller(); - let pool_account: AccountId = PalletId(*b"lighten#").into_account_truncating(); - - self.balances(vec![ - (whitelist_caller.clone(), KSM, 100_000_000_000_000), - (whitelist_caller.clone(), VKSM, 100_000_000_000_000), - (pool_account.clone(), KSM, 100_000_000_000_000), - ]) - } - pub fn build(self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); diff --git a/pallets/slp/src/mocks/mock_kusama.rs b/pallets/slp/src/mocks/mock_kusama.rs index ecc95801d..373827729 100644 --- a/pallets/slp/src/mocks/mock_kusama.rs +++ b/pallets/slp/src/mocks/mock_kusama.rs @@ -20,25 +20,24 @@ #![cfg(test)] -use bifrost_asset_registry::AssetIdMaps; -// use parachain_staking::ParachainStakingInterface; use crate as bifrost_slp; use crate::{Config, DispatchResult, QueryResponseManager}; +use bifrost_asset_registry::AssetIdMaps; use codec::{Decode, Encode}; pub use cumulus_primitives_core::ParaId; use frame_support::{ construct_runtime, ord_parameter_types, pallet_prelude::Get, parameter_types, - traits::{Everything, GenesisBuild, Nothing}, + traits::{Everything, GenesisBuild, Nothing, ProcessMessageError}, PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; use node_primitives::{ currency::{BNC, KSM, VKSM}, - Amount, Balance, CurrencyId, SlpxOperator, TokenSymbol, XcmDestWeightAndFeeHandler, - XcmOperationType, + Amount, Balance, CurrencyId, DoNothingExecuteXcm, DoNothingRouter, SlpxOperator, TokenSymbol, + XcmDestWeightAndFeeHandler, XcmOperationType, }; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key}; use sp_core::{bounded::BoundedVec, hashing::blake2_256, ConstU32, H256}; @@ -50,7 +49,7 @@ use sp_runtime::{ use sp_std::{boxed::Box, vec::Vec}; use xcm::v3::{prelude::*, Weight}; use xcm_builder::FixedWeightBounds; -use xcm_executor::XcmExecutor; +use xcm_executor::traits::ShouldExecute; pub type AccountId = AccountId32; pub type Block = frame_system::mocking::MockBlock; @@ -211,7 +210,7 @@ impl orml_xtokens::Config for Runtime { type AccountIdToMultiLocation = (); type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; - type XcmExecutor = XcmExecutor; + type XcmExecutor = DoNothingExecuteXcm; type Weigher = FixedWeightBounds; type BaseXcmWeight = BaseXcmWeight; type MaxAssetsForTransfer = MaxAssetsForTransfer; @@ -475,8 +474,6 @@ impl Config for Runtime { type BifrostSlpx = SlpxInterface; type AccountConverter = SubAccountIndexMultiLocationConvertor; type ParachainId = ParachainId; - type XcmRouter = (); - type XcmExecutor = (); type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; type MaxRefundPerBlock = MaxRefundPerBlock; @@ -513,12 +510,24 @@ parameter_types! { pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); } +pub struct Barrier; +impl ShouldExecute for Barrier { + fn should_execute( + _origin: &MultiLocation, + _message: &mut [Instruction], + _max_weight: Weight, + _weight_credit: &mut Weight, + ) -> Result<(), ProcessMessageError> { + Ok(()) + } +} + pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type AssetClaims = PolkadotXcm; type AssetTransactor = (); type AssetTrap = PolkadotXcm; - type Barrier = (); + type Barrier = Barrier; type RuntimeCall = RuntimeCall; type IsReserve = (); type IsTeleporter = (); @@ -528,7 +537,7 @@ impl xcm_executor::Config for XcmConfig { type SubscriptionService = PolkadotXcm; type Trader = (); type Weigher = FixedWeightBounds; - type XcmSender = (); + type XcmSender = DoNothingRouter; type PalletInstancesInfo = AllPalletsWithSystem; type MaxAssetsIntoHolding = ConstU32<64>; type FeeManager = (); @@ -552,9 +561,9 @@ impl pallet_xcm::Config for Runtime { type SendXcmOrigin = xcm_builder::EnsureXcmOrigin; type Weigher = FixedWeightBounds; type XcmExecuteFilter = Nothing; - type XcmExecutor = XcmExecutor; + type XcmExecutor = DoNothingExecuteXcm; type XcmReserveTransferFilter = Everything; - type XcmRouter = (); + type XcmRouter = DoNothingRouter; type XcmTeleportFilter = Nothing; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; @@ -591,20 +600,6 @@ impl ExtBuilder { self.balances(vec![(ALICE, BNC, 100), (ALICE, KSM, 100), (ALICE, VKSM, 100)]) } - #[cfg(feature = "runtime-benchmarks")] - pub fn one_hundred_precision_for_each_currency_type_for_whitelist_account(self) -> Self { - use frame_benchmarking::whitelisted_caller; - use sp_runtime::traits::AccountIdConversion; - let whitelist_caller: AccountId = whitelisted_caller(); - let pool_account: AccountId = PalletId(*b"lighten#").into_account_truncating(); - - self.balances(vec![ - (whitelist_caller.clone(), KSM, 100_000_000_000_000), - (whitelist_caller.clone(), VKSM, 100_000_000_000_000), - (pool_account.clone(), KSM, 100_000_000_000_000), - ]) - } - pub fn build(self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); diff --git a/pallets/slp/src/tests/kusama_tests.rs b/pallets/slp/src/tests/kusama_tests.rs index 32b516046..99aa2c0d5 100644 --- a/pallets/slp/src/tests/kusama_tests.rs +++ b/pallets/slp/src/tests/kusama_tests.rs @@ -540,16 +540,13 @@ fn bond_works() { register_subaccount_index_0(); // Bond 1 ksm for sub-account index 0 - assert_noop!( - Slp::bond( - RuntimeOrigin::signed(ALICE), - DOT, - Box::new(SUBACCOUNT_0_LOCATION), - 1_000_000_000_000, - None - ), - Error::::XcmFailure - ); + assert_ok!(Slp::bond( + RuntimeOrigin::signed(ALICE), + DOT, + Box::new(SUBACCOUNT_0_LOCATION), + 1_000_000_000_000, + None + )); }); } diff --git a/pallets/slp/src/weights.rs b/pallets/slp/src/weights.rs index 5d4f5d907..4c6ab8b1e 100644 --- a/pallets/slp/src/weights.rs +++ b/pallets/slp/src/weights.rs @@ -25,10 +25,9 @@ //! Autogenerated weights for bifrost_slp //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: // target/release/bifrost @@ -43,48 +42,46 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/slp/src/weights.rs -// --template=./frame-weight-template.hbs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_slp. pub trait WeightInfo { fn initialize_delegator() -> Weight; fn bond() -> Weight; fn bond_extra() -> Weight; + fn unbond() -> Weight; + fn unbond_all() -> Weight; fn rebond() -> Weight; fn delegate() -> Weight; + fn undelegate() -> Weight; fn redelegate() -> Weight; fn payout() -> Weight; fn liquidize() -> Weight; + fn chill() -> Weight; fn transfer_back() -> Weight; + fn transfer_to() -> Weight; + fn convert_asset() -> Weight; fn increase_token_pool() -> Weight; fn decrease_token_pool() -> Weight; fn update_ongoing_time_unit() -> Weight; fn refund_currency_due_unbond() -> Weight; + fn supplement_fee_reserve() -> Weight; fn charge_host_fee_and_tune_vtoken_exchange_rate() -> Weight; - fn confirm_delegator_ledger_query_response() -> Weight; - fn fail_delegator_ledger_query_response() -> Weight; - fn set_xcm_dest_weight_and_fee() -> Weight; fn set_operate_origin() -> Weight; fn set_fee_source() -> Weight; fn add_delegator() -> Weight; fn remove_delegator() -> Weight; - fn set_validators_by_delegator() -> Weight; - fn set_delegator_ledger() -> Weight; fn add_validator() -> Weight; fn remove_validator() -> Weight; - fn reset_validators() -> Weight; - fn set_validator_boost_list() -> Weight; - fn convert_asset() -> Weight; - fn add_to_validator_boost_list() -> Weight; - fn remove_from_validator_boot_list() -> Weight; + fn set_validators_by_delegator() -> Weight; + fn set_delegator_ledger() -> Weight; fn set_minimums_and_maximums() -> Weight; fn set_currency_delays() -> Weight; fn set_hosting_fees() -> Weight; @@ -92,19 +89,18 @@ pub trait WeightInfo { fn set_ongoing_time_unit_update_interval() -> Weight; fn add_supplement_fee_account_to_whitelist() -> Weight; fn remove_supplement_fee_account_from_whitelist() -> Weight; - fn unbond() -> Weight; - fn unbond_all() -> Weight; - fn undelegate() -> Weight; - fn transfer_to() -> Weight; - fn chill() -> Weight; - fn supplement_fee_reserve() -> Weight; + fn confirm_delegator_ledger_query_response() -> Weight; + fn fail_delegator_ledger_query_response() -> Weight; fn confirm_validators_by_delegator_query_response() -> Weight; fn fail_validators_by_delegator_query_response() -> Weight; + fn reset_validators() -> Weight; + fn set_validator_boost_list() -> Weight; + fn add_to_validator_boost_list() -> Weight; + fn remove_from_validator_boot_list() -> Weight; } -/// Weights for bifrost_slp using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { +// For backwards compatibility and tests +impl WeightInfo for () { /// Storage: Slp DelegatorNextIndex (r:1 w:1) /// Proof Skipped: Slp DelegatorNextIndex (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainInfo ParachainId (r:1 w:0) @@ -117,15 +113,13 @@ impl WeightInfo for BifrostWeight { /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) fn initialize_delegator() -> Weight { // Proof Size summary in bytes: - // Measured: `546` - // Estimated: `10108` - // Minimum execution time: 71_407_000 picoseconds. - Weight::from_parts(72_731_000, 10108) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `166` + // Estimated: `3631` + // Minimum execution time: 67_073_000 picoseconds. + Weight::from_parts(69_028_000, 3631) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) /// Storage: Slp DelegatorLedgers (r:1 w:1) /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) /// Storage: Slp MinimumsAndMaximums (r:1 w:0) @@ -134,8 +128,8 @@ impl WeightInfo for BifrostWeight { /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) + /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + /// Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) @@ -144,15 +138,13 @@ impl WeightInfo for BifrostWeight { /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn bond() -> Weight { // Proof Size summary in bytes: - // Measured: `1151` - // Estimated: `22577` - // Minimum execution time: 112_733_000 picoseconds. - Weight::from_parts(114_929_000, 22577) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `629` + // Estimated: `4094` + // Minimum execution time: 102_848_000 picoseconds. + Weight::from_parts(104_843_000, 4094) + .saturating_add(RocksDbWeight::get().reads(6_u64)) + .saturating_add(RocksDbWeight::get().writes(4_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) /// Storage: Slp DelegatorLedgers (r:1 w:0) /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) /// Storage: Slp MinimumsAndMaximums (r:1 w:0) @@ -161,8 +153,8 @@ impl WeightInfo for BifrostWeight { /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) + /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + /// Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) @@ -171,15 +163,69 @@ impl WeightInfo for BifrostWeight { /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn bond_extra() -> Weight { // Proof Size summary in bytes: - // Measured: `1419` - // Estimated: `24721` - // Minimum execution time: 127_679_000 picoseconds. - Weight::from_parts(129_246_000, 24721) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `896` + // Estimated: `4361` + // Minimum execution time: 105_795_000 picoseconds. + Weight::from_parts(107_641_000, 4361) + .saturating_add(RocksDbWeight::get().reads(6_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: Slp DelegatorLedgers (r:1 w:0) + /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + /// Storage: Slp MinimumsAndMaximums (r:1 w:0) + /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + /// Storage: PolkadotXcm QueryCounter (r:1 w:1) + /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + /// Proof Skipped: XcmInterface XcmWeightAndFee (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: VtokenMinting OngoingTimeUnit (r:1 w:0) + /// Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + /// Storage: Slp CurrencyDelays (r:1 w:0) + /// Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) + /// Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + /// Storage: PolkadotXcm Queries (r:0 w:1) + /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn unbond() -> Weight { + // Proof Size summary in bytes: + // Measured: `1028` + // Estimated: `4493` + // Minimum execution time: 127_785_000 picoseconds. + Weight::from_parts(130_622_000, 4493) + .saturating_add(RocksDbWeight::get().reads(8_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: Slp DelegatorLedgers (r:1 w:0) + /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + /// Storage: PolkadotXcm QueryCounter (r:1 w:1) + /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + /// Proof Skipped: XcmInterface XcmWeightAndFee (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: VtokenMinting OngoingTimeUnit (r:1 w:0) + /// Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + /// Storage: Slp CurrencyDelays (r:1 w:0) + /// Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) + /// Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + /// Storage: PolkadotXcm Queries (r:0 w:1) + /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn unbond_all() -> Weight { + // Proof Size summary in bytes: + // Measured: `1006` + // Estimated: `4471` + // Minimum execution time: 121_231_000 picoseconds. + Weight::from_parts(122_934_000, 4471) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) /// Storage: Slp DelegatorLedgers (r:1 w:0) /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) /// Storage: Slp MinimumsAndMaximums (r:1 w:0) @@ -188,8 +234,8 @@ impl WeightInfo for BifrostWeight { /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) + /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + /// Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) @@ -198,15 +244,13 @@ impl WeightInfo for BifrostWeight { /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn rebond() -> Weight { // Proof Size summary in bytes: - // Measured: `1382` - // Estimated: `24425` - // Minimum execution time: 114_332_000 picoseconds. - Weight::from_parts(115_551_000, 24425) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `941` + // Estimated: `4406` + // Minimum execution time: 106_042_000 picoseconds. + Weight::from_parts(107_450_000, 4406) + .saturating_add(RocksDbWeight::get().reads(6_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) /// Storage: Slp DelegatorLedgers (r:1 w:0) /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) /// Storage: Slp MinimumsAndMaximums (r:1 w:0) @@ -217,8 +261,8 @@ impl WeightInfo for BifrostWeight { /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) + /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + /// Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp ValidatorsByDelegatorXcmUpdateQueue (r:0 w:1) @@ -227,15 +271,38 @@ impl WeightInfo for BifrostWeight { /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn delegate() -> Weight { // Proof Size summary in bytes: - // Measured: `1445` - // Estimated: `28849` - // Minimum execution time: 122_225_000 picoseconds. - Weight::from_parts(124_896_000, 28849) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `963` + // Estimated: `4428` + // Minimum execution time: 120_863_000 picoseconds. + Weight::from_parts(123_062_000, 4428) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: Slp DelegatorLedgers (r:1 w:0) + /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + /// Storage: Slp ValidatorsByDelegator (r:1 w:0) + /// Proof Skipped: Slp ValidatorsByDelegator (max_values: None, max_size: None, mode: Measured) + /// Storage: PolkadotXcm QueryCounter (r:1 w:1) + /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + /// Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp ValidatorsByDelegatorXcmUpdateQueue (r:0 w:1) + /// Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + /// Storage: PolkadotXcm Queries (r:0 w:1) + /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn undelegate() -> Weight { + // Proof Size summary in bytes: + // Measured: `1031` + // Estimated: `4496` + // Minimum execution time: 109_811_000 picoseconds. + Weight::from_parts(113_351_000, 4496) + .saturating_add(RocksDbWeight::get().reads(6_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) /// Storage: Slp DelegatorLedgers (r:1 w:0) /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) /// Storage: Slp MinimumsAndMaximums (r:1 w:0) @@ -246,8 +313,8 @@ impl WeightInfo for BifrostWeight { /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) + /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + /// Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp ValidatorsByDelegatorXcmUpdateQueue (r:0 w:1) @@ -256,37 +323,33 @@ impl WeightInfo for BifrostWeight { /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn redelegate() -> Weight { // Proof Size summary in bytes: - // Measured: `1445` - // Estimated: `28849` - // Minimum execution time: 133_488_000 picoseconds. - Weight::from_parts(134_799_000, 28849) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `963` + // Estimated: `4428` + // Minimum execution time: 121_023_000 picoseconds. + Weight::from_parts(123_877_000, 4428) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) + /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + /// Proof Skipped: XcmInterface XcmWeightAndFee (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 payout() -> Weight { // Proof Size summary in bytes: - // Measured: `958` - // Estimated: `10798` - // Minimum execution time: 71_215_000 picoseconds. - Weight::from_parts(72_756_000, 10798) - .saturating_add(T::DbWeight::get().reads(4_u64)) + // Measured: `367` + // Estimated: `3832` + // Minimum execution time: 60_062_000 picoseconds. + Weight::from_parts(61_483_000, 3832) + .saturating_add(RocksDbWeight::get().reads(3_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) /// Storage: PolkadotXcm QueryCounter (r:1 w:1) /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) + /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + /// Proof Skipped: XcmInterface XcmWeightAndFee (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: VtokenMinting OngoingTimeUnit (r:1 w:0) @@ -297,50 +360,108 @@ impl WeightInfo for BifrostWeight { /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn liquidize() -> Weight { // Proof Size summary in bytes: - // Measured: `1262` - // Estimated: `18493` - // Minimum execution time: 106_021_000 picoseconds. - Weight::from_parts(108_559_000, 18493) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `612` + // Estimated: `4077` + // Minimum execution time: 96_862_000 picoseconds. + Weight::from_parts(98_220_000, 4077) + .saturating_add(RocksDbWeight::get().reads(5_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + /// Storage: PolkadotXcm QueryCounter (r:1 w:1) + /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + /// Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp DelegatorLedgers (r:1 w:0) + /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + /// Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) + /// Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + /// Storage: Slp CurrencyDelays (r:1 w:0) + /// Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) + /// Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + /// Storage: PolkadotXcm Queries (r:0 w:1) + /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn chill() -> Weight { + // Proof Size summary in bytes: + // Measured: `1006` + // Estimated: `4471` + // Minimum execution time: 127_079_000 picoseconds. + Weight::from_parts(129_021_000, 4471) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) /// Proof Skipped: Slp DelegatorsMultilocation2Index (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: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) + /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + /// Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) fn transfer_back() -> Weight { // Proof Size summary in bytes: - // Measured: `958` - // Estimated: `10798` - // Minimum execution time: 77_416_000 picoseconds. - Weight::from_parts(78_900_000, 10798) - .saturating_add(T::DbWeight::get().reads(4_u64)) + // Measured: `401` + // Estimated: `3866` + // Minimum execution time: 74_681_000 picoseconds. + Weight::from_parts(76_287_000, 3866) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + } + /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + /// Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + fn transfer_to() -> Weight { + // Proof Size summary in bytes: + // Measured: `298` + // Estimated: `3763` + // Minimum execution time: 55_085_000 picoseconds. + Weight::from_parts(56_405_000, 3763) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + } + /// Storage: Slp DelegatorLedgers (r:1 w:0) + /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + /// Storage: PolkadotXcm QueryCounter (r:1 w:1) + /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + /// Proof Skipped: XcmInterface XcmWeightAndFee (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: PolkadotXcm Queries (r:0 w:1) + /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn convert_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `697` + // Estimated: `4162` + // Minimum execution time: 85_355_000 picoseconds. + Weight::from_parts(86_658_000, 4162) + .saturating_add(RocksDbWeight::get().reads(5_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: VtokenMinting TokenPool (r:1 w:1) /// Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) fn increase_token_pool() -> Weight { // Proof Size summary in bytes: // Measured: `180` - // Estimated: `2513` - // Minimum execution time: 28_478_000 picoseconds. - Weight::from_parts(29_303_000, 2513) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Estimated: `3503` + // Minimum execution time: 26_862_000 picoseconds. + Weight::from_parts(31_255_000, 3503) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: VtokenMinting TokenPool (r:1 w:1) /// Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) fn decrease_token_pool() -> Weight { // Proof Size summary in bytes: // Measured: `230` - // Estimated: `2513` - // Minimum execution time: 30_415_000 picoseconds. - Weight::from_parts(31_358_000, 2513) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Estimated: `3503` + // Minimum execution time: 32_177_000 picoseconds. + Weight::from_parts(33_486_000, 3503) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Slp OngoingTimeUnitUpdateInterval (r:1 w:0) /// Proof Skipped: Slp OngoingTimeUnitUpdateInterval (max_values: None, max_size: None, mode: Measured) @@ -351,24 +472,45 @@ impl WeightInfo for BifrostWeight { fn update_ongoing_time_unit() -> Weight { // Proof Size summary in bytes: // Measured: `277` - // Estimated: `8006` - // Minimum execution time: 49_875_000 picoseconds. - Weight::from_parts(50_771_000, 8006) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Estimated: `3742` + // Minimum execution time: 54_171_000 picoseconds. + Weight::from_parts(55_307_000, 3742) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: Tokens Accounts (r:1 w:0) + /// Storage: Tokens Accounts (r:2 w:2) /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + /// Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) + /// Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + /// Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:0) + /// Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, 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:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn refund_currency_due_unbond() -> Weight { // Proof Size summary in bytes: - // Measured: `686` - // Estimated: `2593` - // Minimum execution time: 22_695_000 picoseconds. - Weight::from_parts(23_726_000, 2593) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Measured: `1897` + // Estimated: `6196` + // Minimum execution time: 153_157_000 picoseconds. + Weight::from_parts(155_361_000, 6196) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(4_u64)) + } + /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + /// Storage: Slp FeeSources (r:1 w:0) + /// Proof Skipped: Slp FeeSources (max_values: None, max_size: None, mode: Measured) + /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + /// Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + fn supplement_fee_reserve() -> Weight { + // Proof Size summary in bytes: + // Measured: `391` + // Estimated: `3856` + // Minimum execution time: 61_058_000 picoseconds. + Weight::from_parts(62_459_000, 3856) + .saturating_add(RocksDbWeight::get().reads(3_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) /// Storage: Slp CurrencyTuneExchangeRateLimit (r:1 w:0) /// Proof Skipped: Slp CurrencyTuneExchangeRateLimit (max_values: None, max_size: None, mode: Measured) /// Storage: VtokenMinting TokenPool (r:1 w:1) @@ -395,77 +537,34 @@ impl WeightInfo for BifrostWeight { /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) fn charge_host_fee_and_tune_vtoken_exchange_rate() -> Weight { // Proof Size summary in bytes: - // Measured: `2441` - // Estimated: `52052` - // Minimum execution time: 202_228_000 picoseconds. - Weight::from_parts(206_963_000, 52052) - .saturating_add(T::DbWeight::get().reads(13_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgerXcmUpdateQueue (r:1 w:1) - /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:1) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:1 w:0) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn confirm_delegator_ledger_query_response() -> Weight { - // Proof Size summary in bytes: - // Measured: `888` - // Estimated: `13452` - // Minimum execution time: 77_231_000 picoseconds. - Weight::from_parts(78_490_000, 13452) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgerXcmUpdateQueue (r:1 w:1) - /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:1 w:0) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn fail_delegator_ledger_query_response() -> Weight { - // Proof Size summary in bytes: - // Measured: `756` - // Estimated: `9693` - // Minimum execution time: 58_354_000 picoseconds. - Weight::from_parts(59_001_000, 9693) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Slp XcmDestWeightAndFee (r:1 w:1) - /// Proof Skipped: Slp XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) - fn set_xcm_dest_weight_and_fee() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 28_258_000 picoseconds. - Weight::from_parts(29_193_000, 2479) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `2097` + // Estimated: `5562` + // Minimum execution time: 215_037_000 picoseconds. + Weight::from_parts(223_330_000, 5562) + .saturating_add(RocksDbWeight::get().reads(12_u64)) + .saturating_add(RocksDbWeight::get().writes(7_u64)) } /// Storage: Slp OperateOrigins (r:1 w:1) /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) fn set_operate_origin() -> Weight { // Proof Size summary in bytes: // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 30_774_000 picoseconds. - Weight::from_parts(31_627_000, 2479) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Estimated: `3469` + // Minimum execution time: 26_493_000 picoseconds. + Weight::from_parts(29_536_000, 3469) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Slp FeeSources (r:1 w:1) /// Proof Skipped: Slp FeeSources (max_values: None, max_size: None, mode: Measured) fn set_fee_source() -> Weight { // Proof Size summary in bytes: // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 31_787_000 picoseconds. - Weight::from_parts(33_056_000, 2479) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Estimated: `3469` + // Minimum execution time: 31_573_000 picoseconds. + Weight::from_parts(32_217_000, 3469) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Slp DelegatorsIndex2Multilocation (r:1 w:1) /// Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) @@ -477,12 +576,12 @@ impl WeightInfo for BifrostWeight { /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) fn add_delegator() -> Weight { // Proof Size summary in bytes: - // Measured: `443` - // Estimated: `9197` - // Minimum execution time: 61_071_000 picoseconds. - Weight::from_parts(62_024_000, 9197) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `63` + // Estimated: `3528` + // Minimum execution time: 50_598_000 picoseconds. + Weight::from_parts(51_353_000, 3528) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: Slp DelegatorLedgers (r:1 w:1) /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) @@ -492,12 +591,36 @@ impl WeightInfo for BifrostWeight { /// Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) fn remove_delegator() -> Weight { // Proof Size summary in bytes: - // Measured: `554` - // Estimated: `6612` - // Minimum execution time: 57_870_000 picoseconds. - Weight::from_parts(58_959_000, 6612) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `340` + // Estimated: `3805` + // Minimum execution time: 62_281_000 picoseconds. + Weight::from_parts(63_505_000, 3805) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: Slp Validators (r:1 w:1) + /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + /// Storage: Slp MinimumsAndMaximums (r:1 w:0) + /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + fn add_validator() -> Weight { + // Proof Size summary in bytes: + // Measured: `63` + // Estimated: `3528` + // Minimum execution time: 39_766_000 picoseconds. + Weight::from_parts(40_794_000, 3528) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: Slp Validators (r:1 w:1) + /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + fn remove_validator() -> Weight { + // Proof Size summary in bytes: + // Measured: `120` + // Estimated: `3585` + // Minimum execution time: 39_932_000 picoseconds. + Weight::from_parts(41_381_000, 3585) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Slp MinimumsAndMaximums (r:1 w:0) /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) @@ -509,150 +632,67 @@ impl WeightInfo for BifrostWeight { /// Proof Skipped: Slp ValidatorsByDelegator (max_values: None, max_size: None, mode: Measured) fn set_validators_by_delegator() -> Weight { // Proof Size summary in bytes: - // Measured: `508` - // Estimated: `9457` - // Minimum execution time: 55_710_000 picoseconds. - Weight::from_parts(56_691_000, 9457) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `331` + // Estimated: `3796` + // Minimum execution time: 59_974_000 picoseconds. + Weight::from_parts(60_886_000, 3796) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Slp DelegatorLedgers (r:1 w:1) /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) fn set_delegator_ledger() -> Weight { // Proof Size summary in bytes: - // Measured: `252` - // Estimated: `2727` - // Minimum execution time: 34_225_000 picoseconds. - Weight::from_parts(35_043_000, 2727) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `242` + // Estimated: `3707` + // Minimum execution time: 45_327_000 picoseconds. + Weight::from_parts(46_064_000, 3707) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: Slp Validators (r:1 w:1) - /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp MinimumsAndMaximums (r:1 w:0) + /// Storage: Slp MinimumsAndMaximums (r:1 w:1) /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - fn add_validator() -> Weight { - // Proof Size summary in bytes: - // Measured: `315` - // Estimated: `5580` - // Minimum execution time: 44_031_000 picoseconds. - Weight::from_parts(45_308_000, 5580) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Slp Validators (r:1 w:1) - /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) - fn remove_validator() -> Weight { + fn set_minimums_and_maximums() -> Weight { // Proof Size summary in bytes: - // Measured: `357` - // Estimated: `2832` - // Minimum execution time: 39_581_000 picoseconds. - Weight::from_parts(40_289_000, 2832) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 30_765_000 picoseconds. + Weight::from_parts(32_019_000, 3469) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: Slp MinimumsAndMaximums (r:1 w:0) - /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp Validators (r:0 w:1) - /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) - fn reset_validators() -> Weight { + /// Storage: Slp CurrencyDelays (r:1 w:1) + /// Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) + fn set_currency_delays() -> Weight { // Proof Size summary in bytes: - // Measured: `280` - // Estimated: `3035` - // Minimum execution time: 39_546_000 picoseconds. - Weight::from_parts(40_188_000, 3035) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Slp MinimumsAndMaximums (r:1 w:0) - /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp Validators (r:1 w:1) - /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp ValidatorBoostList (r:0 w:1) - /// Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) - fn set_validator_boost_list() -> Weight { - // Proof Size summary in bytes: - // Measured: `315` - // Estimated: `5895` - // Minimum execution time: 61_812_000 picoseconds. - Weight::from_parts(62_579_000, 5895) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - fn convert_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 21_631_000 picoseconds. - Weight::from_parts(22_204_000, 0) - } - /// Storage: Slp ValidatorBoostList (r:1 w:1) - /// Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp Validators (r:1 w:1) - /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) - fn add_to_validator_boost_list() -> Weight { - // Proof Size summary in bytes: - // Measured: `287` - // Estimated: `5524` - // Minimum execution time: 53_686_000 picoseconds. - Weight::from_parts(54_283_000, 5524) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: Slp ValidatorBoostList (r:1 w:1) - /// Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) - fn remove_from_validator_boot_list() -> Weight { - // Proof Size summary in bytes: - // Measured: `370` - // Estimated: `2845` - // Minimum execution time: 34_690_000 picoseconds. - Weight::from_parts(35_842_000, 2845) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Slp MinimumsAndMaximums (r:1 w:1) - /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - fn set_minimums_and_maximums() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 27_958_000 picoseconds. - Weight::from_parts(29_059_000, 2479) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Slp CurrencyDelays (r:1 w:1) - /// Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) - fn set_currency_delays() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 26_351_000 picoseconds. - Weight::from_parts(27_273_000, 2479) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 29_336_000 picoseconds. + Weight::from_parts(30_256_000, 3469) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Slp HostingFees (r:1 w:1) /// Proof Skipped: Slp HostingFees (max_values: None, max_size: None, mode: Measured) fn set_hosting_fees() -> Weight { // Proof Size summary in bytes: // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 27_829_000 picoseconds. - Weight::from_parts(28_836_000, 2479) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Estimated: `3469` + // Minimum execution time: 30_698_000 picoseconds. + Weight::from_parts(31_544_000, 3469) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Slp CurrencyTuneExchangeRateLimit (r:1 w:1) /// Proof Skipped: Slp CurrencyTuneExchangeRateLimit (max_values: None, max_size: None, mode: Measured) fn set_currency_tune_exchange_rate_limit() -> Weight { // Proof Size summary in bytes: // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 25_580_000 picoseconds. - Weight::from_parts(26_773_000, 2479) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Estimated: `3469` + // Minimum execution time: 25_918_000 picoseconds. + Weight::from_parts(29_042_000, 3469) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Slp OngoingTimeUnitUpdateInterval (r:1 w:1) /// Proof Skipped: Slp OngoingTimeUnitUpdateInterval (max_values: None, max_size: None, mode: Measured) @@ -661,1056 +701,138 @@ impl WeightInfo for BifrostWeight { fn set_ongoing_time_unit_update_interval() -> Weight { // Proof Size summary in bytes: // Measured: `4` - // Estimated: `2483` - // Minimum execution time: 32_195_000 picoseconds. - Weight::from_parts(33_368_000, 2483) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Estimated: `3469` + // Minimum execution time: 29_907_000 picoseconds. + Weight::from_parts(35_433_000, 3469) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: Slp SupplementFeeAccountWhitelist (r:1 w:1) /// Proof Skipped: Slp SupplementFeeAccountWhitelist (max_values: None, max_size: None, mode: Measured) fn add_supplement_fee_account_to_whitelist() -> Weight { // Proof Size summary in bytes: // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 32_100_000 picoseconds. - Weight::from_parts(32_714_000, 2479) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Estimated: `3469` + // Minimum execution time: 35_893_000 picoseconds. + Weight::from_parts(37_810_000, 3469) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Slp SupplementFeeAccountWhitelist (r:1 w:1) /// Proof Skipped: Slp SupplementFeeAccountWhitelist (max_values: None, max_size: None, mode: Measured) fn remove_supplement_fee_account_from_whitelist() -> Weight { // Proof Size summary in bytes: - // Measured: `151` - // Estimated: `2626` - // Minimum execution time: 36_740_000 picoseconds. - Weight::from_parts(37_650_000, 2626) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:0) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp MinimumsAndMaximums (r:1 w:0) - /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (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: VtokenMinting OngoingTimeUnit (r:1 w:0) - /// Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) - /// Storage: Slp CurrencyDelays (r:1 w:0) - /// Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) - /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn unbond() -> Weight { - // Proof Size summary in bytes: - // Measured: `1506` - // Estimated: `31900` - // Minimum execution time: 129_878_000 picoseconds. - Weight::from_parts(131_519_000, 31900) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `119` + // Estimated: `3584` + // Minimum execution time: 40_548_000 picoseconds. + Weight::from_parts(41_870_000, 3584) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:0) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (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: VtokenMinting OngoingTimeUnit (r:1 w:0) - /// Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) - /// Storage: Slp CurrencyDelays (r:1 w:0) - /// Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + /// Storage: Slp DelegatorLedgerXcmUpdateQueue (r:1 w:1) /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn unbond_all() -> Weight { - // Proof Size summary in bytes: - // Measured: `1478` - // Estimated: `27695` - // Minimum execution time: 122_759_000 picoseconds. - Weight::from_parts(124_788_000, 27695) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:0) + /// Storage: Slp DelegatorLedgers (r:1 w:1) /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp ValidatorsByDelegator (r:1 w:0) - /// Proof Skipped: Slp ValidatorsByDelegator (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (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: Slp ValidatorsByDelegatorXcmUpdateQueue (r:0 w:1) - /// Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:0 w:1) + /// Storage: PolkadotXcm Queries (r:1 w:0) /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn undelegate() -> Weight { - // Proof Size summary in bytes: - // Measured: `1450` - // Estimated: `24969` - // Minimum execution time: 130_474_000 picoseconds. - Weight::from_parts(131_915_000, 24969) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) - /// Storage: UnknownTokens ConcreteFungibleBalances (r:1 w:0) - /// Proof Skipped: UnknownTokens ConcreteFungibleBalances (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, 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: PolkadotXcm SupportedVersion (r:1 w:0) - /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) - /// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) - /// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainSystem HostConfiguration (r:1 w:0) - /// Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) - /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - fn transfer_to() -> Weight { + fn confirm_delegator_ledger_query_response() -> Weight { // Proof Size summary in bytes: - // Measured: `2815` - // Estimated: `50585` - // Minimum execution time: 221_136_000 picoseconds. - Weight::from_parts(223_116_000, 50585) - .saturating_add(T::DbWeight::get().reads(13_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `597` + // Estimated: `4062` + // Minimum execution time: 73_688_000 picoseconds. + Weight::from_parts(74_643_000, 4062) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (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: Slp DelegatorLedgers (r:1 w:0) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) - /// Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) - /// Storage: Slp CurrencyDelays (r:1 w:0) - /// Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + /// Storage: Slp DelegatorLedgerXcmUpdateQueue (r:1 w:1) /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:0 w:1) + /// Storage: PolkadotXcm Queries (r:1 w:0) /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn chill() -> Weight { - // Proof Size summary in bytes: - // Measured: `1353` - // Estimated: `26695` - // Minimum execution time: 125_208_000 picoseconds. - Weight::from_parts(126_186_000, 26695) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp FeeSources (r:1 w:0) - /// Proof Skipped: Slp FeeSources (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) - /// Storage: UnknownTokens ConcreteFungibleBalances (r:1 w:0) - /// Proof Skipped: UnknownTokens ConcreteFungibleBalances (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, 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: PolkadotXcm SupportedVersion (r:1 w:0) - /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) - /// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) - /// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainSystem HostConfiguration (r:1 w:0) - /// Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) - /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - fn supplement_fee_reserve() -> Weight { + fn fail_delegator_ledger_query_response() -> Weight { // Proof Size summary in bytes: - // Measured: `2977` - // Estimated: `57657` - // Minimum execution time: 247_508_000 picoseconds. - Weight::from_parts(358_989_000, 57657) - .saturating_add(T::DbWeight::get().reads(14_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `496` + // Estimated: `3961` + // Minimum execution time: 52_188_000 picoseconds. + Weight::from_parts(53_270_000, 3961) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) /// Storage: Slp ValidatorsByDelegatorXcmUpdateQueue (r:1 w:1) /// Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) /// Storage: Slp ValidatorsByDelegator (r:0 w:1) /// Proof Skipped: Slp ValidatorsByDelegator (max_values: None, max_size: None, mode: Measured) fn confirm_validators_by_delegator_query_response() -> Weight { // Proof Size summary in bytes: - // Measured: `484` - // Estimated: `6402` - // Minimum execution time: 57_318_000 picoseconds. - Weight::from_parts(58_268_000, 6402) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `229` + // Estimated: `3694` + // Minimum execution time: 47_345_000 picoseconds. + Weight::from_parts(48_170_000, 3694) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) /// Storage: Slp ValidatorsByDelegatorXcmUpdateQueue (r:1 w:1) /// Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) /// Storage: PolkadotXcm Queries (r:1 w:0) /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn fail_validators_by_delegator_query_response() -> Weight { // Proof Size summary in bytes: - // Measured: `779` - // Estimated: `9762` - // Minimum execution time: 57_378_000 picoseconds. - Weight::from_parts(58_045_000, 9762) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `561` + // Estimated: `4026` + // Minimum execution time: 53_401_000 picoseconds. + Weight::from_parts(54_368_000, 4026) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } -} - -// For backwards compatibility and tests -impl WeightInfo for () { - /// Storage: Slp DelegatorNextIndex (r:1 w:1) - /// Proof Skipped: Slp DelegatorNextIndex (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: Slp DelegatorsIndex2Multilocation (r:1 w:1) - /// Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) /// Storage: Slp MinimumsAndMaximums (r:1 w:0) /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:0 w:1) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - fn initialize_delegator() -> Weight { + /// Storage: Slp Validators (r:0 w:1) + /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + fn reset_validators() -> Weight { // Proof Size summary in bytes: - // Measured: `546` - // Estimated: `10108` - // Minimum execution time: 71_407_000 picoseconds. - Weight::from_parts(72_731_000, 10108) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) + // Measured: `63` + // Estimated: `3528` + // Minimum execution time: 32_829_000 picoseconds. + Weight::from_parts(38_597_000, 3528) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:1) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) /// Storage: Slp MinimumsAndMaximums (r:1 w:0) /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (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: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) - /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn bond() -> Weight { + /// Storage: Slp Validators (r:1 w:1) + /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + /// Storage: Slp ValidatorBoostList (r:0 w:1) + /// Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) + fn set_validator_boost_list() -> Weight { // Proof Size summary in bytes: - // Measured: `1151` - // Estimated: `22577` - // Minimum execution time: 112_733_000 picoseconds. - Weight::from_parts(114_929_000, 22577) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) + // Measured: `63` + // Estimated: `3528` + // Minimum execution time: 58_093_000 picoseconds. + Weight::from_parts(59_811_000, 3528) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:0) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp MinimumsAndMaximums (r:1 w:0) - /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (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: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) - /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn bond_extra() -> Weight { + /// Storage: Slp ValidatorBoostList (r:1 w:1) + /// Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) + /// Storage: Slp Validators (r:1 w:1) + /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + fn add_to_validator_boost_list() -> Weight { // Proof Size summary in bytes: - // Measured: `1419` - // Estimated: `24721` - // Minimum execution time: 127_679_000 picoseconds. - Weight::from_parts(129_246_000, 24721) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) + // Measured: `42` + // Estimated: `3507` + // Minimum execution time: 53_232_000 picoseconds. + Weight::from_parts(54_290_000, 3507) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:0) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp MinimumsAndMaximums (r:1 w:0) - /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (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: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) - /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn rebond() -> Weight { + /// Storage: Slp ValidatorBoostList (r:1 w:1) + /// Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) + fn remove_from_validator_boot_list() -> Weight { // Proof Size summary in bytes: - // Measured: `1382` - // Estimated: `24425` - // Minimum execution time: 114_332_000 picoseconds. - Weight::from_parts(115_551_000, 24425) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:0) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp MinimumsAndMaximums (r:1 w:0) - /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp Validators (r:1 w:0) - /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (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: Slp ValidatorsByDelegatorXcmUpdateQueue (r:0 w:1) - /// Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn delegate() -> Weight { - // Proof Size summary in bytes: - // Measured: `1445` - // Estimated: `28849` - // Minimum execution time: 122_225_000 picoseconds. - Weight::from_parts(124_896_000, 28849) - .saturating_add(RocksDbWeight::get().reads(8_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:0) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp MinimumsAndMaximums (r:1 w:0) - /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp Validators (r:1 w:0) - /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (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: Slp ValidatorsByDelegatorXcmUpdateQueue (r:0 w:1) - /// Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn redelegate() -> Weight { - // Proof Size summary in bytes: - // Measured: `1445` - // Estimated: `28849` - // Minimum execution time: 133_488_000 picoseconds. - Weight::from_parts(134_799_000, 28849) - .saturating_add(RocksDbWeight::get().reads(8_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (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 payout() -> Weight { - // Proof Size summary in bytes: - // Measured: `958` - // Estimated: `10798` - // Minimum execution time: 71_215_000 picoseconds. - Weight::from_parts(72_756_000, 10798) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (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: VtokenMinting OngoingTimeUnit (r:1 w:0) - /// Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) - /// Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) - /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn liquidize() -> Weight { - // Proof Size summary in bytes: - // Measured: `1262` - // Estimated: `18493` - // Minimum execution time: 106_021_000 picoseconds. - Weight::from_parts(108_559_000, 18493) - .saturating_add(RocksDbWeight::get().reads(6_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (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: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) - fn transfer_back() -> Weight { - // Proof Size summary in bytes: - // Measured: `958` - // Estimated: `10798` - // Minimum execution time: 77_416_000 picoseconds. - Weight::from_parts(78_900_000, 10798) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - } - /// Storage: VtokenMinting TokenPool (r:1 w:1) - /// Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - fn increase_token_pool() -> Weight { - // Proof Size summary in bytes: - // Measured: `180` - // Estimated: `2513` - // Minimum execution time: 28_478_000 picoseconds. - Weight::from_parts(29_303_000, 2513) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: VtokenMinting TokenPool (r:1 w:1) - /// Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - fn decrease_token_pool() -> Weight { - // Proof Size summary in bytes: - // Measured: `230` - // Estimated: `2513` - // Minimum execution time: 30_415_000 picoseconds. - Weight::from_parts(31_358_000, 2513) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Slp OngoingTimeUnitUpdateInterval (r:1 w:0) - /// Proof Skipped: Slp OngoingTimeUnitUpdateInterval (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp LastTimeUpdatedOngoingTimeUnit (r:1 w:1) - /// Proof Skipped: Slp LastTimeUpdatedOngoingTimeUnit (max_values: None, max_size: None, mode: Measured) - /// Storage: VtokenMinting OngoingTimeUnit (r:1 w:1) - /// Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) - fn update_ongoing_time_unit() -> Weight { - // Proof Size summary in bytes: - // Measured: `277` - // Estimated: `8006` - // Minimum execution time: 49_875_000 picoseconds. - Weight::from_parts(50_771_000, 8006) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// Storage: Tokens Accounts (r:1 w:0) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - fn refund_currency_due_unbond() -> Weight { - // Proof Size summary in bytes: - // Measured: `686` - // Estimated: `2593` - // Minimum execution time: 22_695_000 picoseconds. - Weight::from_parts(23_726_000, 2593) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp CurrencyTuneExchangeRateLimit (r:1 w:0) - /// Proof Skipped: Slp CurrencyTuneExchangeRateLimit (max_values: None, max_size: None, mode: Measured) - /// Storage: VtokenMinting TokenPool (r:1 w:1) - /// Proof: VtokenMinting TokenPool (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: Slp CurrencyLatestTuneRecord (r:1 w:1) - /// Proof Skipped: Slp CurrencyLatestTuneRecord (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp HostingFees (r:1 w:0) - /// Proof Skipped: Slp HostingFees (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLatestTuneRecord (r:1 w:1) - /// Proof Skipped: Slp DelegatorLatestTuneRecord (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:1) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - fn charge_host_fee_and_tune_vtoken_exchange_rate() -> Weight { - // Proof Size summary in bytes: - // Measured: `2441` - // Estimated: `52052` - // Minimum execution time: 202_228_000 picoseconds. - Weight::from_parts(206_963_000, 52052) - .saturating_add(RocksDbWeight::get().reads(13_u64)) - .saturating_add(RocksDbWeight::get().writes(7_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgerXcmUpdateQueue (r:1 w:1) - /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:1) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:1 w:0) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn confirm_delegator_ledger_query_response() -> Weight { - // Proof Size summary in bytes: - // Measured: `888` - // Estimated: `13452` - // Minimum execution time: 77_231_000 picoseconds. - Weight::from_parts(78_490_000, 13452) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgerXcmUpdateQueue (r:1 w:1) - /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:1 w:0) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn fail_delegator_ledger_query_response() -> Weight { - // Proof Size summary in bytes: - // Measured: `756` - // Estimated: `9693` - // Minimum execution time: 58_354_000 picoseconds. - Weight::from_parts(59_001_000, 9693) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Slp XcmDestWeightAndFee (r:1 w:1) - /// Proof Skipped: Slp XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) - fn set_xcm_dest_weight_and_fee() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 28_258_000 picoseconds. - Weight::from_parts(29_193_000, 2479) + // Measured: `161` + // Estimated: `3626` + // Minimum execution time: 30_639_000 picoseconds. + Weight::from_parts(37_323_000, 3626) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: Slp OperateOrigins (r:1 w:1) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - fn set_operate_origin() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 30_774_000 picoseconds. - Weight::from_parts(31_627_000, 2479) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Slp FeeSources (r:1 w:1) - /// Proof Skipped: Slp FeeSources (max_values: None, max_size: None, mode: Measured) - fn set_fee_source() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 31_787_000 picoseconds. - Weight::from_parts(33_056_000, 2479) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Slp DelegatorsIndex2Multilocation (r:1 w:1) - /// Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorNextIndex (r:1 w:0) - /// Proof Skipped: Slp DelegatorNextIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp MinimumsAndMaximums (r:1 w:0) - /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:0 w:1) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - fn add_delegator() -> Weight { - // Proof Size summary in bytes: - // Measured: `443` - // Estimated: `9197` - // Minimum execution time: 61_071_000 picoseconds. - Weight::from_parts(62_024_000, 9197) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// Storage: Slp DelegatorLedgers (r:1 w:1) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:1) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorsIndex2Multilocation (r:0 w:1) - /// Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) - fn remove_delegator() -> Weight { - // Proof Size summary in bytes: - // Measured: `554` - // Estimated: `6612` - // Minimum execution time: 57_870_000 picoseconds. - Weight::from_parts(58_959_000, 6612) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: Slp MinimumsAndMaximums (r:1 w:0) - /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:0) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp Validators (r:1 w:0) - /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp ValidatorsByDelegator (r:0 w:1) - /// Proof Skipped: Slp ValidatorsByDelegator (max_values: None, max_size: None, mode: Measured) - fn set_validators_by_delegator() -> Weight { - // Proof Size summary in bytes: - // Measured: `508` - // Estimated: `9457` - // Minimum execution time: 55_710_000 picoseconds. - Weight::from_parts(56_691_000, 9457) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Slp DelegatorLedgers (r:1 w:1) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - fn set_delegator_ledger() -> Weight { - // Proof Size summary in bytes: - // Measured: `252` - // Estimated: `2727` - // Minimum execution time: 34_225_000 picoseconds. - Weight::from_parts(35_043_000, 2727) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Slp Validators (r:1 w:1) - /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp MinimumsAndMaximums (r:1 w:0) - /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - fn add_validator() -> Weight { - // Proof Size summary in bytes: - // Measured: `315` - // Estimated: `5580` - // Minimum execution time: 44_031_000 picoseconds. - Weight::from_parts(45_308_000, 5580) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Slp Validators (r:1 w:1) - /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) - fn remove_validator() -> Weight { - // Proof Size summary in bytes: - // Measured: `357` - // Estimated: `2832` - // Minimum execution time: 39_581_000 picoseconds. - Weight::from_parts(40_289_000, 2832) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Slp MinimumsAndMaximums (r:1 w:0) - /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp Validators (r:0 w:1) - /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) - fn reset_validators() -> Weight { - // Proof Size summary in bytes: - // Measured: `280` - // Estimated: `3035` - // Minimum execution time: 39_546_000 picoseconds. - Weight::from_parts(40_188_000, 3035) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Slp MinimumsAndMaximums (r:1 w:0) - /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp Validators (r:1 w:1) - /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp ValidatorBoostList (r:0 w:1) - /// Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) - fn set_validator_boost_list() -> Weight { - // Proof Size summary in bytes: - // Measured: `315` - // Estimated: `5895` - // Minimum execution time: 61_812_000 picoseconds. - Weight::from_parts(62_579_000, 5895) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - fn convert_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 21_631_000 picoseconds. - Weight::from_parts(22_204_000, 0) - } - /// Storage: Slp ValidatorBoostList (r:1 w:1) - /// Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp Validators (r:1 w:1) - /// Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) - fn add_to_validator_boost_list() -> Weight { - // Proof Size summary in bytes: - // Measured: `287` - // Estimated: `5524` - // Minimum execution time: 53_686_000 picoseconds. - Weight::from_parts(54_283_000, 5524) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// Storage: Slp ValidatorBoostList (r:1 w:1) - /// Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) - fn remove_from_validator_boot_list() -> Weight { - // Proof Size summary in bytes: - // Measured: `370` - // Estimated: `2845` - // Minimum execution time: 34_690_000 picoseconds. - Weight::from_parts(35_842_000, 2845) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Slp MinimumsAndMaximums (r:1 w:1) - /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - fn set_minimums_and_maximums() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 27_958_000 picoseconds. - Weight::from_parts(29_059_000, 2479) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Slp CurrencyDelays (r:1 w:1) - /// Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) - fn set_currency_delays() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 26_351_000 picoseconds. - Weight::from_parts(27_273_000, 2479) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Slp HostingFees (r:1 w:1) - /// Proof Skipped: Slp HostingFees (max_values: None, max_size: None, mode: Measured) - fn set_hosting_fees() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 27_829_000 picoseconds. - Weight::from_parts(28_836_000, 2479) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Slp CurrencyTuneExchangeRateLimit (r:1 w:1) - /// Proof Skipped: Slp CurrencyTuneExchangeRateLimit (max_values: None, max_size: None, mode: Measured) - fn set_currency_tune_exchange_rate_limit() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 25_580_000 picoseconds. - Weight::from_parts(26_773_000, 2479) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Slp OngoingTimeUnitUpdateInterval (r:1 w:1) - /// Proof Skipped: Slp OngoingTimeUnitUpdateInterval (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp LastTimeUpdatedOngoingTimeUnit (r:0 w:1) - /// Proof Skipped: Slp LastTimeUpdatedOngoingTimeUnit (max_values: None, max_size: None, mode: Measured) - fn set_ongoing_time_unit_update_interval() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `2483` - // Minimum execution time: 32_195_000 picoseconds. - Weight::from_parts(33_368_000, 2483) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// Storage: Slp SupplementFeeAccountWhitelist (r:1 w:1) - /// Proof Skipped: Slp SupplementFeeAccountWhitelist (max_values: None, max_size: None, mode: Measured) - fn add_supplement_fee_account_to_whitelist() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `2479` - // Minimum execution time: 32_100_000 picoseconds. - Weight::from_parts(32_714_000, 2479) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Slp SupplementFeeAccountWhitelist (r:1 w:1) - /// Proof Skipped: Slp SupplementFeeAccountWhitelist (max_values: None, max_size: None, mode: Measured) - fn remove_supplement_fee_account_from_whitelist() -> Weight { - // Proof Size summary in bytes: - // Measured: `151` - // Estimated: `2626` - // Minimum execution time: 36_740_000 picoseconds. - Weight::from_parts(37_650_000, 2626) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:0) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp MinimumsAndMaximums (r:1 w:0) - /// Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (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: VtokenMinting OngoingTimeUnit (r:1 w:0) - /// Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) - /// Storage: Slp CurrencyDelays (r:1 w:0) - /// Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) - /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn unbond() -> Weight { - // Proof Size summary in bytes: - // Measured: `1506` - // Estimated: `31900` - // Minimum execution time: 129_878_000 picoseconds. - Weight::from_parts(131_519_000, 31900) - .saturating_add(RocksDbWeight::get().reads(9_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:0) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (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: VtokenMinting OngoingTimeUnit (r:1 w:0) - /// Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) - /// Storage: Slp CurrencyDelays (r:1 w:0) - /// Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) - /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn unbond_all() -> Weight { - // Proof Size summary in bytes: - // Measured: `1478` - // Estimated: `27695` - // Minimum execution time: 122_759_000 picoseconds. - Weight::from_parts(124_788_000, 27695) - .saturating_add(RocksDbWeight::get().reads(8_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:0) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp ValidatorsByDelegator (r:1 w:0) - /// Proof Skipped: Slp ValidatorsByDelegator (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (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: Slp ValidatorsByDelegatorXcmUpdateQueue (r:0 w:1) - /// Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn undelegate() -> Weight { - // Proof Size summary in bytes: - // Measured: `1450` - // Estimated: `24969` - // Minimum execution time: 130_474_000 picoseconds. - Weight::from_parts(131_915_000, 24969) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) - /// Storage: UnknownTokens ConcreteFungibleBalances (r:1 w:0) - /// Proof Skipped: UnknownTokens ConcreteFungibleBalances (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, 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: PolkadotXcm SupportedVersion (r:1 w:0) - /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) - /// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) - /// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainSystem HostConfiguration (r:1 w:0) - /// Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) - /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - fn transfer_to() -> Weight { - // Proof Size summary in bytes: - // Measured: `2815` - // Estimated: `50585` - // Minimum execution time: 221_136_000 picoseconds. - Weight::from_parts(223_116_000, 50585) - .saturating_add(RocksDbWeight::get().reads(13_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (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: Slp DelegatorLedgers (r:1 w:0) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) - /// Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) - /// Storage: Slp CurrencyDelays (r:1 w:0) - /// Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) - /// Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn chill() -> Weight { - // Proof Size summary in bytes: - // Measured: `1353` - // Estimated: `26695` - // Minimum execution time: 125_208_000 picoseconds. - Weight::from_parts(126_186_000, 26695) - .saturating_add(RocksDbWeight::get().reads(8_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) - /// Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp FeeSources (r:1 w:0) - /// Proof Skipped: Slp FeeSources (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp XcmDestWeightAndFee (r:1 w:0) - /// Proof Skipped: Slp XcmDestWeightAndFee (max_values: None, max_size: None, mode: Measured) - /// Storage: UnknownTokens ConcreteFungibleBalances (r:1 w:0) - /// Proof Skipped: UnknownTokens ConcreteFungibleBalances (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, 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: PolkadotXcm SupportedVersion (r:1 w:0) - /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) - /// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) - /// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainSystem HostConfiguration (r:1 w:0) - /// Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) - /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - fn supplement_fee_reserve() -> Weight { - // Proof Size summary in bytes: - // Measured: `2977` - // Estimated: `57657` - // Minimum execution time: 247_508_000 picoseconds. - Weight::from_parts(358_989_000, 57657) - .saturating_add(RocksDbWeight::get().reads(14_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp ValidatorsByDelegatorXcmUpdateQueue (r:1 w:1) - /// Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp ValidatorsByDelegator (r:0 w:1) - /// Proof Skipped: Slp ValidatorsByDelegator (max_values: None, max_size: None, mode: Measured) - fn confirm_validators_by_delegator_query_response() -> Weight { - // Proof Size summary in bytes: - // Measured: `484` - // Estimated: `6402` - // Minimum execution time: 57_318_000 picoseconds. - Weight::from_parts(58_268_000, 6402) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// Storage: Slp OperateOrigins (r:1 w:0) - /// Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp ValidatorsByDelegatorXcmUpdateQueue (r:1 w:1) - /// Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm Queries (r:1 w:0) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn fail_validators_by_delegator_query_response() -> Weight { - // Proof Size summary in bytes: - // Measured: `779` - // Estimated: `9762` - // Minimum execution time: 57_378_000 picoseconds. - Weight::from_parts(58_045_000, 9762) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } } diff --git a/pallets/slpx/Cargo.toml b/pallets/slpx/Cargo.toml index e11a32362..6c2e5e571 100644 --- a/pallets/slpx/Cargo.toml +++ b/pallets/slpx/Cargo.toml @@ -30,19 +30,23 @@ node-primitives = { path = "../../node/primitives", default-features = false } xcm-interface = { path = "../xcm-interface", default-features = false } bifrost-asset-registry = { path = "../asset-registry", default-features = false } bifrost-stable-pool = { path = "../stable-pool", default-features = false } +nutsfinance-stable-asset = { path = "../stable-asset" , default-features = false } +orml-tokens = { version = "0.4.1-dev", default-features = false } [dev-dependencies] pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } bifrost-vtoken-minting = { path = "../vtoken-minting" } bifrost-slp = { path = "../slp" } cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -orml-tokens = "0.4.1-dev" bifrost-currencies = { workspace = true } xcm-executor = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } pallet-xcm = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } xcm-builder = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } xcm-simulator = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } bifrost-runtime-common = { package = "bifrost-runtime-common", path = "../../runtime/common", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"} +parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } + [features] default = ["std"] @@ -66,11 +70,15 @@ std = [ "sp-runtime/std", "bifrost-asset-registry/std", "bifrost-stable-pool/std", + "nutsfinance-stable-asset/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "pallet-collective/runtime-benchmarks", ] try-runtime = ["frame-support/try-runtime"] with-bifrost-polkadot-runtime = [] diff --git a/pallets/slpx/src/benchmarking.rs b/pallets/slpx/src/benchmarking.rs index a355dbcc2..356c030df 100644 --- a/pallets/slpx/src/benchmarking.rs +++ b/pallets/slpx/src/benchmarking.rs @@ -17,92 +17,172 @@ // along with this program. If not, see . #![cfg(feature = "runtime-benchmarks")] -use crate::{Pallet as Slpx, *}; -use frame_benchmarking::v1::{benchmarks, whitelisted_caller, BenchmarkError}; -use frame_support::{ - assert_ok, sp_runtime::traits::UniqueSaturatedFrom, traits::EnsureOrigin, BoundedVec, -}; +use crate::*; +use bifrost_asset_registry::CurrencyIdToLocations; +use frame_benchmarking::v2::*; +use frame_support::{assert_ok, sp_runtime::traits::UniqueSaturatedFrom, BoundedVec}; use frame_system::RawOrigin; -use node_primitives::{CurrencyId, TokenSymbol}; +use node_primitives::{CurrencyId, KSM}; -benchmarks! { - add_whitelist { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let contract: T::AccountId = whitelisted_caller(); - }: _(RawOrigin::Root,SupportChain::Astar, contract) +fn init_whitelist() -> (T::AccountId, H160) { + let caller: T::AccountId = whitelisted_caller(); + assert_ok!(Pallet::::add_whitelist( + RawOrigin::Root.into(), + SupportChain::Astar, + caller.clone() + )); + let addr: [u8; 20] = hex_literal::hex!["3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0"].into(); + let receiver = H160::from(addr); + let evm_caller_account_id = Pallet::::h160_to_account_id(receiver); + assert_ok!(::MultiCurrency::deposit( + KSM, + &evm_caller_account_id, + BalanceOf::::unique_saturated_from(100_000_000_000_000u128), + )); - remove_whitelist { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let contract: T::AccountId = whitelisted_caller(); - assert_ok!(Slpx::::add_whitelist( - origin, - SupportChain::Astar, - contract.clone() - )); - }: _(RawOrigin::Root,SupportChain::Astar, contract) + assert_ok!(::MultiCurrency::deposit( + VKSM, + &evm_caller_account_id, + BalanceOf::::unique_saturated_from(100_000_000_000_000u128), + )); - set_execution_fee { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let contract: T::AccountId = whitelisted_caller(); - }: _(RawOrigin::Root,CurrencyId::Token2(0), 10u32.into()) + CurrencyIdToLocations::::insert(KSM, MultiLocation::default()); + CurrencyIdToLocations::::insert(VKSM, MultiLocation::default()); - set_transfer_to_fee { - let origin = ::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; + (caller, receiver) +} + +#[benchmarks(where T: Config + bifrost_asset_registry::Config + bifrost_stable_pool::Config + nutsfinance_stable_asset::Config + orml_tokens::Config)] +mod benchmarks { + use super::*; + use bifrost_stable_pool::AtLeast64BitUnsignedOf; + use frame_benchmarking::impl_benchmark_test_suite; + + #[benchmark] + fn add_whitelist() { let contract: T::AccountId = whitelisted_caller(); - }: _(RawOrigin::Root,SupportChain::Astar, 10u32.into()) + #[extrinsic_call] + _(RawOrigin::Root, SupportChain::Astar, contract.clone()); + + assert_eq!(WhitelistAccountId::::get(SupportChain::Astar).first(), Some(&contract)); + } - mint { + #[benchmark] + fn remove_whitelist() { let contract: T::AccountId = whitelisted_caller(); - assert_ok!(Slpx::::add_whitelist( - RawOrigin::Root.into(), - SupportChain::Astar, - contract.clone() + let whitelist = BoundedVec::try_from(vec![contract.clone()]).unwrap(); + + WhitelistAccountId::::insert(SupportChain::Astar, whitelist); + + #[extrinsic_call] + _(RawOrigin::Root, SupportChain::Astar, contract.clone()); + + assert_eq!(WhitelistAccountId::::get(SupportChain::Astar).first(), None); + } + + #[benchmark] + fn set_execution_fee() { + #[extrinsic_call] + _(RawOrigin::Root, CurrencyId::Token2(0), 10u32.into()); + + assert_eq!(ExecutionFee::::get(CurrencyId::Token2(0)), Some(10u32.into())); + } + + #[benchmark] + fn set_transfer_to_fee() { + #[extrinsic_call] + _(RawOrigin::Root, SupportChain::Moonbeam, 10u32.into()); + + assert_eq!(TransferToFee::::get(SupportChain::Moonbeam), Some(10u32.into())); + } + + #[benchmark] + fn mint() { + let (caller, receiver) = init_whitelist::(); + + #[extrinsic_call] + _( + RawOrigin::Signed(caller), + receiver, + KSM, + TargetChain::Astar(receiver), + BoundedVec::default(), + ); + } + + #[benchmark] + fn redeem() { + let (caller, receiver) = init_whitelist::(); + #[extrinsic_call] + _(RawOrigin::Signed(caller), receiver, VKSM, TargetChain::Astar(receiver)); + } + + #[benchmark] + fn zenlink_swap() { + let (caller, receiver) = init_whitelist::(); + #[extrinsic_call] + _(RawOrigin::Signed(caller), receiver, KSM, VKSM, 0u128, TargetChain::Astar(receiver)); + } + + #[benchmark] + fn stable_pool_swap() { + let (caller, receiver) = init_whitelist::(); + + assert_ok!(bifrost_stable_pool::Pallet::::create_pool( + RawOrigin::Root.into(), + vec![KSM.into(), VKSM.into()], + vec![1u128.into(), 1u128.into()], + 0u128.into(), + 0u128.into(), + 0u128.into(), + 220u128.into(), + whitelisted_caller(), + whitelisted_caller(), + 1000000000000u128.into() )); - assert_ok!(Slpx::::set_execution_fee( - RawOrigin::Root.into(), - CurrencyId::Native(TokenSymbol::BNC), - 0u32.into() + + assert_ok!(bifrost_stable_pool::Pallet::::edit_token_rate( + RawOrigin::Root.into(), + 0, + vec![ + (VKSM.into(), (1u128.into(), 1u128.into())), + (KSM.into(), (10u128.into(), 30u128.into())) + ] )); - let addr: [u8; 20] = hex_literal::hex!["3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0"].into(); - let receiver = H160::from(addr); - let evm_caller_account_id = Slpx::::h160_to_account_id(receiver); - T::MultiCurrency::deposit(CurrencyId::Native(TokenSymbol::BNC), &evm_caller_account_id, BalanceOf::::unique_saturated_from(100_000_000_000_000u128))?; - }: _(RawOrigin::Signed(contract), receiver, CurrencyId::Native(TokenSymbol::BNC), TargetChain::Astar(receiver),BoundedVec::default()) - redeem { - let contract: T::AccountId = whitelisted_caller(); - assert_ok!(Slpx::::add_whitelist( - RawOrigin::Root.into(), - SupportChain::Astar, - contract.clone() + assert_ok!(::MultiCurrency::deposit( + KSM, + &caller, + BalanceOf::::unique_saturated_from(1_000_000_000_000_000_000u128) )); - assert_ok!(Slpx::::set_execution_fee( - RawOrigin::Root.into(), - CurrencyId::VToken(TokenSymbol::BNC), - 0u32.into() + assert_ok!(::MultiCurrency::deposit( + VKSM, + &caller, + BalanceOf::::unique_saturated_from(1_000_000_000_000_000_000u128) )); - let addr: [u8; 20] = hex_literal::hex!["3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0"].into(); - let receiver = H160::from(addr); - let evm_caller_account_id = Slpx::::h160_to_account_id(receiver); - T::MultiCurrency::deposit(CurrencyId::VToken(TokenSymbol::BNC), &evm_caller_account_id, BalanceOf::::unique_saturated_from(100_000_000_000_000u128))?; - }: _(RawOrigin::Signed(contract), receiver, CurrencyId::VToken(TokenSymbol::BNC), TargetChain::Astar(receiver)) - zenlink_swap { - let contract: T::AccountId = whitelisted_caller(); - assert_ok!(Slpx::::add_whitelist( - RawOrigin::Root.into(), - SupportChain::Astar, - contract.clone() + let amounts1: AtLeast64BitUnsignedOf = 1_000_000_000_000u128.into(); + let amounts: ::Balance = amounts1.into(); + assert_ok!(bifrost_stable_pool::Pallet::::add_liquidity( + RawOrigin::Signed(caller.clone()).into(), + 0, + vec![amounts, amounts], + amounts )); - assert_ok!(Slpx::::set_execution_fee( - RawOrigin::Root.into(), - CurrencyId::Native(TokenSymbol::BNC), - 0u32.into() - )); - let addr: [u8; 20] = hex_literal::hex!["3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0"].into(); - let receiver = H160::from(addr); - let evm_caller_account_id = Slpx::::h160_to_account_id(receiver); - T::MultiCurrency::deposit(CurrencyId::Native(TokenSymbol::BNC), &evm_caller_account_id, BalanceOf::::unique_saturated_from(100_000_000_000_000u128))?; - }: _(RawOrigin::Signed(contract), receiver, CurrencyId::Native(TokenSymbol::BNC),CurrencyId::VToken(TokenSymbol::BNC), 0u32.into(),TargetChain::Astar(receiver)) + + #[extrinsic_call] + _( + RawOrigin::Signed(caller), + receiver, + 0u32, + KSM, + VKSM, + BalanceOf::::unique_saturated_from(10000000000u128), + TargetChain::Astar(receiver), + ); + } + + // `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); } diff --git a/pallets/slpx/src/lib.rs b/pallets/slpx/src/lib.rs index baadce362..25c491732 100644 --- a/pallets/slpx/src/lib.rs +++ b/pallets/slpx/src/lib.rs @@ -334,7 +334,7 @@ pub mod pallet { /// Swap and transfer to target chain #[pallet::call_index(1)] - #[pallet::weight(::WeightInfo::swap())] + #[pallet::weight(::WeightInfo::zenlink_swap())] pub fn zenlink_swap( origin: OriginFor, evm_caller: H160, @@ -471,7 +471,7 @@ pub mod pallet { /// Stable pool swap #[pallet::call_index(3)] - #[pallet::weight(::WeightInfo::swap())] + #[pallet::weight(::WeightInfo::stable_pool_swap())] pub fn stable_pool_swap( origin: OriginFor, evm_caller: H160, diff --git a/pallets/slpx/src/mock.rs b/pallets/slpx/src/mock.rs index 459f1e149..c29b65955 100644 --- a/pallets/slpx/src/mock.rs +++ b/pallets/slpx/src/mock.rs @@ -30,9 +30,11 @@ use frame_support::{ }; use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; -use node_primitives::{CurrencyId, SlpxOperator, TokenSymbol}; +use node_primitives::{ + CurrencyId, CurrencyIdMapping, DoNothingExecuteXcm, SlpxOperator, TokenSymbol, +}; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key, MultiCurrency}; -use sp_core::{blake2_256, H256}; +use sp_core::{blake2_256, ConstU128, H256}; use sp_runtime::{ testing::Header, traits::{ @@ -58,7 +60,6 @@ pub use xcm_builder::{ SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, }; -use xcm_executor::XcmExecutor; use zenlink_protocol::{ AssetBalance, AssetId as ZenlinkAssetId, LocalAssetHandler, PairLpGenerate, ZenlinkMultiAssets, }; @@ -91,7 +92,10 @@ construct_runtime!( ZenlinkProtocol: zenlink_protocol, XTokens: orml_xtokens, Slpx: slpx, - PolkadotXcm: pallet_xcm + PolkadotXcm: pallet_xcm, + ParachainInfo: parachain_info, + StableAsset: nutsfinance_stable_asset, + StablePool: bifrost_stable_pool } ); @@ -357,15 +361,30 @@ parameter_types! { pub const MaxAssetsForTransfer: usize = 2; } +pub struct BifrostCurrencyIdConvert(sp_std::marker::PhantomData); +impl> Convert> for BifrostCurrencyIdConvert { + fn convert(id: CurrencyId) -> Option { + AssetIdMaps::::get_multi_location(id) + } +} + +impl> Convert> for BifrostCurrencyIdConvert { + fn convert(location: MultiLocation) -> Option { + AssetIdMaps::::get_currency_id(location) + } +} + +impl parachain_info::Config for Test {} + impl orml_xtokens::Config for Test { type RuntimeEvent = RuntimeEvent; type Balance = Balance; type CurrencyId = CurrencyId; - type CurrencyIdConvert = (); + type CurrencyIdConvert = BifrostCurrencyIdConvert; type AccountIdToMultiLocation = (); type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; - type XcmExecutor = XcmExecutor; + type XcmExecutor = DoNothingExecuteXcm; type Weigher = FixedWeightBounds; type BaseXcmWeight = BaseXcmWeight; type MaxAssetsForTransfer = MaxAssetsForTransfer; @@ -467,8 +486,6 @@ impl bifrost_slp::Config for Test { type BifrostSlpx = Slpx; type AccountConverter = SubAccountIndexMultiLocationConvertor; type ParachainId = ParachainId; - type XcmRouter = (); - type XcmExecutor = (); type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; type MaxRefundPerBlock = MaxRefundPerBlock; @@ -491,7 +508,7 @@ impl pallet_xcm::Config for Test { type SendXcmOrigin = EnsureXcmOrigin; type Weigher = FixedWeightBounds; type XcmExecuteFilter = Nothing; - type XcmExecutor = XcmExecutor; + type XcmExecutor = DoNothingExecuteXcm; type XcmReserveTransferFilter = Everything; type XcmRouter = (); type XcmTeleportFilter = Nothing; @@ -510,6 +527,43 @@ impl pallet_xcm::Config for Test { type AdminOrigin = EnsureRoot; } +pub struct EnsurePoolAssetId; +impl nutsfinance_stable_asset::traits::ValidateAssetId for EnsurePoolAssetId { + fn validate(_: CurrencyId) -> bool { + true + } +} +parameter_types! { + pub const StableAssetPalletId: PalletId = PalletId(*b"nuts/sta"); +} + +impl nutsfinance_stable_asset::Config for Test { + type RuntimeEvent = RuntimeEvent; + type AssetId = CurrencyId; + type Balance = Balance; + type Assets = Tokens; + type PalletId = StableAssetPalletId; + type AtLeast64BitUnsigned = u128; + type FeePrecision = ConstU128<10_000_000_000>; + type APrecision = ConstU128<100>; + type PoolAssetLimit = ConstU32<5>; + type SwapExactOverAmount = ConstU128<100>; + type WeightInfo = (); + type ListingOrigin = EnsureSignedBy; + type EnsurePoolAssetId = EnsurePoolAssetId; +} + +impl bifrost_stable_pool::Config for Test { + type WeightInfo = (); + type ControlOrigin = EnsureRoot; + type CurrencyId = CurrencyId; + type MultiCurrency = Tokens; + type StableAsset = StableAsset; + type VtokenMinting = VtokenMinting; + type CurrencyIdConversion = AssetIdMaps; + type CurrencyIdRegister = AssetIdMaps; +} + // Pallet slpx configuration parameter_types! { pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); @@ -517,14 +571,19 @@ parameter_types! { impl slpx::Config for Test { type RuntimeEvent = RuntimeEvent; - type ControlOrigin = EnsureSignedBy; + type ControlOrigin = EnsureRoot; type MultiCurrency = Currencies; type DexOperator = ZenlinkProtocol; type VtokenMintingInterface = VtokenMinting; - type StablePoolHandler = (); + type StablePoolHandler = StablePool; type XcmTransfer = XTokens; type CurrencyIdConvert = AssetIdMaps; type TreasuryAccount = BifrostFeeAccount; type ParachainId = ParachainId; type WeightInfo = (); } + +#[cfg(feature = "runtime-benchmarks")] +pub fn new_test_ext() -> frame_support::sp_io::TestExternalities { + frame_system::GenesisConfig::default().build_storage::().unwrap().into() +} diff --git a/pallets/slpx/src/tests.rs b/pallets/slpx/src/tests.rs index c28a8af77..aaef5456e 100644 --- a/pallets/slpx/src/tests.rs +++ b/pallets/slpx/src/tests.rs @@ -48,21 +48,17 @@ fn test_account_convert_work() { #[test] fn test_whitelist_work() { sp_io::TestExternalities::default().execute_with(|| { - assert_ok!(Slpx::add_whitelist(RuntimeOrigin::signed(ALICE), SupportChain::Astar, ALICE)); - assert_ok!(Slpx::add_whitelist(RuntimeOrigin::signed(ALICE), SupportChain::Astar, BOB)); + assert_ok!(Slpx::add_whitelist(RuntimeOrigin::root(), SupportChain::Astar, ALICE)); + assert_ok!(Slpx::add_whitelist(RuntimeOrigin::root(), SupportChain::Astar, BOB)); assert_eq!( Slpx::whitelist_account_ids(SupportChain::Astar), BoundedVec::>::try_from(vec![ALICE, BOB]).unwrap() ); assert_noop!( - Slpx::add_whitelist(RuntimeOrigin::signed(ALICE), SupportChain::Astar, ALICE), + Slpx::add_whitelist(RuntimeOrigin::root(), SupportChain::Astar, ALICE), Error::::AccountIdAlreadyInWhitelist ); - assert_ok!(Slpx::remove_whitelist( - RuntimeOrigin::signed(ALICE), - SupportChain::Astar, - ALICE - )); + assert_ok!(Slpx::remove_whitelist(RuntimeOrigin::root(), SupportChain::Astar, ALICE)); assert_eq!( Slpx::whitelist_account_ids(SupportChain::Astar), BoundedVec::>::try_from(vec![BOB]).unwrap() @@ -86,7 +82,7 @@ fn test_whitelist_work() { assert_eq!(evm_caller_account_id, Slpx::h160_to_account_id(evm_caller)); // Hydradx - assert_ok!(Slpx::add_whitelist(RuntimeOrigin::signed(ALICE), SupportChain::Hydradx, ALICE)); + assert_ok!(Slpx::add_whitelist(RuntimeOrigin::root(), SupportChain::Hydradx, ALICE)); let target_chain = TargetChain::Hydradx(ALICE); let (evm_contract_account_id, evm_caller_account_id) = Slpx::ensure_singer_on_whitelist( RuntimeOrigin::signed(ALICE), @@ -108,22 +104,14 @@ fn test_execution_fee_work() { sp_io::TestExternalities::default().execute_with(|| { assert_ok!(Currencies::deposit(CurrencyId::Token2(0), &ALICE, 50)); - assert_ok!(Slpx::set_execution_fee( - RuntimeOrigin::signed(ALICE), - CurrencyId::Token2(0), - 10 - )); + assert_ok!(Slpx::set_execution_fee(RuntimeOrigin::root(), CurrencyId::Token2(0), 10)); assert_eq!(Slpx::execution_fee(CurrencyId::Token2(0)), Some(10)); let balance_exclude_fee = Slpx::charge_execution_fee(CurrencyId::Token2(0), &ALICE).unwrap(); assert_eq!(balance_exclude_fee, 40); - assert_ok!(Slpx::set_transfer_to_fee( - RuntimeOrigin::signed(ALICE), - SupportChain::Moonbeam, - 10 - )); + assert_ok!(Slpx::set_transfer_to_fee(RuntimeOrigin::root(), SupportChain::Moonbeam, 10)); assert_eq!(Slpx::transfer_to_fee(SupportChain::Moonbeam), Some(10)); }); } diff --git a/pallets/slpx/src/weights.rs b/pallets/slpx/src/weights.rs index fcc8c4818..4b75e5ada 100644 --- a/pallets/slpx/src/weights.rs +++ b/pallets/slpx/src/weights.rs @@ -25,10 +25,9 @@ //! Autogenerated weights for bifrost_slpx //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: // target/release/bifrost @@ -43,15 +42,14 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/slpx/src/weights.rs -// --template=./frame-weight-template.hbs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_slpx. pub trait WeightInfo { @@ -61,33 +59,33 @@ pub trait WeightInfo { fn set_transfer_to_fee() -> Weight; fn mint() -> Weight; fn redeem() -> Weight; - fn swap() -> Weight; + fn zenlink_swap() -> Weight; + fn stable_pool_swap() -> Weight; } -/// Weights for bifrost_slpx using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { +// 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) fn add_whitelist() -> Weight { // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `2813` - // Minimum execution time: 34_393_000 picoseconds. - Weight::from_parts(35_349_000, 2813) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `4` + // Estimated: `3803` + // Minimum execution time: 33_813_000 picoseconds. + Weight::from_parts(34_425_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) fn remove_whitelist() -> Weight { // Proof Size summary in bytes: - // Measured: `218` - // Estimated: `2813` - // Minimum execution time: 37_884_000 picoseconds. - Weight::from_parts(38_449_000, 2813) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `81` + // Estimated: `3803` + // Minimum execution time: 36_169_000 picoseconds. + Weight::from_parts(37_581_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) @@ -95,9 +93,9 @@ impl WeightInfo for BifrostWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 20_535_000 picoseconds. - Weight::from_parts(21_107_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 24_261_000 picoseconds. + Weight::from_parts(25_400_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) @@ -105,18 +103,20 @@ impl WeightInfo for BifrostWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 20_762_000 picoseconds. - Weight::from_parts(21_610_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 23_834_000 picoseconds. + Weight::from_parts(24_458_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: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, 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:2 w:0) + /// 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) @@ -125,25 +125,29 @@ impl WeightInfo for BifrostWeight { /// 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: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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) fn mint() -> Weight { // Proof Size summary in bytes: - // Measured: `2180` - // Estimated: `28305` - // Minimum execution time: 213_010_000 picoseconds. - Weight::from_parts(215_837_000, 28305) - .saturating_add(T::DbWeight::get().reads(11_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) + // 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)) } /// 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:1 w:0) + /// 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:1 w:0) + /// 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) @@ -156,153 +160,67 @@ impl WeightInfo for BifrostWeight { /// 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) fn redeem() -> Weight { // Proof Size summary in bytes: - // Measured: `1866` - // Estimated: `27153` - // Minimum execution time: 103_512_000 picoseconds. - Weight::from_parts(104_442_000, 27153) - .saturating_add(T::DbWeight::get().reads(10_u64)) + // 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: System Account (r:2 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, 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: Tokens Accounts (r:1 w:0) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - fn swap() -> Weight { - // Proof Size summary in bytes: - // Measured: `1703` - // Estimated: `17810` - // Minimum execution time: 88_961_000 picoseconds. - Weight::from_parts(90_236_000, 17810) - .saturating_add(T::DbWeight::get().reads(7_u64)) - } -} - -// 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) - fn add_whitelist() -> Weight { - // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `2813` - // Minimum execution time: 34_393_000 picoseconds. - Weight::from_parts(35_349_000, 2813) - .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) - fn remove_whitelist() -> Weight { - // Proof Size summary in bytes: - // Measured: `218` - // Estimated: `2813` - // Minimum execution time: 37_884_000 picoseconds. - Weight::from_parts(38_449_000, 2813) - .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) - fn set_execution_fee() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 20_535_000 picoseconds. - Weight::from_parts(21_107_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) - fn set_transfer_to_fee() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 20_762_000 picoseconds. - Weight::from_parts(21_610_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: System Account (r:2 w:2) + /// Storage: System Account (r:2 w:1) /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, 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: 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: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - fn mint() -> Weight { + /// 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: `2180` - // Estimated: `28305` - // Minimum execution time: 213_010_000 picoseconds. - Weight::from_parts(215_837_000, 28305) + // 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(5_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: Tokens Accounts (r:1 w:0) + /// 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: 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) - fn redeem() -> Weight { - // Proof Size summary in bytes: - // Measured: `1866` - // Estimated: `27153` - // Minimum execution time: 103_512_000 picoseconds. - Weight::from_parts(104_442_000, 27153) - .saturating_add(RocksDbWeight::get().reads(10_u64)) - } - /// Storage: Slpx WhitelistAccountId (r:1 w:0) - /// Proof: Slpx WhitelistAccountId (max_values: None, max_size: Some(338), added: 2813, mode: MaxEncodedLen) + /// 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) - /// Storage: System Account (r:2 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, 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: Tokens Accounts (r:1 w:0) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - fn swap() -> Weight { + fn stable_pool_swap() -> Weight { // Proof Size summary in bytes: - // Measured: `1703` - // Estimated: `17810` - // Minimum execution time: 88_961_000 picoseconds. - Weight::from_parts(90_236_000, 17810) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // 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)) } } diff --git a/pallets/stable-pool/src/benchmarking.rs b/pallets/stable-pool/src/benchmarking.rs index 7a0cb274e..9a2a98422 100644 --- a/pallets/stable-pool/src/benchmarking.rs +++ b/pallets/stable-pool/src/benchmarking.rs @@ -42,7 +42,24 @@ benchmarks! { fee_account, 1000000000000000000u128.into()) - edit_token_rate {}: _(RawOrigin::Root, 0, vec![(VDOT.into(), (9u128.into(), 10u128.into()))]) + edit_token_rate { + let fee_account: T::AccountId = account("seed",1,1); + let coin0 = BNC; + let coin1 = KSM; + assert_ok!( + StablePool::::create_pool( + RawOrigin::Root.into(), + vec![coin0.into(), coin1.into()], + vec![1u128.into(), 1u128.into()], + 10000000u128.into(), + 20000000u128.into(), + 50000000u128.into(), + 10000u128.into(), + fee_account.clone(), + fee_account.clone(), + 1000000000000000000u128.into()) + ); + }: _(RawOrigin::Root, 0, vec![(VDOT.into(), (9u128.into(), 10u128.into())),(DOT.into(), (1u128.into(), 1u128.into()))]) add_liquidity { let test_account: T::AccountId = whitelisted_caller(); @@ -234,5 +251,5 @@ benchmarks! { 1000000000000u128.into())); }: _(RawOrigin::Root, 0, Some(test_account.clone()), Some(test_account)) - impl_benchmark_test_suite!(StablePool, crate::mock::ExtBuilder::build(), crate::mock::Test); + impl_benchmark_test_suite!(StablePool, crate::mock::ExtBuilder::default().build(), crate::mock::Test); } diff --git a/pallets/stable-pool/src/mock.rs b/pallets/stable-pool/src/mock.rs index ea9fa0e97..9a8ead303 100644 --- a/pallets/stable-pool/src/mock.rs +++ b/pallets/stable-pool/src/mock.rs @@ -23,7 +23,7 @@ use frame_support::{ traits::{ConstU128, ConstU16, ConstU32, ConstU64, Everything, GenesisBuild, Nothing}, PalletId, }; -use frame_system::EnsureSignedBy; +use frame_system::{EnsureRoot, EnsureSignedBy}; pub use node_primitives::{ AccountId, Balance, CurrencyId, CurrencyIdMapping, SlpOperator, SlpxOperator, TokenSymbol, ASTR, BNC, DOT, DOT_TOKEN_ID, GLMR, VBNC, VDOT, @@ -269,7 +269,7 @@ impl nutsfinance_stable_asset::Config for Test { impl bifrost_stable_pool::Config for Test { type WeightInfo = (); - type ControlOrigin = EnsureSignedBy; + type ControlOrigin = EnsureRoot; type CurrencyId = CurrencyId; type MultiCurrency = Currencies; type StableAsset = StableAsset; @@ -386,16 +386,6 @@ impl ExtBuilder { ]) } - #[cfg(feature = "runtime-benchmarks")] - pub fn for_benchmark(self) -> Self { - use frame_benchmarking::whitelisted_caller; - let whitelist_caller: AccountId = whitelisted_caller(); - self.balances(vec![ - (whitelist_caller.clone(), DOT, 100_000_000_000_000), - (whitelist_caller.clone(), VDOT, 100_000_000_000_000), - ]) - } - // Build genesis storage according to the mock runtime. pub fn build(self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap().into(); diff --git a/pallets/stable-pool/src/tests.rs b/pallets/stable-pool/src/tests.rs index fa90d75b7..c6093cd41 100644 --- a/pallets/stable-pool/src/tests.rs +++ b/pallets/stable-pool/src/tests.rs @@ -29,7 +29,7 @@ fn create_pool() -> (CurrencyId, CurrencyId, CurrencyId, u128) { let pool_asset: CurrencyId = CurrencyId::BLP(0); assert_ok!(StablePool::create_pool( - RuntimeOrigin::signed(1), + RuntimeOrigin::root(), vec![coin0, coin1], vec![10000000000u128, 10000000000u128], 10000000u128, @@ -49,7 +49,7 @@ fn create_pool2() -> (CurrencyId, CurrencyId, CurrencyId, u128) { let pool_asset = CurrencyId::BLP(0); assert_ok!(StablePool::create_pool( - RuntimeOrigin::signed(1), + RuntimeOrigin::root(), vec![coin0, coin1], vec![1u128, 1u128], 10000000u128, @@ -96,7 +96,7 @@ fn create_pool_successful() { let coin1 = VDOT; assert_eq!(StableAsset::pool_count(), 0); assert_ok!(StablePool::create_pool( - RuntimeOrigin::signed(1), + RuntimeOrigin::root(), vec![coin0, coin1], vec![1u128, 1u128], 1u128, @@ -140,7 +140,7 @@ fn mint_successful_equal_amounts() { let (coin0, coin1, pool_asset, swap_id) = create_pool(); System::set_block_number(2); assert_ok!(StablePool::edit_token_rate( - RuntimeOrigin::signed(1), + RuntimeOrigin::root(), 0, vec![(coin0, (1, 1)), (coin1, (1, 1))] )); @@ -236,7 +236,7 @@ fn get_swap_output_amount() { let (coin0, coin1, pool_asset, swap_id) = create_pool(); assert_ok!(StablePool::edit_token_rate( - RuntimeOrigin::signed(1), + RuntimeOrigin::root(), 0, vec![(coin0, (1, 1)), (coin1, (1, 1))] )); @@ -309,7 +309,7 @@ fn mint_swap_redeem1() { let (coin0, coin1, _pool_asset, swap_id) = create_pool(); assert_ok!(StablePool::edit_token_rate( - RuntimeOrigin::signed(1), + RuntimeOrigin::root(), 0, vec![(DOT, (1, 1)), (VDOT, (90_000_000, 100_000_000))] )); @@ -340,7 +340,7 @@ fn mint_swap_redeem2() { assert_ok!(Tokens::set_balance(RuntimeOrigin::root(), 3, VDOT, 90_000_000, 0)); let (coin0, coin1, pool_asset, swap_id) = create_pool2(); assert_ok!(StablePool::edit_token_rate( - RuntimeOrigin::signed(1), + RuntimeOrigin::root(), 0, vec![(DOT, (1, 1)), (VDOT, (90_000_000, 100_000_000))] )); @@ -403,7 +403,7 @@ fn mint_swap_redeem_for_precisions() { assert_ok!(Tokens::set_balance(RuntimeOrigin::root(), 3, VDOT, 90_000_000, 0)); let (coin0, coin1, _pool_asset, _swap_id) = create_pool2(); assert_ok!(StablePool::edit_token_rate( - RuntimeOrigin::signed(1), + RuntimeOrigin::root(), 0, vec![(DOT, (1, 1)), (VDOT, (90_000_000, 100_000_000))] )); @@ -441,7 +441,7 @@ fn redeem_single() { let amounts = vec![100_000_000_000u128, 100_000_000_000u128]; assert_ok!(StablePool::create_pool( - RuntimeOrigin::signed(1), + RuntimeOrigin::root(), vec![coin0.into(), coin1.into()], vec![1u128.into(), 1u128.into()], 0u128.into(), @@ -453,7 +453,7 @@ fn redeem_single() { 1000000000000u128.into() )); assert_ok!(StablePool::edit_token_rate( - RuntimeOrigin::signed(1), + RuntimeOrigin::root(), 0, vec![(DOT, (1, 1)), (VDOT, (10, 11))] )); @@ -553,7 +553,7 @@ fn redeem_multi() { let amounts = vec![100_000_000_000u128, 100_000_000_000u128]; assert_ok!(StablePool::create_pool( - RuntimeOrigin::signed(1), + RuntimeOrigin::root(), vec![coin0.into(), coin1.into()], vec![1u128.into(), 1u128.into()], 0u128.into(), @@ -565,7 +565,7 @@ fn redeem_multi() { 1000000000000u128.into() )); assert_ok!(StablePool::edit_token_rate( - RuntimeOrigin::signed(1), + RuntimeOrigin::root(), 0, vec![(DOT, (1, 1)), (VDOT, (10, 11))] )); @@ -651,7 +651,7 @@ fn bnc_add_liquidity_should_work() { let amounts = vec![100_000_000_000u128, 100_000_000_000u128]; assert_ok!(StablePool::create_pool( - RuntimeOrigin::signed(1), + RuntimeOrigin::root(), vec![coin0.into(), coin1.into()], vec![1u128.into(), 1u128.into()], 0u128.into(), @@ -663,7 +663,7 @@ fn bnc_add_liquidity_should_work() { 1000000000000u128.into() )); assert_ok!(StablePool::edit_token_rate( - RuntimeOrigin::signed(1), + RuntimeOrigin::root(), 0, vec![(BNC, (1, 1)), (VBNC, (10, 11))] )); @@ -678,7 +678,7 @@ fn edit_token_rate() { ExtBuilder::default().new_test_ext().build().execute_with(|| { assert_noop!( StablePool::edit_token_rate( - RuntimeOrigin::signed(1), + RuntimeOrigin::root(), 0, vec![(BNC, (1, 1)), (VBNC, (10, 11))] ), @@ -686,7 +686,7 @@ fn edit_token_rate() { ); let (_coin0, _coin1, _pool_asset, _swap_id) = create_pool2(); assert_ok!(StablePool::edit_token_rate( - RuntimeOrigin::signed(1), + RuntimeOrigin::root(), 0, vec![(BNC, (1, 1)), (VBNC, (10, 11))] )); @@ -698,11 +698,7 @@ fn edit_token_rate() { vec![(VBNC, (10, 11)), (BNC, (1, 1))] ); - assert_ok!(StablePool::edit_token_rate( - RuntimeOrigin::signed(1), - 0, - vec![(VBNC, (10, 12))] - )); + assert_ok!(StablePool::edit_token_rate(RuntimeOrigin::root(), 0, vec![(VBNC, (10, 12))])); assert_eq!( nutsfinance_stable_asset::TokenRateCaches::::iter_prefix(0).collect::, @@ -711,7 +707,7 @@ fn edit_token_rate() { vec![(VBNC, (10, 12)), (BNC, (1, 1))] ); - assert_ok!(StablePool::edit_token_rate(RuntimeOrigin::signed(1), 0, vec![])); + assert_ok!(StablePool::edit_token_rate(RuntimeOrigin::root(), 0, vec![])); assert_eq!( nutsfinance_stable_asset::TokenRateCaches::::iter_prefix(0).collect::, @@ -719,11 +715,7 @@ fn edit_token_rate() { )>>(), vec![] ); - assert_ok!(StablePool::edit_token_rate( - RuntimeOrigin::signed(1), - 0, - vec![(VBNC, (10, 12))] - )); + assert_ok!(StablePool::edit_token_rate(RuntimeOrigin::root(), 0, vec![(VBNC, (10, 12))])); assert_eq!( nutsfinance_stable_asset::TokenRateCaches::::iter_prefix(0).collect::, diff --git a/pallets/stable-pool/src/weights.rs b/pallets/stable-pool/src/weights.rs index 1ea81258e..f14efeef2 100644 --- a/pallets/stable-pool/src/weights.rs +++ b/pallets/stable-pool/src/weights.rs @@ -15,37 +15,43 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. -//! Autogenerated weights for `bifrost_stable_pool` +//! Autogenerated weights for bifrost_stable_pool //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-07-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `yml`, CPU: `AMD Ryzen 9 3950X 16-Core Processor` -//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! DATE: 2023-09-14, 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 // benchmark // pallet // --chain=bifrost-kusama-local -// --pallet=bifrost_stable_pool -// --extrinsic=* // --steps=50 // --repeat=20 +// --pallet=bifrost_stable_pool +// --extrinsic=* +// --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --header=./HEADER-GPL3 -// --output=./bifrost_stable_pool.rs +// --output=./pallets/stable-pool/src/weights.rs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] -use frame_support::{traits::Get, weights::{Weight,constants::RocksDbWeight}}; -use core::marker::PhantomData; +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; +/// Weight functions needed for bifrost_stable_pool. pub trait WeightInfo { fn create_pool() -> Weight; fn edit_token_rate() -> Weight; @@ -59,358 +65,174 @@ pub trait WeightInfo { fn modify_recipients() -> Weight; } -/// Weight functions for `bifrost_stable_pool`. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { +// For backwards compatibility and tests +impl WeightInfo for () { /// Storage: StableAsset PoolCount (r:1 w:1) /// Proof Skipped: StableAsset PoolCount (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:1) + /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) /// Storage: StableAsset Pools (r:1 w:1) /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) /// Storage: System Account (r:1 w:1) /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn create_pool() -> Weight { // Proof Size summary in bytes: - // Measured: `128` - // Estimated: `3593` - // Minimum execution time: 15_640_000 picoseconds. - Weight::from_parts(16_071_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `663` + // Estimated: `4128` + // Minimum execution time: 87_500_000 picoseconds. + Weight::from_parts(89_559_000, 4128) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(4_u64)) } - /// Storage: StableAsset TokenRateCaches (r:1 w:1) + /// Storage: StableAsset PoolCount (r:1 w:0) + /// Proof Skipped: StableAsset PoolCount (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: StableAsset TokenRateCaches (r:3 w:2) /// Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) fn edit_token_rate() -> Weight { // Proof Size summary in bytes: - // Measured: `218` - // Estimated: `3683` - // Minimum execution time: 5_611_000 picoseconds. - Weight::from_parts(5_771_000, 0) - .saturating_add(Weight::from_parts(0, 3683)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `258` + // Estimated: `8673` + // Minimum execution time: 68_594_000 picoseconds. + Weight::from_parts(69_659_000, 8673) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: StableAsset Pools (r:1 w:1) /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:4 w:4) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) /// Storage: StableAsset TokenRateCaches (r:2 w:0) /// Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:3 w:3) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) fn add_liquidity() -> Weight { // Proof Size summary in bytes: - // Measured: `2547` - // Estimated: `11362` - // Minimum execution time: 103_185_000 picoseconds. - Weight::from_parts(104_127_000, 0) - .saturating_add(Weight::from_parts(0, 11362)) - .saturating_add(T::DbWeight::get().reads(12)) - .saturating_add(T::DbWeight::get().writes(7)) + // Measured: `2557` + // Estimated: `8769` + // Minimum execution time: 416_124_000 picoseconds. + Weight::from_parts(426_362_000, 8769) + .saturating_add(RocksDbWeight::get().reads(11_u64)) + .saturating_add(RocksDbWeight::get().writes(7_u64)) } /// Storage: StableAsset Pools (r:1 w:1) /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) /// Storage: StableAsset TokenRateCaches (r:1 w:0) /// Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) fn swap() -> Weight { // Proof Size summary in bytes: - // Measured: `2290` + // Measured: `2239` // Estimated: `6196` - // Minimum execution time: 80_553_000 picoseconds. - Weight::from_parts(81_855_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(4)) + // Minimum execution time: 366_396_000 picoseconds. + Weight::from_parts(378_337_000, 6196) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64)) } /// Storage: StableAsset Pools (r:1 w:1) /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: StableAsset TokenRateCaches (r:1 w:0) - /// Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:0) + /// Storage: System Account (r:2 w:2) /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - fn redeem_proportion() -> Weight { - // Proof Size summary in bytes: - // Measured: `2150` - // Estimated: `6176` - // Minimum execution time: 74_020_000 picoseconds. - Weight::from_parts(74_441_000, 0) - .saturating_add(Weight::from_parts(0, 6176)) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: StableAsset Pools (r:1 w:1) - /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) /// Storage: StableAsset TokenRateCaches (r:1 w:0) /// Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - fn redeem_single() -> Weight { - // Proof Size summary in bytes: - // Measured: `2150` - // Estimated: `6176` - // Minimum execution time: 69_101_000 picoseconds. - Weight::from_parts(69_772_000, 0) - .saturating_add(Weight::from_parts(0, 6176)) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: StableAsset Pools (r:1 w:1) - /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) + /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: StableAsset TokenRateCaches (r:1 w:0) - /// Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - fn redeem_multi() -> Weight { - // Proof Size summary in bytes: - // Measured: `2150` - // Estimated: `6176` - // Minimum execution time: 73_369_000 picoseconds. - Weight::from_parts(73_981_000, 0) - .saturating_add(Weight::from_parts(0, 6176)) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: StableAsset Pools (r:1 w:1) - /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) - fn modify_a() -> Weight { - // Proof Size summary in bytes: - // Measured: `443` - // Estimated: `3908` - // Minimum execution time: 12_844_000 picoseconds. - Weight::from_parts(13_365_000, 0) - .saturating_add(Weight::from_parts(0, 3908)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: StableAsset Pools (r:1 w:1) - /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) - fn modify_fees() -> Weight { - // Proof Size summary in bytes: - // Measured: `443` - // Estimated: `3908` - // Minimum execution time: 12_534_000 picoseconds. - Weight::from_parts(12_714_000, 0) - .saturating_add(Weight::from_parts(0, 3908)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: StableAsset Pools (r:1 w:1) - /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) - fn modify_recipients() -> Weight { - // Proof Size summary in bytes: - // Measured: `443` - // Estimated: `3908` - // Minimum execution time: 12_323_000 picoseconds. - Weight::from_parts(12_704_000, 0) - .saturating_add(Weight::from_parts(0, 3908)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } -} - -impl WeightInfo for () { - /// Storage: StableAsset PoolCount (r:1 w:1) - /// Proof Skipped: StableAsset PoolCount (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: StableAsset Pools (r:1 w:1) - /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - fn create_pool() -> Weight { - // Proof Size summary in bytes: - // Measured: `128` - // Estimated: `3593` - // Minimum execution time: 15_640_000 picoseconds. - Weight::from_parts(16_071_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(RocksDbWeight::get().reads(3)) - .saturating_add(RocksDbWeight::get().writes(3)) - } - /// Storage: StableAsset TokenRateCaches (r:1 w:1) - /// Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) - fn edit_token_rate() -> Weight { + fn redeem_proportion() -> Weight { // Proof Size summary in bytes: - // Measured: `218` - // Estimated: `3683` - // Minimum execution time: 5_611_000 picoseconds. - Weight::from_parts(5_771_000, 0) - .saturating_add(Weight::from_parts(0, 3683)) - .saturating_add(RocksDbWeight::get().reads(1)) - .saturating_add(RocksDbWeight::get().writes(1)) + // Measured: `2239` + // Estimated: `6196` + // Minimum execution time: 350_451_000 picoseconds. + Weight::from_parts(357_994_000, 6196) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64)) } /// Storage: StableAsset Pools (r:1 w:1) /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:4 w:4) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: StableAsset TokenRateCaches (r:2 w:0) - /// Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) - /// 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) + /// Storage: System Account (r:2 w:2) /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - fn add_liquidity() -> Weight { - // Proof Size summary in bytes: - // Measured: `2547` - // Estimated: `11362` - // Minimum execution time: 103_185_000 picoseconds. - Weight::from_parts(104_127_000, 0) - .saturating_add(Weight::from_parts(0, 11362)) - .saturating_add(RocksDbWeight::get().reads(12)) - .saturating_add(RocksDbWeight::get().writes(7)) - } - /// Storage: StableAsset Pools (r:1 w:1) - /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) /// Storage: StableAsset TokenRateCaches (r:1 w:0) /// Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - fn swap() -> Weight { + fn redeem_single() -> Weight { // Proof Size summary in bytes: - // Measured: `2290` + // Measured: `2239` // Estimated: `6196` - // Minimum execution time: 80_553_000 picoseconds. - Weight::from_parts(81_855_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(RocksDbWeight::get().reads(8)) - .saturating_add(RocksDbWeight::get().writes(4)) + // Minimum execution time: 297_040_000 picoseconds. + Weight::from_parts(304_546_000, 6196) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64)) } /// Storage: StableAsset Pools (r:1 w:1) /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: StableAsset TokenRateCaches (r:1 w:0) - /// Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:0) + /// Storage: System Account (r:2 w:2) /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - fn redeem_proportion() -> Weight { - // Proof Size summary in bytes: - // Measured: `2150` - // Estimated: `6176` - // Minimum execution time: 74_020_000 picoseconds. - Weight::from_parts(74_441_000, 0) - .saturating_add(Weight::from_parts(0, 6176)) - .saturating_add(RocksDbWeight::get().reads(7)) - .saturating_add(RocksDbWeight::get().writes(4)) - } - /// Storage: StableAsset Pools (r:1 w:1) - /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) /// Storage: StableAsset TokenRateCaches (r:1 w:0) /// Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - fn redeem_single() -> Weight { - // Proof Size summary in bytes: - // Measured: `2150` - // Estimated: `6176` - // Minimum execution time: 69_101_000 picoseconds. - Weight::from_parts(69_772_000, 0) - .saturating_add(Weight::from_parts(0, 6176)) - .saturating_add(RocksDbWeight::get().reads(7)) - .saturating_add(RocksDbWeight::get().writes(4)) - } - /// Storage: StableAsset Pools (r:1 w:1) - /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) + /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: StableAsset TokenRateCaches (r:1 w:0) - /// Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) fn redeem_multi() -> Weight { // Proof Size summary in bytes: - // Measured: `2150` - // Estimated: `6176` - // Minimum execution time: 73_369_000 picoseconds. - Weight::from_parts(73_981_000, 0) - .saturating_add(Weight::from_parts(0, 6176)) - .saturating_add(RocksDbWeight::get().reads(7)) - .saturating_add(RocksDbWeight::get().writes(4)) + // Measured: `2239` + // Estimated: `6196` + // Minimum execution time: 353_506_000 picoseconds. + Weight::from_parts(363_290_000, 6196) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64)) } /// Storage: StableAsset Pools (r:1 w:1) /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) fn modify_a() -> Weight { // Proof Size summary in bytes: - // Measured: `443` - // Estimated: `3908` - // Minimum execution time: 12_844_000 picoseconds. - Weight::from_parts(13_365_000, 0) - .saturating_add(Weight::from_parts(0, 3908)) - .saturating_add(RocksDbWeight::get().reads(1)) - .saturating_add(RocksDbWeight::get().writes(1)) + // Measured: `446` + // Estimated: `3911` + // Minimum execution time: 43_656_000 picoseconds. + Weight::from_parts(44_538_000, 3911) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: StableAsset Pools (r:1 w:1) /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) fn modify_fees() -> Weight { // Proof Size summary in bytes: - // Measured: `443` - // Estimated: `3908` - // Minimum execution time: 12_534_000 picoseconds. - Weight::from_parts(12_714_000, 0) - .saturating_add(Weight::from_parts(0, 3908)) - .saturating_add(RocksDbWeight::get().reads(1)) - .saturating_add(RocksDbWeight::get().writes(1)) + // Measured: `446` + // Estimated: `3911` + // Minimum execution time: 41_403_000 picoseconds. + Weight::from_parts(41_816_000, 3911) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: StableAsset Pools (r:1 w:1) /// Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) fn modify_recipients() -> Weight { // Proof Size summary in bytes: - // Measured: `443` - // Estimated: `3908` - // Minimum execution time: 12_323_000 picoseconds. - Weight::from_parts(12_704_000, 0) - .saturating_add(Weight::from_parts(0, 3908)) - .saturating_add(RocksDbWeight::get().reads(1)) - .saturating_add(RocksDbWeight::get().writes(1)) + // Measured: `446` + // Estimated: `3911` + // Minimum execution time: 41_495_000 picoseconds. + Weight::from_parts(42_190_000, 3911) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } } diff --git a/pallets/system-maker/src/mock.rs b/pallets/system-maker/src/mock.rs index f208f55da..f701049ff 100644 --- a/pallets/system-maker/src/mock.rs +++ b/pallets/system-maker/src/mock.rs @@ -312,8 +312,6 @@ impl bifrost_slp::Config for Runtime { type BifrostSlpx = SlpxInterface; type AccountConverter = SubAccountIndexMultiLocationConvertor; type ParachainId = ParachainId; - type XcmRouter = (); - type XcmExecutor = (); type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; type MaxRefundPerBlock = MaxRefundPerBlock; @@ -557,13 +555,6 @@ impl ExtBuilder { ]) } - #[cfg(feature = "runtime-benchmarks")] - pub fn one_hundred_precision_for_each_currency_type_for_whitelist_account(self) -> Self { - use frame_benchmarking::whitelisted_caller; - let whitelist_caller: AccountId = whitelisted_caller(); - self.balances(vec![(whitelist_caller.clone(), KSM, 100_000_000_000_000)]) - } - pub fn build(self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); diff --git a/pallets/system-maker/src/weights.rs b/pallets/system-maker/src/weights.rs index 621853e51..2591f3389 100644 --- a/pallets/system-maker/src/weights.rs +++ b/pallets/system-maker/src/weights.rs @@ -25,10 +25,9 @@ //! Autogenerated weights for bifrost_system_maker //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: // target/release/bifrost @@ -43,15 +42,14 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/system-maker/src/weights.rs -// --template=./frame-weight-template.hbs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_system_maker. pub trait WeightInfo { @@ -62,86 +60,16 @@ pub trait WeightInfo { fn on_idle() -> Weight; } -/// Weights for bifrost_system_maker using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: SystemMaker Infos (r:1 w:1) - /// Proof Skipped: SystemMaker Infos (max_values: None, max_size: None, mode: Measured) - fn set_config() -> Weight { - // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `2551` - // Minimum execution time: 27_575_000 picoseconds. - Weight::from_parts(28_533_000, 2551) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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) - fn charge() -> Weight { - // Proof Size summary in bytes: - // Measured: `1395` - // Estimated: `14262` - // Minimum execution time: 99_892_000 picoseconds. - Weight::from_parts(104_941_000, 14262) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: SystemMaker Infos (r:0 w:1) - /// Proof Skipped: SystemMaker Infos (max_values: None, max_size: None, mode: Measured) - fn close() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 21_703_000 picoseconds. - Weight::from_parts(22_199_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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) - fn payout() -> Weight { - // Proof Size summary in bytes: - // Measured: `1486` - // Estimated: `14353` - // Minimum execution time: 92_259_000 picoseconds. - Weight::from_parts(93_527_000, 14353) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: SystemMaker Infos (r:2 w:0) - /// Proof Skipped: SystemMaker Infos (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: Tokens Accounts (r:2 w:0) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - fn on_idle() -> Weight { - // Proof Size summary in bytes: - // Measured: `709` - // Estimated: `11344` - // Minimum execution time: 591_941 nanoseconds. - Weight::from_parts(594_646_000, 11344) - .saturating_add(T::DbWeight::get().reads(5)) - } -} - // For backwards compatibility and tests impl WeightInfo for () { /// Storage: SystemMaker Infos (r:1 w:1) /// Proof Skipped: SystemMaker Infos (max_values: None, max_size: None, mode: Measured) fn set_config() -> Weight { // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `2551` - // Minimum execution time: 27_575_000 picoseconds. - Weight::from_parts(28_533_000, 2551) + // Measured: `109` + // Estimated: `3574` + // Minimum execution time: 32_767_000 picoseconds. + Weight::from_parts(33_874_000, 3574) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -153,10 +81,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn charge() -> Weight { // Proof Size summary in bytes: - // Measured: `1395` - // Estimated: `14262` - // Minimum execution time: 99_892_000 picoseconds. - Weight::from_parts(104_941_000, 14262) + // Measured: `1402` + // Estimated: `6196` + // Minimum execution time: 119_870_000 picoseconds. + Weight::from_parts(121_960_000, 6196) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -166,8 +94,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 21_703_000 picoseconds. - Weight::from_parts(22_199_000, 0) + // Minimum execution time: 22_064_000 picoseconds. + Weight::from_parts(22_538_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Tokens Accounts (r:2 w:2) @@ -178,10 +106,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn payout() -> Weight { // Proof Size summary in bytes: - // Measured: `1486` - // Estimated: `14353` - // Minimum execution time: 92_259_000 picoseconds. - Weight::from_parts(93_527_000, 14353) + // Measured: `1461` + // Estimated: `6196` + // Minimum execution time: 111_864_000 picoseconds. + Weight::from_parts(113_839_000, 6196) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -193,10 +121,10 @@ impl WeightInfo for () { /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) fn on_idle() -> Weight { // Proof Size summary in bytes: - // Measured: `709` - // Estimated: `11344` - // Minimum execution time: 591_941 nanoseconds. - Weight::from_parts(594_646_000, 11344) - .saturating_add(RocksDbWeight::get().reads(5)) + // Measured: `894` + // Estimated: `6834` + // Minimum execution time: 54_117_000 picoseconds. + Weight::from_parts(56_635_000, 6834) + .saturating_add(RocksDbWeight::get().reads(5_u64)) } } diff --git a/pallets/system-staking/src/mock.rs b/pallets/system-staking/src/mock.rs index 0137a7964..756346199 100644 --- a/pallets/system-staking/src/mock.rs +++ b/pallets/system-staking/src/mock.rs @@ -331,8 +331,6 @@ impl bifrost_slp::Config for Runtime { type BifrostSlpx = SlpxInterface; type AccountConverter = SubAccountIndexMultiLocationConvertor; type ParachainId = ParachainId; - type XcmRouter = (); - type XcmExecutor = (); type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; type MaxRefundPerBlock = MaxRefundPerBlock; @@ -380,7 +378,7 @@ impl system_staking::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Currencies; type EnsureConfirmAsGovernance = EnsureRoot; - type WeightInfo = system_staking::weights::BifrostWeight; + type WeightInfo = (); type FarmingInfo = Farming; type VtokenMintingInterface = VtokenMinting; type TreasuryAccount = TreasuryAccount; @@ -485,13 +483,6 @@ impl ExtBuilder { ]) } - #[cfg(feature = "runtime-benchmarks")] - pub fn one_hundred_precision_for_each_currency_type_for_whitelist_account(self) -> Self { - use frame_benchmarking::whitelisted_caller; - let whitelist_caller: AccountId = whitelisted_caller(); - self.balances(vec![(whitelist_caller.clone(), KSM, 100_000_000_000_000)]) - } - pub fn build(self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); diff --git a/pallets/system-staking/src/weights.rs b/pallets/system-staking/src/weights.rs index 1c0fc58a5..fa40d07ab 100644 --- a/pallets/system-staking/src/weights.rs +++ b/pallets/system-staking/src/weights.rs @@ -25,10 +25,9 @@ //! Autogenerated weights for bifrost_system_staking //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: // target/release/bifrost @@ -43,15 +42,14 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/system-staking/src/weights.rs -// --template=./frame-weight-template.hbs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_system_staking. pub trait WeightInfo { @@ -64,94 +62,6 @@ pub trait WeightInfo { fn delete_token() -> Weight; } -/// Weights for bifrost_system_staking using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: SystemStaking TokenList (r:1 w:0) - /// Proof Skipped: SystemStaking TokenList (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: SystemStaking Round (r:1 w:0) - /// Proof Skipped: SystemStaking Round (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: SystemStaking TokenStatus (r:2 w:0) - /// Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) - fn on_initialize() -> Weight { - // Proof Size summary in bytes: - // Measured: `507` - // Estimated: `7461` - // Minimum execution time: 28_021_000 picoseconds. - Weight::from_parts(28_766_000, 7461) - .saturating_add(T::DbWeight::get().reads(4_u64)) - } - /// Storage: SystemStaking TokenStatus (r:1 w:1) - /// Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) - /// Storage: SystemStaking TokenList (r:1 w:1) - /// Proof Skipped: SystemStaking TokenList (max_values: Some(1), max_size: None, mode: Measured) - fn token_config() -> Weight { - // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `3188` - // Minimum execution time: 36_840_000 picoseconds. - Weight::from_parts(37_852_000, 3188) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: SystemStaking TokenStatus (r:1 w:1) - /// Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) - /// Storage: Farming PoolInfos (r:1 w:0) - /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) - fn refresh_token_info() -> Weight { - // Proof Size summary in bytes: - // Measured: `402` - // Estimated: `5754` - // Minimum execution time: 51_174_000 picoseconds. - Weight::from_parts(52_517_000, 5754) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: SystemStaking TokenStatus (r:1 w:0) - /// Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:1 w:0) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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) - fn payout() -> Weight { - // Proof Size summary in bytes: - // Measured: `1189` - // Estimated: `11283` - // Minimum execution time: 63_134_000 picoseconds. - Weight::from_parts(64_103_000, 11283) - .saturating_add(T::DbWeight::get().reads(4_u64)) - } - fn on_redeem_success() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_739_000 picoseconds. - Weight::from_parts(1_947_000, 0) - } - fn on_redeemed() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_940_000 picoseconds. - Weight::from_parts(2_023_000, 0) - } - /// Storage: SystemStaking TokenList (r:1 w:1) - /// Proof Skipped: SystemStaking TokenList (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: SystemStaking TokenStatus (r:0 w:1) - /// Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) - fn delete_token() -> Weight { - // Proof Size summary in bytes: - // Measured: `169` - // Estimated: `833` - // Minimum execution time: 19_516_000 picoseconds. - Weight::from_parts(20_535_000, 833) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } -} - // For backwards compatibility and tests impl WeightInfo for () { /// Storage: SystemStaking TokenList (r:1 w:0) @@ -162,10 +72,10 @@ impl WeightInfo for () { /// Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) fn on_initialize() -> Weight { // Proof Size summary in bytes: - // Measured: `507` - // Estimated: `7461` - // Minimum execution time: 28_021_000 picoseconds. - Weight::from_parts(28_766_000, 7461) + // Measured: `445` + // Estimated: `6385` + // Minimum execution time: 30_023_000 picoseconds. + Weight::from_parts(30_834_000, 6385) .saturating_add(RocksDbWeight::get().reads(4_u64)) } /// Storage: SystemStaking TokenStatus (r:1 w:1) @@ -175,9 +85,9 @@ impl WeightInfo for () { fn token_config() -> Weight { // Proof Size summary in bytes: // Measured: `109` - // Estimated: `3188` - // Minimum execution time: 36_840_000 picoseconds. - Weight::from_parts(37_852_000, 3188) + // Estimated: `3574` + // Minimum execution time: 44_695_000 picoseconds. + Weight::from_parts(45_801_000, 3574) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -187,10 +97,10 @@ impl WeightInfo for () { /// Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) fn refresh_token_info() -> Weight { // Proof Size summary in bytes: - // Measured: `402` - // Estimated: `5754` - // Minimum execution time: 51_174_000 picoseconds. - Weight::from_parts(52_517_000, 5754) + // Measured: `403` + // Estimated: `3868` + // Minimum execution time: 56_032_000 picoseconds. + Weight::from_parts(57_981_000, 3868) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -204,25 +114,25 @@ impl WeightInfo for () { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) fn payout() -> Weight { // Proof Size summary in bytes: - // Measured: `1189` - // Estimated: `11283` - // Minimum execution time: 63_134_000 picoseconds. - Weight::from_parts(64_103_000, 11283) + // Measured: `1190` + // Estimated: `4655` + // Minimum execution time: 71_558_000 picoseconds. + Weight::from_parts(72_649_000, 4655) .saturating_add(RocksDbWeight::get().reads(4_u64)) } fn on_redeem_success() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_739_000 picoseconds. - Weight::from_parts(1_947_000, 0) + // Minimum execution time: 1_672_000 picoseconds. + Weight::from_parts(2_317_000, 0) } fn on_redeemed() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_940_000 picoseconds. - Weight::from_parts(2_023_000, 0) + // Minimum execution time: 2_053_000 picoseconds. + Weight::from_parts(2_416_000, 0) } /// Storage: SystemStaking TokenList (r:1 w:1) /// Proof Skipped: SystemStaking TokenList (max_values: Some(1), max_size: None, mode: Measured) @@ -231,9 +141,9 @@ impl WeightInfo for () { fn delete_token() -> Weight { // Proof Size summary in bytes: // Measured: `169` - // Estimated: `833` - // Minimum execution time: 19_516_000 picoseconds. - Weight::from_parts(20_535_000, 833) + // Estimated: `1654` + // Minimum execution time: 24_359_000 picoseconds. + Weight::from_parts(25_049_000, 1654) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } diff --git a/pallets/token-issuer/src/weights.rs b/pallets/token-issuer/src/weights.rs index 81c7d2879..7ffa3b23c 100644 --- a/pallets/token-issuer/src/weights.rs +++ b/pallets/token-issuer/src/weights.rs @@ -25,10 +25,9 @@ //! Autogenerated weights for bifrost_token_issuer //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: // target/release/bifrost @@ -43,15 +42,14 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/token-issuer/src/weights.rs -// --template=./frame-weight-template.hbs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_token_issuer. pub trait WeightInfo { @@ -63,87 +61,6 @@ pub trait WeightInfo { fn transfer() -> Weight; } -/// Weights for bifrost_token_issuer using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: TokenIssuer IssueWhiteList (r:1 w:1) - /// Proof Skipped: TokenIssuer IssueWhiteList (max_values: None, max_size: None, mode: Measured) - fn add_to_issue_whitelist() -> Weight { - // Proof Size summary in bytes: - // Measured: `142` - // Estimated: `2617` - // Minimum execution time: 32_562_000 picoseconds. - Weight::from_parts(33_435_000, 2617) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: TokenIssuer IssueWhiteList (r:1 w:1) - /// Proof Skipped: TokenIssuer IssueWhiteList (max_values: None, max_size: None, mode: Measured) - fn remove_from_issue_whitelist() -> Weight { - // Proof Size summary in bytes: - // Measured: `252` - // Estimated: `2727` - // Minimum execution time: 31_042_000 picoseconds. - Weight::from_parts(31_701_000, 2727) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: TokenIssuer TransferWhiteList (r:1 w:1) - /// Proof Skipped: TokenIssuer TransferWhiteList (max_values: None, max_size: None, mode: Measured) - fn add_to_transfer_whitelist() -> Weight { - // Proof Size summary in bytes: - // Measured: `142` - // Estimated: `2617` - // Minimum execution time: 31_878_000 picoseconds. - Weight::from_parts(32_550_000, 2617) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: TokenIssuer TransferWhiteList (r:1 w:1) - /// Proof Skipped: TokenIssuer TransferWhiteList (max_values: None, max_size: None, mode: Measured) - fn remove_from_transfer_whitelist() -> Weight { - // Proof Size summary in bytes: - // Measured: `252` - // Estimated: `2727` - // Minimum execution time: 35_599_000 picoseconds. - Weight::from_parts(36_101_000, 2727) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: TokenIssuer IssueWhiteList (r:1 w:0) - /// Proof Skipped: TokenIssuer IssueWhiteList (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - fn issue() -> Weight { - // Proof Size summary in bytes: - // Measured: `1862` - // Estimated: `13780` - // Minimum execution time: 91_641_000 picoseconds. - Weight::from_parts(93_160_000, 13780) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: TokenIssuer TransferWhiteList (r:1 w:0) - /// Proof Skipped: TokenIssuer TransferWhiteList (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - fn transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `2012` - // Estimated: `14160` - // Minimum execution time: 104_480_000 picoseconds. - Weight::from_parts(106_402_000, 14160) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } -} - // For backwards compatibility and tests impl WeightInfo for () { /// Storage: TokenIssuer IssueWhiteList (r:1 w:1) @@ -151,9 +68,9 @@ impl WeightInfo for () { fn add_to_issue_whitelist() -> Weight { // Proof Size summary in bytes: // Measured: `142` - // Estimated: `2617` - // Minimum execution time: 32_562_000 picoseconds. - Weight::from_parts(33_435_000, 2617) + // Estimated: `3607` + // Minimum execution time: 32_693_000 picoseconds. + Weight::from_parts(33_651_000, 3607) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -161,10 +78,10 @@ impl WeightInfo for () { /// Proof Skipped: TokenIssuer IssueWhiteList (max_values: None, max_size: None, mode: Measured) fn remove_from_issue_whitelist() -> Weight { // Proof Size summary in bytes: - // Measured: `252` - // Estimated: `2727` - // Minimum execution time: 31_042_000 picoseconds. - Weight::from_parts(31_701_000, 2727) + // Measured: `220` + // Estimated: `3685` + // Minimum execution time: 34_136_000 picoseconds. + Weight::from_parts(35_196_000, 3685) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -173,9 +90,9 @@ impl WeightInfo for () { fn add_to_transfer_whitelist() -> Weight { // Proof Size summary in bytes: // Measured: `142` - // Estimated: `2617` - // Minimum execution time: 31_878_000 picoseconds. - Weight::from_parts(32_550_000, 2617) + // Estimated: `3607` + // Minimum execution time: 32_485_000 picoseconds. + Weight::from_parts(33_735_000, 3607) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -183,10 +100,10 @@ impl WeightInfo for () { /// Proof Skipped: TokenIssuer TransferWhiteList (max_values: None, max_size: None, mode: Measured) fn remove_from_transfer_whitelist() -> Weight { // Proof Size summary in bytes: - // Measured: `252` - // Estimated: `2727` - // Minimum execution time: 35_599_000 picoseconds. - Weight::from_parts(36_101_000, 2727) + // Measured: `220` + // Estimated: `3685` + // Minimum execution time: 33_573_000 picoseconds. + Weight::from_parts(34_609_000, 3685) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -200,10 +117,10 @@ impl WeightInfo for () { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) fn issue() -> Weight { // Proof Size summary in bytes: - // Measured: `1862` - // Estimated: `13780` - // Minimum execution time: 91_641_000 picoseconds. - Weight::from_parts(93_160_000, 13780) + // Measured: `1870` + // Estimated: `5335` + // Minimum execution time: 99_796_000 picoseconds. + Weight::from_parts(100_707_000, 5335) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -215,10 +132,10 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) fn transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `2012` - // Estimated: `14160` - // Minimum execution time: 104_480_000 picoseconds. - Weight::from_parts(106_402_000, 14160) + // Measured: `1989` + // Estimated: `6176` + // Minimum execution time: 114_723_000 picoseconds. + Weight::from_parts(115_788_000, 6176) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } diff --git a/pallets/ve-minting/Cargo.toml b/pallets/ve-minting/Cargo.toml index fed867795..eb165fe72 100644 --- a/pallets/ve-minting/Cargo.toml +++ b/pallets/ve-minting/Cargo.toml @@ -65,5 +65,7 @@ runtime-benchmarks = [ "pallet-collective/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", ] try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/ve-minting/src/benchmarking.rs b/pallets/ve-minting/src/benchmarking.rs index aef53bf09..ed2707f04 100644 --- a/pallets/ve-minting/src/benchmarking.rs +++ b/pallets/ve-minting/src/benchmarking.rs @@ -165,5 +165,5 @@ benchmarks! { T::MultiCurrency::deposit(CurrencyId::Native(TokenSymbol::BNC), &account("seed",1,1), BalanceOf::::unique_saturated_from(100_000_000_000_000u128))?; }: _(RawOrigin::Root,account("seed",1,1),Some((7 * 86400 / 12u32).into()),rewards) - // impl_benchmark_test_suite!(VeMinting,crate::mock::ExtBuilder::default().build(),crate::mock::Runtime); + impl_benchmark_test_suite!(VeMinting,crate::mock::ExtBuilder::default().build(),crate::mock::Runtime); } diff --git a/pallets/ve-minting/src/mock.rs b/pallets/ve-minting/src/mock.rs index 2e8e57497..3e67d3237 100644 --- a/pallets/ve-minting/src/mock.rs +++ b/pallets/ve-minting/src/mock.rs @@ -275,7 +275,7 @@ parameter_types! { impl bifrost_ve_minting::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Currencies; - type ControlOrigin = EnsureSignedBy; + type ControlOrigin = EnsureRoot; type TokenType = VeMintingTokenType; type VeMintingPalletId = VeMintingPalletId; type IncentivePalletId = IncentivePalletId; @@ -377,8 +377,6 @@ impl bifrost_slp::Config for Runtime { type BifrostSlpx = SlpxInterface; type AccountConverter = SubAccountIndexMultiLocationConvertor; type ParachainId = ParachainId; - type XcmRouter = (); - type XcmExecutor = (); type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; type MaxRefundPerBlock = MaxRefundPerBlock; @@ -484,13 +482,6 @@ impl ExtBuilder { ]) } - #[cfg(feature = "runtime-benchmarks")] - pub fn one_hundred_precision_for_each_currency_type_for_whitelist_account(self) -> Self { - use frame_benchmarking::whitelisted_caller; - let whitelist_caller: AccountId = whitelisted_caller(); - self.balances(vec![(whitelist_caller.clone(), KSM, 100_000_000_000_000)]) - } - pub fn build(self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); diff --git a/pallets/ve-minting/src/tests.rs b/pallets/ve-minting/src/tests.rs index 3f897372a..a330c1285 100644 --- a/pallets/ve-minting/src/tests.rs +++ b/pallets/ve-minting/src/tests.rs @@ -37,11 +37,7 @@ fn _checkpoint() { end: System::block_number() + 365 * 86400 / 12, }; - assert_ok!(VeMinting::set_config( - RuntimeOrigin::signed(ALICE), - Some(0), - Some(7 * 86400 / 12) - )); + assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); System::set_block_number(System::block_number() + 20); assert_ok!(VeMinting::_checkpoint(&BOB, old_locked, new_locked)); assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(7499936934420)); @@ -53,11 +49,7 @@ fn update_reward() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { asset_registry(); System::set_block_number(System::block_number() + 20); - assert_ok!(VeMinting::set_config( - RuntimeOrigin::signed(ALICE), - Some(0), - Some(7 * 86400 / 12) - )); + assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); System::set_block_number(System::block_number() + 40); assert_ok!(VeMinting::create_lock_inner( @@ -96,11 +88,7 @@ fn notify_reward_amount() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { asset_registry(); System::set_block_number(System::block_number() + 20); - assert_ok!(VeMinting::set_config( - RuntimeOrigin::signed(ALICE), - Some(0), - Some(7 * 86400 / 12) - )); + assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); System::set_block_number(System::block_number() + 40); assert_noop!( @@ -122,7 +110,7 @@ fn notify_reward_amount() { let rewards = vec![(KSM, 1_000_000_000)]; assert_ok!(VeMinting::notify_rewards( - RuntimeOrigin::signed(ALICE), + RuntimeOrigin::root(), ALICE, Some(7 * 86400 / 12), rewards.clone() @@ -136,7 +124,7 @@ fn notify_reward_amount() { assert_ok!(VeMinting::get_rewards_inner(&BOB)); assert_eq!(Tokens::free_balance(KSM, &BOB), 999986398); assert_ok!(VeMinting::notify_rewards( - RuntimeOrigin::signed(ALICE), + RuntimeOrigin::root(), ALICE, Some(7 * 86400 / 12), rewards @@ -165,7 +153,7 @@ fn create_lock_to_withdraw() { asset_registry(); System::set_block_number(System::block_number() + 7 * 86400 / 12); // a week assert_ok!(VeMinting::set_config( - RuntimeOrigin::signed(ALICE), + RuntimeOrigin::root(), Some(4 * 365 * 86400 / 12), Some(7 * 86400 / 12) )); @@ -178,7 +166,7 @@ fn create_lock_to_withdraw() { let rewards = vec![(KSM, 1000)]; assert_ok!(VeMinting::notify_rewards( - RuntimeOrigin::signed(ALICE), + RuntimeOrigin::root(), ALICE, Some(7 * 86400 / 12), rewards diff --git a/pallets/ve-minting/src/weights.rs b/pallets/ve-minting/src/weights.rs index d03c97c21..57f2ed4f8 100644 --- a/pallets/ve-minting/src/weights.rs +++ b/pallets/ve-minting/src/weights.rs @@ -25,13 +25,12 @@ //! Autogenerated weights for bifrost_ve_minting //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-polkadot-local"), DB CACHE: 1024 +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-polkadot-local"), DB CACHE: 1024 // Executed Command: -// ./target/release/bifrost +// target/release/bifrost // benchmark // pallet // --chain=bifrost-polkadot-local @@ -42,18 +41,15 @@ // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --header=./HEADER-GPL3 -// --output=./weight.rs -// --template -// ./frame-weight-template.hbs +// --output=./pallets/ve-minting/src/weights.rs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_ve_minting. pub trait WeightInfo { @@ -66,264 +62,6 @@ pub trait WeightInfo { fn notify_rewards() -> Weight; } -/// Weights for bifrost_ve_minting using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: VeMinting VeConfigs (r:1 w:1) - /// Proof Skipped: VeMinting VeConfigs (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: System Number (r:1 w:0) - /// Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: System ExecutionPhase (r:1 w:0) - /// Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) - /// Storage: System EventCount (r:1 w:1) - /// Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: System Events (r:1 w:1) - /// Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) - fn set_config() -> Weight { - // Proof Size summary in bytes: - // Measured: `200` - // Estimated: `2888` - // Minimum execution time: 28_607_000 picoseconds. - Weight::from_parts(29_455_000, 2888) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: VeMinting VeConfigs (r:1 w:0) - /// Proof Skipped: VeMinting VeConfigs (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting Locked (r:1 w:1) - /// Proof Skipped: VeMinting Locked (max_values: None, max_size: None, mode: Measured) - /// Storage: System Number (r:1 w:0) - /// Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VeMinting Supply (r:1 w:1) - /// Proof Skipped: VeMinting Supply (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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: System ExecutionPhase (r:1 w:0) - /// Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) - /// Storage: System EventCount (r:1 w:1) - /// Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: System Events (r:1 w:1) - /// Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting IncentiveConfigs (r:1 w:1) - /// Proof Skipped: VeMinting IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting Epoch (r:1 w:1) - /// Proof Skipped: VeMinting Epoch (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting PointHistory (r:1 w:1) - /// Proof Skipped: VeMinting PointHistory (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting UserPointEpoch (r:1 w:1) - /// Proof Skipped: VeMinting UserPointEpoch (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting Rewards (r:1 w:0) - /// Proof Skipped: VeMinting Rewards (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting SlopeChanges (r:2 w:1) - /// Proof Skipped: VeMinting SlopeChanges (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting UserPointHistory (r:0 w:1) - /// Proof Skipped: VeMinting UserPointHistory (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting UserRewardPerTokenPaid (r:0 w:1) - /// Proof Skipped: VeMinting UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) - fn create_lock() -> Weight { - // Proof Size summary in bytes: - // Measured: `1598` - // Estimated: `52464` - // Minimum execution time: 224_417_000 picoseconds. - Weight::from_parts(228_293_000, 52464) - .saturating_add(T::DbWeight::get().reads(19_u64)) - .saturating_add(T::DbWeight::get().writes(14_u64)) - } - /// Storage: VeMinting VeConfigs (r:1 w:0) - /// Proof Skipped: VeMinting VeConfigs (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting Locked (r:1 w:1) - /// Proof Skipped: VeMinting Locked (max_values: None, max_size: None, mode: Measured) - /// Storage: System Number (r:1 w:0) - /// Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VeMinting Supply (r:1 w:1) - /// Proof Skipped: VeMinting Supply (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: System ExecutionPhase (r:1 w:0) - /// Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) - /// Storage: System EventCount (r:1 w:1) - /// Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: System Events (r:1 w:1) - /// Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting IncentiveConfigs (r:1 w:1) - /// Proof Skipped: VeMinting IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting Epoch (r:1 w:1) - /// Proof Skipped: VeMinting Epoch (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting PointHistory (r:1 w:1) - /// Proof Skipped: VeMinting PointHistory (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting UserPointEpoch (r:1 w:1) - /// Proof Skipped: VeMinting UserPointEpoch (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting UserPointHistory (r:1 w:1) - /// Proof Skipped: VeMinting UserPointHistory (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting Rewards (r:1 w:1) - /// Proof Skipped: VeMinting Rewards (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting UserRewardPerTokenPaid (r:1 w:1) - /// Proof Skipped: VeMinting UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting SlopeChanges (r:1 w:1) - /// Proof Skipped: VeMinting SlopeChanges (max_values: None, max_size: None, mode: Measured) - fn increase_amount() -> Weight { - // Proof Size summary in bytes: - // Measured: `2304` - // Estimated: `61514` - // Minimum execution time: 254_977_000 picoseconds. - Weight::from_parts(258_707_000, 61514) - .saturating_add(T::DbWeight::get().reads(19_u64)) - .saturating_add(T::DbWeight::get().writes(14_u64)) - } - /// Storage: VeMinting VeConfigs (r:1 w:0) - /// Proof Skipped: VeMinting VeConfigs (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting Locked (r:1 w:1) - /// Proof Skipped: VeMinting Locked (max_values: None, max_size: None, mode: Measured) - /// Storage: System Number (r:1 w:0) - /// Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VeMinting Supply (r:1 w:1) - /// Proof Skipped: VeMinting Supply (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting IncentiveConfigs (r:1 w:1) - /// Proof Skipped: VeMinting IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting Epoch (r:1 w:1) - /// Proof Skipped: VeMinting Epoch (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting PointHistory (r:1 w:1) - /// Proof Skipped: VeMinting PointHistory (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting UserPointEpoch (r:1 w:1) - /// Proof Skipped: VeMinting UserPointEpoch (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting UserPointHistory (r:1 w:1) - /// Proof Skipped: VeMinting UserPointHistory (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting Rewards (r:1 w:1) - /// Proof Skipped: VeMinting Rewards (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting UserRewardPerTokenPaid (r:1 w:1) - /// Proof Skipped: VeMinting UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting SlopeChanges (r:2 w:2) - /// Proof Skipped: VeMinting SlopeChanges (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:1 w:0) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: System ExecutionPhase (r:1 w:0) - /// Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) - /// Storage: System EventCount (r:1 w:1) - /// Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: System Events (r:1 w:1) - /// Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) - fn increase_unlock_time() -> Weight { - // Proof Size summary in bytes: - // Measured: `1715` - // Estimated: `46946` - // Minimum execution time: 204_412_000 picoseconds. - Weight::from_parts(213_930_000, 46946) - .saturating_add(T::DbWeight::get().reads(17_u64)) - .saturating_add(T::DbWeight::get().writes(13_u64)) - } - /// Storage: VeMinting Locked (r:1 w:1) - /// Proof Skipped: VeMinting Locked (max_values: None, max_size: None, mode: Measured) - /// Storage: System Number (r:1 w:0) - /// Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VeMinting Supply (r:1 w:1) - /// Proof Skipped: VeMinting Supply (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: System ExecutionPhase (r:1 w:0) - /// Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) - /// Storage: System EventCount (r:1 w:1) - /// Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: System Events (r:1 w:1) - /// Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting IncentiveConfigs (r:1 w:1) - /// Proof Skipped: VeMinting IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting Epoch (r:1 w:1) - /// Proof Skipped: VeMinting Epoch (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting PointHistory (r:1 w:105) - /// Proof Skipped: VeMinting PointHistory (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting SlopeChanges (r:104 w:0) - /// Proof Skipped: VeMinting SlopeChanges (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting UserPointEpoch (r:1 w:1) - /// Proof Skipped: VeMinting UserPointEpoch (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting UserPointHistory (r:1 w:1) - /// Proof Skipped: VeMinting UserPointHistory (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting Rewards (r:1 w:1) - /// Proof Skipped: VeMinting Rewards (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting UserRewardPerTokenPaid (r:1 w:1) - /// Proof Skipped: VeMinting UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) - fn withdraw() -> Weight { - // Proof Size summary in bytes: - // Measured: `2249` - // Estimated: `312980` - // Minimum execution time: 1_107_038_000 picoseconds. - Weight::from_parts(1_122_759_000, 312980) - .saturating_add(T::DbWeight::get().reads(121_u64)) - .saturating_add(T::DbWeight::get().writes(118_u64)) - } - /// Storage: VeMinting IncentiveConfigs (r:1 w:1) - /// Proof Skipped: VeMinting IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: System Number (r:1 w:0) - /// Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VeMinting Epoch (r:1 w:0) - /// Proof Skipped: VeMinting Epoch (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting PointHistory (r:1 w:0) - /// Proof Skipped: VeMinting PointHistory (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting SlopeChanges (r:104 w:0) - /// Proof Skipped: VeMinting SlopeChanges (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting UserPointEpoch (r:1 w:0) - /// Proof Skipped: VeMinting UserPointEpoch (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting UserPointHistory (r:1 w:0) - /// Proof Skipped: VeMinting UserPointHistory (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting Rewards (r:1 w:1) - /// Proof Skipped: VeMinting Rewards (max_values: None, max_size: None, mode: Measured) - /// Storage: VeMinting UserRewardPerTokenPaid (r:1 w:1) - /// Proof Skipped: VeMinting UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:3 w:3) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: System ExecutionPhase (r:1 w:0) - /// Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) - /// Storage: System EventCount (r:1 w:1) - /// Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: System Events (r:1 w:1) - /// Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) - fn get_rewards() -> Weight { - // Proof Size summary in bytes: - // Measured: `1465` - // Estimated: `293752` - // Minimum execution time: 604_909_000 picoseconds. - Weight::from_parts(615_238_000, 293752) - .saturating_add(T::DbWeight::get().reads(118_u64)) - .saturating_add(T::DbWeight::get().writes(8_u64)) - } - /// Storage: VeMinting IncentiveConfigs (r:1 w:1) - /// Proof Skipped: VeMinting IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: System Number (r:1 w:0) - /// Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: System ExecutionPhase (r:1 w:0) - /// Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) - /// Storage: System EventCount (r:1 w:1) - /// Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: System Events (r:1 w:1) - /// Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting Epoch (r:1 w:0) - /// Proof Skipped: VeMinting Epoch (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VeMinting PointHistory (r:1 w:0) - /// Proof Skipped: VeMinting PointHistory (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - fn notify_rewards() -> Weight { - // Proof Size summary in bytes: - // Measured: `462` - // Estimated: `12512` - // Minimum execution time: 132_807_000 picoseconds. - Weight::from_parts(140_857_000, 12512) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) - } -} - // For backwards compatibility and tests impl WeightInfo for () { /// Storage: VeMinting VeConfigs (r:1 w:1) @@ -339,9 +77,9 @@ impl WeightInfo for () { fn set_config() -> Weight { // Proof Size summary in bytes: // Measured: `200` - // Estimated: `2888` - // Minimum execution time: 28_607_000 picoseconds. - Weight::from_parts(29_455_000, 2888) + // Estimated: `1685` + // Minimum execution time: 32_840_000 picoseconds. + Weight::from_parts(34_249_000, 1685) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -383,10 +121,10 @@ impl WeightInfo for () { /// Proof Skipped: VeMinting UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) fn create_lock() -> Weight { // Proof Size summary in bytes: - // Measured: `1598` - // Estimated: `52464` - // Minimum execution time: 224_417_000 picoseconds. - Weight::from_parts(228_293_000, 52464) + // Measured: `1439` + // Estimated: `7379` + // Minimum execution time: 254_132_000 picoseconds. + Weight::from_parts(257_959_000, 7379) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().writes(14_u64)) } @@ -428,10 +166,10 @@ impl WeightInfo for () { /// Proof Skipped: VeMinting SlopeChanges (max_values: None, max_size: None, mode: Measured) fn increase_amount() -> Weight { // Proof Size summary in bytes: - // Measured: `2304` - // Estimated: `61514` - // Minimum execution time: 254_977_000 picoseconds. - Weight::from_parts(258_707_000, 61514) + // Measured: `2083` + // Estimated: `6176` + // Minimum execution time: 282_837_000 picoseconds. + Weight::from_parts(287_187_000, 6176) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().writes(14_u64)) } @@ -469,10 +207,10 @@ impl WeightInfo for () { /// Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) fn increase_unlock_time() -> Weight { // Proof Size summary in bytes: - // Measured: `1715` - // Estimated: `46946` - // Minimum execution time: 204_412_000 picoseconds. - Weight::from_parts(213_930_000, 46946) + // Measured: `1589` + // Estimated: `7529` + // Minimum execution time: 225_251_000 picoseconds. + Weight::from_parts(229_018_000, 7529) .saturating_add(RocksDbWeight::get().reads(17_u64)) .saturating_add(RocksDbWeight::get().writes(13_u64)) } @@ -512,10 +250,10 @@ impl WeightInfo for () { /// Proof Skipped: VeMinting UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) fn withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `2249` - // Estimated: `312980` - // Minimum execution time: 1_107_038_000 picoseconds. - Weight::from_parts(1_122_759_000, 312980) + // Measured: `2059` + // Estimated: `260449` + // Minimum execution time: 1_285_654_000 picoseconds. + Weight::from_parts(1_315_018_000, 260449) .saturating_add(RocksDbWeight::get().reads(121_u64)) .saturating_add(RocksDbWeight::get().writes(118_u64)) } @@ -537,6 +275,8 @@ impl WeightInfo for () { /// Proof Skipped: VeMinting Rewards (max_values: None, max_size: None, mode: Measured) /// Storage: VeMinting UserRewardPerTokenPaid (r:1 w:1) /// Proof Skipped: VeMinting UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) + /// Storage: Balances TotalIssuance (r:1 w:1) + /// Proof: Balances TotalIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: System Account (r:3 w:3) /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) /// Storage: System ExecutionPhase (r:1 w:0) @@ -547,12 +287,12 @@ impl WeightInfo for () { /// Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) fn get_rewards() -> Weight { // Proof Size summary in bytes: - // Measured: `1465` - // Estimated: `293752` - // Minimum execution time: 604_909_000 picoseconds. - Weight::from_parts(615_238_000, 293752) - .saturating_add(RocksDbWeight::get().reads(118_u64)) - .saturating_add(RocksDbWeight::get().writes(8_u64)) + // Measured: `1384` + // Estimated: `259774` + // Minimum execution time: 752_030_000 picoseconds. + Weight::from_parts(778_014_000, 259774) + .saturating_add(RocksDbWeight::get().reads(119_u64)) + .saturating_add(RocksDbWeight::get().writes(9_u64)) } /// Storage: VeMinting IncentiveConfigs (r:1 w:1) /// Proof Skipped: VeMinting IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) @@ -570,13 +310,15 @@ impl WeightInfo for () { /// Proof Skipped: VeMinting PointHistory (max_values: None, max_size: None, mode: Measured) /// Storage: System Account (r:2 w:2) /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Balances TotalIssuance (r:1 w:0) + /// Proof: Balances TotalIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) fn notify_rewards() -> Weight { // Proof Size summary in bytes: - // Measured: `462` - // Estimated: `12512` - // Minimum execution time: 132_807_000 picoseconds. - Weight::from_parts(140_857_000, 12512) - .saturating_add(RocksDbWeight::get().reads(9_u64)) + // Measured: `508` + // Estimated: `6196` + // Minimum execution time: 175_754_000 picoseconds. + Weight::from_parts(179_695_000, 6196) + .saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } } diff --git a/pallets/vesting/src/benchmarking.rs b/pallets/vesting/src/benchmarking.rs index b7e1f94df..93a0da597 100644 --- a/pallets/vesting/src/benchmarking.rs +++ b/pallets/vesting/src/benchmarking.rs @@ -170,8 +170,6 @@ benchmarks! { T::Currency::make_free_balance_be(&caller, BalanceOf::::max_value()); let target: T::AccountId = account("target", 0, SEED); let target_lookup: ::Source = T::Lookup::unlookup(target.clone()); - // Give target existing locks - add_locks::(&target, l as u8); let transfer_amount = T::MinVestedTransfer::get(); @@ -202,8 +200,6 @@ benchmarks! { T::Currency::make_free_balance_be(&source, BalanceOf::::max_value()); let target: T::AccountId = account("target", 0, SEED); let target_lookup: ::Source = T::Lookup::unlookup(target.clone()); - // Give target existing locks - add_locks::(&target, l as u8); let transfer_amount = T::MinVestedTransfer::get(); diff --git a/pallets/vsbond-auction/src/weights.rs b/pallets/vsbond-auction/src/weights.rs index f23330a56..948ee3e44 100644 --- a/pallets/vsbond-auction/src/weights.rs +++ b/pallets/vsbond-auction/src/weights.rs @@ -25,10 +25,9 @@ //! Autogenerated weights for bifrost_vsbond_auction //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: // target/release/bifrost @@ -43,15 +42,14 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/vsbond-auction/src/weights.rs -// --template=./frame-weight-template.hbs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_vsbond_auction. pub trait WeightInfo { @@ -62,104 +60,6 @@ pub trait WeightInfo { fn set_buy_and_sell_transaction_fee_rate() -> Weight; } -/// Weights for bifrost_vsbond_auction using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: VSBondAuction TransactionFee (r:1 w:0) - /// Proof Skipped: VSBondAuction TransactionFee (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: VSBondAuction UserOrderIds (r:1 w:1) - /// Proof Skipped: VSBondAuction UserOrderIds (max_values: None, max_size: None, mode: Measured) - /// Storage: VSBondAuction NextOrderId (r:1 w:1) - /// Proof Skipped: VSBondAuction NextOrderId (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: VSBondAuction TotalOrderInfos (r:0 w:1) - /// Proof Skipped: VSBondAuction TotalOrderInfos (max_values: None, max_size: None, mode: Measured) - fn create_order() -> Weight { - // Proof Size summary in bytes: - // Measured: `1814` - // Estimated: `22799` - // Minimum execution time: 152_647_000 picoseconds. - Weight::from_parts(156_670_000, 22799) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) - } - /// Storage: VSBondAuction TotalOrderInfos (r:1 w:1) - /// Proof Skipped: VSBondAuction TotalOrderInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: VSBondAuction UserOrderIds (r:1 w:1) - /// Proof Skipped: VSBondAuction UserOrderIds (max_values: None, max_size: None, mode: Measured) - fn revoke_order() -> Weight { - // Proof Size summary in bytes: - // Measured: `2079` - // Estimated: `21451` - // Minimum execution time: 142_714_000 picoseconds. - Weight::from_parts(144_325_000, 21451) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) - } - /// Storage: VSBondAuction TotalOrderInfos (r:1 w:1) - /// Proof Skipped: VSBondAuction TotalOrderInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: VSBondAuction TransactionFee (r:1 w:0) - /// Proof Skipped: VSBondAuction TransactionFee (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:4 w:4) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: VSBondAuction UserOrderIds (r:1 w:1) - /// Proof Skipped: VSBondAuction UserOrderIds (max_values: None, max_size: None, mode: Measured) - fn clinch_order() -> Weight { - // Proof Size summary in bytes: - // Measured: `2501` - // Estimated: `30899` - // Minimum execution time: 208_910_000 picoseconds. - Weight::from_parts(211_261_000, 30899) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) - } - /// Storage: VSBondAuction TotalOrderInfos (r:1 w:1) - /// Proof Skipped: VSBondAuction TotalOrderInfos (max_values: None, max_size: None, mode: Measured) - /// Storage: VSBondAuction TransactionFee (r:1 w:0) - /// Proof Skipped: VSBondAuction TransactionFee (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:4 w:4) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - fn partial_clinch_order() -> Weight { - // Proof Size summary in bytes: - // Measured: `2409` - // Estimated: `25647` - // Minimum execution time: 181_617_000 picoseconds. - Weight::from_parts(187_315_000, 25647) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) - } - /// Storage: VSBondAuction TransactionFee (r:1 w:1) - /// Proof Skipped: VSBondAuction TransactionFee (max_values: Some(1), max_size: None, mode: Measured) - fn set_buy_and_sell_transaction_fee_rate() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `499` - // Minimum execution time: 27_702_000 picoseconds. - Weight::from_parts(28_712_000, 499) - .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: VSBondAuction TransactionFee (r:1 w:0) @@ -178,10 +78,10 @@ impl WeightInfo for () { /// Proof Skipped: VSBondAuction TotalOrderInfos (max_values: None, max_size: None, mode: Measured) fn create_order() -> Weight { // Proof Size summary in bytes: - // Measured: `1814` - // Estimated: `22799` - // Minimum execution time: 152_647_000 picoseconds. - Weight::from_parts(156_670_000, 22799) + // Measured: `1789` + // Estimated: `6176` + // Minimum execution time: 175_480_000 picoseconds. + Weight::from_parts(178_938_000, 6176) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -197,10 +97,10 @@ impl WeightInfo for () { /// Proof Skipped: VSBondAuction UserOrderIds (max_values: None, max_size: None, mode: Measured) fn revoke_order() -> Weight { // Proof Size summary in bytes: - // Measured: `2079` - // Estimated: `21451` - // Minimum execution time: 142_714_000 picoseconds. - Weight::from_parts(144_325_000, 21451) + // Measured: `2023` + // Estimated: `6176` + // Minimum execution time: 159_741_000 picoseconds. + Weight::from_parts(162_287_000, 6176) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -218,10 +118,10 @@ impl WeightInfo for () { /// Proof Skipped: VSBondAuction UserOrderIds (max_values: None, max_size: None, mode: Measured) fn clinch_order() -> Weight { // Proof Size summary in bytes: - // Measured: `2501` - // Estimated: `30899` - // Minimum execution time: 208_910_000 picoseconds. - Weight::from_parts(211_261_000, 30899) + // Measured: `2383` + // Estimated: `11362` + // Minimum execution time: 231_797_000 picoseconds. + Weight::from_parts(235_426_000, 11362) .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } @@ -237,10 +137,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn partial_clinch_order() -> Weight { // Proof Size summary in bytes: - // Measured: `2409` - // Estimated: `25647` - // Minimum execution time: 181_617_000 picoseconds. - Weight::from_parts(187_315_000, 25647) + // Measured: `2291` + // Estimated: `11362` + // Minimum execution time: 205_639_000 picoseconds. + Weight::from_parts(208_525_000, 11362) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -249,9 +149,9 @@ impl WeightInfo for () { fn set_buy_and_sell_transaction_fee_rate() -> Weight { // Proof Size summary in bytes: // Measured: `4` - // Estimated: `499` - // Minimum execution time: 27_702_000 picoseconds. - Weight::from_parts(28_712_000, 499) + // Estimated: `1489` + // Minimum execution time: 26_001_000 picoseconds. + Weight::from_parts(26_868_000, 1489) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/pallets/vstoken-conversion/src/mock.rs b/pallets/vstoken-conversion/src/mock.rs index 91f6cab14..56d1d3fc2 100644 --- a/pallets/vstoken-conversion/src/mock.rs +++ b/pallets/vstoken-conversion/src/mock.rs @@ -216,13 +216,6 @@ impl ExtBuilder { ]) } - #[cfg(feature = "runtime-benchmarks")] - pub fn one_hundred_precision_for_each_currency_type_for_whitelist_account(self) -> Self { - use frame_benchmarking::whitelisted_caller; - let whitelist_caller: AccountId = whitelisted_caller(); - self.balances(vec![(whitelist_caller.clone(), KSM, 100_000_000_000_000)]) - } - pub fn build(self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); diff --git a/pallets/vstoken-conversion/src/weights.rs b/pallets/vstoken-conversion/src/weights.rs index fe99eea8e..20bce5e91 100644 --- a/pallets/vstoken-conversion/src/weights.rs +++ b/pallets/vstoken-conversion/src/weights.rs @@ -25,10 +25,9 @@ //! Autogenerated weights for bifrost_vstoken_conversion //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: // target/release/bifrost @@ -43,15 +42,14 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/vstoken-conversion/src/weights.rs -// --template=./frame-weight-template.hbs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_vstoken_conversion. pub trait WeightInfo { @@ -62,90 +60,6 @@ pub trait WeightInfo { fn vstoken_convert_to_vsbond() -> Weight; } -/// Weights for bifrost_vstoken_conversion using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: VstokenConversion ExchangeFee (r:1 w:1) - /// Proof: VstokenConversion ExchangeFee (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - fn set_exchange_fee() -> Weight { - // Proof Size summary in bytes: - // Measured: `180` - // Estimated: `527` - // Minimum execution time: 31_970_000 picoseconds. - Weight::from_parts(32_911_000, 527) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: VstokenConversion ExchangeRate (r:1 w:1) - /// Proof: VstokenConversion ExchangeRate (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) - fn set_exchange_rate() -> Weight { - // Proof Size summary in bytes: - // Measured: `180` - // Estimated: `2489` - // Minimum execution time: 27_446_000 picoseconds. - Weight::from_parts(28_821_000, 2489) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: VstokenConversion RelaychainLease (r:1 w:1) - /// Proof: VstokenConversion RelaychainLease (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn set_relaychain_lease() -> Weight { - // Proof Size summary in bytes: - // Measured: `180` - // Estimated: `499` - // Minimum execution time: 26_708_000 picoseconds. - Weight::from_parts(27_924_000, 499) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Tokens Accounts (r:4 w:4) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:2 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: VstokenConversion RelaychainLease (r:1 w:0) - /// Proof: VstokenConversion RelaychainLease (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VstokenConversion ExchangeRate (r:1 w:0) - /// Proof: VstokenConversion ExchangeRate (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) - /// Storage: VstokenConversion ExchangeFee (r:1 w:0) - /// Proof: VstokenConversion ExchangeFee (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: System Account (r:3 w:3) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:2 w:2) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - fn vsbond_convert_to_vstoken() -> Weight { - // Proof Size summary in bytes: - // Measured: `2424` - // Estimated: `34096` - // Minimum execution time: 227_677_000 picoseconds. - Weight::from_parts(231_016_000, 34096) - .saturating_add(T::DbWeight::get().reads(14_u64)) - .saturating_add(T::DbWeight::get().writes(9_u64)) - } - /// Storage: Tokens Accounts (r:4 w:4) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:2 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: VstokenConversion RelaychainLease (r:1 w:0) - /// Proof: VstokenConversion RelaychainLease (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VstokenConversion ExchangeRate (r:1 w:0) - /// Proof: VstokenConversion ExchangeRate (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) - /// Storage: VstokenConversion ExchangeFee (r:1 w:0) - /// Proof: VstokenConversion ExchangeFee (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: System Account (r:3 w:2) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - fn vstoken_convert_to_vsbond() -> Weight { - // Proof Size summary in bytes: - // Measured: `2415` - // Estimated: `31574` - // Minimum execution time: 215_741_000 picoseconds. - Weight::from_parts(220_044_000, 31574) - .saturating_add(T::DbWeight::get().reads(13_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) - } -} - // For backwards compatibility and tests impl WeightInfo for () { /// Storage: VstokenConversion ExchangeFee (r:1 w:1) @@ -153,9 +67,9 @@ impl WeightInfo for () { fn set_exchange_fee() -> Weight { // Proof Size summary in bytes: // Measured: `180` - // Estimated: `527` - // Minimum execution time: 31_970_000 picoseconds. - Weight::from_parts(32_911_000, 527) + // Estimated: `1517` + // Minimum execution time: 30_744_000 picoseconds. + Weight::from_parts(31_166_000, 1517) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -164,9 +78,9 @@ impl WeightInfo for () { fn set_exchange_rate() -> Weight { // Proof Size summary in bytes: // Measured: `180` - // Estimated: `2489` - // Minimum execution time: 27_446_000 picoseconds. - Weight::from_parts(28_821_000, 2489) + // Estimated: `3479` + // Minimum execution time: 30_215_000 picoseconds. + Weight::from_parts(31_148_000, 3479) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -175,9 +89,9 @@ impl WeightInfo for () { fn set_relaychain_lease() -> Weight { // Proof Size summary in bytes: // Measured: `180` - // Estimated: `499` - // Minimum execution time: 26_708_000 picoseconds. - Weight::from_parts(27_924_000, 499) + // Estimated: `1489` + // Minimum execution time: 28_293_000 picoseconds. + Weight::from_parts(29_337_000, 1489) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -197,10 +111,10 @@ impl WeightInfo for () { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) fn vsbond_convert_to_vstoken() -> Weight { // Proof Size summary in bytes: - // Measured: `2424` - // Estimated: `34096` - // Minimum execution time: 227_677_000 picoseconds. - Weight::from_parts(231_016_000, 34096) + // Measured: `2336` + // Estimated: `11362` + // Minimum execution time: 258_393_000 picoseconds. + Weight::from_parts(262_031_000, 11362) .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(9_u64)) } @@ -220,10 +134,10 @@ impl WeightInfo for () { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) fn vstoken_convert_to_vsbond() -> Weight { // Proof Size summary in bytes: - // Measured: `2415` - // Estimated: `31574` - // Minimum execution time: 215_741_000 picoseconds. - Weight::from_parts(220_044_000, 31574) + // Measured: `2327` + // Estimated: `11362` + // Minimum execution time: 244_708_000 picoseconds. + Weight::from_parts(247_427_000, 11362) .saturating_add(RocksDbWeight::get().reads(13_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } diff --git a/pallets/vtoken-minting/src/mock.rs b/pallets/vtoken-minting/src/mock.rs index 179e380c3..befd4e7ea 100644 --- a/pallets/vtoken-minting/src/mock.rs +++ b/pallets/vtoken-minting/src/mock.rs @@ -353,8 +353,6 @@ impl bifrost_slp::Config for Runtime { type BifrostSlpx = SlpxInterface; type AccountConverter = SubAccountIndexMultiLocationConvertor; type ParachainId = ParachainId; - type XcmRouter = (); - type XcmExecutor = (); type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; type MaxRefundPerBlock = MaxRefundPerBlock; @@ -459,13 +457,6 @@ impl ExtBuilder { ]) } - #[cfg(feature = "runtime-benchmarks")] - pub fn one_hundred_precision_for_each_currency_type_for_whitelist_account(self) -> Self { - use frame_benchmarking::whitelisted_caller; - let whitelist_caller: AccountId = whitelisted_caller(); - self.balances(vec![(whitelist_caller.clone(), KSM, 100_000_000_000_000)]) - } - pub fn build(self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); diff --git a/pallets/vtoken-minting/src/weights.rs b/pallets/vtoken-minting/src/weights.rs index a4a2ff459..9b9d4db34 100644 --- a/pallets/vtoken-minting/src/weights.rs +++ b/pallets/vtoken-minting/src/weights.rs @@ -25,10 +25,9 @@ //! Autogenerated weights for bifrost_vtoken_minting //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: // target/release/bifrost @@ -43,15 +42,14 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/vtoken-minting/src/weights.rs -// --template=./frame-weight-template.hbs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_vtoken_minting. pub trait WeightInfo { @@ -69,220 +67,6 @@ pub trait WeightInfo { fn on_initialize() -> Weight; } -/// Weights for bifrost_vtoken_minting using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: VtokenMinting MinimumMint (r:1 w:1) - /// Proof: VtokenMinting MinimumMint (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - fn set_minimum_mint() -> Weight { - // Proof Size summary in bytes: - // Measured: `725` - // Estimated: `5713` - // Minimum execution time: 41_301_000 picoseconds. - Weight::from_parts(42_784_000, 5713) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: VtokenMinting MinimumRedeem (r:1 w:1) - /// Proof: VtokenMinting MinimumRedeem (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - fn set_minimum_redeem() -> Weight { - // Proof Size summary in bytes: - // Measured: `180` - // Estimated: `2513` - // Minimum execution time: 31_026_000 picoseconds. - Weight::from_parts(32_331_000, 2513) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: VtokenMinting UnlockDuration (r:1 w:1) - /// Proof: VtokenMinting UnlockDuration (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) - fn set_unlock_duration() -> Weight { - // Proof Size summary in bytes: - // Measured: `180` - // Estimated: `2502` - // Minimum execution time: 27_106_000 picoseconds. - Weight::from_parts(28_201_000, 2502) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: VtokenMinting TokenToRebond (r:1 w:1) - /// Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - fn add_support_rebond_token() -> Weight { - // Proof Size summary in bytes: - // Measured: `180` - // Estimated: `2513` - // Minimum execution time: 27_972_000 picoseconds. - Weight::from_parts(28_887_000, 2513) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: VtokenMinting TokenToRebond (r:1 w:1) - /// Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - fn remove_support_rebond_token() -> Weight { - // Proof Size summary in bytes: - // Measured: `230` - // Estimated: `2513` - // Minimum execution time: 33_406_000 picoseconds. - Weight::from_parts(34_381_000, 2513) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: VtokenMinting Fees (r:1 w:1) - /// Proof: VtokenMinting Fees (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - fn set_fees() -> Weight { - // Proof Size summary in bytes: - // Measured: `180` - // Estimated: `503` - // Minimum execution time: 26_295_000 picoseconds. - Weight::from_parts(27_432_000, 503) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: VtokenMinting HookIterationLimit (r:1 w:1) - /// Proof: VtokenMinting HookIterationLimit (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn set_hook_iteration_limit() -> Weight { - // Proof Size summary in bytes: - // Measured: `180` - // Estimated: `499` - // Minimum execution time: 25_306_000 picoseconds. - Weight::from_parts(26_704_000, 499) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// 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: Tokens Accounts (r:3 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - fn mint() -> Weight { - // Proof Size summary in bytes: - // Measured: `2001` - // Estimated: `22900` - // Minimum execution time: 180_996_000 picoseconds. - Weight::from_parts(185_208_000, 22900) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) - } - /// 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: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, 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 OngoingTimeUnit (r:1 w:0) - /// Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) - /// Storage: VtokenMinting UnlockDuration (r:1 w:0) - /// Proof: VtokenMinting UnlockDuration (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) - /// Storage: VtokenMinting UnlockingTotal (r:1 w:1) - /// Proof: VtokenMinting UnlockingTotal (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: VtokenMinting TokenUnlockNextId (r:1 w:1) - /// Proof: VtokenMinting TokenUnlockNextId (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) - /// Storage: VtokenMinting UserUnlockLedger (r:1 w:1) - /// Proof: VtokenMinting UserUnlockLedger (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen) - /// Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:1) - /// Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, mode: MaxEncodedLen) - /// Storage: VtokenMinting TokenUnlockLedger (r:0 w:1) - /// Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - fn redeem() -> Weight { - // Proof Size summary in bytes: - // Measured: `2211` - // Estimated: `40588` - // Minimum execution time: 218_898_000 picoseconds. - Weight::from_parts(223_145_000, 40588) - .saturating_add(T::DbWeight::get().reads(15_u64)) - .saturating_add(T::DbWeight::get().writes(10_u64)) - } - /// Storage: VtokenMinting TokenToRebond (r:1 w:1) - /// Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: VtokenMinting UserUnlockLedger (r:1 w:1) - /// Proof: VtokenMinting UserUnlockLedger (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen) - /// Storage: VtokenMinting TokenUnlockLedger (r:1 w:1) - /// Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:1) - /// Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, mode: MaxEncodedLen) - /// Storage: VtokenMinting UnlockingTotal (r:1 w:1) - /// Proof: VtokenMinting UnlockingTotal (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: Tokens Accounts (r:3 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - fn rebond() -> Weight { - // Proof Size summary in bytes: - // Measured: `2674` - // Estimated: `31449` - // Minimum execution time: 211_834_000 picoseconds. - Weight::from_parts(232_479_000, 31449) - .saturating_add(T::DbWeight::get().reads(12_u64)) - .saturating_add(T::DbWeight::get().writes(10_u64)) - } - /// Storage: VtokenMinting TokenToRebond (r:1 w:1) - /// Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: VtokenMinting TokenUnlockLedger (r:1 w:1) - /// Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:1) - /// Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, mode: MaxEncodedLen) - /// Storage: VtokenMinting UserUnlockLedger (r:1 w:1) - /// Proof: VtokenMinting UserUnlockLedger (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen) - /// Storage: VtokenMinting UnlockingTotal (r:1 w:1) - /// Proof: VtokenMinting UnlockingTotal (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: Tokens Accounts (r:3 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - fn rebond_by_unlock_id() -> Weight { - // Proof Size summary in bytes: - // Measured: `2674` - // Estimated: `31449` - // Minimum execution time: 200_291_000 picoseconds. - Weight::from_parts(203_895_000, 31449) - .saturating_add(T::DbWeight::get().reads(12_u64)) - .saturating_add(T::DbWeight::get().writes(10_u64)) - } - /// Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) - /// Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) - fn on_initialize() -> Weight { - // Proof Size summary in bytes: - // Measured: `211` - // Estimated: `2502` - // Minimum execution time: 12_774_000 picoseconds. - Weight::from_parts(13_337_000, 2502) - .saturating_add(T::DbWeight::get().reads(1_u64)) - } -} - // For backwards compatibility and tests impl WeightInfo for () { /// Storage: VtokenMinting MinimumMint (r:1 w:1) @@ -291,10 +75,10 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) fn set_minimum_mint() -> Weight { // Proof Size summary in bytes: - // Measured: `725` - // Estimated: `5713` - // Minimum execution time: 41_301_000 picoseconds. - Weight::from_parts(42_784_000, 5713) + // Measured: `732` + // Estimated: `4197` + // Minimum execution time: 68_449_000 picoseconds. + Weight::from_parts(70_238_000, 4197) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -303,9 +87,9 @@ impl WeightInfo for () { fn set_minimum_redeem() -> Weight { // Proof Size summary in bytes: // Measured: `180` - // Estimated: `2513` - // Minimum execution time: 31_026_000 picoseconds. - Weight::from_parts(32_331_000, 2513) + // Estimated: `3503` + // Minimum execution time: 44_475_000 picoseconds. + Weight::from_parts(46_842_000, 3503) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -314,9 +98,9 @@ impl WeightInfo for () { fn set_unlock_duration() -> Weight { // Proof Size summary in bytes: // Measured: `180` - // Estimated: `2502` - // Minimum execution time: 27_106_000 picoseconds. - Weight::from_parts(28_201_000, 2502) + // Estimated: `3492` + // Minimum execution time: 44_894_000 picoseconds. + Weight::from_parts(46_294_000, 3492) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -325,9 +109,9 @@ impl WeightInfo for () { fn add_support_rebond_token() -> Weight { // Proof Size summary in bytes: // Measured: `180` - // Estimated: `2513` - // Minimum execution time: 27_972_000 picoseconds. - Weight::from_parts(28_887_000, 2513) + // Estimated: `3503` + // Minimum execution time: 46_545_000 picoseconds. + Weight::from_parts(49_039_000, 3503) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -336,9 +120,9 @@ impl WeightInfo for () { fn remove_support_rebond_token() -> Weight { // Proof Size summary in bytes: // Measured: `230` - // Estimated: `2513` - // Minimum execution time: 33_406_000 picoseconds. - Weight::from_parts(34_381_000, 2513) + // Estimated: `3503` + // Minimum execution time: 54_033_000 picoseconds. + Weight::from_parts(56_404_000, 3503) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -347,9 +131,9 @@ impl WeightInfo for () { fn set_fees() -> Weight { // Proof Size summary in bytes: // Measured: `180` - // Estimated: `503` - // Minimum execution time: 26_295_000 picoseconds. - Weight::from_parts(27_432_000, 503) + // Estimated: `1493` + // Minimum execution time: 43_422_000 picoseconds. + Weight::from_parts(44_736_000, 1493) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -358,9 +142,9 @@ impl WeightInfo for () { fn set_hook_iteration_limit() -> Weight { // Proof Size summary in bytes: // Measured: `180` - // Estimated: `499` - // Minimum execution time: 25_306_000 picoseconds. - Weight::from_parts(26_704_000, 499) + // Estimated: `1489` + // Minimum execution time: 42_113_000 picoseconds. + Weight::from_parts(42_959_000, 1489) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -380,10 +164,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn mint() -> Weight { // Proof Size summary in bytes: - // Measured: `2001` - // Estimated: `22900` - // Minimum execution time: 180_996_000 picoseconds. - Weight::from_parts(185_208_000, 22900) + // Measured: `2041` + // Estimated: `8769` + // Minimum execution time: 316_607_000 picoseconds. + Weight::from_parts(325_143_000, 8769) .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -416,13 +200,13 @@ impl WeightInfo for () { /// Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:1) /// Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, mode: MaxEncodedLen) /// Storage: VtokenMinting TokenUnlockLedger (r:0 w:1) - /// Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) + /// Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(136), added: 2611, mode: MaxEncodedLen) fn redeem() -> Weight { // Proof Size summary in bytes: - // Measured: `2211` - // Estimated: `40588` - // Minimum execution time: 218_898_000 picoseconds. - Weight::from_parts(223_145_000, 40588) + // Measured: `2187` + // Estimated: `6176` + // Minimum execution time: 248_394_000 picoseconds. + Weight::from_parts(377_727_000, 6176) .saturating_add(RocksDbWeight::get().reads(15_u64)) .saturating_add(RocksDbWeight::get().writes(10_u64)) } @@ -431,7 +215,7 @@ impl WeightInfo for () { /// Storage: VtokenMinting UserUnlockLedger (r:1 w:1) /// Proof: VtokenMinting UserUnlockLedger (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen) /// Storage: VtokenMinting TokenUnlockLedger (r:1 w:1) - /// Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) + /// Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(136), added: 2611, mode: MaxEncodedLen) /// Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:1) /// Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, mode: MaxEncodedLen) /// Storage: VtokenMinting UnlockingTotal (r:1 w:1) @@ -448,17 +232,17 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) fn rebond() -> Weight { // Proof Size summary in bytes: - // Measured: `2674` - // Estimated: `31449` - // Minimum execution time: 211_834_000 picoseconds. - Weight::from_parts(232_479_000, 31449) + // Measured: `2620` + // Estimated: `8769` + // Minimum execution time: 234_399_000 picoseconds. + Weight::from_parts(237_749_000, 8769) .saturating_add(RocksDbWeight::get().reads(12_u64)) .saturating_add(RocksDbWeight::get().writes(10_u64)) } /// Storage: VtokenMinting TokenToRebond (r:1 w:1) /// Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) /// Storage: VtokenMinting TokenUnlockLedger (r:1 w:1) - /// Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) + /// Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(136), added: 2611, mode: MaxEncodedLen) /// Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:1) /// Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, mode: MaxEncodedLen) /// Storage: VtokenMinting UserUnlockLedger (r:1 w:1) @@ -477,10 +261,10 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) fn rebond_by_unlock_id() -> Weight { // Proof Size summary in bytes: - // Measured: `2674` - // Estimated: `31449` - // Minimum execution time: 200_291_000 picoseconds. - Weight::from_parts(203_895_000, 31449) + // Measured: `2620` + // Estimated: `8769` + // Minimum execution time: 224_388_000 picoseconds. + Weight::from_parts(227_544_000, 8769) .saturating_add(RocksDbWeight::get().reads(12_u64)) .saturating_add(RocksDbWeight::get().writes(10_u64)) } @@ -489,9 +273,9 @@ impl WeightInfo for () { fn on_initialize() -> Weight { // Proof Size summary in bytes: // Measured: `211` - // Estimated: `2502` - // Minimum execution time: 12_774_000 picoseconds. - Weight::from_parts(13_337_000, 2502) + // Estimated: `3492` + // Minimum execution time: 14_822_000 picoseconds. + Weight::from_parts(15_243_000, 3492) .saturating_add(RocksDbWeight::get().reads(1_u64)) } } diff --git a/pallets/vtoken-voting/src/benchmarking.rs b/pallets/vtoken-voting/src/benchmarking.rs index 6d669c401..1a190e514 100644 --- a/pallets/vtoken-voting/src/benchmarking.rs +++ b/pallets/vtoken-voting/src/benchmarking.rs @@ -19,16 +19,21 @@ use crate::*; use assert_matches::assert_matches; use frame_benchmarking::v2::*; +use frame_support::assert_ok; use frame_system::RawOrigin; use node_primitives::{currency::VKSM, XcmOperationType as XcmOperation}; use pallet_conviction_voting::{Conviction, Vote}; -use sp_runtime::traits::Bounded; +use sp_runtime::traits::UniqueSaturatedFrom; const SEED: u32 = 0; fn funded_account(name: &'static str, index: u32) -> AccountIdOf { let caller = account(name, index, SEED); - T::MultiCurrency::deposit(VKSM, &caller, BalanceOf::::max_value()).unwrap(); + assert_ok!(T::MultiCurrency::deposit( + VKSM, + &caller, + BalanceOf::::unique_saturated_from(1000000000000u128) + )); caller } @@ -350,5 +355,5 @@ mod benchmarks { // // The line generates three steps per benchmark, with repeat=1 and the three steps are // [low, mid, high] of the range. - impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Runtime); + impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext_benchmark(), crate::mock::Runtime); } diff --git a/pallets/vtoken-voting/src/lib.rs b/pallets/vtoken-voting/src/lib.rs index 64a949988..aaae91831 100644 --- a/pallets/vtoken-voting/src/lib.rs +++ b/pallets/vtoken-voting/src/lib.rs @@ -56,7 +56,7 @@ use sp_runtime::{ ArithmeticError, }; use sp_std::prelude::*; -use weights::WeightInfo; +pub use weights::WeightInfo; use xcm::v3::{prelude::*, Weight as XcmWeight}; const CONVICTION_VOTING_ID: LockIdentifier = *b"vtvoting"; diff --git a/pallets/vtoken-voting/src/mock.rs b/pallets/vtoken-voting/src/mock.rs index 2faed7409..a1ea540fa 100644 --- a/pallets/vtoken-voting/src/mock.rs +++ b/pallets/vtoken-voting/src/mock.rs @@ -27,7 +27,7 @@ use frame_support::{ parameter_types, traits::{Everything, GenesisBuild, Get, Nothing}, }; -use frame_system::{EnsureRoot, EnsureSignedBy}; +use frame_system::EnsureRoot; use node_primitives::{ currency::{KSM, VBNC, VKSM}, traits::XcmDestWeightAndFeeHandler, @@ -277,6 +277,15 @@ impl DerivativeAccountHandler for DerivativeAccount { Self::get_multilocation(token, derivative_index) .and_then(|_location| Some((u32::MAX.into(), u32::MAX.into()))) } + + #[cfg(feature = "runtime-benchmarks")] + fn init_minimums_and_maximums(_token: CurrencyId) {} + + #[cfg(feature = "runtime-benchmarks")] + fn new_delegator_ledger(_token: CurrencyId, _who: MultiLocation) {} + + #[cfg(feature = "runtime-benchmarks")] + fn add_delegator(_token: CurrencyId, _index: DerivativeIndex, _who: MultiLocation) {} } parameter_types! { @@ -304,7 +313,7 @@ impl vtoken_voting::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; type MultiCurrency = Currencies; - type ControlOrigin = EnsureSignedBy; + type ControlOrigin = EnsureRoot; type ResponseOrigin = EnsureResponse; type XcmDestWeightAndFee = XcmDestWeightAndFee; type DerivativeAccount = DerivativeAccount; @@ -352,3 +361,11 @@ pub fn new_test_ext() -> sp_io::TestExternalities { ext.execute_with(|| System::set_block_number(1)); ext } + +#[cfg(feature = "runtime-benchmarks")] +pub fn new_test_ext_benchmark() -> sp_io::TestExternalities { + frame_system::GenesisConfig::default() + .build_storage::() + .unwrap() + .into() +} diff --git a/pallets/vtoken-voting/src/tests.rs b/pallets/vtoken-voting/src/tests.rs index 9052048d3..47116a9d9 100644 --- a/pallets/vtoken-voting/src/tests.rs +++ b/pallets/vtoken-voting/src/tests.rs @@ -228,7 +228,7 @@ fn successful_but_zero_conviction_vote_balance_can_be_unlocked() { assert_ok!(VtokenVoting::notify_vote(origin_response(), 1, response_success())); assert_ok!(VtokenVoting::set_referendum_status( - RuntimeOrigin::signed(CONTROLLER), + RuntimeOrigin::root(), vtoken, poll_index, ReferendumInfoOf::::Completed(3), @@ -251,7 +251,7 @@ fn unsuccessful_conviction_vote_balance_can_be_unlocked() { assert_ok!(VtokenVoting::notify_vote(origin_response(), 1, response_success())); assert_ok!(VtokenVoting::set_referendum_status( - RuntimeOrigin::signed(CONTROLLER), + RuntimeOrigin::root(), vtoken, poll_index, ReferendumInfoOf::::Completed(3), @@ -278,7 +278,7 @@ fn successful_conviction_vote_balance_stays_locked_for_correct_time() { assert_ok!(VtokenVoting::notify_vote(origin_response(), i - 1, response_success())); } assert_ok!(VtokenVoting::set_referendum_status( - RuntimeOrigin::signed(CONTROLLER), + RuntimeOrigin::root(), vtoken, poll_index, ReferendumInfoOf::::Completed(3), @@ -304,26 +304,26 @@ fn lock_amalgamation_valid_with_multiple_removed_votes() { assert_eq!(usable_balance(vtoken, &ALICE), 0); assert_ok!(VtokenVoting::set_referendum_status( - RuntimeOrigin::signed(CONTROLLER), + RuntimeOrigin::root(), vtoken, 0, ReferendumInfoOf::::Completed(1), )); assert_ok!(VtokenVoting::set_referendum_status( - RuntimeOrigin::signed(CONTROLLER), + RuntimeOrigin::root(), vtoken, 1, ReferendumInfoOf::::Completed(1), )); assert_ok!(VtokenVoting::set_referendum_status( - RuntimeOrigin::signed(CONTROLLER), + RuntimeOrigin::root(), vtoken, 2, ReferendumInfoOf::::Completed(1), )); - assert_ok!(VtokenVoting::kill_referendum(RuntimeOrigin::signed(CONTROLLER), vtoken, 0)); - assert_ok!(VtokenVoting::kill_referendum(RuntimeOrigin::signed(CONTROLLER), vtoken, 1)); - assert_ok!(VtokenVoting::kill_referendum(RuntimeOrigin::signed(CONTROLLER), vtoken, 2)); + assert_ok!(VtokenVoting::kill_referendum(RuntimeOrigin::root(), vtoken, 0)); + assert_ok!(VtokenVoting::kill_referendum(RuntimeOrigin::root(), vtoken, 1)); + assert_ok!(VtokenVoting::kill_referendum(RuntimeOrigin::root(), vtoken, 2)); assert_ok!(VtokenVoting::unlock(RuntimeOrigin::signed(ALICE), vtoken, 0)); assert_eq!(usable_balance(vtoken, &ALICE), 0); @@ -385,16 +385,12 @@ fn kill_referendum_works() { assert_ok!(VtokenVoting::vote(RuntimeOrigin::signed(ALICE), vtoken, poll_index, aye(5, 1))); assert_ok!(VtokenVoting::set_referendum_status( - RuntimeOrigin::signed(CONTROLLER), + RuntimeOrigin::root(), vtoken, poll_index, ReferendumInfoOf::::Completed(1), )); - assert_ok!(VtokenVoting::kill_referendum( - RuntimeOrigin::signed(CONTROLLER), - vtoken, - poll_index - )); + assert_ok!(VtokenVoting::kill_referendum(RuntimeOrigin::root(), vtoken, poll_index)); System::assert_last_event(RuntimeEvent::VtokenVoting(Event::ReferendumKilled { vtoken, poll_index, @@ -410,7 +406,7 @@ fn kill_referendum_with_origin_signed_fails() { assert_ok!(VtokenVoting::vote(RuntimeOrigin::signed(ALICE), vtoken, poll_index, aye(5, 1))); assert_ok!(VtokenVoting::set_referendum_status( - RuntimeOrigin::signed(CONTROLLER), + RuntimeOrigin::root(), vtoken, poll_index, ReferendumInfoOf::::Completed(1), @@ -430,7 +426,7 @@ fn set_delegator_role_works() { let role = aye(10, 3).into(); assert_ok!(VtokenVoting::set_delegator_role( - RuntimeOrigin::signed(CONTROLLER), + RuntimeOrigin::root(), vtoken, derivative_index, role, @@ -453,7 +449,7 @@ fn set_referendum_status_works() { assert_ok!(VtokenVoting::vote(RuntimeOrigin::signed(ALICE), vtoken, poll_index, aye(2, 5))); assert_ok!(VtokenVoting::set_referendum_status( - RuntimeOrigin::signed(CONTROLLER), + RuntimeOrigin::root(), vtoken, poll_index, info.clone(), @@ -476,7 +472,7 @@ fn set_referendum_status_without_vote_should_fail() { assert_noop!( VtokenVoting::set_referendum_status( - RuntimeOrigin::signed(CONTROLLER), + RuntimeOrigin::root(), vtoken, poll_index, info.clone(), @@ -512,7 +508,7 @@ fn set_vote_locking_period_works() { let locking_period = 100; assert_ok!(VtokenVoting::set_vote_locking_period( - RuntimeOrigin::signed(CONTROLLER), + RuntimeOrigin::root(), vtoken, locking_period, )); @@ -548,7 +544,7 @@ fn set_undeciding_timeout_works() { let undeciding_timeout = 100; assert_ok!(VtokenVoting::set_undeciding_timeout( - RuntimeOrigin::signed(CONTROLLER), + RuntimeOrigin::root(), vtoken, undeciding_timeout, )); @@ -766,16 +762,12 @@ fn notify_remove_delegator_vote_success_works() { assert_ok!(VtokenVoting::notify_vote(origin_response(), query_id, response.clone())); assert_ok!(VtokenVoting::set_referendum_status( - RuntimeOrigin::signed(CONTROLLER), + RuntimeOrigin::root(), vtoken, poll_index, ReferendumInfoOf::::Completed(3), )); - assert_ok!(VtokenVoting::set_vote_locking_period( - RuntimeOrigin::signed(CONTROLLER), - vtoken, - 10, - )); + assert_ok!(VtokenVoting::set_vote_locking_period(RuntimeOrigin::root(), vtoken, 10,)); RelaychainDataProvider::set_block_number(15); assert_ok!(VtokenVoting::remove_delegator_vote( @@ -826,16 +818,12 @@ fn notify_remove_delegator_vote_fail_works() { assert_ok!(VtokenVoting::notify_vote(origin_response(), query_id, response_success())); assert_ok!(VtokenVoting::set_referendum_status( - RuntimeOrigin::signed(CONTROLLER), + RuntimeOrigin::root(), vtoken, poll_index, ReferendumInfoOf::::Completed(3), )); - assert_ok!(VtokenVoting::set_vote_locking_period( - RuntimeOrigin::signed(CONTROLLER), - vtoken, - 10, - )); + assert_ok!(VtokenVoting::set_vote_locking_period(RuntimeOrigin::root(), vtoken, 10,)); RelaychainDataProvider::set_block_number(15); assert_ok!(VtokenVoting::remove_delegator_vote( diff --git a/pallets/vtoken-voting/src/weights.rs b/pallets/vtoken-voting/src/weights.rs index 84719d0c2..8dbad08c2 100644 --- a/pallets/vtoken-voting/src/weights.rs +++ b/pallets/vtoken-voting/src/weights.rs @@ -25,33 +25,31 @@ //! Autogenerated weights for bifrost_vtoken_voting //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-09-07, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `EdwindeMBP`, CPU: `` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 +//! DATE: 2023-09-14, 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-vtoken-voting +// --pallet=bifrost_vtoken_voting // --extrinsic=* // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 // --output=./pallets/vtoken-voting/src/weights.rs -// --template=./frame-weight-template.hbs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for bifrost_vtoken_voting. pub trait WeightInfo { @@ -68,222 +66,6 @@ pub trait WeightInfo { fn notify_remove_delegator_vote() -> Weight; } -/// Weights for bifrost_vtoken_voting using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: VtokenVoting UndecidingTimeout (r:1 w:0) - /// Proof: VtokenVoting UndecidingTimeout (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) - /// Storage: VtokenVoting DelegatorVote (r:2 w:1) - /// Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) - /// Storage: Slp DelegatorsIndex2Multilocation (r:1 w:0) - /// Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:0) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: VtokenVoting PendingVotingInfo (r:1 w:1) - /// Proof: VtokenVoting PendingVotingInfo (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VtokenVoting ReferendumInfoFor (r:1 w:1) - /// Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: VtokenVoting VotingFor (r:1 w:1) - /// Proof: VtokenVoting VotingFor (max_values: None, max_size: Some(13663), added: 16138, mode: MaxEncodedLen) - /// Storage: VtokenVoting ClassLocksFor (r:1 w:1) - /// Proof: VtokenVoting ClassLocksFor (max_values: None, max_size: Some(5162), added: 7637, mode: MaxEncodedLen) - /// Storage: Tokens Locks (r:1 w:1) - /// Proof: Tokens Locks (max_values: None, max_size: Some(1271), added: 3746, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) - /// Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), 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: VtokenVoting PendingReferendumInfo (r:0 w:1) - /// Proof: VtokenVoting PendingReferendumInfo (max_values: None, max_size: Some(34), added: 2509, mode: MaxEncodedLen) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn vote_new() -> Weight { - // Proof Size summary in bytes: - // Measured: `14411` - // Estimated: `17876` - // Minimum execution time: 128_000_000 picoseconds. - Weight::from_parts(133_000_000, 17876) - .saturating_add(T::DbWeight::get().reads(15_u64)) - .saturating_add(T::DbWeight::get().writes(10_u64)) - } - /// Storage: VtokenVoting UndecidingTimeout (r:1 w:0) - /// Proof: VtokenVoting UndecidingTimeout (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) - /// Storage: VtokenVoting DelegatorVote (r:2 w:1) - /// Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) - /// Storage: Slp DelegatorsIndex2Multilocation (r:1 w:0) - /// Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) - /// Storage: Slp DelegatorLedgers (r:1 w:0) - /// Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) - /// Storage: VtokenVoting PendingVotingInfo (r:1 w:1) - /// Proof: VtokenVoting PendingVotingInfo (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VtokenVoting ReferendumInfoFor (r:1 w:1) - /// Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: VtokenVoting VotingFor (r:1 w:1) - /// Proof: VtokenVoting VotingFor (max_values: None, max_size: Some(13663), added: 16138, mode: MaxEncodedLen) - /// Storage: VtokenVoting ClassLocksFor (r:1 w:1) - /// Proof: VtokenVoting ClassLocksFor (max_values: None, max_size: Some(5162), added: 7637, mode: MaxEncodedLen) - /// Storage: Tokens Locks (r:1 w:1) - /// Proof: Tokens Locks (max_values: None, max_size: Some(1271), added: 3746, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) - /// Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), 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: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn vote_existing() -> Weight { - // Proof Size summary in bytes: - // Measured: `14786` - // Estimated: `18251` - // Minimum execution time: 133_000_000 picoseconds. - Weight::from_parts(135_000_000, 18251) - .saturating_add(T::DbWeight::get().reads(15_u64)) - .saturating_add(T::DbWeight::get().writes(9_u64)) - } - /// Storage: VtokenVoting ReferendumInfoFor (r:1 w:0) - /// Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) - /// Storage: VtokenVoting VoteLockingPeriod (r:1 w:0) - /// Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) - /// Storage: ParachainSystem ValidationData (r:1 w:0) - /// Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VtokenVoting VotingFor (r:1 w:1) - /// Proof: VtokenVoting VotingFor (max_values: None, max_size: Some(13663), added: 16138, mode: MaxEncodedLen) - /// Storage: VtokenVoting ClassLocksFor (r:1 w:1) - /// Proof: VtokenVoting ClassLocksFor (max_values: None, max_size: Some(5162), added: 7637, mode: MaxEncodedLen) - /// Storage: Tokens Locks (r:1 w:1) - /// Proof: Tokens Locks (max_values: None, max_size: Some(1271), added: 3746, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) - /// Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) - /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) - fn unlock() -> Weight { - // Proof Size summary in bytes: - // Measured: `2032` - // Estimated: `17128` - // Minimum execution time: 65_000_000 picoseconds. - Weight::from_parts(67_000_000, 17128) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// Storage: VtokenVoting ReferendumInfoFor (r:1 w:0) - /// Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) - /// Storage: VtokenVoting VoteLockingPeriod (r:1 w:0) - /// Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) - /// Storage: ParachainSystem ValidationData (r:1 w:0) - /// Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VtokenVoting DelegatorVote (r:1 w:0) - /// Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) - /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) - /// Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), 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: VtokenVoting PendingRemoveDelegatorVote (r:0 w:1) - /// Proof: VtokenVoting PendingRemoveDelegatorVote (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) - fn remove_delegator_vote() -> Weight { - // Proof Size summary in bytes: - // Measured: `965` - // Estimated: `4430` - // Minimum execution time: 40_000_000 picoseconds. - Weight::from_parts(41_000_000, 4430) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: VtokenVoting ReferendumInfoFor (r:1 w:1) - /// Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) - /// Storage: ParachainSystem ValidationData (r:1 w:0) - /// Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) - fn kill_referendum() -> Weight { - // Proof Size summary in bytes: - // Measured: `370` - // Estimated: `3553` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 3553) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Slp DelegatorsIndex2Multilocation (r:1 w:0) - /// Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) - /// Storage: VtokenVoting DelegatorVote (r:1 w:1) - /// Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) - fn set_delegator_role() -> Weight { - // Proof Size summary in bytes: - // Measured: `372` - // Estimated: `3837` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_000_000, 3837) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: VtokenVoting ReferendumInfoFor (r:1 w:1) - /// Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) - fn set_referendum_status() -> Weight { - // Proof Size summary in bytes: - // Measured: `321` - // Estimated: `3553` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(14_000_000, 3553) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: VtokenVoting UndecidingTimeout (r:0 w:1) - /// Proof: VtokenVoting UndecidingTimeout (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) - fn set_undeciding_timeout() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(8_000_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: VtokenVoting VoteLockingPeriod (r:0 w:1) - /// Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) - fn set_vote_locking_period() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(8_000_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: VtokenVoting PendingVotingInfo (r:1 w:0) - /// Proof: VtokenVoting PendingVotingInfo (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VtokenVoting PendingReferendumInfo (r:1 w:0) - /// Proof: VtokenVoting PendingReferendumInfo (max_values: None, max_size: Some(34), added: 2509, mode: MaxEncodedLen) - fn notify_vote() -> Weight { - // Proof Size summary in bytes: - // Measured: `361` - // Estimated: `3582` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 3582) - .saturating_add(T::DbWeight::get().reads(2_u64)) - } - /// Storage: VtokenVoting PendingRemoveDelegatorVote (r:1 w:0) - /// Proof: VtokenVoting PendingRemoveDelegatorVote (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) - fn notify_remove_delegator_vote() -> Weight { - // Proof Size summary in bytes: - // Measured: `329` - // Estimated: `3501` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 3501) - .saturating_add(T::DbWeight::get().reads(1_u64)) - } -} - // For backwards compatibility and tests impl WeightInfo for () { /// Storage: VtokenVoting UndecidingTimeout (r:1 w:0) @@ -320,10 +102,10 @@ impl WeightInfo for () { /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn vote_new() -> Weight { // Proof Size summary in bytes: - // Measured: `14411` - // Estimated: `17876` - // Minimum execution time: 128_000_000 picoseconds. - Weight::from_parts(133_000_000, 17876) + // Measured: `14356` + // Estimated: `17821` + // Minimum execution time: 306_277_000 picoseconds. + Weight::from_parts(319_464_000, 17821) .saturating_add(RocksDbWeight::get().reads(15_u64)) .saturating_add(RocksDbWeight::get().writes(10_u64)) } @@ -359,10 +141,10 @@ impl WeightInfo for () { /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn vote_existing() -> Weight { // Proof Size summary in bytes: - // Measured: `14786` - // Estimated: `18251` - // Minimum execution time: 133_000_000 picoseconds. - Weight::from_parts(135_000_000, 18251) + // Measured: `5531` + // Estimated: `17128` + // Minimum execution time: 274_492_000 picoseconds. + Weight::from_parts(283_068_000, 17128) .saturating_add(RocksDbWeight::get().reads(15_u64)) .saturating_add(RocksDbWeight::get().writes(9_u64)) } @@ -384,10 +166,10 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) fn unlock() -> Weight { // Proof Size summary in bytes: - // Measured: `2032` + // Measured: `2103` // Estimated: `17128` - // Minimum execution time: 65_000_000 picoseconds. - Weight::from_parts(67_000_000, 17128) + // Minimum execution time: 165_014_000 picoseconds. + Weight::from_parts(167_638_000, 17128) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -413,8 +195,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `965` // Estimated: `4430` - // Minimum execution time: 40_000_000 picoseconds. - Weight::from_parts(41_000_000, 4430) + // Minimum execution time: 86_949_000 picoseconds. + Weight::from_parts(112_996_000, 4430) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -426,8 +208,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `370` // Estimated: `3553` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 3553) + // Minimum execution time: 41_865_000 picoseconds. + Weight::from_parts(46_801_000, 3553) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -439,8 +221,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `372` // Estimated: `3837` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_000_000, 3837) + // Minimum execution time: 51_783_000 picoseconds. + Weight::from_parts(52_655_000, 3837) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -450,8 +232,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `321` // Estimated: `3553` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(14_000_000, 3553) + // Minimum execution time: 41_679_000 picoseconds. + Weight::from_parts(42_389_000, 3553) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -461,8 +243,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(8_000_000, 0) + // Minimum execution time: 24_444_000 picoseconds. + Weight::from_parts(25_058_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: VtokenVoting VoteLockingPeriod (r:0 w:1) @@ -471,8 +253,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(8_000_000, 0) + // Minimum execution time: 10_145_000 picoseconds. + Weight::from_parts(24_174_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: VtokenVoting PendingVotingInfo (r:1 w:0) @@ -483,8 +265,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `361` // Estimated: `3582` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 3582) + // Minimum execution time: 44_382_000 picoseconds. + Weight::from_parts(44_901_000, 3582) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: VtokenVoting PendingRemoveDelegatorVote (r:1 w:0) @@ -493,8 +275,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `329` // Estimated: `3501` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 3501) + // Minimum execution time: 38_747_000 picoseconds. + Weight::from_parts(39_364_000, 3501) .saturating_add(RocksDbWeight::get().reads(1_u64)) } } diff --git a/pallets/xcm-interface/src/lib.rs b/pallets/xcm-interface/src/lib.rs index adc550c48..db2c780ac 100644 --- a/pallets/xcm-interface/src/lib.rs +++ b/pallets/xcm-interface/src/lib.rs @@ -48,11 +48,10 @@ macro_rules! use_relay { pub(crate) type AccountIdOf = ::AccountId; -pub(crate) type CurrencyIdOf = +pub type CurrencyIdOf = <::MultiCurrency as MultiCurrency>>::CurrencyId; -pub(crate) type BalanceOf = - <::MultiCurrency as MultiCurrency>>::Balance; +pub type BalanceOf = <::MultiCurrency as MultiCurrency>>::Balance; #[frame_support::pallet] pub mod pallet { diff --git a/runtime/bifrost-kusama/src/lib.rs b/runtime/bifrost-kusama/src/lib.rs index 75085eaf1..8b6a4fb9c 100644 --- a/runtime/bifrost-kusama/src/lib.rs +++ b/runtime/bifrost-kusama/src/lib.rs @@ -1137,7 +1137,7 @@ impl bifrost_flexible_fee::Config for Runtime { type TreasuryAccount = BifrostTreasuryAccount; type MaxFeeCurrencyOrderListLen = MaxFeeCurrencyOrderListLen; type OnUnbalanced = Treasury; - type WeightInfo = bifrost_flexible_fee::weights::BifrostWeight; + type WeightInfo = weights::bifrost_flexible_fee::BifrostWeight; type ExtraFeeMatcher = ExtraFeeMatcher; type ParachainId = ParachainInfo; type ControlOrigin = EitherOfDiverse; @@ -1258,7 +1258,7 @@ impl bifrost_salp::Config for Runtime { type RemoveKeysLimit = RemoveKeysLimit; type SlotLength = SlotLength; type VSBondValidPeriod = VSBondValidPeriod; - type WeightInfo = bifrost_salp::weights::BifrostWeight; + type WeightInfo = weights::bifrost_salp::BifrostWeight; type EnsureConfirmAsGovernance = EitherOfDiverse< TechAdmin, EitherOfDiverse, @@ -1285,7 +1285,7 @@ impl bifrost_vsbond_auction::Config for Runtime { type MaximumOrderInTrade = MaximumOrderInTrade; type MinimumAmount = MinimumSupply; type MultiCurrency = Currencies; - type WeightInfo = bifrost_vsbond_auction::weights::BifrostWeight; + type WeightInfo = weights::bifrost_vsbond_auction::BifrostWeight; type PalletId = VsbondAuctionPalletId; type TreasuryAccount = BifrostTreasuryAccount; type ControlOrigin = EitherOfDiverse; @@ -1295,7 +1295,7 @@ impl bifrost_token_issuer::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Currencies; type ControlOrigin = EitherOfDiverse; - type WeightInfo = bifrost_token_issuer::weights::BifrostWeight; + type WeightInfo = weights::bifrost_token_issuer::BifrostWeight; type MaxLengthLimit = MaxLengthLimit; } @@ -1305,14 +1305,14 @@ impl bifrost_call_switchgear::Config for Runtime { CoreAdmin, EitherOfDiverse, >; - type WeightInfo = bifrost_call_switchgear::weights::BifrostWeight; + type WeightInfo = weights::bifrost_call_switchgear::BifrostWeight; } impl bifrost_asset_registry::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type RegisterOrigin = EitherOfDiverse; - type WeightInfo = bifrost_asset_registry::weights::BifrostWeight; + type WeightInfo = weights::bifrost_asset_registry::BifrostWeight; } parameter_types! { @@ -1374,13 +1374,11 @@ impl bifrost_slp::Config for Runtime { TechAdmin, EitherOfDiverse, >; - type WeightInfo = bifrost_slp::weights::BifrostWeight; + type WeightInfo = weights::bifrost_slp::BifrostWeight; type VtokenMinting = VtokenMinting; type BifrostSlpx = Slpx; type AccountConverter = SubAccountIndexMultiLocationConvertor; type ParachainId = SelfParaChainId; - type XcmRouter = XcmRouter; - type XcmExecutor = XcmExecutor; type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; type MaxRefundPerBlock = MaxRefundPerBlock; @@ -1402,7 +1400,7 @@ impl bifrost_vstoken_conversion::Config for Runtime { >; type VsbondAccount = BifrostVsbondPalletId; type CurrencyIdConversion = AssetIdMaps; - type WeightInfo = (); + type WeightInfo = weights::bifrost_vstoken_conversion::BifrostWeight; } parameter_types! { @@ -1419,7 +1417,7 @@ impl bifrost_farming::Config for Runtime { type TreasuryAccount = BifrostTreasuryAccount; type Keeper = FarmingKeeperPalletId; type RewardIssuer = FarmingRewardIssuerPalletId; - type WeightInfo = bifrost_farming::weights::BifrostWeight; + type WeightInfo = weights::bifrost_farming::BifrostWeight; type FarmingBoost = FarmingBoostPalletId; type VeMinting = (); type BlockNumberToBalance = ConvertInto; @@ -1439,7 +1437,7 @@ impl bifrost_system_staking::Config for Runtime { CoreAdmin, EitherOfDiverse, >; - type WeightInfo = bifrost_system_staking::weights::BifrostWeight; + type WeightInfo = weights::bifrost_system_staking::BifrostWeight; type FarmingInfo = Farming; type VtokenMintingInterface = VtokenMinting; type TreasuryAccount = BifrostTreasuryAccount; @@ -1453,7 +1451,7 @@ impl bifrost_system_maker::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Currencies; type ControlOrigin = EitherOfDiverse; - type WeightInfo = (); + type WeightInfo = weights::bifrost_system_maker::BifrostWeight; type DexOperator = ZenlinkProtocol; type CurrencyIdConversion = AssetIdMaps; type TreasuryAccount = BifrostTreasuryAccount; @@ -1467,7 +1465,7 @@ impl bifrost_fee_share::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Currencies; type ControlOrigin = EitherOfDiverse; - type WeightInfo = bifrost_fee_share::weights::BifrostWeight; + type WeightInfo = weights::bifrost_fee_share::BifrostWeight; type FeeSharePalletId = FeeSharePalletId; } @@ -1476,7 +1474,7 @@ impl bifrost_cross_in_out::Config for Runtime { type MultiCurrency = Currencies; type ControlOrigin = EitherOfDiverse; type EntrancePalletId = SlpEntrancePalletId; - type WeightInfo = bifrost_cross_in_out::weights::BifrostWeight; + type WeightInfo = weights::bifrost_cross_in_out::BifrostWeight; type MaxLengthLimit = MaxLengthLimit; } @@ -1504,7 +1502,7 @@ impl bifrost_vtoken_voting::Config for Runtime { type ParachainId = SelfParaChainId; type MaxVotes = ConstU32<256>; type QueryTimeout = QueryTimeout; - type WeightInfo = bifrost_vtoken_voting::weights::BifrostWeight; + type WeightInfo = weights::bifrost_vtoken_voting::BifrostWeight; } // Bifrost modules end @@ -1628,7 +1626,7 @@ impl bifrost_vtoken_minting::Config for Runtime { type FeeAccount = BifrostFeeAccount; type BifrostSlp = Slp; type BifrostSlpx = Slpx; - type WeightInfo = bifrost_vtoken_minting::weights::BifrostWeight; + type WeightInfo = weights::bifrost_vtoken_minting::BifrostWeight; type OnRedeemSuccess = OnRedeemSuccess; type RelayChainToken = RelayCurrencyId; type CurrencyIdConversion = AssetIdMaps; @@ -1650,7 +1648,7 @@ impl bifrost_slpx::Config for Runtime { type CurrencyIdConvert = AssetIdMaps; type TreasuryAccount = BifrostTreasuryAccount; type ParachainId = SelfParaChainId; - type WeightInfo = bifrost_slpx::weights::BifrostWeight; + type WeightInfo = weights::bifrost_slpx::BifrostWeight; } pub struct EnsurePoolAssetId; @@ -1681,7 +1679,7 @@ impl nutsfinance_stable_asset::Config for Runtime { } impl bifrost_stable_pool::Config for Runtime { - type WeightInfo = bifrost_stable_pool::weights::BifrostWeight; + type WeightInfo = weights::bifrost_stable_pool::BifrostWeight; type ControlOrigin = EitherOfDiverse; type CurrencyId = CurrencyId; type MultiCurrency = Currencies; @@ -2061,23 +2059,22 @@ extern crate frame_benchmarking; #[cfg(feature = "runtime-benchmarks")] mod benches { define_benchmarks!( - [bifrost_salp, Salp] - [bifrost_vsbond_auction, VSBondAuction] - [bifrost_token_issuer, TokenIssuer] + [bifrost_asset_registry, AssetRegistry] [bifrost_call_switchgear, CallSwitchgear] - [parachain_staking, ParachainStaking] - [bifrost_vtoken_minting, VtokenMinting] + [bifrost_cross_in_out, CrossInOut] [bifrost_farming, Farming] - [bifrost_system_staking, SystemStaking] - [bifrost_slp, Slp] - [bifrost_asset_registry, AssetRegistry] [bifrost_fee_share, FeeShare] - [bifrost_cross_in_out, CrossInOut] [bifrost_flexible_fee, FlexibleFee] - [bifrost_system_maker, SystemMaker] - [bifrost_vstoken_conversion, VstokenConversion] + [bifrost_salp, Salp] + [bifrost_slp, Slp] [bifrost_slpx, Slpx] [bifrost_stable_pool, StablePool] + [bifrost_system_maker, SystemMaker] + [bifrost_system_staking, SystemStaking] + [bifrost_token_issuer, TokenIssuer] + [bifrost_vsbond_auction, VSBondAuction] + [bifrost_vstoken_conversion, VstokenConversion] + [bifrost_vtoken_minting, VtokenMinting] [bifrost_vtoken_voting, VtokenVoting] [lend_market, LendMarket] ); diff --git a/runtime/bifrost-kusama/src/weights/bifrost_asset_registry.rs b/runtime/bifrost-kusama/src/weights/bifrost_asset_registry.rs new file mode 100644 index 000000000..1ab2267b4 --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_asset_registry.rs @@ -0,0 +1,167 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_asset_registry +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_asset_registry +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_asset_registry.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_asset_registry. +pub struct BifrostWeight(PhantomData); +impl bifrost_asset_registry::WeightInfo for BifrostWeight { + // Storage: AssetRegistry LocationToCurrencyIds (r:1 w:1) + // Proof Skipped: AssetRegistry LocationToCurrencyIds (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyIdToLocations (r:1 w:1) + // Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry AssetMetadatas (r:1 w:1) + // Proof Skipped: AssetRegistry AssetMetadatas (max_values: None, max_size: None, mode: Measured) + fn register_native_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `118` + // Estimated: `3583` + // Minimum execution time: 49_553 nanoseconds. + Weight::from_parts(50_599_000, 3583) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: AssetRegistry LocationToCurrencyIds (r:1 w:1) + // Proof Skipped: AssetRegistry LocationToCurrencyIds (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyIdToLocations (r:1 w:1) + // Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry AssetMetadatas (r:1 w:1) + // Proof Skipped: AssetRegistry AssetMetadatas (max_values: None, max_size: None, mode: Measured) + fn update_native_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `250` + // Estimated: `3715` + // Minimum execution time: 56_917 nanoseconds. + Weight::from_parts(57_419_000, 3715) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: AssetRegistry NextTokenId (r:1 w:1) + // Proof Skipped: AssetRegistry NextTokenId (max_values: Some(1), max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn register_token_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `607` + // Estimated: `4072` + // Minimum execution time: 44_741 nanoseconds. + Weight::from_parts(46_339_000, 4072) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn register_vtoken_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `779` + // Estimated: `6719` + // Minimum execution time: 51_173 nanoseconds. + Weight::from_parts(52_854_000, 6719) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn register_vstoken_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `705` + // Estimated: `6645` + // Minimum execution time: 49_492 nanoseconds. + Weight::from_parts(50_943_000, 6645) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn register_vsbond_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `763` + // Estimated: `6703` + // Minimum execution time: 52_709 nanoseconds. + Weight::from_parts(54_285_000, 6703) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry LocationToCurrencyIds (r:1 w:1) + // Proof Skipped: AssetRegistry LocationToCurrencyIds (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyIdToLocations (r:1 w:1) + // Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyIdToWeights (r:0 w:1) + // Proof Skipped: AssetRegistry CurrencyIdToWeights (max_values: None, max_size: None, mode: Measured) + fn register_multilocation() -> Weight { + // Proof Size summary in bytes: + // Measured: `683` + // Estimated: `4148` + // Minimum execution time: 45_385 nanoseconds. + Weight::from_parts(46_739_000, 4148) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry LocationToCurrencyIds (r:0 w:1) + // Proof Skipped: AssetRegistry LocationToCurrencyIds (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyIdToWeights (r:0 w:1) + // Proof Skipped: AssetRegistry CurrencyIdToWeights (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyIdToLocations (r:0 w:1) + // Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) + fn force_set_multilocation() -> Weight { + // Proof Size summary in bytes: + // Measured: `683` + // Estimated: `4148` + // Minimum execution time: 50_743 nanoseconds. + Weight::from_parts(52_775_000, 4148) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(3)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs b/runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs new file mode 100644 index 000000000..c56319b60 --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs @@ -0,0 +1,101 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_call_switchgear +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_call_switchgear +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_call_switchgear. +pub struct BifrostWeight(PhantomData); +impl bifrost_call_switchgear::WeightInfo for BifrostWeight { + // Storage: CallSwitchgear SwitchedOffTransactions (r:1 w:1) + // Proof Skipped: CallSwitchgear SwitchedOffTransactions (max_values: None, max_size: None, mode: Measured) + fn switchoff_transaction() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 29_214 nanoseconds. + Weight::from_parts(30_398_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CallSwitchgear SwitchedOffTransactions (r:1 w:1) + // Proof Skipped: CallSwitchgear SwitchedOffTransactions (max_values: None, max_size: None, mode: Measured) + fn switchon_transaction() -> Weight { + // Proof Size summary in bytes: + // Measured: `55` + // Estimated: `3520` + // Minimum execution time: 31_720 nanoseconds. + Weight::from_parts(32_717_000, 3520) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CallSwitchgear DisabledTransfers (r:1 w:1) + // Proof Skipped: CallSwitchgear DisabledTransfers (max_values: None, max_size: None, mode: Measured) + fn disable_transfers() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 26_079 nanoseconds. + Weight::from_parts(26_977_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CallSwitchgear DisabledTransfers (r:1 w:1) + // Proof Skipped: CallSwitchgear DisabledTransfers (max_values: None, max_size: None, mode: Measured) + fn enable_transfers() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `3503` + // Minimum execution time: 27_719 nanoseconds. + Weight::from_parts(28_319_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_cross_in_out.rs b/runtime/bifrost-kusama/src/weights/bifrost_cross_in_out.rs new file mode 100644 index 000000000..2fcb40922 --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_cross_in_out.rs @@ -0,0 +1,209 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_cross_in_out +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_cross_in_out +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_cross_in_out.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_cross_in_out. +pub struct BifrostWeight(PhantomData); +impl bifrost_cross_in_out::WeightInfo for BifrostWeight { + // Storage: CrossInOut CrossCurrencyRegistry (r:1 w:1) + // Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) + fn register_currency_for_cross_in_out() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `3541` + // Minimum execution time: 30_069 nanoseconds. + Weight::from_parts(30_714_000, 3541) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut CrossCurrencyRegistry (r:1 w:1) + // Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) + fn deregister_currency_for_cross_in_out() -> Weight { + // Proof Size summary in bytes: + // Measured: `119` + // Estimated: `3584` + // Minimum execution time: 32_781 nanoseconds. + Weight::from_parts(33_720_000, 3584) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut CrossingMinimumAmount (r:0 w:1) + // Proof Skipped: CrossInOut CrossingMinimumAmount (max_values: None, max_size: None, mode: Measured) + fn set_crossing_minimum_amount() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 24_811 nanoseconds. + Weight::from_parts(25_172_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut IssueWhiteList (r:1 w:1) + // Proof Skipped: CrossInOut IssueWhiteList (max_values: None, max_size: None, mode: Measured) + fn add_to_issue_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `3541` + // Minimum execution time: 34_593 nanoseconds. + Weight::from_parts(35_760_000, 3541) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut IssueWhiteList (r:1 w:1) + // Proof Skipped: CrossInOut IssueWhiteList (max_values: None, max_size: None, mode: Measured) + fn remove_from_issue_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `154` + // Estimated: `3619` + // Minimum execution time: 35_748 nanoseconds. + Weight::from_parts(36_569_000, 3619) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut RegisterWhiteList (r:1 w:1) + // Proof Skipped: CrossInOut RegisterWhiteList (max_values: None, max_size: None, mode: Measured) + fn add_to_register_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `3541` + // Minimum execution time: 38_561 nanoseconds. + Weight::from_parts(39_371_000, 3541) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut RegisterWhiteList (r:1 w:1) + // Proof Skipped: CrossInOut RegisterWhiteList (max_values: None, max_size: None, mode: Measured) + fn remove_from_register_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `154` + // Estimated: `3619` + // Minimum execution time: 35_886 nanoseconds. + Weight::from_parts(36_589_000, 3619) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut CrossCurrencyRegistry (r:1 w:0) + // Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut CrossingMinimumAmount (r:1 w:0) + // Proof Skipped: CrossInOut CrossingMinimumAmount (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut IssueWhiteList (r:1 w:0) + // Proof Skipped: CrossInOut IssueWhiteList (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn cross_in() -> Weight { + // Proof Size summary in bytes: + // Measured: `1758` + // Estimated: `5223` + // Minimum execution time: 146_344 nanoseconds. + Weight::from_parts(147_835_000, 5223) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: CrossInOut RegisterWhiteList (r:1 w:0) + // Proof Skipped: CrossInOut RegisterWhiteList (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut CrossCurrencyRegistry (r:1 w:0) + // Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut AccountToOuterMultilocation (r:1 w:1) + // Proof Skipped: CrossInOut AccountToOuterMultilocation (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut OuterMultilocationToAccount (r:0 w:1) + // Proof Skipped: CrossInOut OuterMultilocationToAccount (max_values: None, max_size: None, mode: Measured) + fn register_linked_account() -> Weight { + // Proof Size summary in bytes: + // Measured: `193` + // Estimated: `3658` + // Minimum execution time: 58_096 nanoseconds. + Weight::from_parts(59_952_000, 3658) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: CrossInOut CrossCurrencyRegistry (r:1 w:0) + // Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut CrossingMinimumAmount (r:1 w:0) + // Proof Skipped: CrossInOut CrossingMinimumAmount (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: CrossInOut AccountToOuterMultilocation (r:1 w:0) + // Proof Skipped: CrossInOut AccountToOuterMultilocation (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn cross_out() -> Weight { + // Proof Size summary in bytes: + // Measured: `1781` + // Estimated: `5246` + // Minimum execution time: 121_799 nanoseconds. + Weight::from_parts(124_055_000, 5246) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: CrossInOut CrossCurrencyRegistry (r:1 w:0) + // Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut AccountToOuterMultilocation (r:1 w:1) + // Proof Skipped: CrossInOut AccountToOuterMultilocation (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut OuterMultilocationToAccount (r:0 w:1) + // Proof Skipped: CrossInOut OuterMultilocationToAccount (max_values: None, max_size: None, mode: Measured) + fn change_outer_linked_account() -> Weight { + // Proof Size summary in bytes: + // Measured: `312` + // Estimated: `3777` + // Minimum execution time: 56_108 nanoseconds. + Weight::from_parts(57_171_000, 3777) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_farming.rs b/runtime/bifrost-kusama/src/weights/bifrost_farming.rs new file mode 100644 index 000000000..6d36c92de --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_farming.rs @@ -0,0 +1,359 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_farming +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_farming +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_farming.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_farming. +pub struct BifrostWeight(PhantomData); +impl bifrost_farming::WeightInfo for BifrostWeight { + // Storage: Farming PoolInfos (r:1 w:0) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:1 w:0) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming BoostPoolInfos (r:1 w:0) + // Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) + fn on_initialize() -> Weight { + // Proof Size summary in bytes: + // Measured: `113` + // Estimated: `3578` + // Minimum execution time: 21_942 nanoseconds. + Weight::from_parts(22_864_000, 3578) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: Farming PoolNextId (r:1 w:1) + // Proof Skipped: Farming PoolNextId (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming GaugePoolNextId (r:1 w:1) + // Proof Skipped: Farming GaugePoolNextId (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:0 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming PoolInfos (r:0 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + fn create_farming_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `1594` + // Minimum execution time: 52_521 nanoseconds. + Weight::from_parts(53_437_000, 1594) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:1) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + fn deposit() -> Weight { + // Proof Size summary in bytes: + // Measured: `1752` + // Estimated: `6176` + // Minimum execution time: 164_962 nanoseconds. + Weight::from_parts(169_239_000, 6176) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:1) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + fn withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `510` + // Estimated: `3975` + // Minimum execution time: 77_186 nanoseconds. + Weight::from_parts(78_796_000, 3975) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:1) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugeInfos (r:1 w:0) + // Proof Skipped: Farming GaugeInfos (max_values: None, max_size: None, mode: Measured) + fn claim() -> Weight { + // Proof Size summary in bytes: + // Measured: `547` + // Estimated: `4012` + // Minimum execution time: 76_561 nanoseconds. + Weight::from_parts(77_635_000, 4012) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming GaugePoolInfos (r:1 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugeInfos (r:1 w:1) + // Proof Skipped: Farming GaugeInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming PoolInfos (r:1 w:0) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:0) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + fn gauge_withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `832` + // Estimated: `4297` + // Minimum execution time: 82_224 nanoseconds. + Weight::from_parts(84_369_000, 4297) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming PoolInfos (r:1 w:0) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:1) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + fn withdraw_claim() -> Weight { + // Proof Size summary in bytes: + // Measured: `510` + // Estimated: `3975` + // Minimum execution time: 52_808 nanoseconds. + Weight::from_parts(53_519_000, 3975) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugePoolNextId (r:1 w:1) + // Proof Skipped: Farming GaugePoolNextId (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:0 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + fn reset_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `436` + // Estimated: `3901` + // Minimum execution time: 58_270 nanoseconds. + Weight::from_parts(59_721_000, 3901) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming RetireLimit (r:1 w:0) + // Proof Skipped: Farming RetireLimit (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:0) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:1 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + fn force_retire_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `627` + // Estimated: `4092` + // Minimum execution time: 71_326 nanoseconds. + Weight::from_parts(72_463_000, 4092) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + fn kill_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `380` + // Estimated: `3845` + // Minimum execution time: 50_342 nanoseconds. + Weight::from_parts(51_828_000, 3845) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:1 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + fn edit_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `513` + // Estimated: `3978` + // Minimum execution time: 55_700 nanoseconds. + Weight::from_parts(57_535_000, 3978) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + fn close_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `417` + // Estimated: `3882` + // Minimum execution time: 45_159 nanoseconds. + Weight::from_parts(46_221_000, 3882) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn charge() -> Weight { + // Proof Size summary in bytes: + // Measured: `2059` + // Estimated: `6176` + // Minimum execution time: 162_037 nanoseconds. + Weight::from_parts(167_329_000, 6176) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: Farming RetireLimit (r:1 w:0) + // Proof Skipped: Farming RetireLimit (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming GaugeInfos (r:2 w:1) + // Proof Skipped: Farming GaugeInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:1 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming PoolInfos (r:1 w:0) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:0) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + fn force_gauge_claim() -> Weight { + // Proof Size summary in bytes: + // Measured: `855` + // Estimated: `6795` + // Minimum execution time: 99_268 nanoseconds. + Weight::from_parts(100_563_000, 6795) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming RetireLimit (r:1 w:1) + // Proof Skipped: Farming RetireLimit (max_values: Some(1), max_size: None, mode: Measured) + fn set_retire_limit() -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `1594` + // Minimum execution time: 28_852 nanoseconds. + Weight::from_parts(29_866_000, 1594) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming BoostWhitelist (r:0 w:1) + // Proof Skipped: Farming BoostWhitelist (max_values: None, max_size: None, mode: Measured) + fn add_boost_pool_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 11_356 nanoseconds. + Weight::from_parts(11_723_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming BoostNextRoundWhitelist (r:0 w:1) + // Proof Skipped: Farming BoostNextRoundWhitelist (max_values: None, max_size: None, mode: Measured) + fn set_next_round_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `145` + // Estimated: `145` + // Minimum execution time: 16_252 nanoseconds. + Weight::from_parts(19_916_000, 145) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming BoostPoolInfos (r:1 w:1) + // Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming UserBoostInfos (r:1 w:1) + // Proof Skipped: Farming UserBoostInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming BoostWhitelist (r:1 w:0) + // Proof Skipped: Farming BoostWhitelist (max_values: None, max_size: None, mode: Measured) + // Storage: Farming BoostVotingPools (r:1 w:1) + // Proof Skipped: Farming BoostVotingPools (max_values: None, max_size: None, mode: Measured) + fn vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `145` + // Estimated: `3610` + // Minimum execution time: 50_384 nanoseconds. + Weight::from_parts(52_399_000, 3610) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Farming BoostPoolInfos (r:1 w:1) + // Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming BoostNextRoundWhitelist (r:1 w:0) + // Proof Skipped: Farming BoostNextRoundWhitelist (max_values: None, max_size: None, mode: Measured) + // Storage: Farming BoostWhitelist (r:2 w:0) + // Proof Skipped: Farming BoostWhitelist (max_values: None, max_size: None, mode: Measured) + // Storage: Farming BoostVotingPools (r:1 w:0) + // Proof Skipped: Farming BoostVotingPools (max_values: None, max_size: None, mode: Measured) + fn start_boost_round() -> Weight { + // Proof Size summary in bytes: + // Measured: `149` + // Estimated: `6089` + // Minimum execution time: 63_053 nanoseconds. + Weight::from_parts(64_194_000, 6089) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming BoostPoolInfos (r:1 w:1) + // Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) + fn end_boost_round() -> Weight { + // Proof Size summary in bytes: + // Measured: `195` + // Estimated: `1680` + // Minimum execution time: 42_148 nanoseconds. + Weight::from_parts(43_580_000, 1680) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn charge_boost() -> Weight { + // Proof Size summary in bytes: + // Measured: `1477` + // Estimated: `6176` + // Minimum execution time: 126_868 nanoseconds. + Weight::from_parts(131_856_000, 6176) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_fee_share.rs b/runtime/bifrost-kusama/src/weights/bifrost_fee_share.rs new file mode 100644 index 000000000..2e7902d09 --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_fee_share.rs @@ -0,0 +1,130 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_fee_share +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_fee_share +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_fee_share.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_fee_share. +pub struct BifrostWeight(PhantomData); +impl bifrost_fee_share::WeightInfo for BifrostWeight { + // Storage: FeeShare AutoEra (r:1 w:0) + // Proof Skipped: FeeShare AutoEra (max_values: Some(1), max_size: None, mode: Measured) + fn on_initialize() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `1489` + // Minimum execution time: 7_333 nanoseconds. + Weight::from_parts(7_571_000, 1489) + .saturating_add(T::DbWeight::get().reads(1)) + } + // Storage: FeeShare DistributionNextId (r:1 w:1) + // Proof Skipped: FeeShare DistributionNextId (max_values: Some(1), max_size: None, mode: Measured) + // Storage: FeeShare DistributionInfos (r:0 w:1) + // Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) + fn create_distribution() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `1489` + // Minimum execution time: 37_152 nanoseconds. + Weight::from_parts(38_371_000, 1489) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: FeeShare DistributionInfos (r:1 w:1) + // Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) + fn edit_distribution() -> Weight { + // Proof Size summary in bytes: + // Measured: `139` + // Estimated: `3604` + // Minimum execution time: 40_063 nanoseconds. + Weight::from_parts(40_816_000, 3604) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: FeeShare AutoEra (r:0 w:1) + // Proof Skipped: FeeShare AutoEra (max_values: Some(1), max_size: None, mode: Measured) + fn set_era_length() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 23_201 nanoseconds. + Weight::from_parts(23_949_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: FeeShare DistributionInfos (r:1 w:0) + // Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:0) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + fn execute_distribute() -> Weight { + // Proof Size summary in bytes: + // Measured: `1616` + // Estimated: `6176` + // Minimum execution time: 78_453 nanoseconds. + Weight::from_parts(80_732_000, 6176) + .saturating_add(T::DbWeight::get().reads(4)) + } + // Storage: FeeShare DistributionInfos (r:1 w:1) + // Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:0) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + fn delete_distribution() -> Weight { + // Proof Size summary in bytes: + // Measured: `1616` + // Estimated: `6176` + // Minimum execution time: 80_872 nanoseconds. + Weight::from_parts(82_734_000, 6176) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_flexible_fee.rs b/runtime/bifrost-kusama/src/weights/bifrost_flexible_fee.rs new file mode 100644 index 000000000..881576d80 --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_flexible_fee.rs @@ -0,0 +1,77 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_flexible_fee +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_flexible_fee +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_flexible_fee.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_flexible_fee. +pub struct BifrostWeight(PhantomData); +impl bifrost_flexible_fee::WeightInfo for BifrostWeight { + // Storage: FlexibleFee UserDefaultFeeCurrency (r:0 w:1) + // Proof Skipped: FlexibleFee UserDefaultFeeCurrency (max_values: None, max_size: None, mode: Measured) + fn set_user_default_fee_currency() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 10_741 nanoseconds. + Weight::from_parts(11_257_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: FlexibleFee UniversalFeeCurrencyOrderList (r:0 w:1) + // Proof Skipped: FlexibleFee UniversalFeeCurrencyOrderList (max_values: Some(1), max_size: None, mode: Measured) + fn set_universal_fee_currency_order_list() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 9_810 nanoseconds. + Weight::from_parts(10_160_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_salp.rs b/runtime/bifrost-kusama/src/weights/bifrost_salp.rs new file mode 100644 index 000000000..15bec40ae --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_salp.rs @@ -0,0 +1,367 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_salp +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_salp +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_salp.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_salp. +pub struct BifrostWeight(PhantomData); +impl bifrost_salp::WeightInfo for BifrostWeight { + // Storage: Salp Funds (r:1 w:0) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), 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: Salp QueryIdContributionInfo (r:0 w:1) + // Proof Skipped: Salp QueryIdContributionInfo (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + // Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + // Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + fn contribute() -> Weight { + // Proof Size summary in bytes: + // Measured: `2252` + // Estimated: `5717` + // Minimum execution time: 178_249 nanoseconds. + Weight::from_parts(181_741_000, 5717) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: Salp FailedFundsToRefund (r:1 w:0) + // Proof Skipped: Salp FailedFundsToRefund (max_values: None, max_size: None, mode: Measured) + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Salp RedeemPool (r:1 w:1) + // Proof Skipped: Salp RedeemPool (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:2 w:2) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn refund() -> Weight { + // Proof Size summary in bytes: + // Measured: `2375` + // Estimated: `11362` + // Minimum execution time: 269_471 nanoseconds. + Weight::from_parts(271_761_000, 11362) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(9)) + } + // Storage: Salp Funds (r:1 w:0) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:0) + // Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:0) + fn unlock() -> Weight { + // Proof Size summary in bytes: + // Measured: `1962` + // Estimated: `6176` + // Minimum execution time: 131_128 nanoseconds. + Weight::from_parts(132_692_000, 6176) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Salp Funds (r:1 w:0) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: unknown `0x` (r:1 w:0) + // Proof Skipped: unknown `0x` (r:1 w:0) + // Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:0) + // Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:0) + fn batch_unlock() -> Weight { + // Proof Size summary in bytes: + // Measured: `1995` + // Estimated: `6176` + // Minimum execution time: 142_535 nanoseconds. + Weight::from_parts(144_730_000, 6176) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Salp RedeemPool (r:1 w:1) + // Proof Skipped: Salp RedeemPool (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:2 w:2) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn redeem() -> Weight { + // Proof Size summary in bytes: + // Measured: `2356` + // Estimated: `11362` + // Minimum execution time: 253_883 nanoseconds. + Weight::from_parts(256_438_000, 11362) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(9)) + } + // Storage: Salp MultisigConfirmAccount (r:0 w:1) + // Proof Skipped: Salp MultisigConfirmAccount (max_values: Some(1), max_size: None, mode: Measured) + fn set_multisig_confirm_account() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 9_755 nanoseconds. + Weight::from_parts(10_191_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + fn fund_success() -> Weight { + // Proof Size summary in bytes: + // Measured: `292` + // Estimated: `3757` + // Minimum execution time: 42_866 nanoseconds. + Weight::from_parts(43_319_000, 3757) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + fn fund_fail() -> Weight { + // Proof Size summary in bytes: + // Measured: `292` + // Estimated: `3757` + // Minimum execution time: 43_032 nanoseconds. + Weight::from_parts(43_468_000, 3757) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Salp FailedFundsToRefund (r:0 w:1) + // Proof Skipped: Salp FailedFundsToRefund (max_values: None, max_size: None, mode: Measured) + fn continue_fund() -> Weight { + // Proof Size summary in bytes: + // Measured: `1061` + // Estimated: `7001` + // Minimum execution time: 101_152 nanoseconds. + Weight::from_parts(103_733_000, 7001) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + fn fund_retire() -> Weight { + // Proof Size summary in bytes: + // Measured: `292` + // Estimated: `3757` + // Minimum execution time: 42_448 nanoseconds. + Weight::from_parts(43_562_000, 3757) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + fn fund_end() -> Weight { + // Proof Size summary in bytes: + // Measured: `325` + // Estimated: `3790` + // Minimum execution time: 43_007 nanoseconds. + Weight::from_parts(44_240_000, 3790) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Salp CurrentTrieIndex (r:1 w:1) + // Proof Skipped: Salp CurrentTrieIndex (max_values: Some(1), max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn create() -> Weight { + // Proof Size summary in bytes: + // Measured: `833` + // Estimated: `6773` + // Minimum execution time: 82_745 nanoseconds. + Weight::from_parts(85_358_000, 6773) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + fn edit() -> Weight { + // Proof Size summary in bytes: + // Measured: `292` + // Estimated: `3757` + // Minimum execution time: 38_572 nanoseconds. + Weight::from_parts(39_606_000, 3757) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp MultisigConfirmAccount (r:1 w:0) + // Proof Skipped: Salp MultisigConfirmAccount (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Salp QueryIdContributionInfo (r:1 w:1) + // Proof Skipped: Salp QueryIdContributionInfo (max_values: None, max_size: None, mode: Measured) + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:2 w:2) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + // Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + fn confirm_contribute() -> Weight { + // Proof Size summary in bytes: + // Measured: `2556` + // Estimated: `11362` + // Minimum execution time: 282_283 nanoseconds. + Weight::from_parts(290_913_000, 11362) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Salp RedeemPool (r:1 w:1) + // Proof Skipped: Salp RedeemPool (max_values: Some(1), max_size: None, mode: Measured) + fn withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `325` + // Estimated: `3790` + // Minimum execution time: 45_530 nanoseconds. + Weight::from_parts(47_033_000, 3790) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Salp FailedFundsToRefund (r:1 w:1) + // Proof Skipped: Salp FailedFundsToRefund (max_values: None, max_size: None, mode: Measured) + fn dissolve_refunded() -> Weight { + // Proof Size summary in bytes: + // Measured: `403` + // Estimated: `3868` + // Minimum execution time: 54_018 nanoseconds. + Weight::from_parts(55_598_000, 3868) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:3 w:3) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:3) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: unknown `0x` (r:1 w:0) + // Proof Skipped: unknown `0x` (r:1 w:0) + // Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + // Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + fn dissolve() -> Weight { + // Proof Size summary in bytes: + // Measured: `2063` + // Estimated: `8799` + // Minimum execution time: 256_408 nanoseconds. + Weight::from_parts(261_096_000, 8799) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(8)) + } + // 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:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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: ZenlinkProtocol PairStatuses (r:1 w:0) + // Proof Skipped: ZenlinkProtocol PairStatuses (max_values: None, max_size: None, mode: Measured) + fn buyback() -> Weight { + // Proof Size summary in bytes: + // Measured: `2284` + // Estimated: `11362` + // Minimum execution time: 245_677 nanoseconds. + Weight::from_parts(249_443_000, 11362) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: StableAsset TokenRateCaches (r:2 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // 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) + fn buyback_vstoken_by_stable_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `2438` + // Estimated: `11362` + // Minimum execution time: 362_245 nanoseconds. + Weight::from_parts(367_702_000, 11362) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(6)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_slp.rs b/runtime/bifrost-kusama/src/weights/bifrost_slp.rs new file mode 100644 index 000000000..cce095967 --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_slp.rs @@ -0,0 +1,791 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_slp +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_slp +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_slp.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_slp. +pub struct BifrostWeight(PhantomData); +impl bifrost_slp::WeightInfo for BifrostWeight { + // Storage: Slp DelegatorNextIndex (r:1 w:1) + // Proof Skipped: Slp DelegatorNextIndex (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: Slp DelegatorsIndex2Multilocation (r:1 w:1) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:0 w:1) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + fn initialize_delegator() -> Weight { + // Proof Size summary in bytes: + // Measured: `166` + // Estimated: `3631` + // Minimum execution time: 66_316 nanoseconds. + Weight::from_parts(67_556_000, 3631) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn bond() -> Weight { + // Proof Size summary in bytes: + // Measured: `629` + // Estimated: `4094` + // Minimum execution time: 104_135 nanoseconds. + Weight::from_parts(105_944_000, 4094) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn bond_extra() -> Weight { + // Proof Size summary in bytes: + // Measured: `896` + // Estimated: `4361` + // Minimum execution time: 105_850 nanoseconds. + Weight::from_parts(109_005_000, 4361) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: Slp CurrencyDelays (r:1 w:0) + // Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn unbond() -> Weight { + // Proof Size summary in bytes: + // Measured: `1028` + // Estimated: `4493` + // Minimum execution time: 128_505 nanoseconds. + Weight::from_parts(130_525_000, 4493) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: Slp CurrencyDelays (r:1 w:0) + // Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn unbond_all() -> Weight { + // Proof Size summary in bytes: + // Measured: `1006` + // Estimated: `4471` + // Minimum execution time: 120_242 nanoseconds. + Weight::from_parts(124_199_000, 4471) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn rebond() -> Weight { + // Proof Size summary in bytes: + // Measured: `941` + // Estimated: `4406` + // Minimum execution time: 106_179 nanoseconds. + Weight::from_parts(108_122_000, 4406) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:1 w:0) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp ValidatorsByDelegatorXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn delegate() -> Weight { + // Proof Size summary in bytes: + // Measured: `963` + // Estimated: `4428` + // Minimum execution time: 120_559 nanoseconds. + Weight::from_parts(123_430_000, 4428) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp ValidatorsByDelegator (r:1 w:0) + // Proof Skipped: Slp ValidatorsByDelegator (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp ValidatorsByDelegatorXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn undelegate() -> Weight { + // Proof Size summary in bytes: + // Measured: `1031` + // Estimated: `4496` + // Minimum execution time: 111_483 nanoseconds. + Weight::from_parts(113_771_000, 4496) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:1 w:0) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp ValidatorsByDelegatorXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn redelegate() -> Weight { + // Proof Size summary in bytes: + // Measured: `963` + // Estimated: `4428` + // Minimum execution time: 121_646 nanoseconds. + Weight::from_parts(123_838_000, 4428) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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 payout() -> Weight { + // Proof Size summary in bytes: + // Measured: `367` + // Estimated: `3832` + // Minimum execution time: 61_226 nanoseconds. + Weight::from_parts(62_259_000, 3832) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn liquidize() -> Weight { + // Proof Size summary in bytes: + // Measured: `612` + // Estimated: `4077` + // Minimum execution time: 98_187 nanoseconds. + Weight::from_parts(100_637_000, 4077) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: Slp CurrencyDelays (r:1 w:0) + // Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn chill() -> Weight { + // Proof Size summary in bytes: + // Measured: `1006` + // Estimated: `4471` + // Minimum execution time: 127_921 nanoseconds. + Weight::from_parts(129_570_000, 4471) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (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: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + fn transfer_back() -> Weight { + // Proof Size summary in bytes: + // Measured: `401` + // Estimated: `3866` + // Minimum execution time: 74_216 nanoseconds. + Weight::from_parts(75_781_000, 3866) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + fn transfer_to() -> Weight { + // Proof Size summary in bytes: + // Measured: `298` + // Estimated: `3763` + // Minimum execution time: 55_326 nanoseconds. + Weight::from_parts(57_260_000, 3763) + .saturating_add(T::DbWeight::get().reads(2)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn convert_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `697` + // Estimated: `4162` + // Minimum execution time: 87_626 nanoseconds. + Weight::from_parts(89_702_000, 4162) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: VtokenMinting TokenPool (r:1 w:1) + // Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn increase_token_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3503` + // Minimum execution time: 30_773 nanoseconds. + Weight::from_parts(31_754_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting TokenPool (r:1 w:1) + // Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn decrease_token_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `230` + // Estimated: `3503` + // Minimum execution time: 33_009 nanoseconds. + Weight::from_parts(33_510_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp OngoingTimeUnitUpdateInterval (r:1 w:0) + // Proof Skipped: Slp OngoingTimeUnitUpdateInterval (max_values: None, max_size: None, mode: Measured) + // Storage: Slp LastTimeUpdatedOngoingTimeUnit (r:1 w:1) + // Proof Skipped: Slp LastTimeUpdatedOngoingTimeUnit (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:1) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + fn update_ongoing_time_unit() -> Weight { + // Proof Size summary in bytes: + // Measured: `277` + // Estimated: `3742` + // Minimum execution time: 55_617 nanoseconds. + Weight::from_parts(56_576_000, 3742) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:0) + // Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, 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:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn refund_currency_due_unbond() -> Weight { + // Proof Size summary in bytes: + // Measured: `1897` + // Estimated: `6196` + // Minimum execution time: 157_504 nanoseconds. + Weight::from_parts(160_216_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: Slp FeeSources (r:1 w:0) + // Proof Skipped: Slp FeeSources (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + fn supplement_fee_reserve() -> Weight { + // Proof Size summary in bytes: + // Measured: `391` + // Estimated: `3856` + // Minimum execution time: 62_010 nanoseconds. + Weight::from_parts(63_508_000, 3856) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: Slp CurrencyTuneExchangeRateLimit (r:1 w:0) + // Proof Skipped: Slp CurrencyTuneExchangeRateLimit (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenMinting TokenPool (r:1 w:1) + // Proof: VtokenMinting TokenPool (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: Slp CurrencyLatestTuneRecord (r:1 w:1) + // Proof Skipped: Slp CurrencyLatestTuneRecord (max_values: None, max_size: None, mode: Measured) + // Storage: Slp HostingFees (r:1 w:0) + // Proof Skipped: Slp HostingFees (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLatestTuneRecord (r:1 w:1) + // Proof Skipped: Slp DelegatorLatestTuneRecord (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgers (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + fn charge_host_fee_and_tune_vtoken_exchange_rate() -> Weight { + // Proof Size summary in bytes: + // Measured: `2097` + // Estimated: `5562` + // Minimum execution time: 215_456 nanoseconds. + Weight::from_parts(221_225_000, 5562) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(7)) + } + // Storage: Slp OperateOrigins (r:1 w:1) + // Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) + fn set_operate_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 29_641 nanoseconds. + Weight::from_parts(31_358_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp FeeSources (r:1 w:1) + // Proof Skipped: Slp FeeSources (max_values: None, max_size: None, mode: Measured) + fn set_fee_source() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 28_008 nanoseconds. + Weight::from_parts(33_202_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp DelegatorsIndex2Multilocation (r:1 w:1) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorNextIndex (r:1 w:0) + // Proof Skipped: Slp DelegatorNextIndex (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:0 w:1) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + fn add_delegator() -> Weight { + // Proof Size summary in bytes: + // Measured: `63` + // Estimated: `3528` + // Minimum execution time: 51_783 nanoseconds. + Weight::from_parts(53_173_000, 3528) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp DelegatorLedgers (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:1) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorsIndex2Multilocation (r:0 w:1) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + fn remove_delegator() -> Weight { + // Proof Size summary in bytes: + // Measured: `340` + // Estimated: `3805` + // Minimum execution time: 61_870 nanoseconds. + Weight::from_parts(64_474_000, 3805) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp Validators (r:1 w:1) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + fn add_validator() -> Weight { + // Proof Size summary in bytes: + // Measured: `63` + // Estimated: `3528` + // Minimum execution time: 40_832 nanoseconds. + Weight::from_parts(41_891_000, 3528) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp Validators (r:1 w:1) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + fn remove_validator() -> Weight { + // Proof Size summary in bytes: + // Measured: `120` + // Estimated: `3585` + // Minimum execution time: 40_957 nanoseconds. + Weight::from_parts(42_157_000, 3585) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:1 w:0) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + // Storage: Slp ValidatorsByDelegator (r:0 w:1) + // Proof Skipped: Slp ValidatorsByDelegator (max_values: None, max_size: None, mode: Measured) + fn set_validators_by_delegator() -> Weight { + // Proof Size summary in bytes: + // Measured: `331` + // Estimated: `3796` + // Minimum execution time: 61_606 nanoseconds. + Weight::from_parts(62_459_000, 3796) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp DelegatorLedgers (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + fn set_delegator_ledger() -> Weight { + // Proof Size summary in bytes: + // Measured: `242` + // Estimated: `3707` + // Minimum execution time: 45_286 nanoseconds. + Weight::from_parts(46_262_000, 3707) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp MinimumsAndMaximums (r:1 w:1) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + fn set_minimums_and_maximums() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 31_060 nanoseconds. + Weight::from_parts(32_075_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp CurrencyDelays (r:1 w:1) + // Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) + fn set_currency_delays() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 26_703 nanoseconds. + Weight::from_parts(30_485_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp HostingFees (r:1 w:1) + // Proof Skipped: Slp HostingFees (max_values: None, max_size: None, mode: Measured) + fn set_hosting_fees() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 31_853 nanoseconds. + Weight::from_parts(33_036_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp CurrencyTuneExchangeRateLimit (r:1 w:1) + // Proof Skipped: Slp CurrencyTuneExchangeRateLimit (max_values: None, max_size: None, mode: Measured) + fn set_currency_tune_exchange_rate_limit() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 29_121 nanoseconds. + Weight::from_parts(30_332_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp OngoingTimeUnitUpdateInterval (r:1 w:1) + // Proof Skipped: Slp OngoingTimeUnitUpdateInterval (max_values: None, max_size: None, mode: Measured) + // Storage: Slp LastTimeUpdatedOngoingTimeUnit (r:0 w:1) + // Proof Skipped: Slp LastTimeUpdatedOngoingTimeUnit (max_values: None, max_size: None, mode: Measured) + fn set_ongoing_time_unit_update_interval() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 31_333 nanoseconds. + Weight::from_parts(36_804_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp SupplementFeeAccountWhitelist (r:1 w:1) + // Proof Skipped: Slp SupplementFeeAccountWhitelist (max_values: None, max_size: None, mode: Measured) + fn add_supplement_fee_account_to_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 37_467 nanoseconds. + Weight::from_parts(38_636_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp SupplementFeeAccountWhitelist (r:1 w:1) + // Proof Skipped: Slp SupplementFeeAccountWhitelist (max_values: None, max_size: None, mode: Measured) + fn remove_supplement_fee_account_from_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `119` + // Estimated: `3584` + // Minimum execution time: 41_910 nanoseconds. + Weight::from_parts(42_858_000, 3584) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgers (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:1 w:0) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn confirm_delegator_ledger_query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `597` + // Estimated: `4062` + // Minimum execution time: 73_648 nanoseconds. + Weight::from_parts(74_976_000, 4062) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:1 w:0) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn fail_delegator_ledger_query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `496` + // Estimated: `3961` + // Minimum execution time: 52_423 nanoseconds. + Weight::from_parts(53_428_000, 3961) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp ValidatorsByDelegatorXcmUpdateQueue (r:1 w:1) + // Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: Slp ValidatorsByDelegator (r:0 w:1) + // Proof Skipped: Slp ValidatorsByDelegator (max_values: None, max_size: None, mode: Measured) + fn confirm_validators_by_delegator_query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `229` + // Estimated: `3694` + // Minimum execution time: 47_808 nanoseconds. + Weight::from_parts(48_657_000, 3694) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp ValidatorsByDelegatorXcmUpdateQueue (r:1 w:1) + // Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:1 w:0) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn fail_validators_by_delegator_query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `561` + // Estimated: `4026` + // Minimum execution time: 54_224 nanoseconds. + Weight::from_parts(55_128_000, 4026) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:0 w:1) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + fn reset_validators() -> Weight { + // Proof Size summary in bytes: + // Measured: `63` + // Estimated: `3528` + // Minimum execution time: 36_205 nanoseconds. + Weight::from_parts(39_311_000, 3528) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:1 w:1) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + // Storage: Slp ValidatorBoostList (r:0 w:1) + // Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) + fn set_validator_boost_list() -> Weight { + // Proof Size summary in bytes: + // Measured: `63` + // Estimated: `3528` + // Minimum execution time: 60_318 nanoseconds. + Weight::from_parts(61_929_000, 3528) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp ValidatorBoostList (r:1 w:1) + // Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:1 w:1) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + fn add_to_validator_boost_list() -> Weight { + // Proof Size summary in bytes: + // Measured: `42` + // Estimated: `3507` + // Minimum execution time: 53_855 nanoseconds. + Weight::from_parts(56_070_000, 3507) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp ValidatorBoostList (r:1 w:1) + // Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) + fn remove_from_validator_boot_list() -> Weight { + // Proof Size summary in bytes: + // Measured: `161` + // Estimated: `3626` + // Minimum execution time: 37_202 nanoseconds. + Weight::from_parts(37_957_000, 3626) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_slpx.rs b/runtime/bifrost-kusama/src/weights/bifrost_slpx.rs new file mode 100644 index 000000000..0ac0da0d3 --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_slpx.rs @@ -0,0 +1,215 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_slpx +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_slpx.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_slpx. +pub struct BifrostWeight(PhantomData); +impl bifrost_slpx::WeightInfo for BifrostWeight { + // 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_664 nanoseconds. + Weight::from_parts(34_525_000, 3803) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // 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: 37_038 nanoseconds. + Weight::from_parts(38_028_000, 3803) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // 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_630 nanoseconds. + Weight::from_parts(25_469_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // 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: 24_544 nanoseconds. + Weight::from_parts(25_336_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // 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) + fn mint() -> Weight { + // Proof Size summary in bytes: + // Measured: `2442` + // Estimated: `11362` + // Minimum execution time: 355_230 nanoseconds. + Weight::from_parts(360_766_000, 11362) + .saturating_add(T::DbWeight::get().reads(16)) + .saturating_add(T::DbWeight::get().writes(8)) + } + // 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) + fn redeem() -> Weight { + // Proof Size summary in bytes: + // Measured: `2194` + // Estimated: `8134` + // Minimum execution time: 243_971 nanoseconds. + Weight::from_parts(250_684_000, 8134) + .saturating_add(T::DbWeight::get().reads(16)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // 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: 220_866 nanoseconds. + Weight::from_parts(223_033_000, 11362) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // 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 { + // Proof Size summary in bytes: + // Measured: `2782` + // Estimated: `16548` + // Minimum execution time: 552_131 nanoseconds. + Weight::from_parts(564_804_000, 16548) + .saturating_add(T::DbWeight::get().reads(17)) + .saturating_add(T::DbWeight::get().writes(3)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_stable_pool.rs b/runtime/bifrost-kusama/src/weights/bifrost_stable_pool.rs new file mode 100644 index 000000000..42173ec5d --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_stable_pool.rs @@ -0,0 +1,225 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_stable_pool +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_stable_pool +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_stable_pool.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_stable_pool. +pub struct BifrostWeight(PhantomData); +impl bifrost_stable_pool::WeightInfo for BifrostWeight { + // Storage: StableAsset PoolCount (r:1 w:1) + // Proof Skipped: StableAsset PoolCount (max_values: Some(1), max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn create_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `663` + // Estimated: `4128` + // Minimum execution time: 90_724 nanoseconds. + Weight::from_parts(93_251_000, 4128) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: StableAsset PoolCount (r:1 w:0) + // Proof Skipped: StableAsset PoolCount (max_values: Some(1), max_size: None, mode: Measured) + // Storage: StableAsset TokenRateCaches (r:3 w:2) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + fn edit_token_rate() -> Weight { + // Proof Size summary in bytes: + // Measured: `258` + // Estimated: `8673` + // Minimum execution time: 70_303 nanoseconds. + Weight::from_parts(71_635_000, 8673) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: StableAsset TokenRateCaches (r:2 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:3 w:3) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn add_liquidity() -> Weight { + // Proof Size summary in bytes: + // Measured: `2557` + // Estimated: `8769` + // Minimum execution time: 427_183 nanoseconds. + Weight::from_parts(438_909_000, 8769) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(7)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: StableAsset TokenRateCaches (r:1 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn swap() -> Weight { + // Proof Size summary in bytes: + // Measured: `2239` + // Estimated: `6196` + // Minimum execution time: 375_244 nanoseconds. + Weight::from_parts(385_475_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: StableAsset TokenRateCaches (r:1 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn redeem_proportion() -> Weight { + // Proof Size summary in bytes: + // Measured: `2239` + // Estimated: `6196` + // Minimum execution time: 359_499 nanoseconds. + Weight::from_parts(370_566_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: StableAsset TokenRateCaches (r:1 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn redeem_single() -> Weight { + // Proof Size summary in bytes: + // Measured: `2239` + // Estimated: `6196` + // Minimum execution time: 304_691 nanoseconds. + Weight::from_parts(312_518_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: StableAsset TokenRateCaches (r:1 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn redeem_multi() -> Weight { + // Proof Size summary in bytes: + // Measured: `2239` + // Estimated: `6196` + // Minimum execution time: 363_000 nanoseconds. + Weight::from_parts(367_057_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + fn modify_a() -> Weight { + // Proof Size summary in bytes: + // Measured: `446` + // Estimated: `3911` + // Minimum execution time: 45_142 nanoseconds. + Weight::from_parts(46_445_000, 3911) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + fn modify_fees() -> Weight { + // Proof Size summary in bytes: + // Measured: `446` + // Estimated: `3911` + // Minimum execution time: 42_836 nanoseconds. + Weight::from_parts(44_114_000, 3911) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + fn modify_recipients() -> Weight { + // Proof Size summary in bytes: + // Measured: `446` + // Estimated: `3911` + // Minimum execution time: 42_455 nanoseconds. + Weight::from_parts(43_753_000, 3911) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_system_maker.rs b/runtime/bifrost-kusama/src/weights/bifrost_system_maker.rs new file mode 100644 index 000000000..346c74f41 --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_system_maker.rs @@ -0,0 +1,122 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_system_maker +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_system_maker +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_system_maker.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_system_maker. +pub struct BifrostWeight(PhantomData); +impl bifrost_system_maker::WeightInfo for BifrostWeight { + // Storage: SystemMaker Infos (r:1 w:1) + // Proof Skipped: SystemMaker Infos (max_values: None, max_size: None, mode: Measured) + fn set_config() -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `3574` + // Minimum execution time: 32_211 nanoseconds. + Weight::from_parts(33_399_000, 3574) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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) + fn charge() -> Weight { + // Proof Size summary in bytes: + // Measured: `1402` + // Estimated: `6196` + // Minimum execution time: 122_457 nanoseconds. + Weight::from_parts(124_486_000, 6196) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: SystemMaker Infos (r:0 w:1) + // Proof Skipped: SystemMaker Infos (max_values: None, max_size: None, mode: Measured) + fn close() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 22_412 nanoseconds. + Weight::from_parts(22_806_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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) + fn payout() -> Weight { + // Proof Size summary in bytes: + // Measured: `1461` + // Estimated: `6196` + // Minimum execution time: 114_158 nanoseconds. + Weight::from_parts(116_409_000, 6196) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: SystemMaker Infos (r:2 w:0) + // Proof Skipped: SystemMaker Infos (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: Tokens Accounts (r:2 w:0) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + fn on_idle() -> Weight { + // Proof Size summary in bytes: + // Measured: `894` + // Estimated: `6834` + // Minimum execution time: 54_792 nanoseconds. + Weight::from_parts(55_872_000, 6834) + .saturating_add(T::DbWeight::get().reads(5)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_system_staking.rs b/runtime/bifrost-kusama/src/weights/bifrost_system_staking.rs new file mode 100644 index 000000000..f498d3d9e --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_system_staking.rs @@ -0,0 +1,140 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_system_staking +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_system_staking +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_system_staking.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_system_staking. +pub struct BifrostWeight(PhantomData); +impl bifrost_system_staking::WeightInfo for BifrostWeight { + // Storage: SystemStaking TokenList (r:1 w:0) + // Proof Skipped: SystemStaking TokenList (max_values: Some(1), max_size: None, mode: Measured) + // Storage: SystemStaking Round (r:1 w:0) + // Proof Skipped: SystemStaking Round (max_values: Some(1), max_size: None, mode: Measured) + // Storage: SystemStaking TokenStatus (r:2 w:0) + // Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) + fn on_initialize() -> Weight { + // Proof Size summary in bytes: + // Measured: `445` + // Estimated: `6385` + // Minimum execution time: 28_850 nanoseconds. + Weight::from_parts(29_556_000, 6385) + .saturating_add(T::DbWeight::get().reads(4)) + } + // Storage: SystemStaking TokenStatus (r:1 w:1) + // Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) + // Storage: SystemStaking TokenList (r:1 w:1) + // Proof Skipped: SystemStaking TokenList (max_values: Some(1), max_size: None, mode: Measured) + fn token_config() -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `3574` + // Minimum execution time: 41_759 nanoseconds. + Weight::from_parts(42_957_000, 3574) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: SystemStaking TokenStatus (r:1 w:1) + // Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) + // Storage: Farming PoolInfos (r:1 w:0) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + fn refresh_token_info() -> Weight { + // Proof Size summary in bytes: + // Measured: `403` + // Estimated: `3868` + // Minimum execution time: 51_852 nanoseconds. + Weight::from_parts(53_735_000, 3868) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: SystemStaking TokenStatus (r:1 w:0) + // Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:0) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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) + fn payout() -> Weight { + // Proof Size summary in bytes: + // Measured: `1190` + // Estimated: `4655` + // Minimum execution time: 68_013 nanoseconds. + Weight::from_parts(69_859_000, 4655) + .saturating_add(T::DbWeight::get().reads(4)) + } + fn on_redeem_success() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 1_959 nanoseconds. + Weight::from_parts(2_084_000, 0) + } + fn on_redeemed() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 1_994 nanoseconds. + Weight::from_parts(2_059_000, 0) + } + // Storage: SystemStaking TokenList (r:1 w:1) + // Proof Skipped: SystemStaking TokenList (max_values: Some(1), max_size: None, mode: Measured) + // Storage: SystemStaking TokenStatus (r:0 w:1) + // Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) + fn delete_token() -> Weight { + // Proof Size summary in bytes: + // Measured: `169` + // Estimated: `1654` + // Minimum execution time: 22_823 nanoseconds. + Weight::from_parts(23_707_000, 1654) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_token_issuer.rs b/runtime/bifrost-kusama/src/weights/bifrost_token_issuer.rs new file mode 100644 index 000000000..770f5587b --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_token_issuer.rs @@ -0,0 +1,133 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_token_issuer +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_token_issuer +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_token_issuer.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_token_issuer. +pub struct BifrostWeight(PhantomData); +impl bifrost_token_issuer::WeightInfo for BifrostWeight { + // Storage: TokenIssuer IssueWhiteList (r:1 w:1) + // Proof Skipped: TokenIssuer IssueWhiteList (max_values: None, max_size: None, mode: Measured) + fn add_to_issue_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `142` + // Estimated: `3607` + // Minimum execution time: 34_320 nanoseconds. + Weight::from_parts(35_020_000, 3607) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: TokenIssuer IssueWhiteList (r:1 w:1) + // Proof Skipped: TokenIssuer IssueWhiteList (max_values: None, max_size: None, mode: Measured) + fn remove_from_issue_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `220` + // Estimated: `3685` + // Minimum execution time: 34_889 nanoseconds. + Weight::from_parts(36_249_000, 3685) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: TokenIssuer TransferWhiteList (r:1 w:1) + // Proof Skipped: TokenIssuer TransferWhiteList (max_values: None, max_size: None, mode: Measured) + fn add_to_transfer_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `142` + // Estimated: `3607` + // Minimum execution time: 33_724 nanoseconds. + Weight::from_parts(34_537_000, 3607) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: TokenIssuer TransferWhiteList (r:1 w:1) + // Proof Skipped: TokenIssuer TransferWhiteList (max_values: None, max_size: None, mode: Measured) + fn remove_from_transfer_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `220` + // Estimated: `3685` + // Minimum execution time: 35_235 nanoseconds. + Weight::from_parts(35_823_000, 3685) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: TokenIssuer IssueWhiteList (r:1 w:0) + // Proof Skipped: TokenIssuer IssueWhiteList (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn issue() -> Weight { + // Proof Size summary in bytes: + // Measured: `1870` + // Estimated: `5335` + // Minimum execution time: 104_659 nanoseconds. + Weight::from_parts(106_259_000, 5335) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: TokenIssuer TransferWhiteList (r:1 w:0) + // Proof Skipped: TokenIssuer TransferWhiteList (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn transfer() -> Weight { + // Proof Size summary in bytes: + // Measured: `1989` + // Estimated: `6176` + // Minimum execution time: 118_862 nanoseconds. + Weight::from_parts(121_698_000, 6176) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_vsbond_auction.rs b/runtime/bifrost-kusama/src/weights/bifrost_vsbond_auction.rs new file mode 100644 index 000000000..3dcf1d92c --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_vsbond_auction.rs @@ -0,0 +1,150 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_vsbond_auction +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_vsbond_auction +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_vsbond_auction.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_vsbond_auction. +pub struct BifrostWeight(PhantomData); +impl bifrost_vsbond_auction::WeightInfo for BifrostWeight { + // Storage: VSBondAuction TransactionFee (r:1 w:0) + // Proof Skipped: VSBondAuction TransactionFee (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: VSBondAuction UserOrderIds (r:1 w:1) + // Proof Skipped: VSBondAuction UserOrderIds (max_values: None, max_size: None, mode: Measured) + // Storage: VSBondAuction NextOrderId (r:1 w:1) + // Proof Skipped: VSBondAuction NextOrderId (max_values: Some(1), max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: VSBondAuction TotalOrderInfos (r:0 w:1) + // Proof Skipped: VSBondAuction TotalOrderInfos (max_values: None, max_size: None, mode: Measured) + fn create_order() -> Weight { + // Proof Size summary in bytes: + // Measured: `1789` + // Estimated: `6176` + // Minimum execution time: 175_259 nanoseconds. + Weight::from_parts(177_403_000, 6176) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(6)) + } + // Storage: VSBondAuction TotalOrderInfos (r:1 w:1) + // Proof Skipped: VSBondAuction TotalOrderInfos (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: VSBondAuction UserOrderIds (r:1 w:1) + // Proof Skipped: VSBondAuction UserOrderIds (max_values: None, max_size: None, mode: Measured) + fn revoke_order() -> Weight { + // Proof Size summary in bytes: + // Measured: `2023` + // Estimated: `6176` + // Minimum execution time: 161_381 nanoseconds. + Weight::from_parts(162_871_000, 6176) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: VSBondAuction TotalOrderInfos (r:1 w:1) + // Proof Skipped: VSBondAuction TotalOrderInfos (max_values: None, max_size: None, mode: Measured) + // Storage: VSBondAuction TransactionFee (r:1 w:0) + // Proof Skipped: VSBondAuction TransactionFee (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: VSBondAuction UserOrderIds (r:1 w:1) + // Proof Skipped: VSBondAuction UserOrderIds (max_values: None, max_size: None, mode: Measured) + fn clinch_order() -> Weight { + // Proof Size summary in bytes: + // Measured: `2383` + // Estimated: `11362` + // Minimum execution time: 236_772 nanoseconds. + Weight::from_parts(238_487_000, 11362) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(7)) + } + // Storage: VSBondAuction TotalOrderInfos (r:1 w:1) + // Proof Skipped: VSBondAuction TotalOrderInfos (max_values: None, max_size: None, mode: Measured) + // Storage: VSBondAuction TransactionFee (r:1 w:0) + // Proof Skipped: VSBondAuction TransactionFee (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:0) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn partial_clinch_order() -> Weight { + // Proof Size summary in bytes: + // Measured: `2291` + // Estimated: `11362` + // Minimum execution time: 206_572 nanoseconds. + Weight::from_parts(214_687_000, 11362) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: VSBondAuction TransactionFee (r:1 w:1) + // Proof Skipped: VSBondAuction TransactionFee (max_values: Some(1), max_size: None, mode: Measured) + fn set_buy_and_sell_transaction_fee_rate() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `1489` + // Minimum execution time: 26_870 nanoseconds. + Weight::from_parts(27_527_000, 1489) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_vstoken_conversion.rs b/runtime/bifrost-kusama/src/weights/bifrost_vstoken_conversion.rs new file mode 100644 index 000000000..3ead07648 --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_vstoken_conversion.rs @@ -0,0 +1,136 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_vstoken_conversion +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_vstoken_conversion +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_vstoken_conversion.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_vstoken_conversion. +pub struct BifrostWeight(PhantomData); +impl bifrost_vstoken_conversion::WeightInfo for BifrostWeight { + // Storage: VstokenConversion ExchangeFee (r:1 w:1) + // Proof: VstokenConversion ExchangeFee (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + fn set_exchange_fee() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `1517` + // Minimum execution time: 31_889 nanoseconds. + Weight::from_parts(32_495_000, 1517) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VstokenConversion ExchangeRate (r:1 w:1) + // Proof: VstokenConversion ExchangeRate (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + fn set_exchange_rate() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3479` + // Minimum execution time: 32_059 nanoseconds. + Weight::from_parts(33_515_000, 3479) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VstokenConversion RelaychainLease (r:1 w:1) + // Proof: VstokenConversion RelaychainLease (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn set_relaychain_lease() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `1489` + // Minimum execution time: 29_697 nanoseconds. + Weight::from_parts(30_880_000, 1489) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: VstokenConversion RelaychainLease (r:1 w:0) + // Proof: VstokenConversion RelaychainLease (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: VstokenConversion ExchangeRate (r:1 w:0) + // Proof: VstokenConversion ExchangeRate (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + // Storage: VstokenConversion ExchangeFee (r:1 w:0) + // Proof: VstokenConversion ExchangeFee (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + // Storage: System Account (r:3 w:3) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:2 w:2) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn vsbond_convert_to_vstoken() -> Weight { + // Proof Size summary in bytes: + // Measured: `2336` + // Estimated: `11362` + // Minimum execution time: 261_794 nanoseconds. + Weight::from_parts(267_446_000, 11362) + .saturating_add(T::DbWeight::get().reads(14)) + .saturating_add(T::DbWeight::get().writes(9)) + } + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: VstokenConversion RelaychainLease (r:1 w:0) + // Proof: VstokenConversion RelaychainLease (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: VstokenConversion ExchangeRate (r:1 w:0) + // Proof: VstokenConversion ExchangeRate (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + // Storage: VstokenConversion ExchangeFee (r:1 w:0) + // Proof: VstokenConversion ExchangeFee (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + // Storage: System Account (r:3 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn vstoken_convert_to_vsbond() -> Weight { + // Proof Size summary in bytes: + // Measured: `2327` + // Estimated: `11362` + // Minimum execution time: 244_918 nanoseconds. + Weight::from_parts(250_767_000, 11362) + .saturating_add(T::DbWeight::get().reads(13)) + .saturating_add(T::DbWeight::get().writes(7)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_vtoken_minting.rs b/runtime/bifrost-kusama/src/weights/bifrost_vtoken_minting.rs new file mode 100644 index 000000000..417757860 --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_vtoken_minting.rs @@ -0,0 +1,266 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_vtoken_minting +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_vtoken_minting +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_vtoken_minting.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_vtoken_minting. +pub struct BifrostWeight(PhantomData); +impl bifrost_vtoken_minting::WeightInfo for BifrostWeight { + // Storage: VtokenMinting MinimumMint (r:1 w:1) + // Proof: VtokenMinting MinimumMint (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn set_minimum_mint() -> Weight { + // Proof Size summary in bytes: + // Measured: `732` + // Estimated: `4197` + // Minimum execution time: 47_604 nanoseconds. + Weight::from_parts(48_620_000, 4197) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting MinimumRedeem (r:1 w:1) + // Proof: VtokenMinting MinimumRedeem (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn set_minimum_redeem() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3503` + // Minimum execution time: 31_648 nanoseconds. + Weight::from_parts(33_004_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting UnlockDuration (r:1 w:1) + // Proof: VtokenMinting UnlockDuration (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + fn set_unlock_duration() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3492` + // Minimum execution time: 32_605 nanoseconds. + Weight::from_parts(33_244_000, 3492) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting TokenToRebond (r:1 w:1) + // Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn add_support_rebond_token() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3503` + // Minimum execution time: 33_236 nanoseconds. + Weight::from_parts(34_638_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting TokenToRebond (r:1 w:1) + // Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn remove_support_rebond_token() -> Weight { + // Proof Size summary in bytes: + // Measured: `230` + // Estimated: `3503` + // Minimum execution time: 36_978 nanoseconds. + Weight::from_parts(38_593_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting Fees (r:1 w:1) + // Proof: VtokenMinting Fees (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + fn set_fees() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `1493` + // Minimum execution time: 30_702 nanoseconds. + Weight::from_parts(31_421_000, 1493) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting HookIterationLimit (r:1 w:1) + // Proof: VtokenMinting HookIterationLimit (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn set_hook_iteration_limit() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `1489` + // Minimum execution time: 28_783 nanoseconds. + Weight::from_parts(30_913_000, 1489) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // 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: Tokens Accounts (r:3 w:3) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn mint() -> Weight { + // Proof Size summary in bytes: + // Measured: `2041` + // Estimated: `8769` + // Minimum execution time: 204_920 nanoseconds. + Weight::from_parts(207_086_000, 8769) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(6)) + } + // 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: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, 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 OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: VtokenMinting UnlockDuration (r:1 w:0) + // Proof: VtokenMinting UnlockDuration (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: VtokenMinting UnlockingTotal (r:1 w:1) + // Proof: VtokenMinting UnlockingTotal (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenUnlockNextId (r:1 w:1) + // Proof: VtokenMinting TokenUnlockNextId (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + // Storage: VtokenMinting UserUnlockLedger (r:1 w:1) + // Proof: VtokenMinting UserUnlockLedger (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen) + // Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:1) + // Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenUnlockLedger (r:0 w:1) + // Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(136), added: 2611, mode: MaxEncodedLen) + fn redeem() -> Weight { + // Proof Size summary in bytes: + // Measured: `2187` + // Estimated: `6176` + // Minimum execution time: 244_947 nanoseconds. + Weight::from_parts(249_155_000, 6176) + .saturating_add(T::DbWeight::get().reads(15)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: VtokenMinting TokenToRebond (r:1 w:1) + // Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting UserUnlockLedger (r:1 w:1) + // Proof: VtokenMinting UserUnlockLedger (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenUnlockLedger (r:1 w:1) + // Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(136), added: 2611, mode: MaxEncodedLen) + // Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:1) + // Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, mode: MaxEncodedLen) + // Storage: VtokenMinting UnlockingTotal (r:1 w:1) + // Proof: VtokenMinting UnlockingTotal (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: Tokens Accounts (r:3 w:3) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn rebond() -> Weight { + // Proof Size summary in bytes: + // Measured: `2620` + // Estimated: `8769` + // Minimum execution time: 231_220 nanoseconds. + Weight::from_parts(235_084_000, 8769) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: VtokenMinting TokenToRebond (r:1 w:1) + // Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenUnlockLedger (r:1 w:1) + // Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(136), added: 2611, mode: MaxEncodedLen) + // Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:1) + // Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, mode: MaxEncodedLen) + // Storage: VtokenMinting UserUnlockLedger (r:1 w:1) + // Proof: VtokenMinting UserUnlockLedger (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen) + // Storage: VtokenMinting UnlockingTotal (r:1 w:1) + // Proof: VtokenMinting UnlockingTotal (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: Tokens Accounts (r:3 w:3) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn rebond_by_unlock_id() -> Weight { + // Proof Size summary in bytes: + // Measured: `2620` + // Estimated: `8769` + // Minimum execution time: 221_577 nanoseconds. + Weight::from_parts(223_798_000, 8769) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + fn on_initialize() -> Weight { + // Proof Size summary in bytes: + // Measured: `211` + // Estimated: `3492` + // Minimum execution time: 16_412 nanoseconds. + Weight::from_parts(16_763_000, 3492) + .saturating_add(T::DbWeight::get().reads(1)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs b/runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs new file mode 100644 index 000000000..e6fe0ba43 --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs @@ -0,0 +1,268 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_vtoken_voting +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_vtoken_voting +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_vtoken_voting. +pub struct BifrostWeight(PhantomData); +impl bifrost_vtoken_voting::WeightInfo for BifrostWeight { + // Storage: VtokenVoting UndecidingTimeout (r:1 w:0) + // Proof: VtokenVoting UndecidingTimeout (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + // Storage: VtokenVoting DelegatorVote (r:2 w:1) + // Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) + // Storage: Slp DelegatorsIndex2Multilocation (r:1 w:0) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenVoting PendingVotingInfo (r:1 w:1) + // Proof: VtokenVoting PendingVotingInfo (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:1) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: VtokenVoting VotingFor (r:1 w:1) + // Proof: VtokenVoting VotingFor (max_values: None, max_size: Some(13663), added: 16138, mode: MaxEncodedLen) + // Storage: VtokenVoting ClassLocksFor (r:1 w:1) + // Proof: VtokenVoting ClassLocksFor (max_values: None, max_size: Some(5162), added: 7637, mode: MaxEncodedLen) + // Storage: Tokens Locks (r:1 w:1) + // Proof: Tokens Locks (max_values: None, max_size: Some(1271), added: 3746, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), 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: VtokenVoting PendingReferendumInfo (r:0 w:1) + // Proof: VtokenVoting PendingReferendumInfo (max_values: None, max_size: Some(34), added: 2509, mode: MaxEncodedLen) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn vote_new() -> Weight { + // Proof Size summary in bytes: + // Measured: `14356` + // Estimated: `17821` + // Minimum execution time: 298_891 nanoseconds. + Weight::from_parts(310_932_000, 17821) + .saturating_add(T::DbWeight::get().reads(15)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: VtokenVoting UndecidingTimeout (r:1 w:0) + // Proof: VtokenVoting UndecidingTimeout (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + // Storage: VtokenVoting DelegatorVote (r:2 w:1) + // Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) + // Storage: Slp DelegatorsIndex2Multilocation (r:1 w:0) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenVoting PendingVotingInfo (r:1 w:1) + // Proof: VtokenVoting PendingVotingInfo (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:1) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: VtokenVoting VotingFor (r:1 w:1) + // Proof: VtokenVoting VotingFor (max_values: None, max_size: Some(13663), added: 16138, mode: MaxEncodedLen) + // Storage: VtokenVoting ClassLocksFor (r:1 w:1) + // Proof: VtokenVoting ClassLocksFor (max_values: None, max_size: Some(5162), added: 7637, mode: MaxEncodedLen) + // Storage: Tokens Locks (r:1 w:1) + // Proof: Tokens Locks (max_values: None, max_size: Some(1271), added: 3746, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), 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: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn vote_existing() -> Weight { + // Proof Size summary in bytes: + // Measured: `5531` + // Estimated: `17128` + // Minimum execution time: 267_328 nanoseconds. + Weight::from_parts(274_051_000, 17128) + .saturating_add(T::DbWeight::get().reads(15)) + .saturating_add(T::DbWeight::get().writes(9)) + } + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:0) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + // Storage: VtokenVoting VoteLockingPeriod (r:1 w:0) + // Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VtokenVoting VotingFor (r:1 w:1) + // Proof: VtokenVoting VotingFor (max_values: None, max_size: Some(13663), added: 16138, mode: MaxEncodedLen) + // Storage: VtokenVoting ClassLocksFor (r:1 w:1) + // Proof: VtokenVoting ClassLocksFor (max_values: None, max_size: Some(5162), added: 7637, mode: MaxEncodedLen) + // Storage: Tokens Locks (r:1 w:1) + // Proof: Tokens Locks (max_values: None, max_size: Some(1271), added: 3746, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn unlock() -> Weight { + // Proof Size summary in bytes: + // Measured: `2103` + // Estimated: `17128` + // Minimum execution time: 163_235 nanoseconds. + Weight::from_parts(166_276_000, 17128) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:0) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + // Storage: VtokenVoting VoteLockingPeriod (r:1 w:0) + // Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VtokenVoting DelegatorVote (r:1 w:0) + // Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), 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: VtokenVoting PendingRemoveDelegatorVote (r:0 w:1) + // Proof: VtokenVoting PendingRemoveDelegatorVote (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn remove_delegator_vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `965` + // Estimated: `4430` + // Minimum execution time: 94_053 nanoseconds. + Weight::from_parts(105_489_000, 4430) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:1) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) + fn kill_referendum() -> Weight { + // Proof Size summary in bytes: + // Measured: `370` + // Estimated: `3553` + // Minimum execution time: 39_404 nanoseconds. + Weight::from_parts(45_802_000, 3553) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp DelegatorsIndex2Multilocation (r:1 w:0) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenVoting DelegatorVote (r:1 w:1) + // Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) + fn set_delegator_role() -> Weight { + // Proof Size summary in bytes: + // Measured: `372` + // Estimated: `3837` + // Minimum execution time: 49_788 nanoseconds. + Weight::from_parts(50_805_000, 3837) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:1) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + fn set_referendum_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `321` + // Estimated: `3553` + // Minimum execution time: 40_937 nanoseconds. + Weight::from_parts(41_714_000, 3553) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenVoting UndecidingTimeout (r:0 w:1) + // Proof: VtokenVoting UndecidingTimeout (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + fn set_undeciding_timeout() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 7_244 nanoseconds. + Weight::from_parts(24_083_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenVoting VoteLockingPeriod (r:0 w:1) + // Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + fn set_vote_locking_period() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 23_244 nanoseconds. + Weight::from_parts(23_717_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenVoting PendingVotingInfo (r:1 w:0) + // Proof: VtokenVoting PendingVotingInfo (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + // Storage: VtokenVoting PendingReferendumInfo (r:1 w:0) + // Proof: VtokenVoting PendingReferendumInfo (max_values: None, max_size: Some(34), added: 2509, mode: MaxEncodedLen) + fn notify_vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `361` + // Estimated: `3582` + // Minimum execution time: 43_638 nanoseconds. + Weight::from_parts(44_768_000, 3582) + .saturating_add(T::DbWeight::get().reads(2)) + } + // Storage: VtokenVoting PendingRemoveDelegatorVote (r:1 w:0) + // Proof: VtokenVoting PendingRemoveDelegatorVote (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) + fn notify_remove_delegator_vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `329` + // Estimated: `3501` + // Minimum execution time: 38_311 nanoseconds. + Weight::from_parts(38_955_000, 3501) + .saturating_add(T::DbWeight::get().reads(1)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/mod.rs b/runtime/bifrost-kusama/src/weights/mod.rs index 9caa884c2..73b98d1d6 100644 --- a/runtime/bifrost-kusama/src/weights/mod.rs +++ b/runtime/bifrost-kusama/src/weights/mod.rs @@ -20,7 +20,24 @@ //! A list of the different weight modules for our runtime. +pub mod bifrost_asset_registry; +pub mod bifrost_call_switchgear; +pub mod bifrost_cross_in_out; pub mod bifrost_currencies; +pub mod bifrost_farming; +pub mod bifrost_fee_share; +pub mod bifrost_flexible_fee; +pub mod bifrost_salp; +pub mod bifrost_slp; +pub mod bifrost_slpx; +pub mod bifrost_stable_pool; +pub mod bifrost_system_maker; +pub mod bifrost_system_staking; +pub mod bifrost_token_issuer; +pub mod bifrost_vsbond_auction; +pub mod bifrost_vstoken_conversion; +pub mod bifrost_vtoken_minting; +pub mod bifrost_vtoken_voting; pub mod orml_oracle; pub mod orml_tokens; pub mod pallet_xcm; diff --git a/runtime/bifrost-kusama/src/xcm_config.rs b/runtime/bifrost-kusama/src/xcm_config.rs index 7da032d83..e351797d4 100644 --- a/runtime/bifrost-kusama/src/xcm_config.rs +++ b/runtime/bifrost-kusama/src/xcm_config.rs @@ -696,6 +696,9 @@ impl pallet_xcm::Config for Runtime { type SendXcmOrigin = EnsureXcmOrigin; type Weigher = FixedWeightBounds; type XcmExecuteFilter = Nothing; + #[cfg(feature = "runtime-benchmarks")] + type XcmExecutor = node_primitives::DoNothingExecuteXcm; + #[cfg(not(feature = "runtime-benchmarks"))] type XcmExecutor = XcmExecutor; type XcmReserveTransferFilter = Everything; #[cfg(feature = "runtime-benchmarks")] @@ -874,6 +877,9 @@ impl orml_xtokens::Config for Runtime { type AccountIdToMultiLocation = BifrostAccountIdToMultiLocation; type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; + #[cfg(feature = "runtime-benchmarks")] + type XcmExecutor = node_primitives::DoNothingExecuteXcm; + #[cfg(not(feature = "runtime-benchmarks"))] type XcmExecutor = XcmExecutor; type Weigher = FixedWeightBounds; type BaseXcmWeight = BaseXcmWeight; @@ -904,6 +910,9 @@ impl xcm_interface::Config for Runtime { type RelayNetwork = RelayNetwork; type RelaychainCurrencyId = RelayCurrencyId; type ParachainSovereignAccount = ParachainAccount; + #[cfg(feature = "runtime-benchmarks")] + type XcmExecutor = node_primitives::DoNothingExecuteXcm; + #[cfg(not(feature = "runtime-benchmarks"))] type XcmExecutor = XcmExecutor; type AccountIdToMultiLocation = BifrostAccountIdToMultiLocation; type SalpHelper = Salp; diff --git a/runtime/bifrost-polkadot/Cargo.toml b/runtime/bifrost-polkadot/Cargo.toml index 04130c14d..a8f413597 100644 --- a/runtime/bifrost-polkadot/Cargo.toml +++ b/runtime/bifrost-polkadot/Cargo.toml @@ -88,6 +88,9 @@ xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.4 xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } +# Nuts Finance +nutsfinance-stable-asset = { path = "../../pallets/stable-asset", default-features = false } + # Bifrost bifrost-flexible-fee = { path = "../../pallets/flexible-fee", default-features = false } bifrost-flexible-fee-rpc-runtime-api = { path = "../../pallets/flexible-fee/rpc/runtime-api", default-features = false } @@ -112,6 +115,8 @@ bifrost-slpx = { path = "../../pallets/slpx", default-features = false, features pallet-ranked-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } pallet-referenda = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } bifrost-currencies = { workspace = true } +bifrost-stable-pool = { path = "../../pallets/stable-pool", default-features = false } +bifrost-stable-pool-rpc-runtime-api = { path = "../../pallets/stable-pool/rpc/runtime-api", default-features = false } bifrost-vtoken-voting = { path = "../../pallets/vtoken-voting", default-features = false, features = [ "polkadot" ] } # orml @@ -221,6 +226,8 @@ std = [ "bifrost-cross-in-out/std", "substrate-wasm-builder", "bifrost-slpx/std", + "bifrost-stable-pool/std", + "bifrost-stable-pool-rpc-runtime-api/std", ] with-tracing = ["frame-executive/with-tracing"] @@ -251,6 +258,7 @@ runtime-benchmarks = [ "bifrost-ve-minting/runtime-benchmarks", "bifrost-cross-in-out/runtime-benchmarks", "bifrost-slpx/runtime-benchmarks", + "bifrost-stable-pool/runtime-benchmarks", "bifrost-vtoken-voting/runtime-benchmarks", "sp-api/disable-logging", ] @@ -315,6 +323,8 @@ try-runtime = [ "bifrost-ve-minting/try-runtime", "bifrost-cross-in-out/try-runtime", "bifrost-slpx/try-runtime", + "nutsfinance-stable-asset/try-runtime", + "bifrost-stable-pool/try-runtime", "bifrost-vtoken-voting/try-runtime", ] diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index 332a4a07a..84dbf307d 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -37,9 +37,9 @@ pub use frame_support::{ inherent::Vec, match_types, parameter_types, traits::{ - ConstU32, ConstU64, ConstU8, Contains, EqualPrivilegeOnly, Everything, Imbalance, - InstanceFilter, IsInVec, LockIdentifier, NeverEnsureOrigin, Nothing, OnUnbalanced, - Randomness, + ConstU128, ConstU32, ConstU64, ConstU8, Contains, EqualPrivilegeOnly, Everything, + Imbalance, InstanceFilter, IsInVec, LockIdentifier, NeverEnsureOrigin, Nothing, + OnUnbalanced, Randomness, }, weights::{ constants::{ @@ -112,7 +112,6 @@ use static_assertions::const_assert; use xcm::v3::prelude::*; use xcm_config::{ parachains, BifrostCurrencyIdConvert, BifrostTreasuryAccount, MultiCurrency, SelfParaChainId, - XcmConfig, XcmRouter, }; use xcm_executor::XcmExecutor; @@ -991,7 +990,7 @@ impl bifrost_flexible_fee::Config for Runtime { type TreasuryAccount = BifrostTreasuryAccount; type MaxFeeCurrencyOrderListLen = MaxFeeCurrencyOrderListLen; type OnUnbalanced = Treasury; - type WeightInfo = bifrost_flexible_fee::weights::BifrostWeight; + type WeightInfo = weights::bifrost_flexible_fee::BifrostWeight; type ExtraFeeMatcher = ExtraFeeMatcher; type ParachainId = ParachainInfo; type ControlOrigin = EitherOfDiverse; @@ -1111,7 +1110,7 @@ impl bifrost_salp::Config for Runtime { type RemoveKeysLimit = RemoveKeysLimit; type SlotLength = SlotLength; type VSBondValidPeriod = VSBondValidPeriod; - type WeightInfo = bifrost_salp::weights::BifrostWeight; + type WeightInfo = weights::bifrost_salp::BifrostWeight; type EnsureConfirmAsGovernance = EitherOfDiverse< TechAdmin, EitherOfDiverse, @@ -1123,7 +1122,7 @@ impl bifrost_salp::Config for Runtime { type CurrencyIdConversion = AssetIdMaps; type CurrencyIdRegister = AssetIdMaps; type ParachainId = ParachainInfo; - type StablePool = (); + type StablePool = StablePool; type VtokenMinting = VtokenMinting; } @@ -1133,14 +1132,14 @@ impl bifrost_call_switchgear::Config for Runtime { CoreAdmin, EitherOfDiverse, >; - type WeightInfo = bifrost_call_switchgear::weights::BifrostWeight; + type WeightInfo = weights::bifrost_call_switchgear::BifrostWeight; } impl bifrost_asset_registry::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type RegisterOrigin = EitherOfDiverse; - type WeightInfo = bifrost_asset_registry::weights::BifrostWeight; + type WeightInfo = weights::bifrost_asset_registry::BifrostWeight; } parameter_types! { @@ -1200,13 +1199,11 @@ impl bifrost_slp::Config for Runtime { TechAdmin, EitherOfDiverse, >; - type WeightInfo = bifrost_slp::weights::BifrostWeight; + type WeightInfo = weights::bifrost_slp::BifrostWeight; type VtokenMinting = VtokenMinting; type BifrostSlpx = Slpx; type AccountConverter = SubAccountIndexMultiLocationConvertor; type ParachainId = SelfParaChainId; - type XcmRouter = XcmRouter; - type XcmExecutor = XcmExecutor; type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; type MaxRefundPerBlock = MaxRefundPerBlock; @@ -1232,7 +1229,7 @@ impl bifrost_vstoken_conversion::Config for Runtime { >; type VsbondAccount = BifrostVsbondPalletId; type CurrencyIdConversion = AssetIdMaps; - type WeightInfo = (); + type WeightInfo = weights::bifrost_vstoken_conversion::BifrostWeight; } parameter_types! { @@ -1249,7 +1246,7 @@ impl bifrost_farming::Config for Runtime { type TreasuryAccount = BifrostTreasuryAccount; type Keeper = FarmingKeeperPalletId; type RewardIssuer = FarmingRewardIssuerPalletId; - type WeightInfo = bifrost_farming::weights::BifrostWeight; + type WeightInfo = weights::bifrost_farming::BifrostWeight; type FarmingBoost = FarmingBoostPalletId; type VeMinting = VeMinting; type BlockNumberToBalance = ConvertInto; @@ -1269,7 +1266,7 @@ impl bifrost_system_staking::Config for Runtime { CoreAdmin, EitherOfDiverse, >; - type WeightInfo = bifrost_system_staking::weights::BifrostWeight; + type WeightInfo = weights::bifrost_system_staking::BifrostWeight; type FarmingInfo = Farming; type VtokenMintingInterface = VtokenMinting; type TreasuryAccount = BifrostTreasuryAccount; @@ -1283,7 +1280,7 @@ impl bifrost_system_maker::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Currencies; type ControlOrigin = EitherOfDiverse; - type WeightInfo = (); + type WeightInfo = weights::bifrost_system_maker::BifrostWeight; type DexOperator = ZenlinkProtocol; type CurrencyIdConversion = AssetIdMaps; type TreasuryAccount = BifrostTreasuryAccount; @@ -1297,7 +1294,7 @@ impl bifrost_fee_share::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Currencies; type ControlOrigin = EitherOfDiverse; - type WeightInfo = bifrost_fee_share::weights::BifrostWeight; + type WeightInfo = weights::bifrost_fee_share::BifrostWeight; type FeeSharePalletId = FeeSharePalletId; } @@ -1306,7 +1303,7 @@ impl bifrost_cross_in_out::Config for Runtime { type MultiCurrency = Currencies; type ControlOrigin = EitherOfDiverse; type EntrancePalletId = SlpEntrancePalletId; - type WeightInfo = bifrost_cross_in_out::weights::BifrostWeight; + type WeightInfo = weights::bifrost_cross_in_out::BifrostWeight; type MaxLengthLimit = MaxLengthLimit; } @@ -1316,12 +1313,50 @@ impl bifrost_slpx::Config for Runtime { type MultiCurrency = Currencies; type DexOperator = ZenlinkProtocol; type VtokenMintingInterface = VtokenMinting; - type StablePoolHandler = (); + type StablePoolHandler = StablePool; type XcmTransfer = XTokens; type CurrencyIdConvert = AssetIdMaps; type TreasuryAccount = BifrostTreasuryAccount; type ParachainId = SelfParaChainId; - type WeightInfo = bifrost_slpx::weights::BifrostWeight; + type WeightInfo = weights::bifrost_slpx::BifrostWeight; +} + +pub struct EnsurePoolAssetId; +impl nutsfinance_stable_asset::traits::ValidateAssetId for EnsurePoolAssetId { + fn validate(_: CurrencyId) -> bool { + true + } +} +parameter_types! { + pub const StableAssetPalletId: PalletId = PalletId(*b"nuts/sta"); +} + +/// Configure the pallet nutsfinance_stable_asset in pallets/nutsfinance_stable_asset. +impl nutsfinance_stable_asset::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type AssetId = CurrencyId; + type Balance = Balance; + type Assets = Currencies; + type PalletId = StableAssetPalletId; + type AtLeast64BitUnsigned = u128; + type FeePrecision = ConstU128<10_000_000_000>; + type APrecision = ConstU128<100>; + type PoolAssetLimit = ConstU32<5>; + type SwapExactOverAmount = ConstU128<100>; + type WeightInfo = (); + type ListingOrigin = EitherOfDiverse; + type EnsurePoolAssetId = EnsurePoolAssetId; +} + +impl bifrost_stable_pool::Config for Runtime { + type WeightInfo = weights::bifrost_stable_pool::BifrostWeight; + type ControlOrigin = EitherOfDiverse; + type CurrencyId = CurrencyId; + type MultiCurrency = Currencies; + type StableAsset = StableAsset; + type VtokenMinting = VtokenMinting; + type CurrencyIdConversion = AssetIdMaps; + type CurrencyIdRegister = AssetIdMaps; } parameter_types! { @@ -1348,7 +1383,7 @@ impl bifrost_vtoken_voting::Config for Runtime { type ParachainId = SelfParaChainId; type MaxVotes = ConstU32<256>; type QueryTimeout = QueryTimeout; - type WeightInfo = bifrost_vtoken_voting::weights::BifrostWeight; + type WeightInfo = weights::bifrost_vtoken_voting::BifrostWeight; } // Bifrost modules end @@ -1425,7 +1460,7 @@ impl bifrost_vtoken_minting::Config for Runtime { type FeeAccount = BifrostFeeAccount; type BifrostSlp = Slp; type BifrostSlpx = Slpx; - type WeightInfo = bifrost_vtoken_minting::weights::BifrostWeight; + type WeightInfo = weights::bifrost_vtoken_minting::BifrostWeight; type OnRedeemSuccess = OnRedeemSuccess; type RelayChainToken = RelayCurrencyId; type CurrencyIdConversion = AssetIdMaps; @@ -1451,7 +1486,7 @@ impl bifrost_ve_minting::Config for Runtime { type TokenType = VeMintingTokenType; type VeMintingPalletId = VeMintingPalletId; type IncentivePalletId = IncentivePalletId; - type WeightInfo = (); + type WeightInfo = weights::bifrost_ve_minting::BifrostWeight; type BlockNumberToBalance = ConvertInto; type Week = Week; type MaxBlock = MaxBlock; @@ -1638,6 +1673,8 @@ construct_runtime! { Slpx: bifrost_slpx::{Pallet, Call, Storage, Event} = 125, FellowshipCollective: pallet_ranked_collective::::{Pallet, Call, Storage, Event} = 126, FellowshipReferenda: pallet_referenda::::{Pallet, Call, Storage, Event} = 127, + StableAsset: nutsfinance_stable_asset::{Pallet, Storage, Event} = 128, + StablePool: bifrost_stable_pool::{Pallet, Call, Storage} = 129, VtokenVoting: bifrost_vtoken_voting::{Pallet, Call, Storage, Event} = 130, } } @@ -1699,15 +1736,7 @@ extern crate frame_benchmarking; #[cfg(feature = "runtime-benchmarks")] mod benches { - define_benchmarks!( - [pallet_vesting, Vesting] - [bifrost_call_switchgear, CallSwitchgear] - [bifrost_vtoken_minting, VtokenMinting] - [bifrost_slp, Slp] - [bifrost_ve_minting, VeMinting] - [bifrost_slpx, Slpx] - [bifrost_vtoken_voting, VtokenVoting] - ); + define_benchmarks!([bifrost_ve_minting, VeMinting]); } impl_runtime_apis! { @@ -1946,6 +1975,24 @@ impl_runtime_apis! { } } + impl bifrost_stable_pool_rpc_runtime_api::StablePoolRuntimeApi for Runtime { + fn get_swap_output( + pool_id: u32, + currency_id_in: u32, + currency_id_out: u32, + amount: Balance, + ) -> Balance { + StablePool::get_swap_output(pool_id, currency_id_in, currency_id_out, amount).unwrap_or(Zero::zero()) + } + + fn add_liquidity_amount( + pool_id: u32, + amounts: Vec, + ) -> Balance { + StablePool::add_liquidity_amount(pool_id, amounts).unwrap_or(Zero::zero()) + } + } + #[cfg(feature = "runtime-benchmarks")] impl frame_benchmarking::Benchmark for Runtime { fn benchmark_metadata(extra: bool) -> ( diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_asset_registry.rs b/runtime/bifrost-polkadot/src/weights/bifrost_asset_registry.rs new file mode 100644 index 000000000..1ab2267b4 --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/bifrost_asset_registry.rs @@ -0,0 +1,167 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_asset_registry +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_asset_registry +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_asset_registry.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_asset_registry. +pub struct BifrostWeight(PhantomData); +impl bifrost_asset_registry::WeightInfo for BifrostWeight { + // Storage: AssetRegistry LocationToCurrencyIds (r:1 w:1) + // Proof Skipped: AssetRegistry LocationToCurrencyIds (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyIdToLocations (r:1 w:1) + // Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry AssetMetadatas (r:1 w:1) + // Proof Skipped: AssetRegistry AssetMetadatas (max_values: None, max_size: None, mode: Measured) + fn register_native_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `118` + // Estimated: `3583` + // Minimum execution time: 49_553 nanoseconds. + Weight::from_parts(50_599_000, 3583) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: AssetRegistry LocationToCurrencyIds (r:1 w:1) + // Proof Skipped: AssetRegistry LocationToCurrencyIds (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyIdToLocations (r:1 w:1) + // Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry AssetMetadatas (r:1 w:1) + // Proof Skipped: AssetRegistry AssetMetadatas (max_values: None, max_size: None, mode: Measured) + fn update_native_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `250` + // Estimated: `3715` + // Minimum execution time: 56_917 nanoseconds. + Weight::from_parts(57_419_000, 3715) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: AssetRegistry NextTokenId (r:1 w:1) + // Proof Skipped: AssetRegistry NextTokenId (max_values: Some(1), max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn register_token_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `607` + // Estimated: `4072` + // Minimum execution time: 44_741 nanoseconds. + Weight::from_parts(46_339_000, 4072) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn register_vtoken_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `779` + // Estimated: `6719` + // Minimum execution time: 51_173 nanoseconds. + Weight::from_parts(52_854_000, 6719) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn register_vstoken_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `705` + // Estimated: `6645` + // Minimum execution time: 49_492 nanoseconds. + Weight::from_parts(50_943_000, 6645) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn register_vsbond_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `763` + // Estimated: `6703` + // Minimum execution time: 52_709 nanoseconds. + Weight::from_parts(54_285_000, 6703) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry LocationToCurrencyIds (r:1 w:1) + // Proof Skipped: AssetRegistry LocationToCurrencyIds (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyIdToLocations (r:1 w:1) + // Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyIdToWeights (r:0 w:1) + // Proof Skipped: AssetRegistry CurrencyIdToWeights (max_values: None, max_size: None, mode: Measured) + fn register_multilocation() -> Weight { + // Proof Size summary in bytes: + // Measured: `683` + // Estimated: `4148` + // Minimum execution time: 45_385 nanoseconds. + Weight::from_parts(46_739_000, 4148) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry LocationToCurrencyIds (r:0 w:1) + // Proof Skipped: AssetRegistry LocationToCurrencyIds (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyIdToWeights (r:0 w:1) + // Proof Skipped: AssetRegistry CurrencyIdToWeights (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyIdToLocations (r:0 w:1) + // Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) + fn force_set_multilocation() -> Weight { + // Proof Size summary in bytes: + // Measured: `683` + // Estimated: `4148` + // Minimum execution time: 50_743 nanoseconds. + Weight::from_parts(52_775_000, 4148) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(3)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_call_switchgear.rs b/runtime/bifrost-polkadot/src/weights/bifrost_call_switchgear.rs new file mode 100644 index 000000000..c56319b60 --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/bifrost_call_switchgear.rs @@ -0,0 +1,101 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_call_switchgear +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_call_switchgear +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_call_switchgear. +pub struct BifrostWeight(PhantomData); +impl bifrost_call_switchgear::WeightInfo for BifrostWeight { + // Storage: CallSwitchgear SwitchedOffTransactions (r:1 w:1) + // Proof Skipped: CallSwitchgear SwitchedOffTransactions (max_values: None, max_size: None, mode: Measured) + fn switchoff_transaction() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 29_214 nanoseconds. + Weight::from_parts(30_398_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CallSwitchgear SwitchedOffTransactions (r:1 w:1) + // Proof Skipped: CallSwitchgear SwitchedOffTransactions (max_values: None, max_size: None, mode: Measured) + fn switchon_transaction() -> Weight { + // Proof Size summary in bytes: + // Measured: `55` + // Estimated: `3520` + // Minimum execution time: 31_720 nanoseconds. + Weight::from_parts(32_717_000, 3520) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CallSwitchgear DisabledTransfers (r:1 w:1) + // Proof Skipped: CallSwitchgear DisabledTransfers (max_values: None, max_size: None, mode: Measured) + fn disable_transfers() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 26_079 nanoseconds. + Weight::from_parts(26_977_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CallSwitchgear DisabledTransfers (r:1 w:1) + // Proof Skipped: CallSwitchgear DisabledTransfers (max_values: None, max_size: None, mode: Measured) + fn enable_transfers() -> Weight { + // Proof Size summary in bytes: + // Measured: `38` + // Estimated: `3503` + // Minimum execution time: 27_719 nanoseconds. + Weight::from_parts(28_319_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_cross_in_out.rs b/runtime/bifrost-polkadot/src/weights/bifrost_cross_in_out.rs new file mode 100644 index 000000000..2fcb40922 --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/bifrost_cross_in_out.rs @@ -0,0 +1,209 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_cross_in_out +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_cross_in_out +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_cross_in_out.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_cross_in_out. +pub struct BifrostWeight(PhantomData); +impl bifrost_cross_in_out::WeightInfo for BifrostWeight { + // Storage: CrossInOut CrossCurrencyRegistry (r:1 w:1) + // Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) + fn register_currency_for_cross_in_out() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `3541` + // Minimum execution time: 30_069 nanoseconds. + Weight::from_parts(30_714_000, 3541) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut CrossCurrencyRegistry (r:1 w:1) + // Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) + fn deregister_currency_for_cross_in_out() -> Weight { + // Proof Size summary in bytes: + // Measured: `119` + // Estimated: `3584` + // Minimum execution time: 32_781 nanoseconds. + Weight::from_parts(33_720_000, 3584) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut CrossingMinimumAmount (r:0 w:1) + // Proof Skipped: CrossInOut CrossingMinimumAmount (max_values: None, max_size: None, mode: Measured) + fn set_crossing_minimum_amount() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 24_811 nanoseconds. + Weight::from_parts(25_172_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut IssueWhiteList (r:1 w:1) + // Proof Skipped: CrossInOut IssueWhiteList (max_values: None, max_size: None, mode: Measured) + fn add_to_issue_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `3541` + // Minimum execution time: 34_593 nanoseconds. + Weight::from_parts(35_760_000, 3541) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut IssueWhiteList (r:1 w:1) + // Proof Skipped: CrossInOut IssueWhiteList (max_values: None, max_size: None, mode: Measured) + fn remove_from_issue_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `154` + // Estimated: `3619` + // Minimum execution time: 35_748 nanoseconds. + Weight::from_parts(36_569_000, 3619) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut RegisterWhiteList (r:1 w:1) + // Proof Skipped: CrossInOut RegisterWhiteList (max_values: None, max_size: None, mode: Measured) + fn add_to_register_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `3541` + // Minimum execution time: 38_561 nanoseconds. + Weight::from_parts(39_371_000, 3541) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut RegisterWhiteList (r:1 w:1) + // Proof Skipped: CrossInOut RegisterWhiteList (max_values: None, max_size: None, mode: Measured) + fn remove_from_register_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `154` + // Estimated: `3619` + // Minimum execution time: 35_886 nanoseconds. + Weight::from_parts(36_589_000, 3619) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut CrossCurrencyRegistry (r:1 w:0) + // Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut CrossingMinimumAmount (r:1 w:0) + // Proof Skipped: CrossInOut CrossingMinimumAmount (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut IssueWhiteList (r:1 w:0) + // Proof Skipped: CrossInOut IssueWhiteList (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn cross_in() -> Weight { + // Proof Size summary in bytes: + // Measured: `1758` + // Estimated: `5223` + // Minimum execution time: 146_344 nanoseconds. + Weight::from_parts(147_835_000, 5223) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: CrossInOut RegisterWhiteList (r:1 w:0) + // Proof Skipped: CrossInOut RegisterWhiteList (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut CrossCurrencyRegistry (r:1 w:0) + // Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut AccountToOuterMultilocation (r:1 w:1) + // Proof Skipped: CrossInOut AccountToOuterMultilocation (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut OuterMultilocationToAccount (r:0 w:1) + // Proof Skipped: CrossInOut OuterMultilocationToAccount (max_values: None, max_size: None, mode: Measured) + fn register_linked_account() -> Weight { + // Proof Size summary in bytes: + // Measured: `193` + // Estimated: `3658` + // Minimum execution time: 58_096 nanoseconds. + Weight::from_parts(59_952_000, 3658) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: CrossInOut CrossCurrencyRegistry (r:1 w:0) + // Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut CrossingMinimumAmount (r:1 w:0) + // Proof Skipped: CrossInOut CrossingMinimumAmount (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: CrossInOut AccountToOuterMultilocation (r:1 w:0) + // Proof Skipped: CrossInOut AccountToOuterMultilocation (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn cross_out() -> Weight { + // Proof Size summary in bytes: + // Measured: `1781` + // Estimated: `5246` + // Minimum execution time: 121_799 nanoseconds. + Weight::from_parts(124_055_000, 5246) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: CrossInOut CrossCurrencyRegistry (r:1 w:0) + // Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut AccountToOuterMultilocation (r:1 w:1) + // Proof Skipped: CrossInOut AccountToOuterMultilocation (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut OuterMultilocationToAccount (r:0 w:1) + // Proof Skipped: CrossInOut OuterMultilocationToAccount (max_values: None, max_size: None, mode: Measured) + fn change_outer_linked_account() -> Weight { + // Proof Size summary in bytes: + // Measured: `312` + // Estimated: `3777` + // Minimum execution time: 56_108 nanoseconds. + Weight::from_parts(57_171_000, 3777) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_farming.rs b/runtime/bifrost-polkadot/src/weights/bifrost_farming.rs new file mode 100644 index 000000000..6d36c92de --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/bifrost_farming.rs @@ -0,0 +1,359 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_farming +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_farming +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_farming.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_farming. +pub struct BifrostWeight(PhantomData); +impl bifrost_farming::WeightInfo for BifrostWeight { + // Storage: Farming PoolInfos (r:1 w:0) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:1 w:0) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming BoostPoolInfos (r:1 w:0) + // Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) + fn on_initialize() -> Weight { + // Proof Size summary in bytes: + // Measured: `113` + // Estimated: `3578` + // Minimum execution time: 21_942 nanoseconds. + Weight::from_parts(22_864_000, 3578) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: Farming PoolNextId (r:1 w:1) + // Proof Skipped: Farming PoolNextId (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming GaugePoolNextId (r:1 w:1) + // Proof Skipped: Farming GaugePoolNextId (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:0 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming PoolInfos (r:0 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + fn create_farming_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `1594` + // Minimum execution time: 52_521 nanoseconds. + Weight::from_parts(53_437_000, 1594) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:1) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + fn deposit() -> Weight { + // Proof Size summary in bytes: + // Measured: `1752` + // Estimated: `6176` + // Minimum execution time: 164_962 nanoseconds. + Weight::from_parts(169_239_000, 6176) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:1) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + fn withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `510` + // Estimated: `3975` + // Minimum execution time: 77_186 nanoseconds. + Weight::from_parts(78_796_000, 3975) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:1) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugeInfos (r:1 w:0) + // Proof Skipped: Farming GaugeInfos (max_values: None, max_size: None, mode: Measured) + fn claim() -> Weight { + // Proof Size summary in bytes: + // Measured: `547` + // Estimated: `4012` + // Minimum execution time: 76_561 nanoseconds. + Weight::from_parts(77_635_000, 4012) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming GaugePoolInfos (r:1 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugeInfos (r:1 w:1) + // Proof Skipped: Farming GaugeInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming PoolInfos (r:1 w:0) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:0) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + fn gauge_withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `832` + // Estimated: `4297` + // Minimum execution time: 82_224 nanoseconds. + Weight::from_parts(84_369_000, 4297) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming PoolInfos (r:1 w:0) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:1) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + fn withdraw_claim() -> Weight { + // Proof Size summary in bytes: + // Measured: `510` + // Estimated: `3975` + // Minimum execution time: 52_808 nanoseconds. + Weight::from_parts(53_519_000, 3975) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugePoolNextId (r:1 w:1) + // Proof Skipped: Farming GaugePoolNextId (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:0 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + fn reset_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `436` + // Estimated: `3901` + // Minimum execution time: 58_270 nanoseconds. + Weight::from_parts(59_721_000, 3901) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming RetireLimit (r:1 w:0) + // Proof Skipped: Farming RetireLimit (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:0) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:1 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + fn force_retire_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `627` + // Estimated: `4092` + // Minimum execution time: 71_326 nanoseconds. + Weight::from_parts(72_463_000, 4092) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + fn kill_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `380` + // Estimated: `3845` + // Minimum execution time: 50_342 nanoseconds. + Weight::from_parts(51_828_000, 3845) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:1 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + fn edit_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `513` + // Estimated: `3978` + // Minimum execution time: 55_700 nanoseconds. + Weight::from_parts(57_535_000, 3978) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + fn close_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `417` + // Estimated: `3882` + // Minimum execution time: 45_159 nanoseconds. + Weight::from_parts(46_221_000, 3882) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn charge() -> Weight { + // Proof Size summary in bytes: + // Measured: `2059` + // Estimated: `6176` + // Minimum execution time: 162_037 nanoseconds. + Weight::from_parts(167_329_000, 6176) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: Farming RetireLimit (r:1 w:0) + // Proof Skipped: Farming RetireLimit (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming GaugeInfos (r:2 w:1) + // Proof Skipped: Farming GaugeInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:1 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming PoolInfos (r:1 w:0) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:0) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + fn force_gauge_claim() -> Weight { + // Proof Size summary in bytes: + // Measured: `855` + // Estimated: `6795` + // Minimum execution time: 99_268 nanoseconds. + Weight::from_parts(100_563_000, 6795) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming RetireLimit (r:1 w:1) + // Proof Skipped: Farming RetireLimit (max_values: Some(1), max_size: None, mode: Measured) + fn set_retire_limit() -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `1594` + // Minimum execution time: 28_852 nanoseconds. + Weight::from_parts(29_866_000, 1594) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming BoostWhitelist (r:0 w:1) + // Proof Skipped: Farming BoostWhitelist (max_values: None, max_size: None, mode: Measured) + fn add_boost_pool_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 11_356 nanoseconds. + Weight::from_parts(11_723_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming BoostNextRoundWhitelist (r:0 w:1) + // Proof Skipped: Farming BoostNextRoundWhitelist (max_values: None, max_size: None, mode: Measured) + fn set_next_round_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `145` + // Estimated: `145` + // Minimum execution time: 16_252 nanoseconds. + Weight::from_parts(19_916_000, 145) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming BoostPoolInfos (r:1 w:1) + // Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming UserBoostInfos (r:1 w:1) + // Proof Skipped: Farming UserBoostInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming BoostWhitelist (r:1 w:0) + // Proof Skipped: Farming BoostWhitelist (max_values: None, max_size: None, mode: Measured) + // Storage: Farming BoostVotingPools (r:1 w:1) + // Proof Skipped: Farming BoostVotingPools (max_values: None, max_size: None, mode: Measured) + fn vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `145` + // Estimated: `3610` + // Minimum execution time: 50_384 nanoseconds. + Weight::from_parts(52_399_000, 3610) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Farming BoostPoolInfos (r:1 w:1) + // Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming BoostNextRoundWhitelist (r:1 w:0) + // Proof Skipped: Farming BoostNextRoundWhitelist (max_values: None, max_size: None, mode: Measured) + // Storage: Farming BoostWhitelist (r:2 w:0) + // Proof Skipped: Farming BoostWhitelist (max_values: None, max_size: None, mode: Measured) + // Storage: Farming BoostVotingPools (r:1 w:0) + // Proof Skipped: Farming BoostVotingPools (max_values: None, max_size: None, mode: Measured) + fn start_boost_round() -> Weight { + // Proof Size summary in bytes: + // Measured: `149` + // Estimated: `6089` + // Minimum execution time: 63_053 nanoseconds. + Weight::from_parts(64_194_000, 6089) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming BoostPoolInfos (r:1 w:1) + // Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) + fn end_boost_round() -> Weight { + // Proof Size summary in bytes: + // Measured: `195` + // Estimated: `1680` + // Minimum execution time: 42_148 nanoseconds. + Weight::from_parts(43_580_000, 1680) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn charge_boost() -> Weight { + // Proof Size summary in bytes: + // Measured: `1477` + // Estimated: `6176` + // Minimum execution time: 126_868 nanoseconds. + Weight::from_parts(131_856_000, 6176) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_fee_share.rs b/runtime/bifrost-polkadot/src/weights/bifrost_fee_share.rs new file mode 100644 index 000000000..2e7902d09 --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/bifrost_fee_share.rs @@ -0,0 +1,130 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_fee_share +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_fee_share +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_fee_share.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_fee_share. +pub struct BifrostWeight(PhantomData); +impl bifrost_fee_share::WeightInfo for BifrostWeight { + // Storage: FeeShare AutoEra (r:1 w:0) + // Proof Skipped: FeeShare AutoEra (max_values: Some(1), max_size: None, mode: Measured) + fn on_initialize() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `1489` + // Minimum execution time: 7_333 nanoseconds. + Weight::from_parts(7_571_000, 1489) + .saturating_add(T::DbWeight::get().reads(1)) + } + // Storage: FeeShare DistributionNextId (r:1 w:1) + // Proof Skipped: FeeShare DistributionNextId (max_values: Some(1), max_size: None, mode: Measured) + // Storage: FeeShare DistributionInfos (r:0 w:1) + // Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) + fn create_distribution() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `1489` + // Minimum execution time: 37_152 nanoseconds. + Weight::from_parts(38_371_000, 1489) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: FeeShare DistributionInfos (r:1 w:1) + // Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) + fn edit_distribution() -> Weight { + // Proof Size summary in bytes: + // Measured: `139` + // Estimated: `3604` + // Minimum execution time: 40_063 nanoseconds. + Weight::from_parts(40_816_000, 3604) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: FeeShare AutoEra (r:0 w:1) + // Proof Skipped: FeeShare AutoEra (max_values: Some(1), max_size: None, mode: Measured) + fn set_era_length() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 23_201 nanoseconds. + Weight::from_parts(23_949_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: FeeShare DistributionInfos (r:1 w:0) + // Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:0) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + fn execute_distribute() -> Weight { + // Proof Size summary in bytes: + // Measured: `1616` + // Estimated: `6176` + // Minimum execution time: 78_453 nanoseconds. + Weight::from_parts(80_732_000, 6176) + .saturating_add(T::DbWeight::get().reads(4)) + } + // Storage: FeeShare DistributionInfos (r:1 w:1) + // Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:0) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + fn delete_distribution() -> Weight { + // Proof Size summary in bytes: + // Measured: `1616` + // Estimated: `6176` + // Minimum execution time: 80_872 nanoseconds. + Weight::from_parts(82_734_000, 6176) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_flexible_fee.rs b/runtime/bifrost-polkadot/src/weights/bifrost_flexible_fee.rs new file mode 100644 index 000000000..881576d80 --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/bifrost_flexible_fee.rs @@ -0,0 +1,77 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_flexible_fee +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_flexible_fee +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_flexible_fee.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_flexible_fee. +pub struct BifrostWeight(PhantomData); +impl bifrost_flexible_fee::WeightInfo for BifrostWeight { + // Storage: FlexibleFee UserDefaultFeeCurrency (r:0 w:1) + // Proof Skipped: FlexibleFee UserDefaultFeeCurrency (max_values: None, max_size: None, mode: Measured) + fn set_user_default_fee_currency() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 10_741 nanoseconds. + Weight::from_parts(11_257_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: FlexibleFee UniversalFeeCurrencyOrderList (r:0 w:1) + // Proof Skipped: FlexibleFee UniversalFeeCurrencyOrderList (max_values: Some(1), max_size: None, mode: Measured) + fn set_universal_fee_currency_order_list() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 9_810 nanoseconds. + Weight::from_parts(10_160_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_salp.rs b/runtime/bifrost-polkadot/src/weights/bifrost_salp.rs new file mode 100644 index 000000000..15bec40ae --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/bifrost_salp.rs @@ -0,0 +1,367 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_salp +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_salp +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_salp.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_salp. +pub struct BifrostWeight(PhantomData); +impl bifrost_salp::WeightInfo for BifrostWeight { + // Storage: Salp Funds (r:1 w:0) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), 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: Salp QueryIdContributionInfo (r:0 w:1) + // Proof Skipped: Salp QueryIdContributionInfo (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + // Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + // Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + fn contribute() -> Weight { + // Proof Size summary in bytes: + // Measured: `2252` + // Estimated: `5717` + // Minimum execution time: 178_249 nanoseconds. + Weight::from_parts(181_741_000, 5717) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: Salp FailedFundsToRefund (r:1 w:0) + // Proof Skipped: Salp FailedFundsToRefund (max_values: None, max_size: None, mode: Measured) + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Salp RedeemPool (r:1 w:1) + // Proof Skipped: Salp RedeemPool (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:2 w:2) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn refund() -> Weight { + // Proof Size summary in bytes: + // Measured: `2375` + // Estimated: `11362` + // Minimum execution time: 269_471 nanoseconds. + Weight::from_parts(271_761_000, 11362) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(9)) + } + // Storage: Salp Funds (r:1 w:0) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:0) + // Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:0) + fn unlock() -> Weight { + // Proof Size summary in bytes: + // Measured: `1962` + // Estimated: `6176` + // Minimum execution time: 131_128 nanoseconds. + Weight::from_parts(132_692_000, 6176) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Salp Funds (r:1 w:0) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: unknown `0x` (r:1 w:0) + // Proof Skipped: unknown `0x` (r:1 w:0) + // Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:0) + // Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:0) + fn batch_unlock() -> Weight { + // Proof Size summary in bytes: + // Measured: `1995` + // Estimated: `6176` + // Minimum execution time: 142_535 nanoseconds. + Weight::from_parts(144_730_000, 6176) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Salp RedeemPool (r:1 w:1) + // Proof Skipped: Salp RedeemPool (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:2 w:2) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn redeem() -> Weight { + // Proof Size summary in bytes: + // Measured: `2356` + // Estimated: `11362` + // Minimum execution time: 253_883 nanoseconds. + Weight::from_parts(256_438_000, 11362) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(9)) + } + // Storage: Salp MultisigConfirmAccount (r:0 w:1) + // Proof Skipped: Salp MultisigConfirmAccount (max_values: Some(1), max_size: None, mode: Measured) + fn set_multisig_confirm_account() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 9_755 nanoseconds. + Weight::from_parts(10_191_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + fn fund_success() -> Weight { + // Proof Size summary in bytes: + // Measured: `292` + // Estimated: `3757` + // Minimum execution time: 42_866 nanoseconds. + Weight::from_parts(43_319_000, 3757) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + fn fund_fail() -> Weight { + // Proof Size summary in bytes: + // Measured: `292` + // Estimated: `3757` + // Minimum execution time: 43_032 nanoseconds. + Weight::from_parts(43_468_000, 3757) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Salp FailedFundsToRefund (r:0 w:1) + // Proof Skipped: Salp FailedFundsToRefund (max_values: None, max_size: None, mode: Measured) + fn continue_fund() -> Weight { + // Proof Size summary in bytes: + // Measured: `1061` + // Estimated: `7001` + // Minimum execution time: 101_152 nanoseconds. + Weight::from_parts(103_733_000, 7001) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + fn fund_retire() -> Weight { + // Proof Size summary in bytes: + // Measured: `292` + // Estimated: `3757` + // Minimum execution time: 42_448 nanoseconds. + Weight::from_parts(43_562_000, 3757) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + fn fund_end() -> Weight { + // Proof Size summary in bytes: + // Measured: `325` + // Estimated: `3790` + // Minimum execution time: 43_007 nanoseconds. + Weight::from_parts(44_240_000, 3790) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Salp CurrentTrieIndex (r:1 w:1) + // Proof Skipped: Salp CurrentTrieIndex (max_values: Some(1), max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn create() -> Weight { + // Proof Size summary in bytes: + // Measured: `833` + // Estimated: `6773` + // Minimum execution time: 82_745 nanoseconds. + Weight::from_parts(85_358_000, 6773) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + fn edit() -> Weight { + // Proof Size summary in bytes: + // Measured: `292` + // Estimated: `3757` + // Minimum execution time: 38_572 nanoseconds. + Weight::from_parts(39_606_000, 3757) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp MultisigConfirmAccount (r:1 w:0) + // Proof Skipped: Salp MultisigConfirmAccount (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Salp QueryIdContributionInfo (r:1 w:1) + // Proof Skipped: Salp QueryIdContributionInfo (max_values: None, max_size: None, mode: Measured) + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:2 w:2) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + // Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + fn confirm_contribute() -> Weight { + // Proof Size summary in bytes: + // Measured: `2556` + // Estimated: `11362` + // Minimum execution time: 282_283 nanoseconds. + Weight::from_parts(290_913_000, 11362) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Salp RedeemPool (r:1 w:1) + // Proof Skipped: Salp RedeemPool (max_values: Some(1), max_size: None, mode: Measured) + fn withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `325` + // Estimated: `3790` + // Minimum execution time: 45_530 nanoseconds. + Weight::from_parts(47_033_000, 3790) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Salp FailedFundsToRefund (r:1 w:1) + // Proof Skipped: Salp FailedFundsToRefund (max_values: None, max_size: None, mode: Measured) + fn dissolve_refunded() -> Weight { + // Proof Size summary in bytes: + // Measured: `403` + // Estimated: `3868` + // Minimum execution time: 54_018 nanoseconds. + Weight::from_parts(55_598_000, 3868) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:3 w:3) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:3) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: unknown `0x` (r:1 w:0) + // Proof Skipped: unknown `0x` (r:1 w:0) + // Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + // Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + fn dissolve() -> Weight { + // Proof Size summary in bytes: + // Measured: `2063` + // Estimated: `8799` + // Minimum execution time: 256_408 nanoseconds. + Weight::from_parts(261_096_000, 8799) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(8)) + } + // 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:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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: ZenlinkProtocol PairStatuses (r:1 w:0) + // Proof Skipped: ZenlinkProtocol PairStatuses (max_values: None, max_size: None, mode: Measured) + fn buyback() -> Weight { + // Proof Size summary in bytes: + // Measured: `2284` + // Estimated: `11362` + // Minimum execution time: 245_677 nanoseconds. + Weight::from_parts(249_443_000, 11362) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: StableAsset TokenRateCaches (r:2 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // 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) + fn buyback_vstoken_by_stable_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `2438` + // Estimated: `11362` + // Minimum execution time: 362_245 nanoseconds. + Weight::from_parts(367_702_000, 11362) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(6)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_slp.rs b/runtime/bifrost-polkadot/src/weights/bifrost_slp.rs new file mode 100644 index 000000000..cce095967 --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/bifrost_slp.rs @@ -0,0 +1,791 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_slp +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_slp +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_slp.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_slp. +pub struct BifrostWeight(PhantomData); +impl bifrost_slp::WeightInfo for BifrostWeight { + // Storage: Slp DelegatorNextIndex (r:1 w:1) + // Proof Skipped: Slp DelegatorNextIndex (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: Slp DelegatorsIndex2Multilocation (r:1 w:1) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:0 w:1) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + fn initialize_delegator() -> Weight { + // Proof Size summary in bytes: + // Measured: `166` + // Estimated: `3631` + // Minimum execution time: 66_316 nanoseconds. + Weight::from_parts(67_556_000, 3631) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn bond() -> Weight { + // Proof Size summary in bytes: + // Measured: `629` + // Estimated: `4094` + // Minimum execution time: 104_135 nanoseconds. + Weight::from_parts(105_944_000, 4094) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn bond_extra() -> Weight { + // Proof Size summary in bytes: + // Measured: `896` + // Estimated: `4361` + // Minimum execution time: 105_850 nanoseconds. + Weight::from_parts(109_005_000, 4361) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: Slp CurrencyDelays (r:1 w:0) + // Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn unbond() -> Weight { + // Proof Size summary in bytes: + // Measured: `1028` + // Estimated: `4493` + // Minimum execution time: 128_505 nanoseconds. + Weight::from_parts(130_525_000, 4493) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: Slp CurrencyDelays (r:1 w:0) + // Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn unbond_all() -> Weight { + // Proof Size summary in bytes: + // Measured: `1006` + // Estimated: `4471` + // Minimum execution time: 120_242 nanoseconds. + Weight::from_parts(124_199_000, 4471) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn rebond() -> Weight { + // Proof Size summary in bytes: + // Measured: `941` + // Estimated: `4406` + // Minimum execution time: 106_179 nanoseconds. + Weight::from_parts(108_122_000, 4406) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:1 w:0) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp ValidatorsByDelegatorXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn delegate() -> Weight { + // Proof Size summary in bytes: + // Measured: `963` + // Estimated: `4428` + // Minimum execution time: 120_559 nanoseconds. + Weight::from_parts(123_430_000, 4428) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp ValidatorsByDelegator (r:1 w:0) + // Proof Skipped: Slp ValidatorsByDelegator (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp ValidatorsByDelegatorXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn undelegate() -> Weight { + // Proof Size summary in bytes: + // Measured: `1031` + // Estimated: `4496` + // Minimum execution time: 111_483 nanoseconds. + Weight::from_parts(113_771_000, 4496) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:1 w:0) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp ValidatorsByDelegatorXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn redelegate() -> Weight { + // Proof Size summary in bytes: + // Measured: `963` + // Estimated: `4428` + // Minimum execution time: 121_646 nanoseconds. + Weight::from_parts(123_838_000, 4428) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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 payout() -> Weight { + // Proof Size summary in bytes: + // Measured: `367` + // Estimated: `3832` + // Minimum execution time: 61_226 nanoseconds. + Weight::from_parts(62_259_000, 3832) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn liquidize() -> Weight { + // Proof Size summary in bytes: + // Measured: `612` + // Estimated: `4077` + // Minimum execution time: 98_187 nanoseconds. + Weight::from_parts(100_637_000, 4077) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: Slp CurrencyDelays (r:1 w:0) + // Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn chill() -> Weight { + // Proof Size summary in bytes: + // Measured: `1006` + // Estimated: `4471` + // Minimum execution time: 127_921 nanoseconds. + Weight::from_parts(129_570_000, 4471) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (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: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + fn transfer_back() -> Weight { + // Proof Size summary in bytes: + // Measured: `401` + // Estimated: `3866` + // Minimum execution time: 74_216 nanoseconds. + Weight::from_parts(75_781_000, 3866) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + fn transfer_to() -> Weight { + // Proof Size summary in bytes: + // Measured: `298` + // Estimated: `3763` + // Minimum execution time: 55_326 nanoseconds. + Weight::from_parts(57_260_000, 3763) + .saturating_add(T::DbWeight::get().reads(2)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (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: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn convert_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `697` + // Estimated: `4162` + // Minimum execution time: 87_626 nanoseconds. + Weight::from_parts(89_702_000, 4162) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: VtokenMinting TokenPool (r:1 w:1) + // Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn increase_token_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3503` + // Minimum execution time: 30_773 nanoseconds. + Weight::from_parts(31_754_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting TokenPool (r:1 w:1) + // Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn decrease_token_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `230` + // Estimated: `3503` + // Minimum execution time: 33_009 nanoseconds. + Weight::from_parts(33_510_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp OngoingTimeUnitUpdateInterval (r:1 w:0) + // Proof Skipped: Slp OngoingTimeUnitUpdateInterval (max_values: None, max_size: None, mode: Measured) + // Storage: Slp LastTimeUpdatedOngoingTimeUnit (r:1 w:1) + // Proof Skipped: Slp LastTimeUpdatedOngoingTimeUnit (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:1) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + fn update_ongoing_time_unit() -> Weight { + // Proof Size summary in bytes: + // Measured: `277` + // Estimated: `3742` + // Minimum execution time: 55_617 nanoseconds. + Weight::from_parts(56_576_000, 3742) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:0) + // Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, 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:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn refund_currency_due_unbond() -> Weight { + // Proof Size summary in bytes: + // Measured: `1897` + // Estimated: `6196` + // Minimum execution time: 157_504 nanoseconds. + Weight::from_parts(160_216_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: Slp FeeSources (r:1 w:0) + // Proof Skipped: Slp FeeSources (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + fn supplement_fee_reserve() -> Weight { + // Proof Size summary in bytes: + // Measured: `391` + // Estimated: `3856` + // Minimum execution time: 62_010 nanoseconds. + Weight::from_parts(63_508_000, 3856) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: Slp CurrencyTuneExchangeRateLimit (r:1 w:0) + // Proof Skipped: Slp CurrencyTuneExchangeRateLimit (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenMinting TokenPool (r:1 w:1) + // Proof: VtokenMinting TokenPool (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: Slp CurrencyLatestTuneRecord (r:1 w:1) + // Proof Skipped: Slp CurrencyLatestTuneRecord (max_values: None, max_size: None, mode: Measured) + // Storage: Slp HostingFees (r:1 w:0) + // Proof Skipped: Slp HostingFees (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLatestTuneRecord (r:1 w:1) + // Proof Skipped: Slp DelegatorLatestTuneRecord (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgers (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + fn charge_host_fee_and_tune_vtoken_exchange_rate() -> Weight { + // Proof Size summary in bytes: + // Measured: `2097` + // Estimated: `5562` + // Minimum execution time: 215_456 nanoseconds. + Weight::from_parts(221_225_000, 5562) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(7)) + } + // Storage: Slp OperateOrigins (r:1 w:1) + // Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) + fn set_operate_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 29_641 nanoseconds. + Weight::from_parts(31_358_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp FeeSources (r:1 w:1) + // Proof Skipped: Slp FeeSources (max_values: None, max_size: None, mode: Measured) + fn set_fee_source() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 28_008 nanoseconds. + Weight::from_parts(33_202_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp DelegatorsIndex2Multilocation (r:1 w:1) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorNextIndex (r:1 w:0) + // Proof Skipped: Slp DelegatorNextIndex (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:0 w:1) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + fn add_delegator() -> Weight { + // Proof Size summary in bytes: + // Measured: `63` + // Estimated: `3528` + // Minimum execution time: 51_783 nanoseconds. + Weight::from_parts(53_173_000, 3528) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp DelegatorLedgers (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:1) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorsIndex2Multilocation (r:0 w:1) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + fn remove_delegator() -> Weight { + // Proof Size summary in bytes: + // Measured: `340` + // Estimated: `3805` + // Minimum execution time: 61_870 nanoseconds. + Weight::from_parts(64_474_000, 3805) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp Validators (r:1 w:1) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + fn add_validator() -> Weight { + // Proof Size summary in bytes: + // Measured: `63` + // Estimated: `3528` + // Minimum execution time: 40_832 nanoseconds. + Weight::from_parts(41_891_000, 3528) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp Validators (r:1 w:1) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + fn remove_validator() -> Weight { + // Proof Size summary in bytes: + // Measured: `120` + // Estimated: `3585` + // Minimum execution time: 40_957 nanoseconds. + Weight::from_parts(42_157_000, 3585) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:1 w:0) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + // Storage: Slp ValidatorsByDelegator (r:0 w:1) + // Proof Skipped: Slp ValidatorsByDelegator (max_values: None, max_size: None, mode: Measured) + fn set_validators_by_delegator() -> Weight { + // Proof Size summary in bytes: + // Measured: `331` + // Estimated: `3796` + // Minimum execution time: 61_606 nanoseconds. + Weight::from_parts(62_459_000, 3796) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp DelegatorLedgers (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + fn set_delegator_ledger() -> Weight { + // Proof Size summary in bytes: + // Measured: `242` + // Estimated: `3707` + // Minimum execution time: 45_286 nanoseconds. + Weight::from_parts(46_262_000, 3707) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp MinimumsAndMaximums (r:1 w:1) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + fn set_minimums_and_maximums() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 31_060 nanoseconds. + Weight::from_parts(32_075_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp CurrencyDelays (r:1 w:1) + // Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) + fn set_currency_delays() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 26_703 nanoseconds. + Weight::from_parts(30_485_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp HostingFees (r:1 w:1) + // Proof Skipped: Slp HostingFees (max_values: None, max_size: None, mode: Measured) + fn set_hosting_fees() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 31_853 nanoseconds. + Weight::from_parts(33_036_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp CurrencyTuneExchangeRateLimit (r:1 w:1) + // Proof Skipped: Slp CurrencyTuneExchangeRateLimit (max_values: None, max_size: None, mode: Measured) + fn set_currency_tune_exchange_rate_limit() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 29_121 nanoseconds. + Weight::from_parts(30_332_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp OngoingTimeUnitUpdateInterval (r:1 w:1) + // Proof Skipped: Slp OngoingTimeUnitUpdateInterval (max_values: None, max_size: None, mode: Measured) + // Storage: Slp LastTimeUpdatedOngoingTimeUnit (r:0 w:1) + // Proof Skipped: Slp LastTimeUpdatedOngoingTimeUnit (max_values: None, max_size: None, mode: Measured) + fn set_ongoing_time_unit_update_interval() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 31_333 nanoseconds. + Weight::from_parts(36_804_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp SupplementFeeAccountWhitelist (r:1 w:1) + // Proof Skipped: Slp SupplementFeeAccountWhitelist (max_values: None, max_size: None, mode: Measured) + fn add_supplement_fee_account_to_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 37_467 nanoseconds. + Weight::from_parts(38_636_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp SupplementFeeAccountWhitelist (r:1 w:1) + // Proof Skipped: Slp SupplementFeeAccountWhitelist (max_values: None, max_size: None, mode: Measured) + fn remove_supplement_fee_account_from_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `119` + // Estimated: `3584` + // Minimum execution time: 41_910 nanoseconds. + Weight::from_parts(42_858_000, 3584) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgers (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:1 w:0) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn confirm_delegator_ledger_query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `597` + // Estimated: `4062` + // Minimum execution time: 73_648 nanoseconds. + Weight::from_parts(74_976_000, 4062) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:1 w:0) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn fail_delegator_ledger_query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `496` + // Estimated: `3961` + // Minimum execution time: 52_423 nanoseconds. + Weight::from_parts(53_428_000, 3961) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp ValidatorsByDelegatorXcmUpdateQueue (r:1 w:1) + // Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: Slp ValidatorsByDelegator (r:0 w:1) + // Proof Skipped: Slp ValidatorsByDelegator (max_values: None, max_size: None, mode: Measured) + fn confirm_validators_by_delegator_query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `229` + // Estimated: `3694` + // Minimum execution time: 47_808 nanoseconds. + Weight::from_parts(48_657_000, 3694) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp ValidatorsByDelegatorXcmUpdateQueue (r:1 w:1) + // Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:1 w:0) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn fail_validators_by_delegator_query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `561` + // Estimated: `4026` + // Minimum execution time: 54_224 nanoseconds. + Weight::from_parts(55_128_000, 4026) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:0 w:1) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + fn reset_validators() -> Weight { + // Proof Size summary in bytes: + // Measured: `63` + // Estimated: `3528` + // Minimum execution time: 36_205 nanoseconds. + Weight::from_parts(39_311_000, 3528) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:1 w:1) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + // Storage: Slp ValidatorBoostList (r:0 w:1) + // Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) + fn set_validator_boost_list() -> Weight { + // Proof Size summary in bytes: + // Measured: `63` + // Estimated: `3528` + // Minimum execution time: 60_318 nanoseconds. + Weight::from_parts(61_929_000, 3528) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp ValidatorBoostList (r:1 w:1) + // Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:1 w:1) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + fn add_to_validator_boost_list() -> Weight { + // Proof Size summary in bytes: + // Measured: `42` + // Estimated: `3507` + // Minimum execution time: 53_855 nanoseconds. + Weight::from_parts(56_070_000, 3507) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp ValidatorBoostList (r:1 w:1) + // Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) + fn remove_from_validator_boot_list() -> Weight { + // Proof Size summary in bytes: + // Measured: `161` + // Estimated: `3626` + // Minimum execution time: 37_202 nanoseconds. + Weight::from_parts(37_957_000, 3626) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_slpx.rs b/runtime/bifrost-polkadot/src/weights/bifrost_slpx.rs new file mode 100644 index 000000000..0ac0da0d3 --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/bifrost_slpx.rs @@ -0,0 +1,215 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_slpx +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_slpx.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_slpx. +pub struct BifrostWeight(PhantomData); +impl bifrost_slpx::WeightInfo for BifrostWeight { + // 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_664 nanoseconds. + Weight::from_parts(34_525_000, 3803) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // 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: 37_038 nanoseconds. + Weight::from_parts(38_028_000, 3803) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // 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_630 nanoseconds. + Weight::from_parts(25_469_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // 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: 24_544 nanoseconds. + Weight::from_parts(25_336_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // 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) + fn mint() -> Weight { + // Proof Size summary in bytes: + // Measured: `2442` + // Estimated: `11362` + // Minimum execution time: 355_230 nanoseconds. + Weight::from_parts(360_766_000, 11362) + .saturating_add(T::DbWeight::get().reads(16)) + .saturating_add(T::DbWeight::get().writes(8)) + } + // 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) + fn redeem() -> Weight { + // Proof Size summary in bytes: + // Measured: `2194` + // Estimated: `8134` + // Minimum execution time: 243_971 nanoseconds. + Weight::from_parts(250_684_000, 8134) + .saturating_add(T::DbWeight::get().reads(16)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // 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: 220_866 nanoseconds. + Weight::from_parts(223_033_000, 11362) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // 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 { + // Proof Size summary in bytes: + // Measured: `2782` + // Estimated: `16548` + // Minimum execution time: 552_131 nanoseconds. + Weight::from_parts(564_804_000, 16548) + .saturating_add(T::DbWeight::get().reads(17)) + .saturating_add(T::DbWeight::get().writes(3)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_stable_pool.rs b/runtime/bifrost-polkadot/src/weights/bifrost_stable_pool.rs new file mode 100644 index 000000000..42173ec5d --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/bifrost_stable_pool.rs @@ -0,0 +1,225 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_stable_pool +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_stable_pool +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_stable_pool.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_stable_pool. +pub struct BifrostWeight(PhantomData); +impl bifrost_stable_pool::WeightInfo for BifrostWeight { + // Storage: StableAsset PoolCount (r:1 w:1) + // Proof Skipped: StableAsset PoolCount (max_values: Some(1), max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn create_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `663` + // Estimated: `4128` + // Minimum execution time: 90_724 nanoseconds. + Weight::from_parts(93_251_000, 4128) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: StableAsset PoolCount (r:1 w:0) + // Proof Skipped: StableAsset PoolCount (max_values: Some(1), max_size: None, mode: Measured) + // Storage: StableAsset TokenRateCaches (r:3 w:2) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + fn edit_token_rate() -> Weight { + // Proof Size summary in bytes: + // Measured: `258` + // Estimated: `8673` + // Minimum execution time: 70_303 nanoseconds. + Weight::from_parts(71_635_000, 8673) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: StableAsset TokenRateCaches (r:2 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:3 w:3) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn add_liquidity() -> Weight { + // Proof Size summary in bytes: + // Measured: `2557` + // Estimated: `8769` + // Minimum execution time: 427_183 nanoseconds. + Weight::from_parts(438_909_000, 8769) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(7)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: StableAsset TokenRateCaches (r:1 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn swap() -> Weight { + // Proof Size summary in bytes: + // Measured: `2239` + // Estimated: `6196` + // Minimum execution time: 375_244 nanoseconds. + Weight::from_parts(385_475_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: StableAsset TokenRateCaches (r:1 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn redeem_proportion() -> Weight { + // Proof Size summary in bytes: + // Measured: `2239` + // Estimated: `6196` + // Minimum execution time: 359_499 nanoseconds. + Weight::from_parts(370_566_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: StableAsset TokenRateCaches (r:1 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn redeem_single() -> Weight { + // Proof Size summary in bytes: + // Measured: `2239` + // Estimated: `6196` + // Minimum execution time: 304_691 nanoseconds. + Weight::from_parts(312_518_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: StableAsset TokenRateCaches (r:1 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn redeem_multi() -> Weight { + // Proof Size summary in bytes: + // Measured: `2239` + // Estimated: `6196` + // Minimum execution time: 363_000 nanoseconds. + Weight::from_parts(367_057_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + fn modify_a() -> Weight { + // Proof Size summary in bytes: + // Measured: `446` + // Estimated: `3911` + // Minimum execution time: 45_142 nanoseconds. + Weight::from_parts(46_445_000, 3911) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + fn modify_fees() -> Weight { + // Proof Size summary in bytes: + // Measured: `446` + // Estimated: `3911` + // Minimum execution time: 42_836 nanoseconds. + Weight::from_parts(44_114_000, 3911) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + fn modify_recipients() -> Weight { + // Proof Size summary in bytes: + // Measured: `446` + // Estimated: `3911` + // Minimum execution time: 42_455 nanoseconds. + Weight::from_parts(43_753_000, 3911) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_system_maker.rs b/runtime/bifrost-polkadot/src/weights/bifrost_system_maker.rs new file mode 100644 index 000000000..346c74f41 --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/bifrost_system_maker.rs @@ -0,0 +1,122 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_system_maker +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_system_maker +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_system_maker.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_system_maker. +pub struct BifrostWeight(PhantomData); +impl bifrost_system_maker::WeightInfo for BifrostWeight { + // Storage: SystemMaker Infos (r:1 w:1) + // Proof Skipped: SystemMaker Infos (max_values: None, max_size: None, mode: Measured) + fn set_config() -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `3574` + // Minimum execution time: 32_211 nanoseconds. + Weight::from_parts(33_399_000, 3574) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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) + fn charge() -> Weight { + // Proof Size summary in bytes: + // Measured: `1402` + // Estimated: `6196` + // Minimum execution time: 122_457 nanoseconds. + Weight::from_parts(124_486_000, 6196) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: SystemMaker Infos (r:0 w:1) + // Proof Skipped: SystemMaker Infos (max_values: None, max_size: None, mode: Measured) + fn close() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 22_412 nanoseconds. + Weight::from_parts(22_806_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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) + fn payout() -> Weight { + // Proof Size summary in bytes: + // Measured: `1461` + // Estimated: `6196` + // Minimum execution time: 114_158 nanoseconds. + Weight::from_parts(116_409_000, 6196) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: SystemMaker Infos (r:2 w:0) + // Proof Skipped: SystemMaker Infos (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: Tokens Accounts (r:2 w:0) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + fn on_idle() -> Weight { + // Proof Size summary in bytes: + // Measured: `894` + // Estimated: `6834` + // Minimum execution time: 54_792 nanoseconds. + Weight::from_parts(55_872_000, 6834) + .saturating_add(T::DbWeight::get().reads(5)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_system_staking.rs b/runtime/bifrost-polkadot/src/weights/bifrost_system_staking.rs new file mode 100644 index 000000000..f498d3d9e --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/bifrost_system_staking.rs @@ -0,0 +1,140 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_system_staking +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_system_staking +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_system_staking.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_system_staking. +pub struct BifrostWeight(PhantomData); +impl bifrost_system_staking::WeightInfo for BifrostWeight { + // Storage: SystemStaking TokenList (r:1 w:0) + // Proof Skipped: SystemStaking TokenList (max_values: Some(1), max_size: None, mode: Measured) + // Storage: SystemStaking Round (r:1 w:0) + // Proof Skipped: SystemStaking Round (max_values: Some(1), max_size: None, mode: Measured) + // Storage: SystemStaking TokenStatus (r:2 w:0) + // Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) + fn on_initialize() -> Weight { + // Proof Size summary in bytes: + // Measured: `445` + // Estimated: `6385` + // Minimum execution time: 28_850 nanoseconds. + Weight::from_parts(29_556_000, 6385) + .saturating_add(T::DbWeight::get().reads(4)) + } + // Storage: SystemStaking TokenStatus (r:1 w:1) + // Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) + // Storage: SystemStaking TokenList (r:1 w:1) + // Proof Skipped: SystemStaking TokenList (max_values: Some(1), max_size: None, mode: Measured) + fn token_config() -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `3574` + // Minimum execution time: 41_759 nanoseconds. + Weight::from_parts(42_957_000, 3574) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: SystemStaking TokenStatus (r:1 w:1) + // Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) + // Storage: Farming PoolInfos (r:1 w:0) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + fn refresh_token_info() -> Weight { + // Proof Size summary in bytes: + // Measured: `403` + // Estimated: `3868` + // Minimum execution time: 51_852 nanoseconds. + Weight::from_parts(53_735_000, 3868) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: SystemStaking TokenStatus (r:1 w:0) + // Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:0) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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) + fn payout() -> Weight { + // Proof Size summary in bytes: + // Measured: `1190` + // Estimated: `4655` + // Minimum execution time: 68_013 nanoseconds. + Weight::from_parts(69_859_000, 4655) + .saturating_add(T::DbWeight::get().reads(4)) + } + fn on_redeem_success() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 1_959 nanoseconds. + Weight::from_parts(2_084_000, 0) + } + fn on_redeemed() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 1_994 nanoseconds. + Weight::from_parts(2_059_000, 0) + } + // Storage: SystemStaking TokenList (r:1 w:1) + // Proof Skipped: SystemStaking TokenList (max_values: Some(1), max_size: None, mode: Measured) + // Storage: SystemStaking TokenStatus (r:0 w:1) + // Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) + fn delete_token() -> Weight { + // Proof Size summary in bytes: + // Measured: `169` + // Estimated: `1654` + // Minimum execution time: 22_823 nanoseconds. + Weight::from_parts(23_707_000, 1654) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_ve_minting.rs b/runtime/bifrost-polkadot/src/weights/bifrost_ve_minting.rs new file mode 100644 index 000000000..459a687a3 --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/bifrost_ve_minting.rs @@ -0,0 +1,314 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_ve_minting +//! +//! 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: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-polkadot-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-polkadot-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_ve_minting +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-polkadot/src/weights/bifrost_ve_minting.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_ve_minting. +pub struct BifrostWeight(PhantomData); +impl bifrost_ve_minting::WeightInfo for BifrostWeight { + // Storage: VeMinting VeConfigs (r:1 w:1) + // Proof Skipped: VeMinting VeConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: System Number (r:1 w:0) + // Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System ExecutionPhase (r:1 w:0) + // Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + // Storage: System EventCount (r:1 w:1) + // Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Events (r:1 w:1) + // Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) + fn set_config() -> Weight { + // Proof Size summary in bytes: + // Measured: `200` + // Estimated: `1685` + // Minimum execution time: 33_022 nanoseconds. + Weight::from_parts(33_924_000, 1685) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: VeMinting VeConfigs (r:1 w:0) + // Proof Skipped: VeMinting VeConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting Locked (r:1 w:1) + // Proof Skipped: VeMinting Locked (max_values: None, max_size: None, mode: Measured) + // Storage: System Number (r:1 w:0) + // Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: VeMinting Supply (r:1 w:1) + // Proof Skipped: VeMinting Supply (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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: System ExecutionPhase (r:1 w:0) + // Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + // Storage: System EventCount (r:1 w:1) + // Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Events (r:1 w:1) + // Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting IncentiveConfigs (r:1 w:1) + // Proof Skipped: VeMinting IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting Epoch (r:1 w:1) + // Proof Skipped: VeMinting Epoch (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting PointHistory (r:1 w:1) + // Proof Skipped: VeMinting PointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting UserPointEpoch (r:1 w:1) + // Proof Skipped: VeMinting UserPointEpoch (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting Rewards (r:1 w:0) + // Proof Skipped: VeMinting Rewards (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting SlopeChanges (r:2 w:1) + // Proof Skipped: VeMinting SlopeChanges (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting UserPointHistory (r:0 w:1) + // Proof Skipped: VeMinting UserPointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting UserRewardPerTokenPaid (r:0 w:1) + // Proof Skipped: VeMinting UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) + fn create_lock() -> Weight { + // Proof Size summary in bytes: + // Measured: `1439` + // Estimated: `7379` + // Minimum execution time: 257_228 nanoseconds. + Weight::from_parts(260_165_000, 7379) + .saturating_add(T::DbWeight::get().reads(19)) + .saturating_add(T::DbWeight::get().writes(14)) + } + // Storage: VeMinting VeConfigs (r:1 w:0) + // Proof Skipped: VeMinting VeConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting Locked (r:1 w:1) + // Proof Skipped: VeMinting Locked (max_values: None, max_size: None, mode: Measured) + // Storage: System Number (r:1 w:0) + // Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: VeMinting Supply (r:1 w:1) + // Proof Skipped: VeMinting Supply (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:0) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: System ExecutionPhase (r:1 w:0) + // Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + // Storage: System EventCount (r:1 w:1) + // Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Events (r:1 w:1) + // Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting IncentiveConfigs (r:1 w:1) + // Proof Skipped: VeMinting IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting Epoch (r:1 w:1) + // Proof Skipped: VeMinting Epoch (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting PointHistory (r:1 w:1) + // Proof Skipped: VeMinting PointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting UserPointEpoch (r:1 w:1) + // Proof Skipped: VeMinting UserPointEpoch (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting UserPointHistory (r:1 w:1) + // Proof Skipped: VeMinting UserPointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting Rewards (r:1 w:1) + // Proof Skipped: VeMinting Rewards (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting UserRewardPerTokenPaid (r:1 w:1) + // Proof Skipped: VeMinting UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting SlopeChanges (r:1 w:1) + // Proof Skipped: VeMinting SlopeChanges (max_values: None, max_size: None, mode: Measured) + fn increase_amount() -> Weight { + // Proof Size summary in bytes: + // Measured: `2083` + // Estimated: `6176` + // Minimum execution time: 282_580 nanoseconds. + Weight::from_parts(291_800_000, 6176) + .saturating_add(T::DbWeight::get().reads(19)) + .saturating_add(T::DbWeight::get().writes(14)) + } + // Storage: VeMinting VeConfigs (r:1 w:0) + // Proof Skipped: VeMinting VeConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting Locked (r:1 w:1) + // Proof Skipped: VeMinting Locked (max_values: None, max_size: None, mode: Measured) + // Storage: System Number (r:1 w:0) + // Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: VeMinting Supply (r:1 w:1) + // Proof Skipped: VeMinting Supply (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting IncentiveConfigs (r:1 w:1) + // Proof Skipped: VeMinting IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting Epoch (r:1 w:1) + // Proof Skipped: VeMinting Epoch (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting PointHistory (r:1 w:1) + // Proof Skipped: VeMinting PointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting UserPointEpoch (r:1 w:1) + // Proof Skipped: VeMinting UserPointEpoch (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting UserPointHistory (r:1 w:1) + // Proof Skipped: VeMinting UserPointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting Rewards (r:1 w:1) + // Proof Skipped: VeMinting Rewards (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting UserRewardPerTokenPaid (r:1 w:1) + // Proof Skipped: VeMinting UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting SlopeChanges (r:2 w:2) + // Proof Skipped: VeMinting SlopeChanges (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:0) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: System ExecutionPhase (r:1 w:0) + // Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + // Storage: System EventCount (r:1 w:1) + // Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Events (r:1 w:1) + // Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) + fn increase_unlock_time() -> Weight { + // Proof Size summary in bytes: + // Measured: `1589` + // Estimated: `7529` + // Minimum execution time: 228_588 nanoseconds. + Weight::from_parts(233_726_000, 7529) + .saturating_add(T::DbWeight::get().reads(17)) + .saturating_add(T::DbWeight::get().writes(13)) + } + // Storage: VeMinting Locked (r:1 w:1) + // Proof Skipped: VeMinting Locked (max_values: None, max_size: None, mode: Measured) + // Storage: System Number (r:1 w:0) + // Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: VeMinting Supply (r:1 w:1) + // Proof Skipped: VeMinting Supply (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: System ExecutionPhase (r:1 w:0) + // Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + // Storage: System EventCount (r:1 w:1) + // Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Events (r:1 w:1) + // Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting IncentiveConfigs (r:1 w:1) + // Proof Skipped: VeMinting IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting Epoch (r:1 w:1) + // Proof Skipped: VeMinting Epoch (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting PointHistory (r:1 w:105) + // Proof Skipped: VeMinting PointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting SlopeChanges (r:104 w:0) + // Proof Skipped: VeMinting SlopeChanges (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting UserPointEpoch (r:1 w:1) + // Proof Skipped: VeMinting UserPointEpoch (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting UserPointHistory (r:1 w:1) + // Proof Skipped: VeMinting UserPointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting Rewards (r:1 w:1) + // Proof Skipped: VeMinting Rewards (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting UserRewardPerTokenPaid (r:1 w:1) + // Proof Skipped: VeMinting UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) + fn withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `2059` + // Estimated: `260449` + // Minimum execution time: 1_301_179 nanoseconds. + Weight::from_parts(1_319_174_000, 260449) + .saturating_add(T::DbWeight::get().reads(121)) + .saturating_add(T::DbWeight::get().writes(118)) + } + // Storage: VeMinting IncentiveConfigs (r:1 w:1) + // Proof Skipped: VeMinting IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: System Number (r:1 w:0) + // Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: VeMinting Epoch (r:1 w:0) + // Proof Skipped: VeMinting Epoch (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting PointHistory (r:1 w:0) + // Proof Skipped: VeMinting PointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting SlopeChanges (r:104 w:0) + // Proof Skipped: VeMinting SlopeChanges (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting UserPointEpoch (r:1 w:0) + // Proof Skipped: VeMinting UserPointEpoch (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting UserPointHistory (r:1 w:0) + // Proof Skipped: VeMinting UserPointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting Rewards (r:1 w:1) + // Proof Skipped: VeMinting Rewards (max_values: None, max_size: None, mode: Measured) + // Storage: VeMinting UserRewardPerTokenPaid (r:1 w:1) + // Proof Skipped: VeMinting UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) + // Storage: Balances TotalIssuance (r:1 w:1) + // Proof: Balances TotalIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + // Storage: System Account (r:3 w:3) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: System ExecutionPhase (r:1 w:0) + // Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + // Storage: System EventCount (r:1 w:1) + // Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Events (r:1 w:1) + // Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) + fn get_rewards() -> Weight { + // Proof Size summary in bytes: + // Measured: `1384` + // Estimated: `259774` + // Minimum execution time: 754_097 nanoseconds. + Weight::from_parts(761_819_000, 259774) + .saturating_add(T::DbWeight::get().reads(119)) + .saturating_add(T::DbWeight::get().writes(9)) + } + // Storage: VeMinting IncentiveConfigs (r:1 w:1) + // Proof Skipped: VeMinting IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: System Number (r:1 w:0) + // Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System ExecutionPhase (r:1 w:0) + // Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + // Storage: System EventCount (r:1 w:1) + // Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Events (r:1 w:1) + // Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting Epoch (r:1 w:0) + // Proof Skipped: VeMinting Epoch (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VeMinting PointHistory (r:1 w:0) + // Proof Skipped: VeMinting PointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Balances TotalIssuance (r:1 w:0) + // Proof: Balances TotalIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + fn notify_rewards() -> Weight { + // Proof Size summary in bytes: + // Measured: `508` + // Estimated: `6196` + // Minimum execution time: 176_065 nanoseconds. + Weight::from_parts(177_901_000, 6196) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(5)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_vstoken_conversion.rs b/runtime/bifrost-polkadot/src/weights/bifrost_vstoken_conversion.rs new file mode 100644 index 000000000..3ead07648 --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/bifrost_vstoken_conversion.rs @@ -0,0 +1,136 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_vstoken_conversion +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_vstoken_conversion +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_vstoken_conversion.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_vstoken_conversion. +pub struct BifrostWeight(PhantomData); +impl bifrost_vstoken_conversion::WeightInfo for BifrostWeight { + // Storage: VstokenConversion ExchangeFee (r:1 w:1) + // Proof: VstokenConversion ExchangeFee (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + fn set_exchange_fee() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `1517` + // Minimum execution time: 31_889 nanoseconds. + Weight::from_parts(32_495_000, 1517) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VstokenConversion ExchangeRate (r:1 w:1) + // Proof: VstokenConversion ExchangeRate (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + fn set_exchange_rate() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3479` + // Minimum execution time: 32_059 nanoseconds. + Weight::from_parts(33_515_000, 3479) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VstokenConversion RelaychainLease (r:1 w:1) + // Proof: VstokenConversion RelaychainLease (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn set_relaychain_lease() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `1489` + // Minimum execution time: 29_697 nanoseconds. + Weight::from_parts(30_880_000, 1489) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: VstokenConversion RelaychainLease (r:1 w:0) + // Proof: VstokenConversion RelaychainLease (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: VstokenConversion ExchangeRate (r:1 w:0) + // Proof: VstokenConversion ExchangeRate (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + // Storage: VstokenConversion ExchangeFee (r:1 w:0) + // Proof: VstokenConversion ExchangeFee (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + // Storage: System Account (r:3 w:3) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:2 w:2) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn vsbond_convert_to_vstoken() -> Weight { + // Proof Size summary in bytes: + // Measured: `2336` + // Estimated: `11362` + // Minimum execution time: 261_794 nanoseconds. + Weight::from_parts(267_446_000, 11362) + .saturating_add(T::DbWeight::get().reads(14)) + .saturating_add(T::DbWeight::get().writes(9)) + } + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: VstokenConversion RelaychainLease (r:1 w:0) + // Proof: VstokenConversion RelaychainLease (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: VstokenConversion ExchangeRate (r:1 w:0) + // Proof: VstokenConversion ExchangeRate (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + // Storage: VstokenConversion ExchangeFee (r:1 w:0) + // Proof: VstokenConversion ExchangeFee (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + // Storage: System Account (r:3 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn vstoken_convert_to_vsbond() -> Weight { + // Proof Size summary in bytes: + // Measured: `2327` + // Estimated: `11362` + // Minimum execution time: 244_918 nanoseconds. + Weight::from_parts(250_767_000, 11362) + .saturating_add(T::DbWeight::get().reads(13)) + .saturating_add(T::DbWeight::get().writes(7)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_minting.rs b/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_minting.rs new file mode 100644 index 000000000..417757860 --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_minting.rs @@ -0,0 +1,266 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_vtoken_minting +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_vtoken_minting +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_vtoken_minting.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_vtoken_minting. +pub struct BifrostWeight(PhantomData); +impl bifrost_vtoken_minting::WeightInfo for BifrostWeight { + // Storage: VtokenMinting MinimumMint (r:1 w:1) + // Proof: VtokenMinting MinimumMint (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn set_minimum_mint() -> Weight { + // Proof Size summary in bytes: + // Measured: `732` + // Estimated: `4197` + // Minimum execution time: 47_604 nanoseconds. + Weight::from_parts(48_620_000, 4197) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting MinimumRedeem (r:1 w:1) + // Proof: VtokenMinting MinimumRedeem (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn set_minimum_redeem() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3503` + // Minimum execution time: 31_648 nanoseconds. + Weight::from_parts(33_004_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting UnlockDuration (r:1 w:1) + // Proof: VtokenMinting UnlockDuration (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + fn set_unlock_duration() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3492` + // Minimum execution time: 32_605 nanoseconds. + Weight::from_parts(33_244_000, 3492) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting TokenToRebond (r:1 w:1) + // Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn add_support_rebond_token() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3503` + // Minimum execution time: 33_236 nanoseconds. + Weight::from_parts(34_638_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting TokenToRebond (r:1 w:1) + // Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn remove_support_rebond_token() -> Weight { + // Proof Size summary in bytes: + // Measured: `230` + // Estimated: `3503` + // Minimum execution time: 36_978 nanoseconds. + Weight::from_parts(38_593_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting Fees (r:1 w:1) + // Proof: VtokenMinting Fees (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + fn set_fees() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `1493` + // Minimum execution time: 30_702 nanoseconds. + Weight::from_parts(31_421_000, 1493) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting HookIterationLimit (r:1 w:1) + // Proof: VtokenMinting HookIterationLimit (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn set_hook_iteration_limit() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `1489` + // Minimum execution time: 28_783 nanoseconds. + Weight::from_parts(30_913_000, 1489) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // 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: Tokens Accounts (r:3 w:3) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn mint() -> Weight { + // Proof Size summary in bytes: + // Measured: `2041` + // Estimated: `8769` + // Minimum execution time: 204_920 nanoseconds. + Weight::from_parts(207_086_000, 8769) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(6)) + } + // 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: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, 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:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, 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 OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: VtokenMinting UnlockDuration (r:1 w:0) + // Proof: VtokenMinting UnlockDuration (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: VtokenMinting UnlockingTotal (r:1 w:1) + // Proof: VtokenMinting UnlockingTotal (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenUnlockNextId (r:1 w:1) + // Proof: VtokenMinting TokenUnlockNextId (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + // Storage: VtokenMinting UserUnlockLedger (r:1 w:1) + // Proof: VtokenMinting UserUnlockLedger (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen) + // Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:1) + // Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenUnlockLedger (r:0 w:1) + // Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(136), added: 2611, mode: MaxEncodedLen) + fn redeem() -> Weight { + // Proof Size summary in bytes: + // Measured: `2187` + // Estimated: `6176` + // Minimum execution time: 244_947 nanoseconds. + Weight::from_parts(249_155_000, 6176) + .saturating_add(T::DbWeight::get().reads(15)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: VtokenMinting TokenToRebond (r:1 w:1) + // Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting UserUnlockLedger (r:1 w:1) + // Proof: VtokenMinting UserUnlockLedger (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenUnlockLedger (r:1 w:1) + // Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(136), added: 2611, mode: MaxEncodedLen) + // Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:1) + // Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, mode: MaxEncodedLen) + // Storage: VtokenMinting UnlockingTotal (r:1 w:1) + // Proof: VtokenMinting UnlockingTotal (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: Tokens Accounts (r:3 w:3) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn rebond() -> Weight { + // Proof Size summary in bytes: + // Measured: `2620` + // Estimated: `8769` + // Minimum execution time: 231_220 nanoseconds. + Weight::from_parts(235_084_000, 8769) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: VtokenMinting TokenToRebond (r:1 w:1) + // Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenUnlockLedger (r:1 w:1) + // Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(136), added: 2611, mode: MaxEncodedLen) + // Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:1) + // Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, mode: MaxEncodedLen) + // Storage: VtokenMinting UserUnlockLedger (r:1 w:1) + // Proof: VtokenMinting UserUnlockLedger (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen) + // Storage: VtokenMinting UnlockingTotal (r:1 w:1) + // Proof: VtokenMinting UnlockingTotal (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: Tokens Accounts (r:3 w:3) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn rebond_by_unlock_id() -> Weight { + // Proof Size summary in bytes: + // Measured: `2620` + // Estimated: `8769` + // Minimum execution time: 221_577 nanoseconds. + Weight::from_parts(223_798_000, 8769) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + fn on_initialize() -> Weight { + // Proof Size summary in bytes: + // Measured: `211` + // Estimated: `3492` + // Minimum execution time: 16_412 nanoseconds. + Weight::from_parts(16_763_000, 3492) + .saturating_add(T::DbWeight::get().reads(1)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_voting.rs b/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_voting.rs new file mode 100644 index 000000000..e6fe0ba43 --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_voting.rs @@ -0,0 +1,268 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_vtoken_voting +//! +//! 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: `[]` +//! 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 +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_vtoken_voting +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs +// --template=./weight-template/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_vtoken_voting. +pub struct BifrostWeight(PhantomData); +impl bifrost_vtoken_voting::WeightInfo for BifrostWeight { + // Storage: VtokenVoting UndecidingTimeout (r:1 w:0) + // Proof: VtokenVoting UndecidingTimeout (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + // Storage: VtokenVoting DelegatorVote (r:2 w:1) + // Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) + // Storage: Slp DelegatorsIndex2Multilocation (r:1 w:0) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenVoting PendingVotingInfo (r:1 w:1) + // Proof: VtokenVoting PendingVotingInfo (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:1) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: VtokenVoting VotingFor (r:1 w:1) + // Proof: VtokenVoting VotingFor (max_values: None, max_size: Some(13663), added: 16138, mode: MaxEncodedLen) + // Storage: VtokenVoting ClassLocksFor (r:1 w:1) + // Proof: VtokenVoting ClassLocksFor (max_values: None, max_size: Some(5162), added: 7637, mode: MaxEncodedLen) + // Storage: Tokens Locks (r:1 w:1) + // Proof: Tokens Locks (max_values: None, max_size: Some(1271), added: 3746, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), 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: VtokenVoting PendingReferendumInfo (r:0 w:1) + // Proof: VtokenVoting PendingReferendumInfo (max_values: None, max_size: Some(34), added: 2509, mode: MaxEncodedLen) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn vote_new() -> Weight { + // Proof Size summary in bytes: + // Measured: `14356` + // Estimated: `17821` + // Minimum execution time: 298_891 nanoseconds. + Weight::from_parts(310_932_000, 17821) + .saturating_add(T::DbWeight::get().reads(15)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: VtokenVoting UndecidingTimeout (r:1 w:0) + // Proof: VtokenVoting UndecidingTimeout (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + // Storage: VtokenVoting DelegatorVote (r:2 w:1) + // Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) + // Storage: Slp DelegatorsIndex2Multilocation (r:1 w:0) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenVoting PendingVotingInfo (r:1 w:1) + // Proof: VtokenVoting PendingVotingInfo (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:1) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: VtokenVoting VotingFor (r:1 w:1) + // Proof: VtokenVoting VotingFor (max_values: None, max_size: Some(13663), added: 16138, mode: MaxEncodedLen) + // Storage: VtokenVoting ClassLocksFor (r:1 w:1) + // Proof: VtokenVoting ClassLocksFor (max_values: None, max_size: Some(5162), added: 7637, mode: MaxEncodedLen) + // Storage: Tokens Locks (r:1 w:1) + // Proof: Tokens Locks (max_values: None, max_size: Some(1271), added: 3746, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), 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: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn vote_existing() -> Weight { + // Proof Size summary in bytes: + // Measured: `5531` + // Estimated: `17128` + // Minimum execution time: 267_328 nanoseconds. + Weight::from_parts(274_051_000, 17128) + .saturating_add(T::DbWeight::get().reads(15)) + .saturating_add(T::DbWeight::get().writes(9)) + } + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:0) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + // Storage: VtokenVoting VoteLockingPeriod (r:1 w:0) + // Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VtokenVoting VotingFor (r:1 w:1) + // Proof: VtokenVoting VotingFor (max_values: None, max_size: Some(13663), added: 16138, mode: MaxEncodedLen) + // Storage: VtokenVoting ClassLocksFor (r:1 w:1) + // Proof: VtokenVoting ClassLocksFor (max_values: None, max_size: Some(5162), added: 7637, mode: MaxEncodedLen) + // Storage: Tokens Locks (r:1 w:1) + // Proof: Tokens Locks (max_values: None, max_size: Some(1271), added: 3746, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn unlock() -> Weight { + // Proof Size summary in bytes: + // Measured: `2103` + // Estimated: `17128` + // Minimum execution time: 163_235 nanoseconds. + Weight::from_parts(166_276_000, 17128) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:0) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + // Storage: VtokenVoting VoteLockingPeriod (r:1 w:0) + // Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VtokenVoting DelegatorVote (r:1 w:0) + // Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), 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: VtokenVoting PendingRemoveDelegatorVote (r:0 w:1) + // Proof: VtokenVoting PendingRemoveDelegatorVote (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn remove_delegator_vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `965` + // Estimated: `4430` + // Minimum execution time: 94_053 nanoseconds. + Weight::from_parts(105_489_000, 4430) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:1) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) + fn kill_referendum() -> Weight { + // Proof Size summary in bytes: + // Measured: `370` + // Estimated: `3553` + // Minimum execution time: 39_404 nanoseconds. + Weight::from_parts(45_802_000, 3553) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp DelegatorsIndex2Multilocation (r:1 w:0) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenVoting DelegatorVote (r:1 w:1) + // Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) + fn set_delegator_role() -> Weight { + // Proof Size summary in bytes: + // Measured: `372` + // Estimated: `3837` + // Minimum execution time: 49_788 nanoseconds. + Weight::from_parts(50_805_000, 3837) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:1) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + fn set_referendum_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `321` + // Estimated: `3553` + // Minimum execution time: 40_937 nanoseconds. + Weight::from_parts(41_714_000, 3553) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenVoting UndecidingTimeout (r:0 w:1) + // Proof: VtokenVoting UndecidingTimeout (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + fn set_undeciding_timeout() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 7_244 nanoseconds. + Weight::from_parts(24_083_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenVoting VoteLockingPeriod (r:0 w:1) + // Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + fn set_vote_locking_period() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 23_244 nanoseconds. + Weight::from_parts(23_717_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenVoting PendingVotingInfo (r:1 w:0) + // Proof: VtokenVoting PendingVotingInfo (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + // Storage: VtokenVoting PendingReferendumInfo (r:1 w:0) + // Proof: VtokenVoting PendingReferendumInfo (max_values: None, max_size: Some(34), added: 2509, mode: MaxEncodedLen) + fn notify_vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `361` + // Estimated: `3582` + // Minimum execution time: 43_638 nanoseconds. + Weight::from_parts(44_768_000, 3582) + .saturating_add(T::DbWeight::get().reads(2)) + } + // Storage: VtokenVoting PendingRemoveDelegatorVote (r:1 w:0) + // Proof: VtokenVoting PendingRemoveDelegatorVote (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) + fn notify_remove_delegator_vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `329` + // Estimated: `3501` + // Minimum execution time: 38_311 nanoseconds. + Weight::from_parts(38_955_000, 3501) + .saturating_add(T::DbWeight::get().reads(1)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/mod.rs b/runtime/bifrost-polkadot/src/weights/mod.rs index ccb3838e0..239b4103b 100644 --- a/runtime/bifrost-polkadot/src/weights/mod.rs +++ b/runtime/bifrost-polkadot/src/weights/mod.rs @@ -20,6 +20,22 @@ //! A list of the different weight modules for our runtime. +pub mod bifrost_asset_registry; +pub mod bifrost_call_switchgear; +pub mod bifrost_cross_in_out; pub mod bifrost_currencies; +pub mod bifrost_farming; +pub mod bifrost_fee_share; +pub mod bifrost_flexible_fee; +pub mod bifrost_salp; +pub mod bifrost_slp; +pub mod bifrost_slpx; +pub mod bifrost_stable_pool; +pub mod bifrost_system_maker; +pub mod bifrost_system_staking; +pub mod bifrost_ve_minting; +pub mod bifrost_vstoken_conversion; +pub mod bifrost_vtoken_minting; +pub mod bifrost_vtoken_voting; pub mod orml_tokens; pub mod pallet_xcm; diff --git a/scripts/generate-weights.sh b/scripts/generate-weights.sh index 5bd2ce3ad..8dcacf83d 100644 --- a/scripts/generate-weights.sh +++ b/scripts/generate-weights.sh @@ -19,19 +19,44 @@ do pallet=$line temp=${pallet/bifrost_/} pallet_dir=${temp//_/-} - if [ "$pallet" != "parachain_staking" ]; then - echo "benchmark pallet ${pallet}" - echo "benchmark runtime ${runtime}" - target/release/bifrost benchmark pallet --chain=$chain \ - --steps=50 \ - --repeat=20 \ - --pallet=$pallet \ - --extrinsic="*" \ - --execution=wasm \ - --wasm-execution=compiled \ - --heap-pages=4096 \ - --output="./pallets/${pallet_dir}/src/weights.rs" \ - --template="./frame-weight-template.hbs"; - fi + echo "benchmark pallet ${pallet}" + echo "benchmark runtime ${runtime}" + target/release/bifrost benchmark pallet --chain=$chain \ + --steps=50 \ + --repeat=20 \ + --pallet=$pallet \ + --extrinsic="*" \ + --execution=wasm \ + --wasm-execution=compiled \ + --heap-pages=4096 \ + --output="./pallets/${pallet_dir}/src/weights.rs" \ + --template="./weight-template/pallet-weight-template.hbs"; + done +done + + +IFS=', ' read -r -a runtimes <<< $@; +for runtime in "${runtimes[@]}" +do + chain="${runtime}-local" + echo $chain + target/release/bifrost benchmark pallet --chain=$chain --list | sed -n '2,$p' | grep -Eio "^\w+" | uniq | + while IFS= read -r line + do + pallet=$line + temp=${pallet/bifrost_/} + pallet_dir=${temp//_/-} + echo "benchmark pallet ${pallet}" + echo "benchmark runtime ${runtime}" + target/release/bifrost benchmark pallet --chain=$chain \ + --steps=50 \ + --repeat=20 \ + --pallet=$pallet \ + --extrinsic="*" \ + --execution=wasm \ + --wasm-execution=compiled \ + --heap-pages=4096 \ + --output="./runtime/${runtime}/src/weights/${pallet}.rs" \ + --template="./weight-template/runtime-weight-template.hbs"; done done diff --git a/frame-weight-template.hbs b/weight-template/pallet-weight-template.hbs similarity index 59% rename from frame-weight-template.hbs rename to weight-template/pallet-weight-template.hbs index 229eff8a7..0c5fb87e6 100644 --- a/frame-weight-template.hbs +++ b/weight-template/pallet-weight-template.hbs @@ -25,10 +25,9 @@ //! Autogenerated weights for {{pallet}} //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}} -//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: `{{cmd.repeat}}`, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}` -//! WORST CASE MAP SIZE: `{{cmd.worst_case_map_values}}` +//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}` //! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}` -//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}} +//! WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}} // Executed Command: {{#each args as |arg|}} @@ -38,10 +37,9 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use sp_std::marker::PhantomData; /// Weight functions needed for {{pallet}}. pub trait WeightInfo { @@ -54,53 +52,6 @@ pub trait WeightInfo { {{/each}} } -/// Weights for {{pallet}} using the Bifrost node and recommended hardware. -pub struct BifrostWeight(PhantomData); -{{#if (eq pallet "frame_system")}} -impl WeightInfo for BifrostWeight { -{{else}} -impl WeightInfo for BifrostWeight { -{{/if}} - {{#each benchmarks as |benchmark|}} - {{#each benchmark.comments as |comment|}} - /// {{comment}} - {{/each}} - {{#each benchmark.component_ranges as |range|}} - /// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`. - {{/each}} - fn {{benchmark.name~}} - ( - {{~#each benchmark.components as |c| ~}} - {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} - ) -> Weight { - // Proof Size summary in bytes: - // Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` - // Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` - // Minimum execution time: {{underscore benchmark.min_execution_time}}_000 picoseconds. - Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}}) - {{#each benchmark.component_weight as |cw|}} - // Standard Error: {{underscore cw.error}} - .saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into())) - {{/each}} - {{#if (ne benchmark.base_reads "0")}} - .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}}_u64)) - {{/if}} - {{#each benchmark.component_reads as |cr|}} - .saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into()))) - {{/each}} - {{#if (ne benchmark.base_writes "0")}} - .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}}_u64)) - {{/if}} - {{#each benchmark.component_writes as |cw|}} - .saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into()))) - {{/each}} - {{#each benchmark.component_calculated_proof_size as |cp|}} - .saturating_add(Weight::from_parts(0, {{cp.slope}}).saturating_mul({{cp.name}}.into())) - {{/each}} - } - {{/each}} -} - // For backwards compatibility and tests impl WeightInfo for () { {{#each benchmarks as |benchmark|}} diff --git a/weight-template/runtime-weight-template.hbs b/weight-template/runtime-weight-template.hbs new file mode 100644 index 000000000..357185b68 --- /dev/null +++ b/weight-template/runtime-weight-template.hbs @@ -0,0 +1,85 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for {{pallet}} +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}} +//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}` +//! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}` +//! WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}} + +// Executed Command: +{{#each args as |arg|}} +// {{arg}} +{{/each}} + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for {{pallet}}. +pub struct BifrostWeight(PhantomData); +impl {{pallet}}::WeightInfo for BifrostWeight { + {{#each benchmarks as |benchmark|}} + {{#each benchmark.comments as |comment|}} + // {{comment}} + {{/each}} + {{#each benchmark.component_ranges as |range|}} + /// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`. + {{/each}} + fn {{benchmark.name~}} + ( + {{~#each benchmark.components as |c| ~}} + {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} + ) -> Weight { + // Proof Size summary in bytes: + // Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds. + Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}}) + {{#each benchmark.component_weight as |cw|}} + // Standard Error: {{underscore cw.error}} + .saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into())) + {{/each}} + {{#if (ne benchmark.base_reads "0")}} + .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}})) + {{/if}} + {{#each benchmark.component_reads as |cr|}} + .saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into()))) + {{/each}} + {{#if (ne benchmark.base_writes "0")}} + .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}})) + {{/if}} + {{#each benchmark.component_writes as |cw|}} + .saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into()))) + {{/each}} + {{#each benchmark.component_calculated_proof_size as |cp|}} + .saturating_add(Weight::from_parts(0, {{cp.slope}}).saturating_mul({{cp.name}}.into())) + {{/each}} + } + {{/each}} +}