Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

🔧 Add Funding and Dispenser weights #297

Merged
merged 4 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pallets/dispenser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
pub use pallet::*;

pub use crate::weights::WeightInfo;
pub use frame_support::traits::{
tokens::{currency::VestingSchedule, Balance},
Currency, ExistenceRequirement,
Expand Down
54 changes: 27 additions & 27 deletions pallets/dispenser/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
//! Autogenerated weights for `pallet_dispenser`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-04-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-05-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `Justs-MacBook-Pro.local`, CPU: `<UNKNOWN>`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("politest-local")`, DB CACHE: `1024`
//! HOSTNAME: `ip-172-31-23-147`, CPU: `AMD EPYC 9R14`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("polimec-local")`, DB CACHE: `1024`

// Executed Command:
// target/release/polimec-node
// ./target/production/polimec-node
// benchmark
// pallet
// --chain=politest-local
// --chain=polimec-local
// --steps=50
// --repeat=20
// --pallet=pallet-dispenser
Expand Down Expand Up @@ -62,10 +62,10 @@ pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Storage: `Timestamp::Now` (r:1 w:0)
/// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
/// Storage: `Dispensed::Dispensed` (r:1 w:1)
/// Proof: `Dispensed::Dispensed` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`)
/// Storage: `Dispensed::DispenseAmount` (r:1 w:0)
/// Proof: `Dispensed::DispenseAmount` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Dispenser::Dispensed` (r:1 w:1)
/// Proof: `Dispenser::Dispensed` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`)
/// Storage: `Dispenser::DispenseAmount` (r:1 w:0)
/// Proof: `Dispenser::DispenseAmount` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Vesting::Vesting` (r:1 w:1)
Expand All @@ -76,21 +76,21 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(949), added: 3424, mode: `MaxEncodedLen`)
fn dispense() -> Weight {
// Proof Size summary in bytes:
// Measured: `288`
// Measured: `254`
// Estimated: `4764`
// Minimum execution time: 191_000_000 picoseconds.
Weight::from_parts(200_000_000, 4764)
// Minimum execution time: 177_070_000 picoseconds.
Weight::from_parts(179_190_000, 4764)
.saturating_add(T::DbWeight::get().reads(7_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
}
/// Storage: `Dispensed::DispenseAmount` (r:0 w:1)
/// Proof: `Dispensed::DispenseAmount` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Dispenser::DispenseAmount` (r:0 w:1)
/// Proof: `Dispenser::DispenseAmount` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
fn set_dispense_amount() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_000_000 picoseconds.
Weight::from_parts(5_000_000, 0)
// Minimum execution time: 3_370_000 picoseconds.
Weight::from_parts(3_580_000, 0)
.saturating_add(T::DbWeight::get().writes(1_u64))
}
}
Expand All @@ -99,10 +99,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
impl WeightInfo for () {
/// Storage: `Timestamp::Now` (r:1 w:0)
/// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
/// Storage: `Dispensed::Dispensed` (r:1 w:1)
/// Proof: `Dispensed::Dispensed` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`)
/// Storage: `Dispensed::DispenseAmount` (r:1 w:0)
/// Proof: `Dispensed::DispenseAmount` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Dispenser::Dispensed` (r:1 w:1)
/// Proof: `Dispenser::Dispensed` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`)
/// Storage: `Dispenser::DispenseAmount` (r:1 w:0)
/// Proof: `Dispenser::DispenseAmount` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Vesting::Vesting` (r:1 w:1)
Expand All @@ -113,21 +113,21 @@ impl WeightInfo for () {
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(949), added: 3424, mode: `MaxEncodedLen`)
fn dispense() -> Weight {
// Proof Size summary in bytes:
// Measured: `288`
// Measured: `254`
// Estimated: `4764`
// Minimum execution time: 191_000_000 picoseconds.
Weight::from_parts(200_000_000, 4764)
// Minimum execution time: 177_070_000 picoseconds.
Weight::from_parts(179_190_000, 4764)
.saturating_add(RocksDbWeight::get().reads(7_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
}
/// Storage: `Dispensed::DispenseAmount` (r:0 w:1)
/// Proof: `Dispensed::DispenseAmount` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Dispenser::DispenseAmount` (r:0 w:1)
/// Proof: `Dispenser::DispenseAmount` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
fn set_dispense_amount() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_000_000 picoseconds.
Weight::from_parts(5_000_000, 0)
// Minimum execution time: 3_370_000 picoseconds.
Weight::from_parts(3_580_000, 0)
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
}
4 changes: 2 additions & 2 deletions pallets/funding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ pub mod pallet {
impl<T: Config> Pallet<T> {
/// Creates a project and assigns it to the `issuer` account.
#[pallet::call_index(0)]
#[pallet::weight(WeightInfoOf::<T>::create())]
#[pallet::weight(WeightInfoOf::<T>::create_project())]
pub fn create_project(
origin: OriginFor<T>,
jwt: UntrustedToken,
Expand All @@ -850,7 +850,7 @@ pub mod pallet {

/// Change the metadata hash of a project
#[pallet::call_index(1)]
#[pallet::weight(WeightInfoOf::<T>::edit_metadata())]
#[pallet::weight(WeightInfoOf::<T>::edit_project())]
pub fn edit_project(
origin: OriginFor<T>,
jwt: UntrustedToken,
Expand Down
Loading