code/pallets/crowdloan/src/weights.rs

weights.rs

368 lines · 18,902 bytes · 74b77d74e5RawGitHub

//! Autogenerated weights for `pallet_crowdloan`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0
//! DATE: 2026-06-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runnervmmklqx`, CPU: `AMD EPYC 9V74 80-Core Processor`
//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`

// Executed Command:
// /home/runner/work/subtensor/subtensor/target/production/node-subtensor
// benchmark
// pallet
// --runtime=/home/runner/work/subtensor/subtensor/target/production/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm
// --genesis-builder=runtime
// --genesis-builder-preset=benchmark
// --wasm-execution=compiled
// --pallet=pallet_crowdloan
// --extrinsic=*
// --steps=50
// --repeat=20
// --no-storage-info
// --no-min-squares
// --no-median-slopes
// --output=/tmp/tmp.CWtPZcdN9i
// --template=/home/runner/work/subtensor/subtensor/.maintain/frame-weight-template.hbs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
#![allow(dead_code)]

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

/// Weight functions needed for `pallet_crowdloan`.
pub trait WeightInfo {
	fn create() -> Weight;
	fn contribute() -> Weight;
	fn withdraw() -> Weight;
	fn finalize() -> Weight;
	fn refund(k: u32, ) -> Weight;
	fn dissolve() -> Weight;
	fn update_min_contribution() -> Weight;
	fn update_end() -> Weight;
	fn update_cap() -> Weight;
	fn set_max_contribution() -> Weight;
}

/// Weights for `pallet_crowdloan` using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
	/// Storage: `System::Account` (r:2 w:2)
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::NextCrowdloanId` (r:1 w:1)
	/// Proof: `Crowdloan::NextCrowdloanId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::Contributions` (r:0 w:1)
	/// Proof: `Crowdloan::Contributions` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::Crowdloans` (r:0 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	fn create() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `119`
		//  Estimated: `6148`
		// Minimum execution time: 59_888_000 picoseconds.
		Weight::from_parts(61_110_000, 6148)
			.saturating_add(T::DbWeight::get().reads(3_u64))
			.saturating_add(T::DbWeight::get().writes(5_u64))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::MaxContributions` (r:1 w:0)
	/// Proof: `Crowdloan::MaxContributions` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::Contributions` (r:1 w:1)
	/// Proof: `Crowdloan::Contributions` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
	/// Storage: `System::Account` (r:2 w:2)
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`)
	fn contribute() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `448`
		//  Estimated: `6148`
		// Minimum execution time: 65_807_000 picoseconds.
		Weight::from_parts(66_819_000, 6148)
			.saturating_add(T::DbWeight::get().reads(5_u64))
			.saturating_add(T::DbWeight::get().writes(4_u64))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::Contributions` (r:1 w:1)
	/// Proof: `Crowdloan::Contributions` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
	/// Storage: `System::Account` (r:2 w:2)
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`)
	fn withdraw() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `408`
		//  Estimated: `6148`
		// Minimum execution time: 59_447_000 picoseconds.
		Weight::from_parts(61_220_000, 6148)
			.saturating_add(T::DbWeight::get().reads(4_u64))
			.saturating_add(T::DbWeight::get().writes(4_u64))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::CurrentCrowdloanId` (r:1 w:1)
	/// Proof: `Crowdloan::CurrentCrowdloanId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
	/// Storage: `Preimage::PreimageFor` (r:1 w:0)
	/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
	/// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
	/// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
	/// Storage: `SubtensorModule::ColdkeySwapAnnouncements` (r:1 w:0)
	/// Proof: `SubtensorModule::ColdkeySwapAnnouncements` (`max_values`: None, `max_size`: None, mode: `Measured`)
	fn finalize() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1181`
		//  Estimated: `4197809`
		// Minimum execution time: 32_548_000 picoseconds.
		Weight::from_parts(34_110_000, 4197809)
			.saturating_add(T::DbWeight::get().reads(5_u64))
			.saturating_add(T::DbWeight::get().writes(2_u64))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::Contributions` (r:51 w:49)
	/// Proof: `Crowdloan::Contributions` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
	/// Storage: `System::Account` (r:50 w:50)
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`)
	/// The range of component `k` is `[3, 50]`.
	fn refund(k: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `324 + k * (46 ±0)`
		//  Estimated: `3747 + k * (2579 ±0)`
		// Minimum execution time: 109_320_000 picoseconds.
		Weight::from_parts(110_392_000, 3747)
			// Standard Error: 94_672
			.saturating_add(Weight::from_parts(39_822_919, 0).saturating_mul(k.into()))
			.saturating_add(T::DbWeight::get().reads(2_u64))
			.saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(k.into())))
			.saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(k.into())))
			.saturating_add(Weight::from_parts(0, 2579).saturating_mul(k.into()))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::Contributions` (r:1 w:1)
	/// Proof: `Crowdloan::Contributions` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
	/// Storage: `System::Account` (r:2 w:2)
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::MaxContributions` (r:0 w:1)
	/// Proof: `Crowdloan::MaxContributions` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
	fn dissolve() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `370`
		//  Estimated: `6148`
		// Minimum execution time: 69_442_000 picoseconds.
		Weight::from_parts(70_724_000, 6148)
			.saturating_add(T::DbWeight::get().reads(4_u64))
			.saturating_add(T::DbWeight::get().writes(5_u64))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::MaxContributions` (r:1 w:0)
	/// Proof: `Crowdloan::MaxContributions` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
	fn update_min_contribution() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `229`
		//  Estimated: `3747`
		// Minimum execution time: 13_049_000 picoseconds.
		Weight::from_parts(13_510_000, 3747)
			.saturating_add(T::DbWeight::get().reads(2_u64))
			.saturating_add(T::DbWeight::get().writes(1_u64))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	fn update_end() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `229`
		//  Estimated: `3747`
		// Minimum execution time: 11_557_000 picoseconds.
		Weight::from_parts(12_318_000, 3747)
			.saturating_add(T::DbWeight::get().reads(1_u64))
			.saturating_add(T::DbWeight::get().writes(1_u64))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	fn update_cap() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `229`
		//  Estimated: `3747`
		// Minimum execution time: 11_386_000 picoseconds.
		Weight::from_parts(11_797_000, 3747)
			.saturating_add(T::DbWeight::get().reads(1_u64))
			.saturating_add(T::DbWeight::get().writes(1_u64))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:0)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::Contributions` (r:1 w:0)
	/// Proof: `Crowdloan::Contributions` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::MaxContributions` (r:0 w:1)
	/// Proof: `Crowdloan::MaxContributions` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
	fn set_max_contribution() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `293`
		//  Estimated: `3747`
		// Minimum execution time: 15_924_000 picoseconds.
		Weight::from_parts(16_805_000, 3747)
			.saturating_add(T::DbWeight::get().reads(2_u64))
			.saturating_add(T::DbWeight::get().writes(1_u64))
	}
}

// For backwards compatibility and tests.
impl WeightInfo for () {
	/// Storage: `System::Account` (r:2 w:2)
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::NextCrowdloanId` (r:1 w:1)
	/// Proof: `Crowdloan::NextCrowdloanId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::Contributions` (r:0 w:1)
	/// Proof: `Crowdloan::Contributions` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::Crowdloans` (r:0 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	fn create() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `119`
		//  Estimated: `6148`
		// Minimum execution time: 59_888_000 picoseconds.
		Weight::from_parts(61_110_000, 6148)
			.saturating_add(RocksDbWeight::get().reads(3_u64))
			.saturating_add(RocksDbWeight::get().writes(5_u64))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::MaxContributions` (r:1 w:0)
	/// Proof: `Crowdloan::MaxContributions` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::Contributions` (r:1 w:1)
	/// Proof: `Crowdloan::Contributions` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
	/// Storage: `System::Account` (r:2 w:2)
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`)
	fn contribute() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `448`
		//  Estimated: `6148`
		// Minimum execution time: 65_807_000 picoseconds.
		Weight::from_parts(66_819_000, 6148)
			.saturating_add(RocksDbWeight::get().reads(5_u64))
			.saturating_add(RocksDbWeight::get().writes(4_u64))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::Contributions` (r:1 w:1)
	/// Proof: `Crowdloan::Contributions` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
	/// Storage: `System::Account` (r:2 w:2)
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`)
	fn withdraw() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `408`
		//  Estimated: `6148`
		// Minimum execution time: 59_447_000 picoseconds.
		Weight::from_parts(61_220_000, 6148)
			.saturating_add(RocksDbWeight::get().reads(4_u64))
			.saturating_add(RocksDbWeight::get().writes(4_u64))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::CurrentCrowdloanId` (r:1 w:1)
	/// Proof: `Crowdloan::CurrentCrowdloanId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
	/// Storage: `Preimage::PreimageFor` (r:1 w:0)
	/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
	/// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
	/// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
	/// Storage: `SubtensorModule::ColdkeySwapAnnouncements` (r:1 w:0)
	/// Proof: `SubtensorModule::ColdkeySwapAnnouncements` (`max_values`: None, `max_size`: None, mode: `Measured`)
	fn finalize() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1181`
		//  Estimated: `4197809`
		// Minimum execution time: 32_548_000 picoseconds.
		Weight::from_parts(34_110_000, 4197809)
			.saturating_add(RocksDbWeight::get().reads(5_u64))
			.saturating_add(RocksDbWeight::get().writes(2_u64))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::Contributions` (r:51 w:49)
	/// Proof: `Crowdloan::Contributions` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
	/// Storage: `System::Account` (r:50 w:50)
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`)
	/// The range of component `k` is `[3, 50]`.
	fn refund(k: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `324 + k * (46 ±0)`
		//  Estimated: `3747 + k * (2579 ±0)`
		// Minimum execution time: 109_320_000 picoseconds.
		Weight::from_parts(110_392_000, 3747)
			// Standard Error: 94_672
			.saturating_add(Weight::from_parts(39_822_919, 0).saturating_mul(k.into()))
			.saturating_add(RocksDbWeight::get().reads(2_u64))
			.saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(k.into())))
			.saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(k.into())))
			.saturating_add(Weight::from_parts(0, 2579).saturating_mul(k.into()))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::Contributions` (r:1 w:1)
	/// Proof: `Crowdloan::Contributions` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
	/// Storage: `System::Account` (r:2 w:2)
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::MaxContributions` (r:0 w:1)
	/// Proof: `Crowdloan::MaxContributions` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
	fn dissolve() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `370`
		//  Estimated: `6148`
		// Minimum execution time: 69_442_000 picoseconds.
		Weight::from_parts(70_724_000, 6148)
			.saturating_add(RocksDbWeight::get().reads(4_u64))
			.saturating_add(RocksDbWeight::get().writes(5_u64))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::MaxContributions` (r:1 w:0)
	/// Proof: `Crowdloan::MaxContributions` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
	fn update_min_contribution() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `229`
		//  Estimated: `3747`
		// Minimum execution time: 13_049_000 picoseconds.
		Weight::from_parts(13_510_000, 3747)
			.saturating_add(RocksDbWeight::get().reads(2_u64))
			.saturating_add(RocksDbWeight::get().writes(1_u64))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	fn update_end() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `229`
		//  Estimated: `3747`
		// Minimum execution time: 11_557_000 picoseconds.
		Weight::from_parts(12_318_000, 3747)
			.saturating_add(RocksDbWeight::get().reads(1_u64))
			.saturating_add(RocksDbWeight::get().writes(1_u64))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:1)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	fn update_cap() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `229`
		//  Estimated: `3747`
		// Minimum execution time: 11_386_000 picoseconds.
		Weight::from_parts(11_797_000, 3747)
			.saturating_add(RocksDbWeight::get().reads(1_u64))
			.saturating_add(RocksDbWeight::get().writes(1_u64))
	}
	/// Storage: `Crowdloan::Crowdloans` (r:1 w:0)
	/// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::Contributions` (r:1 w:0)
	/// Proof: `Crowdloan::Contributions` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
	/// Storage: `Crowdloan::MaxContributions` (r:0 w:1)
	/// Proof: `Crowdloan::MaxContributions` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
	fn set_max_contribution() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `293`
		//  Estimated: `3747`
		// Minimum execution time: 15_924_000 picoseconds.
		Weight::from_parts(16_805_000, 3747)
			.saturating_add(RocksDbWeight::get().reads(2_u64))
			.saturating_add(RocksDbWeight::get().writes(1_u64))
	}
}