mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 19:51:02 +00:00
Introduce NIS functionality into Kusama/Rococo (#6352)
* Integrate NIS into Kusama/Rococo * Missing files * Fix * Fix * Formatting * Add Kusama weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add Rococo weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Bump * Bump * ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_nis * ".git/.scripts/bench-bot.sh" runtime rococo-dev pallet_nis Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: command-bot <>
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
|
||||
#![recursion_limit = "256"]
|
||||
|
||||
use pallet_nis::WithMaximumOf;
|
||||
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
|
||||
use primitives::v2::{
|
||||
AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CommittedCandidateReceipt,
|
||||
@@ -53,7 +54,7 @@ use frame_support::{
|
||||
construct_runtime, parameter_types,
|
||||
traits::{
|
||||
ConstU32, Contains, EitherOf, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem,
|
||||
LockIdentifier, PrivilegeCmp, WithdrawReasons,
|
||||
LockIdentifier, PrivilegeCmp, StorageMapShim, WithdrawReasons,
|
||||
},
|
||||
weights::ConstantMultiplier,
|
||||
PalletId, RuntimeDebug,
|
||||
@@ -63,7 +64,7 @@ use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId};
|
||||
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
|
||||
use pallet_session::historical as session_historical;
|
||||
use pallet_transaction_payment::{CurrencyAdapter, FeeDetails, RuntimeDispatchInfo};
|
||||
use sp_core::OpaqueMetadata;
|
||||
use sp_core::{ConstU128, OpaqueMetadata};
|
||||
use sp_mmr_primitives as mmr;
|
||||
use sp_runtime::{
|
||||
create_runtime_str, generic, impl_opaque_keys,
|
||||
@@ -537,7 +538,7 @@ impl pallet_staking::EraPayout<Balance> for EraPayout {
|
||||
|
||||
runtime_common::impls::era_payout(
|
||||
total_staked,
|
||||
Gilt::issuance().non_gilt,
|
||||
Nis::issuance().other,
|
||||
MAX_ANNUAL_INFLATION,
|
||||
Perquintill::from_rational(era_duration_millis, MILLISECONDS_PER_YEAR),
|
||||
auctioned_slots,
|
||||
@@ -1027,7 +1028,7 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
|
||||
RuntimeCall::Scheduler(..) |
|
||||
RuntimeCall::Proxy(..) |
|
||||
RuntimeCall::Multisig(..) |
|
||||
RuntimeCall::Gilt(..) |
|
||||
RuntimeCall::Nis(..) |
|
||||
RuntimeCall::Registrar(paras_registrar::Call::register {..}) |
|
||||
RuntimeCall::Registrar(paras_registrar::Call::deregister {..}) |
|
||||
// Specifically omitting Registrar `swap`
|
||||
@@ -1246,33 +1247,57 @@ impl auctions::Config for Runtime {
|
||||
type WeightInfo = weights::runtime_common_auctions::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub IgnoredIssuance: Balance = Treasury::pot();
|
||||
pub const QueueCount: u32 = 300;
|
||||
pub const MaxQueueLen: u32 = 1000;
|
||||
pub const FifoQueueLen: u32 = 250;
|
||||
pub const GiltPeriod: BlockNumber = 30 * DAYS;
|
||||
pub const MinFreeze: Balance = 10_000 * CENTS;
|
||||
pub const IntakePeriod: BlockNumber = 5 * MINUTES;
|
||||
pub const MaxIntakeBids: u32 = 100;
|
||||
type NisCounterpartInstance = pallet_balances::Instance2;
|
||||
impl pallet_balances::Config<NisCounterpartInstance> for Runtime {
|
||||
type Balance = Balance;
|
||||
type DustRemoval = ();
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type ExistentialDeposit = ConstU128<10_000_000_000>; // One KTC cent
|
||||
type AccountStore = StorageMapShim<
|
||||
pallet_balances::Account<Runtime, NisCounterpartInstance>,
|
||||
frame_system::Provider<Runtime>,
|
||||
AccountId,
|
||||
pallet_balances::AccountData<u128>,
|
||||
>;
|
||||
type MaxLocks = ConstU32<4>;
|
||||
type MaxReserves = ConstU32<4>;
|
||||
type ReserveIdentifier = [u8; 8];
|
||||
type WeightInfo = weights::pallet_balances_nis_counterpart_balances::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
impl pallet_gilt::Config for Runtime {
|
||||
parameter_types! {
|
||||
pub IgnoredIssuance: Balance = Treasury::pot();
|
||||
pub const NisBasePeriod: BlockNumber = 30 * DAYS;
|
||||
pub const MinBid: Balance = 100 * QUID;
|
||||
pub MinReceipt: Perquintill = Perquintill::from_rational(1u64, 10_000_000u64);
|
||||
pub const IntakePeriod: BlockNumber = 5 * MINUTES;
|
||||
pub MaxIntakeWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 10;
|
||||
pub const ThawThrottle: (Perquintill, BlockNumber) = (Perquintill::from_percent(25), 5);
|
||||
pub storage NisTarget: Perquintill = Perquintill::zero();
|
||||
pub const NisPalletId: PalletId = PalletId(*b"py/nis ");
|
||||
}
|
||||
|
||||
impl pallet_nis::Config for Runtime {
|
||||
type WeightInfo = weights::pallet_nis::WeightInfo<Runtime>;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Currency = Balances;
|
||||
type CurrencyBalance = Balance;
|
||||
type AdminOrigin = EnsureRoot<AccountId>;
|
||||
type FundOrigin = frame_system::EnsureSigned<AccountId>;
|
||||
type Counterpart = NisCounterpartBalances;
|
||||
type CounterpartAmount = WithMaximumOf<ConstU128<21_000_000_000_000_000_000u128>>;
|
||||
type Deficit = (); // Mint
|
||||
type Surplus = (); // Burn
|
||||
type IgnoredIssuance = IgnoredIssuance;
|
||||
type QueueCount = QueueCount;
|
||||
type MaxQueueLen = MaxQueueLen;
|
||||
type FifoQueueLen = FifoQueueLen;
|
||||
type Period = GiltPeriod;
|
||||
type MinFreeze = MinFreeze;
|
||||
type Target = NisTarget;
|
||||
type PalletId = NisPalletId;
|
||||
type QueueCount = ConstU32<300>;
|
||||
type MaxQueueLen = ConstU32<1000>;
|
||||
type FifoQueueLen = ConstU32<250>;
|
||||
type BasePeriod = NisBasePeriod;
|
||||
type MinBid = MinBid;
|
||||
type MinReceipt = MinReceipt;
|
||||
type IntakePeriod = IntakePeriod;
|
||||
type MaxIntakeBids = MaxIntakeBids;
|
||||
type WeightInfo = weights::pallet_gilt::WeightInfo<Runtime>;
|
||||
type MaxIntakeWeight = MaxIntakeWeight;
|
||||
type ThawThrottle = ThawThrottle;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -1386,8 +1411,10 @@ construct_runtime! {
|
||||
// Election pallet. Only works with staking, but placed here to maintain indices.
|
||||
ElectionProviderMultiPhase: pallet_election_provider_multi_phase::{Pallet, Call, Storage, Event<T>, ValidateUnsigned} = 37,
|
||||
|
||||
// Gilts pallet.
|
||||
Gilt: pallet_gilt::{Pallet, Call, Storage, Event<T>, Config} = 38,
|
||||
// NIS pallet.
|
||||
Nis: pallet_nis::{Pallet, Call, Storage, Event<T>} = 38,
|
||||
// pub type NisCounterpartInstance = pallet_balances::Instance2;
|
||||
NisCounterpartBalances: pallet_balances::<Instance2> = 45,
|
||||
|
||||
// Provides a semi-sorted list of nominators for staking.
|
||||
VoterList: pallet_bags_list::<Instance1>::{Pallet, Call, Storage, Event<T>} = 39,
|
||||
@@ -1477,7 +1504,7 @@ mod benches {
|
||||
define_benchmarks!(
|
||||
// Polkadot
|
||||
// NOTE: Make sure to prefix these with `runtime_common::` so
|
||||
// the that path resolves correctly in the generated file.
|
||||
// that the path resolves correctly in the generated file.
|
||||
[runtime_common::auctions, Auctions]
|
||||
[runtime_common::crowdloan, Crowdloan]
|
||||
[runtime_common::claims, Claims]
|
||||
@@ -1492,6 +1519,7 @@ mod benches {
|
||||
[runtime_parachains::ump, Ump]
|
||||
// Substrate
|
||||
[pallet_balances, Balances]
|
||||
[pallet_balances, NisCounterpartBalances]
|
||||
[pallet_bags_list, VoterList]
|
||||
[frame_benchmarking::baseline, Baseline::<Runtime>]
|
||||
[pallet_bounties, Bounties]
|
||||
@@ -1504,7 +1532,7 @@ mod benches {
|
||||
[pallet_election_provider_multi_phase, ElectionProviderMultiPhase]
|
||||
[frame_election_provider_support, ElectionProviderBench::<Runtime>]
|
||||
[pallet_fast_unstake, FastUnstake]
|
||||
[pallet_gilt, Gilt]
|
||||
[pallet_nis, Nis]
|
||||
[pallet_identity, Identity]
|
||||
[pallet_im_online, ImOnline]
|
||||
[pallet_indices, Indices]
|
||||
|
||||
@@ -19,6 +19,7 @@ pub mod frame_election_provider_support;
|
||||
pub mod frame_system;
|
||||
pub mod pallet_bags_list;
|
||||
pub mod pallet_balances;
|
||||
pub mod pallet_balances_nis_counterpart_balances;
|
||||
pub mod pallet_bounties;
|
||||
pub mod pallet_child_bounties;
|
||||
pub mod pallet_collective_council;
|
||||
@@ -28,12 +29,12 @@ pub mod pallet_democracy;
|
||||
pub mod pallet_election_provider_multi_phase;
|
||||
pub mod pallet_elections_phragmen;
|
||||
pub mod pallet_fast_unstake;
|
||||
pub mod pallet_gilt;
|
||||
pub mod pallet_identity;
|
||||
pub mod pallet_im_online;
|
||||
pub mod pallet_indices;
|
||||
pub mod pallet_membership;
|
||||
pub mod pallet_multisig;
|
||||
pub mod pallet_nis;
|
||||
pub mod pallet_nomination_pools;
|
||||
pub mod pallet_preimage;
|
||||
pub mod pallet_proxy;
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Polkadot.
|
||||
|
||||
// Polkadot 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.
|
||||
|
||||
// Polkadot 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 Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
//! Autogenerated weights for `pallet_balances`
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
|
||||
//! DATE: 2022-11-28, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
|
||||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024
|
||||
|
||||
// Executed Command:
|
||||
// ./target/production/polkadot
|
||||
// benchmark
|
||||
// pallet
|
||||
// --chain=kusama-dev
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --pallet=pallet-balances
|
||||
// --extrinsic=*
|
||||
// --execution=wasm
|
||||
// --wasm-execution=compiled
|
||||
// --header=./file_header.txt
|
||||
// --output=./runtime/kusama/src/weights/
|
||||
|
||||
#![cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
/// Weight functions for `pallet_balances`.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
|
||||
// Storage: NisCounterpartBalances Account (r:2 w:2)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
// Storage: NisCounterpartBalances TotalIssuance (r:1 w:1)
|
||||
fn transfer() -> Weight {
|
||||
// Minimum execution time: 41_890 nanoseconds.
|
||||
Weight::from_ref_time(42_832_000)
|
||||
.saturating_add(T::DbWeight::get().reads(4))
|
||||
.saturating_add(T::DbWeight::get().writes(4))
|
||||
}
|
||||
// Storage: NisCounterpartBalances Account (r:2 w:2)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
fn transfer_keep_alive() -> Weight {
|
||||
// Minimum execution time: 30_130 nanoseconds.
|
||||
Weight::from_ref_time(31_076_000)
|
||||
.saturating_add(T::DbWeight::get().reads(3))
|
||||
.saturating_add(T::DbWeight::get().writes(3))
|
||||
}
|
||||
// Storage: NisCounterpartBalances Account (r:1 w:1)
|
||||
// Storage: NisCounterpartBalances TotalIssuance (r:1 w:1)
|
||||
fn set_balance_creating() -> Weight {
|
||||
// Minimum execution time: 20_254 nanoseconds.
|
||||
Weight::from_ref_time(20_956_000)
|
||||
.saturating_add(T::DbWeight::get().reads(2))
|
||||
.saturating_add(T::DbWeight::get().writes(2))
|
||||
}
|
||||
// Storage: NisCounterpartBalances Account (r:1 w:1)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
// Storage: NisCounterpartBalances TotalIssuance (r:1 w:1)
|
||||
fn set_balance_killing() -> Weight {
|
||||
// Minimum execution time: 27_767 nanoseconds.
|
||||
Weight::from_ref_time(28_472_000)
|
||||
.saturating_add(T::DbWeight::get().reads(3))
|
||||
.saturating_add(T::DbWeight::get().writes(3))
|
||||
}
|
||||
// Storage: NisCounterpartBalances Account (r:2 w:2)
|
||||
// Storage: System Account (r:2 w:2)
|
||||
// Storage: NisCounterpartBalances TotalIssuance (r:1 w:1)
|
||||
fn force_transfer() -> Weight {
|
||||
// Minimum execution time: 41_369 nanoseconds.
|
||||
Weight::from_ref_time(41_831_000)
|
||||
.saturating_add(T::DbWeight::get().reads(5))
|
||||
.saturating_add(T::DbWeight::get().writes(5))
|
||||
}
|
||||
// Storage: NisCounterpartBalances Account (r:2 w:2)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
fn transfer_all() -> Weight {
|
||||
// Minimum execution time: 37_413 nanoseconds.
|
||||
Weight::from_ref_time(38_587_000)
|
||||
.saturating_add(T::DbWeight::get().reads(3))
|
||||
.saturating_add(T::DbWeight::get().writes(3))
|
||||
}
|
||||
// Storage: NisCounterpartBalances Account (r:1 w:1)
|
||||
fn force_unreserve() -> Weight {
|
||||
// Minimum execution time: 19_049 nanoseconds.
|
||||
Weight::from_ref_time(19_464_000)
|
||||
.saturating_add(T::DbWeight::get().reads(1))
|
||||
.saturating_add(T::DbWeight::get().writes(1))
|
||||
}
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Polkadot.
|
||||
|
||||
// Polkadot 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.
|
||||
|
||||
// Polkadot 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 Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
//! Autogenerated weights for `pallet_gilt`
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
|
||||
//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
|
||||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024
|
||||
|
||||
// Executed Command:
|
||||
// ./target/production/polkadot
|
||||
// benchmark
|
||||
// pallet
|
||||
// --chain=kusama-dev
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --pallet=pallet_gilt
|
||||
// --extrinsic=*
|
||||
// --execution=wasm
|
||||
// --wasm-execution=compiled
|
||||
// --header=./file_header.txt
|
||||
// --output=./runtime/kusama/src/weights/
|
||||
|
||||
#![cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::{Weight}};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
/// Weight functions for `pallet_gilt`.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> pallet_gilt::WeightInfo for WeightInfo<T> {
|
||||
// Storage: Gilt Queues (r:1 w:1)
|
||||
// Storage: Gilt QueueTotals (r:1 w:1)
|
||||
/// The range of component `l` is `[0, 999]`.
|
||||
fn place_bid(l: u32, ) -> Weight {
|
||||
Weight::from_ref_time(33_022_000 as u64)
|
||||
// Standard Error: 0
|
||||
.saturating_add(Weight::from_ref_time(81_000 as u64).saturating_mul(l as u64))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as u64))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as u64))
|
||||
}
|
||||
// Storage: Gilt Queues (r:1 w:1)
|
||||
// Storage: Gilt QueueTotals (r:1 w:1)
|
||||
fn place_bid_max() -> Weight {
|
||||
Weight::from_ref_time(105_031_000 as u64)
|
||||
.saturating_add(T::DbWeight::get().reads(2 as u64))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as u64))
|
||||
}
|
||||
// Storage: Gilt Queues (r:1 w:1)
|
||||
// Storage: Gilt QueueTotals (r:1 w:1)
|
||||
/// The range of component `l` is `[1, 1000]`.
|
||||
fn retract_bid(l: u32, ) -> Weight {
|
||||
Weight::from_ref_time(33_573_000 as u64)
|
||||
// Standard Error: 0
|
||||
.saturating_add(Weight::from_ref_time(62_000 as u64).saturating_mul(l as u64))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as u64))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as u64))
|
||||
}
|
||||
// Storage: Gilt ActiveTotal (r:1 w:1)
|
||||
fn set_target() -> Weight {
|
||||
Weight::from_ref_time(6_386_000 as u64)
|
||||
.saturating_add(T::DbWeight::get().reads(1 as u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as u64))
|
||||
}
|
||||
// Storage: Gilt Active (r:1 w:1)
|
||||
// Storage: Gilt ActiveTotal (r:1 w:1)
|
||||
fn thaw() -> Weight {
|
||||
Weight::from_ref_time(45_459_000 as u64)
|
||||
.saturating_add(T::DbWeight::get().reads(2 as u64))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as u64))
|
||||
}
|
||||
// Storage: Gilt ActiveTotal (r:1 w:0)
|
||||
fn pursue_target_noop() -> Weight {
|
||||
Weight::from_ref_time(2_669_000 as u64)
|
||||
.saturating_add(T::DbWeight::get().reads(1 as u64))
|
||||
}
|
||||
// Storage: Gilt ActiveTotal (r:1 w:1)
|
||||
// Storage: Gilt QueueTotals (r:1 w:1)
|
||||
// Storage: Gilt Queues (r:1 w:1)
|
||||
// Storage: Gilt Active (r:0 w:1)
|
||||
/// The range of component `b` is `[1, 1000]`.
|
||||
fn pursue_target_per_item(b: u32, ) -> Weight {
|
||||
Weight::from_ref_time(33_549_000 as u64)
|
||||
// Standard Error: 2_000
|
||||
.saturating_add(Weight::from_ref_time(3_979_000 as u64).saturating_mul(b as u64))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as u64))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as u64))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(b as u64)))
|
||||
}
|
||||
// Storage: Gilt ActiveTotal (r:1 w:1)
|
||||
// Storage: Gilt QueueTotals (r:1 w:1)
|
||||
// Storage: Gilt Queues (r:1 w:1)
|
||||
// Storage: Gilt Active (r:0 w:1)
|
||||
/// The range of component `q` is `[1, 300]`.
|
||||
fn pursue_target_per_queue(q: u32, ) -> Weight {
|
||||
Weight::from_ref_time(28_306_000 as u64)
|
||||
// Standard Error: 6_000
|
||||
.saturating_add(Weight::from_ref_time(6_651_000 as u64).saturating_mul(q as u64))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as u64))
|
||||
.saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(q as u64)))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as u64))
|
||||
.saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(q as u64)))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Polkadot.
|
||||
|
||||
// Polkadot 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.
|
||||
|
||||
// Polkadot 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 Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
//! Autogenerated weights for `pallet_nis`
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
|
||||
//! DATE: 2022-12-05, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
|
||||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024
|
||||
|
||||
// Executed Command:
|
||||
// /home/benchbot/cargo_target_dir/production/polkadot
|
||||
// benchmark
|
||||
// pallet
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --extrinsic=*
|
||||
// --execution=wasm
|
||||
// --wasm-execution=compiled
|
||||
// --heap-pages=4096
|
||||
// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/polkadot/.git/.artifacts/bench.json
|
||||
// --pallet=pallet_nis
|
||||
// --chain=kusama-dev
|
||||
// --header=./file_header.txt
|
||||
// --output=./runtime/kusama/src/weights/
|
||||
|
||||
#![cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
/// Weight functions for `pallet_nis`.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> pallet_nis::WeightInfo for WeightInfo<T> {
|
||||
// Storage: Nis Queues (r:1 w:1)
|
||||
// Storage: Nis QueueTotals (r:1 w:1)
|
||||
/// The range of component `l` is `[0, 999]`.
|
||||
fn place_bid(l: u32, ) -> Weight {
|
||||
// Minimum execution time: 31_836 nanoseconds.
|
||||
Weight::from_ref_time(33_284_190)
|
||||
// Standard Error: 663
|
||||
.saturating_add(Weight::from_ref_time(70_316).saturating_mul(l.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(2))
|
||||
.saturating_add(T::DbWeight::get().writes(2))
|
||||
}
|
||||
// Storage: Nis Queues (r:1 w:1)
|
||||
// Storage: Nis QueueTotals (r:1 w:1)
|
||||
fn place_bid_max() -> Weight {
|
||||
// Minimum execution time: 100_161 nanoseconds.
|
||||
Weight::from_ref_time(102_736_000)
|
||||
.saturating_add(T::DbWeight::get().reads(2))
|
||||
.saturating_add(T::DbWeight::get().writes(2))
|
||||
}
|
||||
// Storage: Nis Queues (r:1 w:1)
|
||||
// Storage: Nis QueueTotals (r:1 w:1)
|
||||
/// The range of component `l` is `[1, 1000]`.
|
||||
fn retract_bid(l: u32, ) -> Weight {
|
||||
// Minimum execution time: 36_993 nanoseconds.
|
||||
Weight::from_ref_time(34_181_184)
|
||||
// Standard Error: 634
|
||||
.saturating_add(Weight::from_ref_time(56_251).saturating_mul(l.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(2))
|
||||
.saturating_add(T::DbWeight::get().writes(2))
|
||||
}
|
||||
// Storage: Nis Summary (r:1 w:0)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
fn fund_deficit() -> Weight {
|
||||
// Minimum execution time: 40_822 nanoseconds.
|
||||
Weight::from_ref_time(41_752_000)
|
||||
.saturating_add(T::DbWeight::get().reads(2))
|
||||
.saturating_add(T::DbWeight::get().writes(1))
|
||||
}
|
||||
// Storage: Nis Receipts (r:1 w:1)
|
||||
// Storage: Nis Summary (r:1 w:1)
|
||||
// Storage: NisCounterpartBalances Account (r:1 w:1)
|
||||
// Storage: NisCounterpartBalances TotalIssuance (r:1 w:1)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
fn thaw() -> Weight {
|
||||
// Minimum execution time: 61_305 nanoseconds.
|
||||
Weight::from_ref_time(61_909_000)
|
||||
.saturating_add(T::DbWeight::get().reads(5))
|
||||
.saturating_add(T::DbWeight::get().writes(5))
|
||||
}
|
||||
// Storage: Nis Summary (r:1 w:1)
|
||||
// Storage: System Account (r:1 w:0)
|
||||
// Storage: Nis QueueTotals (r:1 w:1)
|
||||
fn process_queues() -> Weight {
|
||||
// Minimum execution time: 32_369 nanoseconds.
|
||||
Weight::from_ref_time(33_715_000)
|
||||
.saturating_add(T::DbWeight::get().reads(3))
|
||||
.saturating_add(T::DbWeight::get().writes(2))
|
||||
}
|
||||
// Storage: Nis Queues (r:1 w:1)
|
||||
fn process_queue() -> Weight {
|
||||
// Minimum execution time: 4_065 nanoseconds.
|
||||
Weight::from_ref_time(4_212_000)
|
||||
.saturating_add(T::DbWeight::get().reads(1))
|
||||
.saturating_add(T::DbWeight::get().writes(1))
|
||||
}
|
||||
// Storage: System Account (r:1 w:0)
|
||||
// Storage: Nis Receipts (r:0 w:1)
|
||||
fn process_bid() -> Weight {
|
||||
// Minimum execution time: 12_606 nanoseconds.
|
||||
Weight::from_ref_time(12_994_000)
|
||||
.saturating_add(T::DbWeight::get().reads(1))
|
||||
.saturating_add(T::DbWeight::get().writes(1))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user