From 8abe0c6f4a0f64131cbad7607c6a38bd7059a1cd Mon Sep 17 00:00:00 2001 From: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> Date: Mon, 23 Feb 2026 13:23:56 +0400 Subject: [PATCH 1/5] remove: native price usage in dAppStaking --- pallets/dapp-staking/src/lib.rs | 12 +- pallets/dapp-staking/src/test/mock.rs | 11 +- pallets/dapp-staking/src/test/tests.rs | 220 ++----------------- pallets/dapp-staking/src/test/tests_types.rs | 103 +++------ pallets/dapp-staking/src/types.rs | 80 ++----- precompiles/dapp-staking/src/test/mock.rs | 4 +- primitives/src/dapp_staking.rs | 2 - 7 files changed, 66 insertions(+), 366 deletions(-) diff --git a/pallets/dapp-staking/src/lib.rs b/pallets/dapp-staking/src/lib.rs index eade51c4c..da302c29e 100644 --- a/pallets/dapp-staking/src/lib.rs +++ b/pallets/dapp-staking/src/lib.rs @@ -162,14 +162,9 @@ pub mod pallet { /// Used to calculate total number of tier slots for some price. type TierSlots: TierSlotFunc; - /// Base native currency price used to calculate base number of slots. - /// This is used to adjust tier configuration, tier thresholds specifically, based on the native token price changes. + /// Base native currency price used as a deterministic input for tier slot calculation. /// - /// When dApp staking thresholds were modeled, a base price was set from which the initial configuration is derived. - /// E.g. for a price of 0.05$, we get 100 slots, and certain tier thresholds. - /// Using these values as the base, we can adjust the configuration based on the current price. - /// - /// This is connected with the `TierSlots` associated type, since it's used to calculate the total number of slots for the given price. + /// Tier recalculation no longer adjusts with live native price changes. #[pallet::constant] type BaseNativeCurrencyPrice: Get; @@ -2178,11 +2173,10 @@ pub mod pallet { // Re-calculate tier configuration for the upcoming new era let tier_params = StaticTierParams::::get(); - let average_price = T::NativePriceProvider::average_price(); let total_issuance = T::Currency::total_issuance(); let new_tier_config = - TierConfig::::get().calculate_new(&tier_params, average_price, total_issuance); + TierConfig::::get().calculate_new(&tier_params, total_issuance); // Validate new tier configuration if new_tier_config.is_valid() { diff --git a/pallets/dapp-staking/src/test/mock.rs b/pallets/dapp-staking/src/test/mock.rs index f10428f2f..19065c4f8 100644 --- a/pallets/dapp-staking/src/test/mock.rs +++ b/pallets/dapp-staking/src/test/mock.rs @@ -97,14 +97,13 @@ impl pallet_migrations::Config for Test { pub struct DummyPriceProvider; impl PriceProvider for DummyPriceProvider { fn average_price() -> FixedU128 { - NATIVE_PRICE.with(|v| v.borrow().clone()) + BaseNativeCurrencyPrice::get() } } thread_local! { pub(crate) static DOES_PAYOUT_SUCCEED: RefCell = RefCell::new(false); pub(crate) static BLOCK_BEFORE_NEW_ERA: RefCell = RefCell::new(0); - pub(crate) static NATIVE_PRICE: RefCell = RefCell::new(BaseNativeCurrencyPrice::get()); pub(crate) static MAX_BONUS_SAFE_MOVES: RefCell = RefCell::new(0); } @@ -354,7 +353,7 @@ impl ExtBuilder { .try_into() .expect("Invalid number of tier thresholds provided."); - // Init tier config, based on the initial params. Needs to be adjusted to the init price. + // Init tier config based on the initial params. let init_tier_config = TiersConfiguration::< ::NumberOfTiers, ::TierSlots, @@ -365,11 +364,7 @@ impl ExtBuilder { tier_thresholds, _phantom: Default::default(), } - .calculate_new( - &tier_params, - NATIVE_PRICE.with(|v| v.borrow().clone()), - total_issuance, - ); + .calculate_new(&tier_params, total_issuance); pallet_dapp_staking::StaticTierParams::::put(tier_params); pallet_dapp_staking::TierConfig::::put(init_tier_config.clone()); diff --git a/pallets/dapp-staking/src/test/tests.rs b/pallets/dapp-staking/src/test/tests.rs index a33808a96..11be41df5 100644 --- a/pallets/dapp-staking/src/test/tests.rs +++ b/pallets/dapp-staking/src/test/tests.rs @@ -36,13 +36,13 @@ use frame_support::{ }; use sp_runtime::{ traits::{ConstU32, Zero}, - BoundedBTreeMap, FixedU128, + BoundedBTreeMap, }; use astar_primitives::{ dapp_staking::{ CycleConfiguration, EraNumber, RankedTier, SmartContractHandle, StakingRewardHandler, - TierSlots, STANDARD_TIER_SLOTS_ARGS, + TierSlots, FIXED_TIER_SLOTS_ARGS, }, Balance, BlockNumber, }; @@ -2682,121 +2682,6 @@ fn force_with_safeguard_on_fails() { }) } -#[test] -fn tier_config_recalculation_works() { - ExtBuilder::default().build_and_execute(|| { - // Setup for price based slot capacity - StaticTierParams::::mutate(|params| { - params.slot_number_args = STANDARD_TIER_SLOTS_ARGS; - }); - assert_ok!(DappStaking::force(RuntimeOrigin::root(), ForcingType::Era)); - run_for_blocks(1); - - let init_price = NATIVE_PRICE.with(|v| v.borrow().clone()); - let init_tier_config = TierConfig::::get(); - - // 1. Advance to a new era, while keeping native price the same. Expect no change in the tier config - assert_ok!(DappStaking::force(RuntimeOrigin::root(), ForcingType::Era)); - run_for_blocks(1); - - assert_eq!( - init_tier_config, - TierConfig::::get(), - "Native price didn't change so tier config should remain the same." - ); - - // 2. Increase the native price, and expect number of tiers to be increased. - NATIVE_PRICE.with(|v| *v.borrow_mut() = init_price * FixedU128::from(3)); - - assert_ok!(DappStaking::force(RuntimeOrigin::root(), ForcingType::Era)); - run_for_blocks(1); - - let new_tier_config = TierConfig::::get(); - assert!( - new_tier_config.total_number_of_slots() > init_tier_config.total_number_of_slots(), - "Price has increased, therefore number of slots must increase." - ); - assert_eq!( - init_tier_config.slots_per_tier.len(), - new_tier_config.slots_per_tier.len(), - "Sanity check." - ); - assert!( - new_tier_config - .slots_per_tier - .iter() - .zip(init_tier_config.slots_per_tier.iter()) - .all(|(new, init)| new > init), - "Number of slots per tier should increase with higher price" - ); - assert!( - new_tier_config - .tier_thresholds - .iter() - .zip(init_tier_config.tier_thresholds.iter()) - .all(|(new, init)| new <= init), - "Tier threshold values should decrease with higher price" - ); - - // 3. Decrease the native price, and expect slots in tiers to be decreased. - NATIVE_PRICE.with(|v| *v.borrow_mut() = init_price * FixedU128::from_rational(1, 2)); - - assert_ok!(DappStaking::force(RuntimeOrigin::root(), ForcingType::Era)); - run_for_blocks(1); - - let new_tier_config = TierConfig::::get(); - assert!( - new_tier_config.total_number_of_slots() < init_tier_config.total_number_of_slots(), - "Price has decreased, therefore number of slots must decrease." - ); - assert_eq!( - init_tier_config.slots_per_tier.len(), - new_tier_config.slots_per_tier.len(), - "Sanity check." - ); - assert!( - new_tier_config - .slots_per_tier - .iter() - .zip(init_tier_config.slots_per_tier.iter()) - .all(|(new, init)| new < init), - "Number of slots per tier should decrease with lower price" - ); - - let total_issuance = ::Currency::total_issuance(); - let tier_params = StaticTierParams::::get(); - - // Compute maximum amounts for each tier - let max_amounts: Vec = tier_params - .tier_thresholds - .iter() - .map(|threshold| match threshold { - TierThreshold::DynamicPercentage { - maximum_possible_percentage, - .. - } => { - let max_percent = maximum_possible_percentage; - *max_percent * total_issuance - } - TierThreshold::FixedPercentage { - required_percentage, - } => *required_percentage * total_issuance, - }) - .collect(); - - // Check that each tier's threshold has increased (or remains equal for fixed percentages) but doesn't exceed its maximum - assert!( - new_tier_config - .tier_thresholds - .iter() - .zip(init_tier_config.tier_thresholds.iter()) - .zip(max_amounts.iter()) - .all(|((new, init), max_amount)| new >= init && new <= max_amount), - "Tier threshold values should increase with lower price but not exceed their maximums" - ); - }) -} - #[test] fn get_dapp_tier_assignment_and_rewards_basic_example_works() { ExtBuilder::default().build_and_execute(|| { @@ -3514,117 +3399,40 @@ fn safeguard_configurable_by_genesis_config() { #[test] fn base_number_of_slots_is_respected() { ExtBuilder::default().build_and_execute(|| { - // Setup for price based slot capacity - StaticTierParams::::mutate(|params| { - params.slot_number_args = STANDARD_TIER_SLOTS_ARGS; - }); assert_ok!(DappStaking::force(RuntimeOrigin::root(), ForcingType::Era)); run_for_blocks(1); - // 0. Get expected number of slots for the base price - let total_issuance = ::Currency::total_issuance(); let base_native_price = ::BaseNativeCurrencyPrice::get(); - let tier_params = StaticTierParams::::get(); - let base_number_of_slots = ::TierSlots::number_of_slots( - base_native_price, - tier_params.slot_number_args, - ); + let slot_limit = + ::TierSlots::number_of_slots(base_native_price, FIXED_TIER_SLOTS_ARGS); - // 1. Make sure base native price is set initially and calculate the new config. Store the thresholds for later comparison. - NATIVE_PRICE.with(|v| *v.borrow_mut() = base_native_price); assert_ok!(DappStaking::force(RuntimeOrigin::root(), ForcingType::Era)); run_for_blocks(1); + let expected_number_of_slots = TierConfig::::get().total_number_of_slots(); assert_eq!( - TierConfig::::get().total_number_of_slots(), - base_number_of_slots, - "Base number of slots is expected for base native currency price." + expected_number_of_slots, slot_limit, + "Number of slots must respect the fixed slot limit." ); let base_thresholds = TierConfig::::get().tier_thresholds; - // 2. Increase the price significantly, and ensure number of slots has increased, and thresholds have been saturated. - let higher_price = base_native_price * FixedU128::from(1000); - NATIVE_PRICE.with(|v| *v.borrow_mut() = higher_price); - assert_ok!(DappStaking::force(RuntimeOrigin::root(), ForcingType::Era)); - run_for_blocks(1); - - assert!( - TierConfig::::get().total_number_of_slots() > base_number_of_slots, - "Price has increased, therefore number of slots must increase." - ); - assert_eq!( - TierConfig::::get().total_number_of_slots(), - ::TierSlots::number_of_slots( - higher_price, - tier_params.slot_number_args - ), - ); - - for (amount, static_tier_threshold) in TierConfig::::get() - .tier_thresholds - .iter() - .zip(StaticTierParams::::get().tier_thresholds.iter()) - { - if let TierThreshold::DynamicPercentage { - minimum_required_percentage, - .. - } = static_tier_threshold - { - let minimum_amount = *minimum_required_percentage * total_issuance; - assert_eq!(*amount, minimum_amount, "Thresholds must be saturated."); - } - } - - // 3. Bring it back down to the base price, and expect number of slots to be the same as the base number of slots, - // and thresholds to be the same as the base thresholds. - NATIVE_PRICE.with(|v| *v.borrow_mut() = base_native_price); - assert_ok!(DappStaking::force(RuntimeOrigin::root(), ForcingType::Era)); - run_for_blocks(1); - - assert_eq!( - TierConfig::::get().total_number_of_slots(), - base_number_of_slots, - "Base number of slots is expected for base native currency price." - ); - - assert_eq!( - TierConfig::::get().tier_thresholds, - base_thresholds, - "Thresholds must be the same as the base thresholds." - ); - - // 4. Bring it below the base price, and expect number of slots to decrease. - let lower_price = base_native_price * FixedU128::from_rational(1, 1000); - NATIVE_PRICE.with(|v| *v.borrow_mut() = lower_price); - assert_ok!(DappStaking::force(RuntimeOrigin::root(), ForcingType::Era)); - run_for_blocks(1); - - assert!( - TierConfig::::get().total_number_of_slots() < base_number_of_slots, - "Price has decreased, therefore number of slots must decrease." - ); - assert_eq!( - TierConfig::::get().total_number_of_slots(), - ::TierSlots::number_of_slots(lower_price, tier_params.slot_number_args), - ); - - // 5. Bring it back to the base price, and expect number of slots to be the same as the base number of slots, - // and thresholds to be the same as the base thresholds. - NATIVE_PRICE.with(|v| *v.borrow_mut() = base_native_price); + // Mutate slot_number_args and ensure recalculation remains unchanged. + StaticTierParams::::mutate(|params| { + params.slot_number_args = (123, 456); + }); assert_ok!(DappStaking::force(RuntimeOrigin::root(), ForcingType::Era)); run_for_blocks(1); assert_eq!( TierConfig::::get().total_number_of_slots(), - base_number_of_slots, - "Base number of slots is expected for base native currency price." + expected_number_of_slots, + "Number of slots must remain fixed regardless of slot_number_args." ); - assert_eq!( TierConfig::::get().tier_thresholds, base_thresholds, - "Thresholds must be the same as the base thresholds." + "Thresholds must remain unchanged regardless of slot_number_args." ); }) } diff --git a/pallets/dapp-staking/src/test/tests_types.rs b/pallets/dapp-staking/src/test/tests_types.rs index edd1a86cc..3f789e318 100644 --- a/pallets/dapp-staking/src/test/tests_types.rs +++ b/pallets/dapp-staking/src/test/tests_types.rs @@ -17,9 +17,7 @@ // along with Astar. If not, see . use astar_primitives::{ - dapp_staking::{ - RankedTier, StandardTierSlots, FIXED_TIER_SLOTS_ARGS, STANDARD_TIER_SLOTS_ARGS, - }, + dapp_staking::{RankedTier, StandardTierSlots, FIXED_TIER_SLOTS_ARGS}, Balance, }; use frame_support::{assert_ok, parameter_types}; @@ -3663,13 +3661,7 @@ fn tier_configuration_basic_tests() { }; assert!(init_config.is_valid(), "Init config must be valid!"); - // Create a new config, based on a new price - let high_price = FixedU128::from_rational(20, 100); // in production will be expressed in USD - let new_config = init_config.calculate_new(¶ms, high_price, total_issuance); - assert!(new_config.is_valid()); - - let low_price = FixedU128::from_rational(1, 100); // in production will be expressed in USD - let new_config = init_config.calculate_new(¶ms, low_price, total_issuance); + let new_config = init_config.calculate_new(¶ms, total_issuance); assert!(new_config.is_valid()); // TODO: expand tests, add more sanity checks (e.g. tier 3 requirement should never be lower than tier 4, etc.) @@ -3863,38 +3855,15 @@ fn tier_configuration_calculate_new_with_maximum_threshold() { ]) .unwrap(); - // Create tier thresholds (legacy without maximum) - let tier_thresholds_legacy = BoundedVec::::try_from(vec![ + // Thresholds with explicit min/max clamping behavior. + let tier_thresholds = BoundedVec::::try_from(vec![ TierThreshold::DynamicPercentage { - percentage: Perbill::from_percent(4), - minimum_required_percentage: Perbill::from_percent(3), - maximum_possible_percentage: Perbill::from_percent(100), - }, - TierThreshold::DynamicPercentage { - percentage: Perbill::from_percent(3), - minimum_required_percentage: Perbill::from_percent(2), - maximum_possible_percentage: Perbill::from_percent(100), - }, - TierThreshold::DynamicPercentage { - percentage: Perbill::from_percent(2), - minimum_required_percentage: Perbill::from_percent(1), - maximum_possible_percentage: Perbill::from_percent(100), - }, - TierThreshold::FixedPercentage { - required_percentage: Perbill::from_parts(5_000_000), // 0.5% - }, - ]) - .unwrap(); - - // Create tier thresholds (with maximum) - let tier_thresholds_with_max = BoundedVec::::try_from(vec![ - TierThreshold::DynamicPercentage { - percentage: Perbill::from_percent(4), + percentage: Perbill::from_percent(9), minimum_required_percentage: Perbill::from_percent(3), maximum_possible_percentage: Perbill::from_percent(5), }, TierThreshold::DynamicPercentage { - percentage: Perbill::from_percent(3), + percentage: Perbill::from_percent(1), minimum_required_percentage: Perbill::from_percent(2), maximum_possible_percentage: Perbill::from_percent(4), }, @@ -3909,19 +3878,11 @@ fn tier_configuration_calculate_new_with_maximum_threshold() { ]) .unwrap(); - let params_legacy = TierParameters:: { - slot_distribution: slot_distribution.clone(), - tier_thresholds: tier_thresholds_legacy, - reward_portion: reward_portion.clone(), - slot_number_args: STANDARD_TIER_SLOTS_ARGS, - tier_rank_multipliers: BoundedVec::try_from(vec![0, 24_000, 46_700, 0]).unwrap(), - }; - - let params_with_max = TierParameters:: { + let params = TierParameters:: { slot_distribution, - tier_thresholds: tier_thresholds_with_max, + tier_thresholds, reward_portion: reward_portion.clone(), - slot_number_args: STANDARD_TIER_SLOTS_ARGS, + slot_number_args: FIXED_TIER_SLOTS_ARGS, tier_rank_multipliers: BoundedVec::try_from(vec![0, 24_000, 46_700, 0]).unwrap(), }; @@ -3930,7 +3891,7 @@ fn tier_configuration_calculate_new_with_maximum_threshold() { pub const BaseNativeCurrencyPrice: FixedU128 = FixedU128::from_rational(5, 100); } let total_issuance: Balance = 8_400_000_000; - let tier_thresholds = params_legacy + let init_tier_thresholds = params .tier_thresholds .iter() .map(|t| t.threshold(total_issuance)) @@ -3940,47 +3901,35 @@ fn tier_configuration_calculate_new_with_maximum_threshold() { let init_config = TiersConfiguration:: { slots_per_tier: BoundedVec::try_from(vec![10, 20, 30, 40]).unwrap(), - reward_portion: reward_portion.clone(), - tier_thresholds, + reward_portion, + tier_thresholds: init_tier_thresholds, _phantom: PhantomData::default(), }; assert!(init_config.is_valid(), "Init config must be valid!"); - // Test Case: When price decreases significantly, legacy thresholds might exceed the maximum - let very_low_price = FixedU128::from_rational(1, 100); // 0.2x base price + let new_config = init_config.calculate_new(¶ms, total_issuance); - // For legacy parameters (no maximum) - let new_config_legacy = - init_config.calculate_new(¶ms_legacy, very_low_price, total_issuance); - - // For parameters with maximum - let new_config_with_max = - init_config.calculate_new(¶ms_with_max, very_low_price, total_issuance); - - // Legacy thresholds will be high - assert!(new_config_legacy.tier_thresholds[0] > Perbill::from_percent(5) * total_issuance); - assert!(new_config_legacy.tier_thresholds[1] > Perbill::from_percent(4) * total_issuance); - assert!(new_config_legacy.tier_thresholds[2] > Perbill::from_percent(3) * total_issuance); + // Clamped to maximum. assert_eq!( - new_config_legacy.tier_thresholds[3], - Perbill::from_parts(5_000_000) * total_issuance - ); - - // Maximum thresholds will be capped - assert_eq!( - new_config_with_max.tier_thresholds[0], + new_config.tier_thresholds[0], Perbill::from_percent(5) * total_issuance ); + + // Clamped to minimum. assert_eq!( - new_config_with_max.tier_thresholds[1], - Perbill::from_percent(4) * total_issuance + new_config.tier_thresholds[1], + Perbill::from_percent(2) * total_issuance ); + + // Within bounds, unchanged. assert_eq!( - new_config_with_max.tier_thresholds[2], - Perbill::from_percent(3) * total_issuance + new_config.tier_thresholds[2], + Perbill::from_percent(2) * total_issuance ); + + // Fixed threshold remains fixed. assert_eq!( - new_config_with_max.tier_thresholds[3], + new_config.tier_thresholds[3], Perbill::from_parts(5_000_000) * total_issuance ); } diff --git a/pallets/dapp-staking/src/types.rs b/pallets/dapp-staking/src/types.rs index bbceaee1a..feb5176e0 100644 --- a/pallets/dapp-staking/src/types.rs +++ b/pallets/dapp-staking/src/types.rs @@ -71,12 +71,15 @@ use serde::{Deserialize, Serialize}; use sp_arithmetic::fixed_point::FixedU128; use sp_runtime::{ traits::{CheckedAdd, UniqueSaturatedInto, Zero}, - FixedPointNumber, Perbill, Permill, Saturating, + Perbill, Permill, Saturating, }; pub use sp_std::{collections::btree_map::BTreeMap, fmt::Debug, vec::Vec}; use astar_primitives::{ - dapp_staking::{DAppId, EraNumber, PeriodNumber, RankedTier, TierSlots as TierSlotsFunc}, + dapp_staking::{ + DAppId, EraNumber, PeriodNumber, RankedTier, TierSlots as TierSlotsFunc, + FIXED_TIER_SLOTS_ARGS, + }, Balance, BlockNumber, }; @@ -1706,9 +1709,10 @@ pub struct TierParameters> { /// Requirements for entry into each tier. /// First entry refers to the first tier, and so on. pub(crate) tier_thresholds: BoundedVec, - /// Arguments for the linear equation used to calculate the number of slots. - /// This can be made more generic in the future in case more complex equations are required. - /// But for now this simple tuple serves the purpose. + /// Legacy arguments for the linear equation used to calculate the number of slots. + /// + /// Kept for storage/config compatibility, but ignored during tier recalculation. + /// Tier slot count is derived from `FIXED_TIER_SLOTS_ARGS` in `TiersConfiguration::calculate_new`. pub(crate) slot_number_args: (u64, u64), /// Rank multiplier per tier in bips (100% = 10_000 bips): /// defines how much rank 10 earns relative to rank 0. @@ -1843,16 +1847,13 @@ impl, T: TierSlotsFunc, P: Get> TiersConfiguration, - native_price: FixedU128, - total_issuance: Balance, - ) -> Self { + /// Calculate new `TiersConfiguration` based on static tier parameters. + /// + /// NOTE: Dynamic slot number arguments are intentionally ignored in this flow. + /// Tier slot count is always derived from `FIXED_TIER_SLOTS_ARGS`. + pub fn calculate_new(&self, params: &TierParameters, total_issuance: Balance) -> Self { // It must always be at least 1 slot. - let base_number_of_slots = T::number_of_slots(P::get(), params.slot_number_args).max(1); - let new_number_of_slots = T::number_of_slots(native_price, params.slot_number_args).max(1); + let number_of_slots = T::number_of_slots(P::get(), FIXED_TIER_SLOTS_ARGS).max(1); // Calculate how much each tier gets slots. let new_slots_per_tier: Vec = params @@ -1860,53 +1861,13 @@ impl, T: TierSlotsFunc, P: Get> TiersConfiguration::try_from(new_slots_per_tier).unwrap_or_default(); - // NOTE: even though we could ignore the situation when the new & base slot numbers are equal, it's necessary to re-calculate it since - // other params related to calculation might have changed. - let delta_threshold = if new_number_of_slots >= base_number_of_slots { - FixedU128::from_rational( - (new_number_of_slots - base_number_of_slots).into(), - new_number_of_slots.into(), - ) - } else { - FixedU128::from_rational( - (base_number_of_slots - new_number_of_slots).into(), - new_number_of_slots.into(), - ) - }; - - // Update tier thresholds. - // In case number of slots increase, we decrease thresholds required to enter the tier. - // In case number of slots decrease, we increase the threshold required to enter the tier. - // - // According to formula: %delta_threshold = (100% / (100% - delta_%_slots) - 1) * 100% - // - // where delta_%_slots is simply: (base_num_slots - new_num_slots) / base_num_slots - // - // `base_num_slots` is the number of slots at the base native currency price. - // - // When these entries are put into the threshold formula, we get: - // = 1 / ( 1 - (base_num_slots - new_num_slots) / base_num_slots ) - 1 - // = 1 / ( new / base) - 1 - // = base / new - 1 - // = (base - new) / new - // - // This number can be negative. In order to keep all operations in unsigned integer domain, - // formulas are adjusted like: - // - // 1. Number of slots has increased, threshold is expected to decrease - // %delta_threshold = (new_num_slots - base_num_slots) / new_num_slots - // new_threshold = base_threshold * (1 - %delta_threshold) - // - // 2. Number of slots has decreased, threshold is expected to increase - // %delta_threshold = (base_num_slots - new_num_slots) / new_num_slots - // new_threshold = base_threshold * (1 + %delta_threshold) - // + // Update tier thresholds using static percentages. let new_tier_thresholds: BoundedVec = params .tier_thresholds .clone() @@ -1918,14 +1879,9 @@ impl, T: TierSlotsFunc, P: Get> TiersConfiguration { let amount = *percentage * total_issuance; - let adjusted_amount = if new_number_of_slots >= base_number_of_slots { - amount.saturating_sub(delta_threshold.saturating_mul_int(amount)) - } else { - amount.saturating_add(delta_threshold.saturating_mul_int(amount)) - }; let minimum_amount = *minimum_required_percentage * total_issuance; let maximum_amount = *maximum_possible_percentage * total_issuance; - adjusted_amount.max(minimum_amount).min(maximum_amount) + amount.max(minimum_amount).min(maximum_amount) } TierThreshold::FixedPercentage { required_percentage, diff --git a/precompiles/dapp-staking/src/test/mock.rs b/precompiles/dapp-staking/src/test/mock.rs index 2a9af5446..cf34c2b8e 100644 --- a/precompiles/dapp-staking/src/test/mock.rs +++ b/precompiles/dapp-staking/src/test/mock.rs @@ -43,7 +43,7 @@ extern crate alloc; use astar_primitives::{ dapp_staking::{ CycleConfiguration, EraNumber, PeriodNumber, SmartContract, StakingRewardHandler, - StandardTierSlots, STANDARD_TIER_SLOTS_ARGS, + StandardTierSlots, FIXED_TIER_SLOTS_ARGS, }, oracle::PriceProvider, AccountId, Balance, BlockNumber, @@ -301,7 +301,7 @@ impl ExternalityBuilder { required_percentage: Perbill::from_percent(1), }, ], - slot_number_args: STANDARD_TIER_SLOTS_ARGS, + slot_number_args: FIXED_TIER_SLOTS_ARGS, slots_per_tier: vec![10, 20, 30, 40], safeguard: None, tier_rank_multipliers: vec![10_000u32, 20_000, 20_000, 20_000], diff --git a/primitives/src/dapp_staking.rs b/primitives/src/dapp_staking.rs index 4fdd997e6..2cf8176a8 100644 --- a/primitives/src/dapp_staking.rs +++ b/primitives/src/dapp_staking.rs @@ -206,8 +206,6 @@ impl TierSlots for StandardTierSlots { } /// Standard tier slots arguments. -/// Initially decided for Astar, during the Tokenomics 2.0 work. -pub const STANDARD_TIER_SLOTS_ARGS: (u64, u64) = (1000, 50); /// Decided for Astar, during the Tokenomics 3.0 revamp. pub const FIXED_TIER_SLOTS_ARGS: (u64, u64) = (0, 16); From 821cbd5637c8618284d7ad13cff7f9d9533a3c9f Mon Sep 17 00:00:00 2001 From: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> Date: Mon, 23 Feb 2026 15:27:50 +0400 Subject: [PATCH 2/5] fix test assertion --- pallets/dapp-staking/src/test/tests_types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/dapp-staking/src/test/tests_types.rs b/pallets/dapp-staking/src/test/tests_types.rs index 3f789e318..1f5ce7885 100644 --- a/pallets/dapp-staking/src/test/tests_types.rs +++ b/pallets/dapp-staking/src/test/tests_types.rs @@ -3506,7 +3506,7 @@ fn tier_params_check_is_ok() { Permill::from_percent(70), ]) .unwrap(); - assert!(params.is_valid()); + assert!(new_params.is_valid()); // 2nd scenario - reward portion is too much let mut new_params = params.clone(); From bfa008030be5369143cb650c2d1810531c6413db Mon Sep 17 00:00:00 2001 From: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:10:43 +0400 Subject: [PATCH 3/5] remove NativePriceProvider config item --- pallets/dapp-staking/src/lib.rs | 4 ---- pallets/dapp-staking/src/test/mock.rs | 8 -------- precompiles/dapp-staking/src/test/mock.rs | 9 --------- runtime/astar/src/lib.rs | 1 - runtime/local/src/lib.rs | 1 - runtime/shibuya/src/lib.rs | 1 - runtime/shiden/src/lib.rs | 1 - tests/xcm-simulator/src/mocks/parachain.rs | 9 --------- 8 files changed, 34 deletions(-) diff --git a/pallets/dapp-staking/src/lib.rs b/pallets/dapp-staking/src/lib.rs index da302c29e..08c190078 100644 --- a/pallets/dapp-staking/src/lib.rs +++ b/pallets/dapp-staking/src/lib.rs @@ -60,7 +60,6 @@ use astar_primitives::{ PeriodNumber, Rank, RankedTier, SmartContractHandle, StakingRewardHandler, TierId, TierSlots as TierSlotFunc, FIXED_TIER_SLOTS_ARGS, }, - oracle::PriceProvider, Balance, BlockNumber, }; @@ -144,9 +143,6 @@ pub mod pallet { /// Privileged origin for managing dApp staking pallet. type ManagerOrigin: EnsureOrigin<::RuntimeOrigin>; - /// Used to provide price information about the native token. - type NativePriceProvider: PriceProvider; - /// Used to handle reward payouts & reward pool amount fetching. type StakingRewardHandler: StakingRewardHandler; diff --git a/pallets/dapp-staking/src/test/mock.rs b/pallets/dapp-staking/src/test/mock.rs index 19065c4f8..d1c70d79e 100644 --- a/pallets/dapp-staking/src/test/mock.rs +++ b/pallets/dapp-staking/src/test/mock.rs @@ -94,13 +94,6 @@ impl pallet_migrations::Config for Test { type MaxServiceWeight = MaxServiceWeight; } -pub struct DummyPriceProvider; -impl PriceProvider for DummyPriceProvider { - fn average_price() -> FixedU128 { - BaseNativeCurrencyPrice::get() - } -} - thread_local! { pub(crate) static DOES_PAYOUT_SUCCEED: RefCell = RefCell::new(false); pub(crate) static BLOCK_BEFORE_NEW_ERA: RefCell = RefCell::new(0); @@ -213,7 +206,6 @@ impl pallet_dapp_staking::Config for Test { >; type ManagerOrigin = EitherOfDiverse, EnsureSignedBy>; - type NativePriceProvider = DummyPriceProvider; type StakingRewardHandler = DummyStakingRewardHandler; type CycleConfiguration = DummyCycleConfiguration; type Observers = DummyDappStakingObserver; diff --git a/precompiles/dapp-staking/src/test/mock.rs b/precompiles/dapp-staking/src/test/mock.rs index cf34c2b8e..24f0f0323 100644 --- a/precompiles/dapp-staking/src/test/mock.rs +++ b/precompiles/dapp-staking/src/test/mock.rs @@ -45,7 +45,6 @@ use astar_primitives::{ CycleConfiguration, EraNumber, PeriodNumber, SmartContract, StakingRewardHandler, StandardTierSlots, FIXED_TIER_SLOTS_ARGS, }, - oracle::PriceProvider, AccountId, Balance, BlockNumber, }; use pallet_dapp_staking::TierThreshold; @@ -161,13 +160,6 @@ impl pallet_timestamp::Config for Test { type MockSmartContract = SmartContract<::AccountId>; -pub struct DummyPriceProvider; -impl PriceProvider for DummyPriceProvider { - fn average_price() -> FixedU128 { - FixedU128::from_rational(1, 10) - } -} - pub struct DummyStakingRewardHandler; impl StakingRewardHandler for DummyStakingRewardHandler { fn staker_and_dapp_reward_pools(_total_staked_value: Balance) -> (Balance, Balance) { @@ -232,7 +224,6 @@ impl pallet_dapp_staking::Config for Test { type ContractRegisterOrigin = frame_system::EnsureRoot; type ContractUnregisterOrigin = frame_system::EnsureRoot; type ManagerOrigin = frame_system::EnsureRoot; - type NativePriceProvider = DummyPriceProvider; type StakingRewardHandler = DummyStakingRewardHandler; type CycleConfiguration = DummyCycleConfiguration; type Observers = (); diff --git a/runtime/astar/src/lib.rs b/runtime/astar/src/lib.rs index 1e00c5f35..f4b5e6cf2 100644 --- a/runtime/astar/src/lib.rs +++ b/runtime/astar/src/lib.rs @@ -462,7 +462,6 @@ impl pallet_dapp_staking::Config for Runtime { type ContractRegisterOrigin = EnsureRootOrTwoThirdsCommunityCouncil; type ContractUnregisterOrigin = EnsureRootOrFourFifthsCommunityCouncil; type ManagerOrigin = EnsureRootOrHalfTechCommitteeOrTwoThirdCouncil; - type NativePriceProvider = PriceAggregator; type StakingRewardHandler = Inflation; type CycleConfiguration = InflationCycleConfig; type Observers = Inflation; diff --git a/runtime/local/src/lib.rs b/runtime/local/src/lib.rs index 59cd1f29f..52b59c81d 100644 --- a/runtime/local/src/lib.rs +++ b/runtime/local/src/lib.rs @@ -477,7 +477,6 @@ impl pallet_dapp_staking::Config for Runtime { type ContractRegisterOrigin = EnsureRootOrTwoThirdsCommunityCouncil; type ContractUnregisterOrigin = EnsureRoot; type ManagerOrigin = EnsureRootOrTwoThirdsTechnicalCommittee; - type NativePriceProvider = StaticPriceProvider; type StakingRewardHandler = Inflation; type CycleConfiguration = InflationCycleConfig; type Observers = Inflation; diff --git a/runtime/shibuya/src/lib.rs b/runtime/shibuya/src/lib.rs index 84babbae1..e230e4f87 100644 --- a/runtime/shibuya/src/lib.rs +++ b/runtime/shibuya/src/lib.rs @@ -487,7 +487,6 @@ impl pallet_dapp_staking::Config for Runtime { type ContractRegisterOrigin = EnsureRootOrHalfCommunityCouncil; type ContractUnregisterOrigin = EnsureRootOrFourFifthsCommunityCouncil; type ManagerOrigin = EnsureRootOrHalfTechnicalCommittee; - type NativePriceProvider = PriceAggregator; type StakingRewardHandler = Inflation; type CycleConfiguration = InflationCycleConfig; type Observers = Inflation; diff --git a/runtime/shiden/src/lib.rs b/runtime/shiden/src/lib.rs index f95090bc8..2140d33b8 100644 --- a/runtime/shiden/src/lib.rs +++ b/runtime/shiden/src/lib.rs @@ -440,7 +440,6 @@ impl pallet_dapp_staking::Config for Runtime { type ContractRegisterOrigin = frame_system::EnsureRoot; type ContractUnregisterOrigin = frame_system::EnsureRoot; type ManagerOrigin = frame_system::EnsureRoot; - type NativePriceProvider = PriceAggregator; type StakingRewardHandler = Inflation; type CycleConfiguration = InflationCycleConfig; type Observers = Inflation; diff --git a/tests/xcm-simulator/src/mocks/parachain.rs b/tests/xcm-simulator/src/mocks/parachain.rs index 42798878f..f4e59d1c9 100644 --- a/tests/xcm-simulator/src/mocks/parachain.rs +++ b/tests/xcm-simulator/src/mocks/parachain.rs @@ -61,7 +61,6 @@ use xcm_executor::{traits::JustTry, XcmExecutor}; use astar_primitives::{ dapp_staking::{AccountCheck, CycleConfiguration, SmartContract, StakingRewardHandler}, - oracle::PriceProvider, xcm::{ AbsoluteAndRelativeReserveProvider, AllowTopLevelPaidExecutionFrom, AssetLocationIdConverter, FixedRateOfForeignAsset, ReserveAssetFilter, @@ -613,13 +612,6 @@ impl StakingRewardHandler for DummyStakingRewardHandler { } } -pub struct DummyPriceProvider; -impl PriceProvider for DummyPriceProvider { - fn average_price() -> FixedU128 { - FixedU128::from_rational(1, 10) - } -} - pub(crate) type MockSmartContract = SmartContract; #[cfg(feature = "runtime-benchmarks")] @@ -651,7 +643,6 @@ impl pallet_dapp_staking::Config for Runtime { type ContractRegisterOrigin = frame_system::EnsureRoot; type ContractUnregisterOrigin = frame_system::EnsureRoot; type ManagerOrigin = frame_system::EnsureRoot; - type NativePriceProvider = DummyPriceProvider; type StakingRewardHandler = DummyStakingRewardHandler; type CycleConfiguration = DummyCycleConfiguration; type Observers = (); From a460cf590f841eae89d0c43a1554ecd2c7958027 Mon Sep 17 00:00:00 2001 From: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> Date: Mon, 23 Feb 2026 17:30:48 +0400 Subject: [PATCH 4/5] remove StandardTierSlots --- .../dapp-staking/src/benchmarking/utils.rs | 19 +++---- pallets/dapp-staking/src/lib.rs | 37 ++++---------- pallets/dapp-staking/src/test/mock.rs | 17 +------ pallets/dapp-staking/src/test/tests.rs | 28 ++++------ pallets/dapp-staking/src/test/tests_types.rs | 51 ++++++------------- pallets/dapp-staking/src/types.rs | 23 +++------ precompiles/dapp-staking/src/test/mock.rs | 10 +--- primitives/src/dapp_staking.rs | 31 ++--------- runtime/astar/src/lib.rs | 9 ++-- runtime/local/src/lib.rs | 9 +--- runtime/shibuya/src/lib.rs | 9 ++-- runtime/shiden/src/lib.rs | 9 ++-- tests/xcm-simulator/src/mocks/parachain.rs | 6 --- 13 files changed, 73 insertions(+), 185 deletions(-) diff --git a/pallets/dapp-staking/src/benchmarking/utils.rs b/pallets/dapp-staking/src/benchmarking/utils.rs index d4213260d..7e04eb3d9 100644 --- a/pallets/dapp-staking/src/benchmarking/utils.rs +++ b/pallets/dapp-staking/src/benchmarking/utils.rs @@ -18,7 +18,10 @@ use super::{Pallet as DappStaking, *}; -use astar_primitives::{dapp_staking::FIXED_TIER_SLOTS_ARGS, Balance}; +use astar_primitives::{ + dapp_staking::{FIXED_NUMBER_OF_TIER_SLOTS, FIXED_TIER_SLOTS_ARGS}, + Balance, +}; use frame_system::Pallet as System; use sp_arithmetic::Permill; @@ -116,7 +119,7 @@ pub(super) const UNIT: Balance = 1_000_000_000_000_000_000; pub(super) const MIN_TIER_THRESHOLD: Balance = 10 * UNIT; /// Number of slots in the tier system. -pub(super) const NUMBER_OF_SLOTS: u32 = 16; +pub(super) const NUMBER_OF_SLOTS: u32 = FIXED_NUMBER_OF_TIER_SLOTS as u32; /// Random seed. pub(super) const SEED: u32 = 9000; @@ -207,13 +210,11 @@ pub(super) fn init_tier_settings() { .expect("Invalid number of tier thresholds provided."); // Init tier config, based on the initial params - let init_tier_config = - TiersConfiguration:: { - slots_per_tier: BoundedVec::try_from(vec![0, 6, 10, 0]).unwrap(), - reward_portion: tier_params.reward_portion.clone(), - tier_thresholds, - _phantom: Default::default(), - }; + let init_tier_config = TiersConfiguration:: { + slots_per_tier: BoundedVec::try_from(vec![0, 6, 10, 0]).unwrap(), + reward_portion: tier_params.reward_portion.clone(), + tier_thresholds, + }; assert!(tier_params.is_valid()); assert!(init_tier_config.is_valid()); diff --git a/pallets/dapp-staking/src/lib.rs b/pallets/dapp-staking/src/lib.rs index 08c190078..ed4afc534 100644 --- a/pallets/dapp-staking/src/lib.rs +++ b/pallets/dapp-staking/src/lib.rs @@ -48,7 +48,6 @@ use frame_support::{ weights::Weight, }; use frame_system::pallet_prelude::*; -use sp_arithmetic::fixed_point::FixedU128; use sp_runtime::{ traits::{One, Saturating, UniqueSaturatedInto, Zero}, Perbill, Permill, SaturatedConversion, @@ -58,7 +57,7 @@ use astar_primitives::{ dapp_staking::{ AccountCheck, CycleConfiguration, DAppId, EraNumber, Observer as DAppStakingObserver, PeriodNumber, Rank, RankedTier, SmartContractHandle, StakingRewardHandler, TierId, - TierSlots as TierSlotFunc, FIXED_TIER_SLOTS_ARGS, + FIXED_TIER_SLOTS_ARGS, }, Balance, BlockNumber, }; @@ -155,15 +154,6 @@ pub mod pallet { /// Used to check whether an account is allowed to participate in dApp staking. type AccountCheck: AccountCheck; - /// Used to calculate total number of tier slots for some price. - type TierSlots: TierSlotFunc; - - /// Base native currency price used as a deterministic input for tier slot calculation. - /// - /// Tier recalculation no longer adjusts with live native price changes. - #[pallet::constant] - type BaseNativeCurrencyPrice: Get; - /// Maximum length of a single era reward span length entry. #[pallet::constant] type EraRewardSpanLength: Get; @@ -493,11 +483,8 @@ pub mod pallet { /// Tier configuration user for current & preceding eras. #[pallet::storage] - pub type TierConfig = StorageValue< - _, - TiersConfiguration, - ValueQuery, - >; + pub type TierConfig = + StorageValue<_, TiersConfiguration, ValueQuery>; /// Information about which tier a dApp belonged to in a specific era. #[pallet::storage] @@ -610,16 +597,14 @@ pub mod pallet { .try_into() .expect("Invalid number of tier thresholds provided."); - let tier_config = - TiersConfiguration:: { - slots_per_tier: BoundedVec::::try_from( - self.slots_per_tier.clone(), - ) - .expect("Invalid number of slots per tier entries provided."), - reward_portion: tier_params.reward_portion.clone(), - tier_thresholds, - _phantom: Default::default(), - }; + let tier_config = TiersConfiguration:: { + slots_per_tier: BoundedVec::::try_from( + self.slots_per_tier.clone(), + ) + .expect("Invalid number of slots per tier entries provided."), + reward_portion: tier_params.reward_portion.clone(), + tier_thresholds, + }; assert!( tier_config.is_valid(), "Invalid tier config values provided." diff --git a/pallets/dapp-staking/src/test/mock.rs b/pallets/dapp-staking/src/test/mock.rs index d1c70d79e..ebea016ef 100644 --- a/pallets/dapp-staking/src/test/mock.rs +++ b/pallets/dapp-staking/src/test/mock.rs @@ -29,15 +29,12 @@ use frame_support::{ traits::{fungible::Mutate as FunMutate, ConstBool, ConstU128, ConstU32, EitherOfDiverse}, weights::Weight, }; -use sp_arithmetic::fixed_point::FixedU128; use sp_io::TestExternalities; use sp_runtime::{BuildStorage, Permill}; use sp_std::cell::RefCell; use astar_primitives::{ - dapp_staking::{ - Observer as DappStakingObserver, SmartContract, StandardTierSlots, FIXED_TIER_SLOTS_ARGS, - }, + dapp_staking::{Observer as DappStakingObserver, SmartContract, FIXED_TIER_SLOTS_ARGS}, Balance, BlockNumber, }; use frame_system::{EnsureRoot, EnsureSignedBy}; @@ -184,9 +181,6 @@ impl Get for DynamicMaxBonusSafeMovesPerPeriod { } } -parameter_types! { - pub const BaseNativeCurrencyPrice: FixedU128 = FixedU128::from_rational(5, 100); -} ord_parameter_types! { pub const ContractRegisterAccount: AccountId = 1337; pub const ContractUnregisterAccount: AccountId = 1779; @@ -210,8 +204,6 @@ impl pallet_dapp_staking::Config for Test { type CycleConfiguration = DummyCycleConfiguration; type Observers = DummyDappStakingObserver; type AccountCheck = DummyAccountCheck; - type TierSlots = StandardTierSlots; - type BaseNativeCurrencyPrice = BaseNativeCurrencyPrice; type EraRewardSpanLength = ConstU32<8>; type RewardRetentionInPeriods = ConstU32<2>; type MaxNumberOfContracts = ConstU32<10>; @@ -346,15 +338,10 @@ impl ExtBuilder { .expect("Invalid number of tier thresholds provided."); // Init tier config based on the initial params. - let init_tier_config = TiersConfiguration::< - ::NumberOfTiers, - ::TierSlots, - ::BaseNativeCurrencyPrice, - > { + let init_tier_config = TiersConfiguration::<::NumberOfTiers> { slots_per_tier: BoundedVec::try_from(vec![2, 5, 13, 20]).unwrap(), reward_portion: tier_params.reward_portion.clone(), tier_thresholds, - _phantom: Default::default(), } .calculate_new(&tier_params, total_issuance); diff --git a/pallets/dapp-staking/src/test/tests.rs b/pallets/dapp-staking/src/test/tests.rs index 11be41df5..fd4307316 100644 --- a/pallets/dapp-staking/src/test/tests.rs +++ b/pallets/dapp-staking/src/test/tests.rs @@ -42,7 +42,7 @@ use sp_runtime::{ use astar_primitives::{ dapp_staking::{ CycleConfiguration, EraNumber, RankedTier, SmartContractHandle, StakingRewardHandler, - TierSlots, FIXED_TIER_SLOTS_ARGS, + FIXED_NUMBER_OF_TIER_SLOTS, }, Balance, BlockNumber, }; @@ -3402,37 +3402,29 @@ fn base_number_of_slots_is_respected() { assert_ok!(DappStaking::force(RuntimeOrigin::root(), ForcingType::Era)); run_for_blocks(1); - let base_native_price = ::BaseNativeCurrencyPrice::get(); - let slot_limit = - ::TierSlots::number_of_slots(base_native_price, FIXED_TIER_SLOTS_ARGS); - - assert_ok!(DappStaking::force(RuntimeOrigin::root(), ForcingType::Era)); - run_for_blocks(1); - - let expected_number_of_slots = TierConfig::::get().total_number_of_slots(); + let config_before = TierConfig::::get(); assert_eq!( - expected_number_of_slots, slot_limit, + config_before.total_number_of_slots(), + FIXED_NUMBER_OF_TIER_SLOTS, "Number of slots must respect the fixed slot limit." ); - let base_thresholds = TierConfig::::get().tier_thresholds; - - // Mutate slot_number_args and ensure recalculation remains unchanged. + // Mutate slot_number_args and ensure full tier config recalculation remains unchanged. StaticTierParams::::mutate(|params| { params.slot_number_args = (123, 456); }); assert_ok!(DappStaking::force(RuntimeOrigin::root(), ForcingType::Era)); run_for_blocks(1); + let config_after = TierConfig::::get(); assert_eq!( - TierConfig::::get().total_number_of_slots(), - expected_number_of_slots, + config_after.total_number_of_slots(), + FIXED_NUMBER_OF_TIER_SLOTS, "Number of slots must remain fixed regardless of slot_number_args." ); assert_eq!( - TierConfig::::get().tier_thresholds, - base_thresholds, - "Thresholds must remain unchanged regardless of slot_number_args." + config_after, config_before, + "Tier configuration must remain unchanged regardless of slot_number_args." ); }) } diff --git a/pallets/dapp-staking/src/test/tests_types.rs b/pallets/dapp-staking/src/test/tests_types.rs index 1f5ce7885..25564a0ae 100644 --- a/pallets/dapp-staking/src/test/tests_types.rs +++ b/pallets/dapp-staking/src/test/tests_types.rs @@ -17,11 +17,10 @@ // along with Astar. If not, see . use astar_primitives::{ - dapp_staking::{RankedTier, StandardTierSlots, FIXED_TIER_SLOTS_ARGS}, + dapp_staking::{RankedTier, FIXED_NUMBER_OF_TIER_SLOTS, FIXED_TIER_SLOTS_ARGS}, Balance, }; -use frame_support::{assert_ok, parameter_types}; -use sp_arithmetic::fixed_point::FixedU128; +use frame_support::assert_ok; use sp_runtime::Permill; use crate::*; @@ -3597,7 +3596,6 @@ fn tier_params_check_is_ok() { #[test] fn tier_configuration_basic_tests() { - // TODO: this should be expanded & improved later get_u32_type!(TiersNum, 4); let params = TierParameters:: { reward_portion: BoundedVec::try_from(vec![ @@ -3615,20 +3613,14 @@ fn tier_configuration_basic_tests() { ]) .unwrap(), tier_thresholds: BoundedVec::try_from(vec![ - TierThreshold::DynamicPercentage { - percentage: Perbill::from_percent(12), - minimum_required_percentage: Perbill::from_percent(8), - maximum_possible_percentage: Perbill::from_percent(100), + TierThreshold::FixedPercentage { + required_percentage: Perbill::from_percent(12), }, - TierThreshold::DynamicPercentage { - percentage: Perbill::from_percent(7), - minimum_required_percentage: Perbill::from_percent(5), - maximum_possible_percentage: Perbill::from_percent(100), + TierThreshold::FixedPercentage { + required_percentage: Perbill::from_percent(7), }, - TierThreshold::DynamicPercentage { - percentage: Perbill::from_percent(4), - minimum_required_percentage: Perbill::from_percent(3), - maximum_possible_percentage: Perbill::from_percent(100), + TierThreshold::FixedPercentage { + required_percentage: Perbill::from_percent(4), }, TierThreshold::FixedPercentage { required_percentage: Perbill::from_percent(3), @@ -3641,9 +3633,6 @@ fn tier_configuration_basic_tests() { assert!(params.is_valid(), "Example params must be valid!"); // Create a configuration with some values - parameter_types! { - pub const BaseNativeCurrencyPrice: FixedU128 = FixedU128::from_rational(5, 100); - } let total_issuance: Balance = 9_000_000_000; let tier_thresholds = params .tier_thresholds @@ -3653,16 +3642,19 @@ fn tier_configuration_basic_tests() { .try_into() .expect("Invalid number of tier thresholds provided."); - let init_config = TiersConfiguration:: { + let init_config = TiersConfiguration:: { slots_per_tier: BoundedVec::try_from(vec![10, 20, 30, 40]).unwrap(), reward_portion: params.reward_portion.clone(), tier_thresholds, - _phantom: PhantomData::default(), }; assert!(init_config.is_valid(), "Init config must be valid!"); let new_config = init_config.calculate_new(¶ms, total_issuance); assert!(new_config.is_valid()); + assert_eq!( + new_config.total_number_of_slots(), + FIXED_NUMBER_OF_TIER_SLOTS + ); // TODO: expand tests, add more sanity checks (e.g. tier 3 requirement should never be lower than tier 4, etc.) } @@ -3886,24 +3878,13 @@ fn tier_configuration_calculate_new_with_maximum_threshold() { tier_rank_multipliers: BoundedVec::try_from(vec![0, 24_000, 46_700, 0]).unwrap(), }; - // Create a starting configuration with some values - parameter_types! { - pub const BaseNativeCurrencyPrice: FixedU128 = FixedU128::from_rational(5, 100); - } + // Create a starting configuration with placeholder values. let total_issuance: Balance = 8_400_000_000; - let init_tier_thresholds = params - .tier_thresholds - .iter() - .map(|t| t.threshold(total_issuance)) - .collect::>() - .try_into() - .expect("Invalid number of tier thresholds provided."); - let init_config = TiersConfiguration:: { + let init_config = TiersConfiguration:: { slots_per_tier: BoundedVec::try_from(vec![10, 20, 30, 40]).unwrap(), reward_portion, - tier_thresholds: init_tier_thresholds, - _phantom: PhantomData::default(), + tier_thresholds: BoundedVec::try_from(vec![0, 0, 0, 0]).unwrap(), }; assert!(init_config.is_valid(), "Init config must be valid!"); diff --git a/pallets/dapp-staking/src/types.rs b/pallets/dapp-staking/src/types.rs index feb5176e0..6c720ce97 100644 --- a/pallets/dapp-staking/src/types.rs +++ b/pallets/dapp-staking/src/types.rs @@ -68,7 +68,6 @@ use core::ops::Deref; use frame_support::{pallet_prelude::*, BoundedBTreeMap, BoundedVec, DefaultNoBound}; use parity_scale_codec::{Decode, Encode}; use serde::{Deserialize, Serialize}; -use sp_arithmetic::fixed_point::FixedU128; use sp_runtime::{ traits::{CheckedAdd, UniqueSaturatedInto, Zero}, Perbill, Permill, Saturating, @@ -76,10 +75,7 @@ use sp_runtime::{ pub use sp_std::{collections::btree_map::BTreeMap, fmt::Debug, vec::Vec}; use astar_primitives::{ - dapp_staking::{ - DAppId, EraNumber, PeriodNumber, RankedTier, TierSlots as TierSlotsFunc, - FIXED_TIER_SLOTS_ARGS, - }, + dapp_staking::{DAppId, EraNumber, PeriodNumber, RankedTier, FIXED_NUMBER_OF_TIER_SLOTS}, Balance, BlockNumber, }; @@ -1712,7 +1708,7 @@ pub struct TierParameters> { /// Legacy arguments for the linear equation used to calculate the number of slots. /// /// Kept for storage/config compatibility, but ignored during tier recalculation. - /// Tier slot count is derived from `FIXED_TIER_SLOTS_ARGS` in `TiersConfiguration::calculate_new`. + /// Tier slot count is fixed via `FIXED_NUMBER_OF_TIER_SLOTS` in `TiersConfiguration::calculate_new`. pub(crate) slot_number_args: (u64, u64), /// Rank multiplier per tier in bips (100% = 10_000 bips): /// defines how much rank 10 earns relative to rank 0. @@ -1800,8 +1796,8 @@ impl> TierParameters { CloneNoBound, TypeInfo, )] -#[scale_info(skip_type_params(NT, T, P))] -pub struct TiersConfiguration, T: TierSlotsFunc, P: Get> { +#[scale_info(skip_type_params(NT))] +pub struct TiersConfiguration> { /// Number of slots per tier. /// First entry refers to the first tier, and so on. pub(crate) slots_per_tier: BoundedVec, @@ -1812,12 +1808,9 @@ pub struct TiersConfiguration, T: TierSlotsFunc, P: Get> /// Requirements for entry into each tier. /// First entry refers to the first tier, and so on. pub(crate) tier_thresholds: BoundedVec, - /// Phantom data to keep track of the tier slots function. - #[codec(skip)] - pub(crate) _phantom: PhantomData<(T, P)>, } -impl, T: TierSlotsFunc, P: Get> TiersConfiguration { +impl> TiersConfiguration { /// Check if parameters are valid. pub fn is_valid(&self) -> bool { let number_of_tiers: usize = NT::get() as usize; @@ -1850,10 +1843,9 @@ impl, T: TierSlotsFunc, P: Get> TiersConfiguration, total_issuance: Balance) -> Self { - // It must always be at least 1 slot. - let number_of_slots = T::number_of_slots(P::get(), FIXED_TIER_SLOTS_ARGS).max(1); + let number_of_slots: u16 = FIXED_NUMBER_OF_TIER_SLOTS; // Calculate how much each tier gets slots. let new_slots_per_tier: Vec = params @@ -1895,7 +1887,6 @@ impl, T: TierSlotsFunc, P: Get> TiersConfiguration fn set_balance(_account: &AccountId, _amount: Balance) {} } -parameter_types! { - pub const BaseNativeCurrencyPrice: FixedU128 = FixedU128::from_rational(5, 100); -} - impl pallet_dapp_staking::Config for Test { type RuntimeEvent = RuntimeEvent; type RuntimeFreezeReason = RuntimeFreezeReason; @@ -228,8 +224,6 @@ impl pallet_dapp_staking::Config for Test { type CycleConfiguration = DummyCycleConfiguration; type Observers = (); type AccountCheck = (); - type TierSlots = StandardTierSlots; - type BaseNativeCurrencyPrice = BaseNativeCurrencyPrice; type EraRewardSpanLength = ConstU32<8>; type RewardRetentionInPeriods = ConstU32<2>; type MaxNumberOfContracts = ConstU32<10>; diff --git a/primitives/src/dapp_staking.rs b/primitives/src/dapp_staking.rs index 2cf8176a8..694c0c1e1 100644 --- a/primitives/src/dapp_staking.rs +++ b/primitives/src/dapp_staking.rs @@ -16,17 +16,14 @@ // You should have received a copy of the GNU General Public License // along with Astar. If not, see . -use super::{oracle::CurrencyAmount, Balance, BlockNumber}; +use super::{Balance, BlockNumber}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use frame_support::pallet_prelude::{RuntimeDebug, Weight}; use sp_arithmetic::ArithmeticError; use sp_core::{DecodeWithMemTracking, H160}; -use sp_runtime::{ - traits::{UniqueSaturatedInto, Zero}, - FixedPointNumber, -}; +use sp_runtime::traits::Zero; use sp_std::hash::Hash; /// Era number type @@ -184,30 +181,12 @@ impl AccountCheck for () { } } -/// Trait for calculating the total number of tier slots for the given price. -pub trait TierSlots { - /// Returns the total number of tier slots for the given price. - /// - /// # Arguments - /// * `price` - price (e.g. moving average over some time period) of the native currency. - /// * `args` - arguments, `a` & `b`, for the linear equation `number_of_slots = a * price + b`. - /// - /// Returns the total number of tier slots. - fn number_of_slots(price: CurrencyAmount, args: (u64, u64)) -> u16; -} - -/// Standard tier slots implementation, as proposed in the Tokenomics 2.0 document. -pub struct StandardTierSlots; -impl TierSlots for StandardTierSlots { - fn number_of_slots(price: CurrencyAmount, args: (u64, u64)) -> u16 { - let result: u64 = price.saturating_mul_int(args.0).saturating_add(args.1); - result.unique_saturated_into() - } -} +/// Fixed number of tier slots used by dApp-staking recalculation. +pub const FIXED_NUMBER_OF_TIER_SLOTS: u16 = 16; /// Standard tier slots arguments. /// Decided for Astar, during the Tokenomics 3.0 revamp. -pub const FIXED_TIER_SLOTS_ARGS: (u64, u64) = (0, 16); +pub const FIXED_TIER_SLOTS_ARGS: (u64, u64) = (0, FIXED_NUMBER_OF_TIER_SLOTS as u64); /// RankedTier is wrapper around u8 to hold both tier and rank. u8 has 2 bytes (8bits) and they're using in this order `0xrank_tier`. /// First 4 bits are used to hold rank and second 4 bits are used to hold tier. diff --git a/runtime/astar/src/lib.rs b/runtime/astar/src/lib.rs index f4b5e6cf2..54f2b4023 100644 --- a/runtime/astar/src/lib.rs +++ b/runtime/astar/src/lib.rs @@ -73,7 +73,7 @@ use sp_runtime::{ DispatchInfoOf, Dispatchable, OpaqueKeys, PostDispatchInfoOf, UniqueSaturatedInto, Zero, }, transaction_validity::{TransactionSource, TransactionValidity, TransactionValidityError}, - ApplyExtrinsicResult, FixedPointNumber, FixedU128, Perbill, Permill, Perquintill, RuntimeDebug, + ApplyExtrinsicResult, FixedPointNumber, Perbill, Permill, Perquintill, RuntimeDebug, }; use xcm::{ v5::{AssetId as XcmAssetId, Location as XcmLocation}, @@ -88,7 +88,7 @@ use xcm_runtime_apis::{ use astar_primitives::{ dapp_staking::{ AccountCheck as DappStakingAccountCheck, CycleConfiguration, DAppId, EraNumber, - PeriodNumber, RankedTier, SmartContract, StandardTierSlots, + PeriodNumber, RankedTier, SmartContract, FIXED_NUMBER_OF_TIER_SLOTS, }, evm::{EVMFungibleAdapterWrapper, EvmRevertCodeHandler}, governance::{ @@ -423,7 +423,6 @@ impl pallet_preimage::Config for Runtime { parameter_types! { pub const MinimumStakingAmount: Balance = 500 * ASTR; - pub const BaseNativeCurrencyPrice: FixedU128 = FixedU128::from_rational(5, 100); } #[cfg(feature = "runtime-benchmarks")] @@ -466,11 +465,9 @@ impl pallet_dapp_staking::Config for Runtime { type CycleConfiguration = InflationCycleConfig; type Observers = Inflation; type AccountCheck = AccountCheck; - type TierSlots = StandardTierSlots; - type BaseNativeCurrencyPrice = BaseNativeCurrencyPrice; type EraRewardSpanLength = ConstU32<16>; type RewardRetentionInPeriods = ConstU32<4>; - type MaxNumberOfContracts = ConstU32<16>; + type MaxNumberOfContracts = ConstU32<{ FIXED_NUMBER_OF_TIER_SLOTS as u32 }>; type MaxNumberOfContractsLegacy = ConstU32<500>; type MaxUnlockingChunks = ConstU32<8>; type MinimumLockedAmount = MinimumStakingAmount; diff --git a/runtime/local/src/lib.rs b/runtime/local/src/lib.rs index 52b59c81d..ca65ee0ec 100644 --- a/runtime/local/src/lib.rs +++ b/runtime/local/src/lib.rs @@ -67,13 +67,12 @@ use sp_runtime::{ DispatchInfoOf, Dispatchable, NumberFor, PostDispatchInfoOf, UniqueSaturatedInto, }, transaction_validity::{TransactionSource, TransactionValidity, TransactionValidityError}, - ApplyExtrinsicResult, FixedPointNumber, FixedU128, Perbill, Permill, Perquintill, RuntimeDebug, + ApplyExtrinsicResult, FixedPointNumber, Perbill, Permill, Perquintill, RuntimeDebug, }; use astar_primitives::{ dapp_staking::{ CycleConfiguration, DAppId, EraNumber, PeriodNumber, RankedTier, SmartContract, - StandardTierSlots, }, evm::{EvmRevertCodeHandler, HashedDefaultMappings}, governance::{ @@ -465,10 +464,6 @@ impl pallet_dapp_staking::BenchmarkHelper, AccountId> } } -parameter_types! { - pub const BaseNativeCurrencyPrice: FixedU128 = FixedU128::from_rational(5, 100); -} - impl pallet_dapp_staking::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeFreezeReason = RuntimeFreezeReason; @@ -481,8 +476,6 @@ impl pallet_dapp_staking::Config for Runtime { type CycleConfiguration = InflationCycleConfig; type Observers = Inflation; type AccountCheck = (); - type TierSlots = StandardTierSlots; - type BaseNativeCurrencyPrice = BaseNativeCurrencyPrice; type EraRewardSpanLength = ConstU32<8>; type RewardRetentionInPeriods = ConstU32<2>; type MaxNumberOfContracts = ConstU32<100>; diff --git a/runtime/shibuya/src/lib.rs b/runtime/shibuya/src/lib.rs index e230e4f87..4dd578ad4 100644 --- a/runtime/shibuya/src/lib.rs +++ b/runtime/shibuya/src/lib.rs @@ -69,7 +69,7 @@ use sp_runtime::{ DispatchInfoOf, Dispatchable, OpaqueKeys, PostDispatchInfoOf, UniqueSaturatedInto, }, transaction_validity::{TransactionSource, TransactionValidity, TransactionValidityError}, - ApplyExtrinsicResult, FixedPointNumber, FixedU128, Perbill, Permill, Perquintill, RuntimeDebug, + ApplyExtrinsicResult, FixedPointNumber, Perbill, Permill, Perquintill, RuntimeDebug, }; use xcm::{ v5::{AssetId as XcmAssetId, Location as XcmLocation}, @@ -84,7 +84,7 @@ use xcm_runtime_apis::{ use astar_primitives::{ dapp_staking::{ AccountCheck as DappStakingAccountCheck, CycleConfiguration, DAppId, EraNumber, - PeriodNumber, RankedTier, SmartContract, StandardTierSlots, + PeriodNumber, RankedTier, SmartContract, FIXED_NUMBER_OF_TIER_SLOTS, }, evm::{EVMFungibleAdapterWrapper, EvmRevertCodeHandler, HashedDefaultMappings}, governance::{ @@ -476,7 +476,6 @@ impl DappStakingAccountCheck for AccountCheck { parameter_types! { pub const MinimumStakingAmount: Balance = 5 * SBY; - pub const BaseNativeCurrencyPrice: FixedU128 = FixedU128::from_rational(5, 100); } impl pallet_dapp_staking::Config for Runtime { @@ -491,11 +490,9 @@ impl pallet_dapp_staking::Config for Runtime { type CycleConfiguration = InflationCycleConfig; type Observers = Inflation; type AccountCheck = AccountCheck; - type TierSlots = StandardTierSlots; - type BaseNativeCurrencyPrice = BaseNativeCurrencyPrice; type EraRewardSpanLength = ConstU32<16>; type RewardRetentionInPeriods = ConstU32<2>; - type MaxNumberOfContracts = ConstU32<16>; + type MaxNumberOfContracts = ConstU32<{ FIXED_NUMBER_OF_TIER_SLOTS as u32 }>; type MaxNumberOfContractsLegacy = ConstU32<500>; type MaxUnlockingChunks = ConstU32<8>; type MinimumLockedAmount = MinimumStakingAmount; diff --git a/runtime/shiden/src/lib.rs b/runtime/shiden/src/lib.rs index 2140d33b8..f113252f2 100644 --- a/runtime/shiden/src/lib.rs +++ b/runtime/shiden/src/lib.rs @@ -70,7 +70,7 @@ use sp_runtime::{ DispatchInfoOf, Dispatchable, OpaqueKeys, PostDispatchInfoOf, UniqueSaturatedInto, }, transaction_validity::{TransactionSource, TransactionValidity, TransactionValidityError}, - ApplyExtrinsicResult, FixedPointNumber, FixedU128, Perbill, Permill, Perquintill, RuntimeDebug, + ApplyExtrinsicResult, FixedPointNumber, Perbill, Permill, Perquintill, RuntimeDebug, }; use xcm::{ v5::{AssetId as XcmAssetId, Location as XcmLocation}, @@ -85,7 +85,7 @@ use xcm_runtime_apis::{ use astar_primitives::{ dapp_staking::{ AccountCheck as DappStakingAccountCheck, CycleConfiguration, DAppId, EraNumber, - PeriodNumber, RankedTier, SmartContract, StandardTierSlots, + PeriodNumber, RankedTier, SmartContract, FIXED_NUMBER_OF_TIER_SLOTS }, evm::{EVMFungibleAdapterWrapper, EvmRevertCodeHandler}, governance::OracleMembershipInst, @@ -429,7 +429,6 @@ impl DappStakingAccountCheck for AccountCheck { parameter_types! { pub const MinimumStakingAmount: Balance = 50 * SDN; - pub const BaseNativeCurrencyPrice: FixedU128 = FixedU128::from_rational(5, 100); } impl pallet_dapp_staking::Config for Runtime { @@ -444,11 +443,9 @@ impl pallet_dapp_staking::Config for Runtime { type CycleConfiguration = InflationCycleConfig; type Observers = Inflation; type AccountCheck = AccountCheck; - type TierSlots = StandardTierSlots; - type BaseNativeCurrencyPrice = BaseNativeCurrencyPrice; type EraRewardSpanLength = ConstU32<16>; type RewardRetentionInPeriods = ConstU32<3>; - type MaxNumberOfContracts = ConstU32<16>; + type MaxNumberOfContracts = ConstU32<{ FIXED_NUMBER_OF_TIER_SLOTS as u32 }>; type MaxNumberOfContractsLegacy = ConstU32<500>; type MaxUnlockingChunks = ConstU32<8>; type MinimumLockedAmount = MinimumStakingAmount; diff --git a/tests/xcm-simulator/src/mocks/parachain.rs b/tests/xcm-simulator/src/mocks/parachain.rs index f4e59d1c9..f1254ba93 100644 --- a/tests/xcm-simulator/src/mocks/parachain.rs +++ b/tests/xcm-simulator/src/mocks/parachain.rs @@ -631,10 +631,6 @@ impl pallet_dapp_staking::BenchmarkHelper } } -parameter_types! { - pub const BaseNativeCurrencyPrice: FixedU128 = FixedU128::from_rational(5, 100); -} - impl pallet_dapp_staking::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeFreezeReason = RuntimeFreezeReason; @@ -647,8 +643,6 @@ impl pallet_dapp_staking::Config for Runtime { type CycleConfiguration = DummyCycleConfiguration; type Observers = (); type AccountCheck = DummyAccountCheck; - type TierSlots = astar_primitives::dapp_staking::StandardTierSlots; - type BaseNativeCurrencyPrice = BaseNativeCurrencyPrice; type EraRewardSpanLength = ConstU32<1>; type RewardRetentionInPeriods = ConstU32<2>; type MaxNumberOfContracts = ConstU32<10>; From 3844c076b3c8cebb483837e27859abef63d11c4f Mon Sep 17 00:00:00 2001 From: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> Date: Tue, 24 Feb 2026 12:08:42 +0400 Subject: [PATCH 5/5] weights --- .../astar/src/weights/pallet_dapp_staking.rs | 148 +++++++++--------- .../src/weights/pallet_dapp_staking.rs | 148 +++++++++--------- runtime/shiden/src/lib.rs | 2 +- .../shiden/src/weights/pallet_dapp_staking.rs | 148 +++++++++--------- 4 files changed, 214 insertions(+), 232 deletions(-) diff --git a/runtime/astar/src/weights/pallet_dapp_staking.rs b/runtime/astar/src/weights/pallet_dapp_staking.rs index 027007d39..f4dd01305 100644 --- a/runtime/astar/src/weights/pallet_dapp_staking.rs +++ b/runtime/astar/src/weights/pallet_dapp_staking.rs @@ -20,7 +20,7 @@ //! Autogenerated weights for `pallet_dapp_staking` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2026-02-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-02-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `gh-runner-01-ovh`, CPU: `Intel(R) Xeon(R) E-2236 CPU @ 3.40GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 @@ -56,8 +56,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_359_000 picoseconds. - Weight::from_parts(8_596_000, 0) + // Minimum execution time: 7_449_000 picoseconds. + Weight::from_parts(7_901_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `DappStaking::IntegratedDApps` (r:1 w:1) @@ -70,8 +70,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `3086` - // Minimum execution time: 16_561_000 picoseconds. - Weight::from_parts(16_759_000, 0) + // Minimum execution time: 14_938_000 picoseconds. + Weight::from_parts(15_586_000, 0) .saturating_add(Weight::from_parts(0, 3086)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -82,8 +82,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `97` // Estimated: `3086` - // Minimum execution time: 14_619_000 picoseconds. - Weight::from_parts(15_003_000, 0) + // Minimum execution time: 12_805_000 picoseconds. + Weight::from_parts(13_387_000, 0) .saturating_add(Weight::from_parts(0, 3086)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -94,8 +94,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `97` // Estimated: `3086` - // Minimum execution time: 14_892_000 picoseconds. - Weight::from_parts(15_238_000, 0) + // Minimum execution time: 12_753_000 picoseconds. + Weight::from_parts(13_307_000, 0) .saturating_add(Weight::from_parts(0, 3086)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -110,8 +110,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `97` // Estimated: `3086` - // Minimum execution time: 20_368_000 picoseconds. - Weight::from_parts(20_675_000, 0) + // Minimum execution time: 17_994_000 picoseconds. + Weight::from_parts(18_679_000, 0) .saturating_add(Weight::from_parts(0, 3086)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) @@ -130,8 +130,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `138` // Estimated: `4764` - // Minimum execution time: 38_020_000 picoseconds. - Weight::from_parts(38_509_000, 0) + // Minimum execution time: 34_147_000 picoseconds. + Weight::from_parts(35_227_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) @@ -148,8 +148,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `158` // Estimated: `4764` - // Minimum execution time: 38_720_000 picoseconds. - Weight::from_parts(39_343_000, 0) + // Minimum execution time: 34_680_000 picoseconds. + Weight::from_parts(35_740_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -166,8 +166,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `158` // Estimated: `4764` - // Minimum execution time: 35_583_000 picoseconds. - Weight::from_parts(35_990_000, 0) + // Minimum execution time: 31_887_000 picoseconds. + Weight::from_parts(32_985_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -185,11 +185,11 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `190` // Estimated: `4764` - // Minimum execution time: 38_158_000 picoseconds. - Weight::from_parts(40_394_137, 0) + // Minimum execution time: 34_447_000 picoseconds. + Weight::from_parts(36_143_598, 0) .saturating_add(Weight::from_parts(0, 4764)) - // Standard Error: 5_223 - .saturating_add(Weight::from_parts(92_010, 0).saturating_mul(x.into())) + // Standard Error: 868 + .saturating_add(Weight::from_parts(90_754, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -205,8 +205,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `200` // Estimated: `4764` - // Minimum execution time: 35_034_000 picoseconds. - Weight::from_parts(35_760_000, 0) + // Minimum execution time: 31_483_000 picoseconds. + Weight::from_parts(32_586_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -229,8 +229,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `274` // Estimated: `4764` - // Minimum execution time: 52_917_000 picoseconds. - Weight::from_parts(53_368_000, 0) + // Minimum execution time: 46_856_000 picoseconds. + Weight::from_parts(48_211_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) @@ -253,8 +253,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `459` // Estimated: `4764` - // Minimum execution time: 57_250_000 picoseconds. - Weight::from_parts(59_104_000, 0) + // Minimum execution time: 51_552_000 picoseconds. + Weight::from_parts(52_941_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) @@ -274,11 +274,11 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `541` // Estimated: `4764` - // Minimum execution time: 56_364_000 picoseconds. - Weight::from_parts(55_482_121, 0) + // Minimum execution time: 52_116_000 picoseconds. + Weight::from_parts(51_542_475, 0) .saturating_add(Weight::from_parts(0, 4764)) - // Standard Error: 3_957 - .saturating_add(Weight::from_parts(1_941_267, 0).saturating_mul(x.into())) + // Standard Error: 979 + .saturating_add(Weight::from_parts(1_751_862, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -295,11 +295,11 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `519` // Estimated: `4764` - // Minimum execution time: 53_777_000 picoseconds. - Weight::from_parts(52_564_857, 0) + // Minimum execution time: 49_378_000 picoseconds. + Weight::from_parts(48_921_221, 0) .saturating_add(Weight::from_parts(0, 4764)) - // Standard Error: 7_719 - .saturating_add(Weight::from_parts(1_981_413, 0).saturating_mul(x.into())) + // Standard Error: 1_133 + .saturating_add(Weight::from_parts(1_754_524, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -313,8 +313,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `275` // Estimated: `3775` - // Minimum execution time: 44_969_000 picoseconds. - Weight::from_parts(45_458_000, 0) + // Minimum execution time: 40_765_000 picoseconds. + Weight::from_parts(41_828_000, 0) .saturating_add(Weight::from_parts(0, 3775)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -327,8 +327,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `647` // Estimated: `5113` - // Minimum execution time: 29_381_000 picoseconds. - Weight::from_parts(30_312_000, 0) + // Minimum execution time: 27_256_000 picoseconds. + Weight::from_parts(28_033_000, 0) .saturating_add(Weight::from_parts(0, 5113)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -349,8 +349,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `322` // Estimated: `4764` - // Minimum execution time: 48_616_000 picoseconds. - Weight::from_parts(49_290_000, 0) + // Minimum execution time: 43_128_000 picoseconds. + Weight::from_parts(44_330_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) @@ -368,11 +368,11 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `257 + x * (73 ±0)` // Estimated: `4764 + x * (2653 ±0)` - // Minimum execution time: 46_102_000 picoseconds. - Weight::from_parts(43_349_342, 0) + // Minimum execution time: 42_191_000 picoseconds. + Weight::from_parts(38_858_025, 0) .saturating_add(Weight::from_parts(0, 4764)) - // Standard Error: 11_849 - .saturating_add(Weight::from_parts(6_251_196, 0).saturating_mul(x.into())) + // Standard Error: 2_874 + .saturating_add(Weight::from_parts(5_718_078, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(x.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -385,8 +385,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `1486` - // Minimum execution time: 11_945_000 picoseconds. - Weight::from_parts(12_232_000, 0) + // Minimum execution time: 10_345_000 picoseconds. + Weight::from_parts(10_855_000, 0) .saturating_add(Weight::from_parts(0, 1486)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -408,8 +408,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `553` // Estimated: `6296` - // Minimum execution time: 91_271_000 picoseconds. - Weight::from_parts(91_921_000, 0) + // Minimum execution time: 81_681_000 picoseconds. + Weight::from_parts(83_670_000, 0) .saturating_add(Weight::from_parts(0, 6296)) .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(7)) @@ -432,8 +432,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `419` // Estimated: `6296` - // Minimum execution time: 82_417_000 picoseconds. - Weight::from_parts(83_201_000, 0) + // Minimum execution time: 73_364_000 picoseconds. + Weight::from_parts(75_276_000, 0) .saturating_add(Weight::from_parts(0, 6296)) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(6)) @@ -444,18 +444,16 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh /// Proof: `DappStaking::EraRewards` (`max_values`: None, `max_size`: Some(789), added: 3264, mode: `MaxEncodedLen`) /// Storage: `DappStaking::StaticTierParams` (r:1 w:0) /// Proof: `DappStaking::StaticTierParams` (`max_values`: Some(1), `max_size`: Some(120), added: 615, mode: `MaxEncodedLen`) - /// Storage: `PriceAggregator::ValuesCircularBuffer` (r:1 w:0) - /// Proof: `PriceAggregator::ValuesCircularBuffer` (`max_values`: Some(1), `max_size`: Some(117), added: 612, mode: `MaxEncodedLen`) /// Storage: `DappStaking::TierConfig` (r:1 w:1) /// Proof: `DappStaking::TierConfig` (`max_values`: Some(1), `max_size`: Some(91), added: 586, mode: `MaxEncodedLen`) fn on_initialize_voting_to_build_and_earn() -> Weight { // Proof Size summary in bytes: - // Measured: `217` + // Measured: `213` // Estimated: `4254` - // Minimum execution time: 26_079_000 picoseconds. - Weight::from_parts(26_756_000, 0) + // Minimum execution time: 21_348_000 picoseconds. + Weight::from_parts(21_956_000, 0) .saturating_add(Weight::from_parts(0, 4254)) - .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `DappStaking::CurrentEraInfo` (r:1 w:1) @@ -468,20 +466,18 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh /// Proof: `DappStaking::EraRewards` (`max_values`: None, `max_size`: Some(789), added: 3264, mode: `MaxEncodedLen`) /// Storage: `DappStaking::StaticTierParams` (r:1 w:0) /// Proof: `DappStaking::StaticTierParams` (`max_values`: Some(1), `max_size`: Some(120), added: 615, mode: `MaxEncodedLen`) - /// Storage: `PriceAggregator::ValuesCircularBuffer` (r:1 w:0) - /// Proof: `PriceAggregator::ValuesCircularBuffer` (`max_values`: Some(1), `max_size`: Some(117), added: 612, mode: `MaxEncodedLen`) /// Storage: `DappStaking::TierConfig` (r:1 w:1) /// Proof: `DappStaking::TierConfig` (`max_values`: Some(1), `max_size`: Some(91), added: 586, mode: `MaxEncodedLen`) /// Storage: `DappStaking::DAppTiers` (r:0 w:1) /// Proof: `DappStaking::DAppTiers` (`max_values`: None, `max_size`: Some(1648), added: 4123, mode: `MaxEncodedLen`) fn on_initialize_build_and_earn_to_voting() -> Weight { // Proof Size summary in bytes: - // Measured: `783` + // Measured: `779` // Estimated: `4254` - // Minimum execution time: 49_334_000 picoseconds. - Weight::from_parts(50_631_000, 0) + // Minimum execution time: 41_155_000 picoseconds. + Weight::from_parts(42_399_000, 0) .saturating_add(Weight::from_parts(0, 4254)) - .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(7)) } /// Storage: `DappStaking::CurrentEraInfo` (r:1 w:1) @@ -490,20 +486,18 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh /// Proof: `DappStaking::EraRewards` (`max_values`: None, `max_size`: Some(789), added: 3264, mode: `MaxEncodedLen`) /// Storage: `DappStaking::StaticTierParams` (r:1 w:0) /// Proof: `DappStaking::StaticTierParams` (`max_values`: Some(1), `max_size`: Some(120), added: 615, mode: `MaxEncodedLen`) - /// Storage: `PriceAggregator::ValuesCircularBuffer` (r:1 w:0) - /// Proof: `PriceAggregator::ValuesCircularBuffer` (`max_values`: Some(1), `max_size`: Some(117), added: 612, mode: `MaxEncodedLen`) /// Storage: `DappStaking::TierConfig` (r:1 w:1) /// Proof: `DappStaking::TierConfig` (`max_values`: Some(1), `max_size`: Some(91), added: 586, mode: `MaxEncodedLen`) /// Storage: `DappStaking::DAppTiers` (r:0 w:1) /// Proof: `DappStaking::DAppTiers` (`max_values`: None, `max_size`: Some(1648), added: 4123, mode: `MaxEncodedLen`) fn on_initialize_build_and_earn_to_build_and_earn() -> Weight { // Proof Size summary in bytes: - // Measured: `269` + // Measured: `265` // Estimated: `4254` - // Minimum execution time: 30_195_000 picoseconds. - Weight::from_parts(30_873_000, 0) + // Minimum execution time: 24_762_000 picoseconds. + Weight::from_parts(25_494_000, 0) .saturating_add(Weight::from_parts(0, 4254)) - .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `DappStaking::ContractStake` (r:17 w:0) @@ -517,11 +511,11 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `210 + x * (33 ±0)` // Estimated: `3061 + x * (2071 ±0)` - // Minimum execution time: 10_336_000 picoseconds. - Weight::from_parts(14_531_778, 0) + // Minimum execution time: 9_233_000 picoseconds. + Weight::from_parts(13_191_932, 0) .saturating_add(Weight::from_parts(0, 3061)) - // Standard Error: 16_087 - .saturating_add(Weight::from_parts(3_114_631, 0).saturating_mul(x.into())) + // Standard Error: 4_023 + .saturating_add(Weight::from_parts(2_815_802, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(x.into()))) .saturating_add(Weight::from_parts(0, 2071).saturating_mul(x.into())) @@ -536,8 +530,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `293` // Estimated: `4254` - // Minimum execution time: 9_785_000 picoseconds. - Weight::from_parts(10_057_000, 0) + // Minimum execution time: 8_598_000 picoseconds. + Weight::from_parts(9_075_000, 0) .saturating_add(Weight::from_parts(0, 4254)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) @@ -548,8 +542,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_291_000 picoseconds. - Weight::from_parts(10_454_000, 0) + // Minimum execution time: 9_159_000 picoseconds. + Weight::from_parts(9_628_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/shibuya/src/weights/pallet_dapp_staking.rs b/runtime/shibuya/src/weights/pallet_dapp_staking.rs index 9fcb2939c..9a017bfd9 100644 --- a/runtime/shibuya/src/weights/pallet_dapp_staking.rs +++ b/runtime/shibuya/src/weights/pallet_dapp_staking.rs @@ -20,7 +20,7 @@ //! Autogenerated weights for `pallet_dapp_staking` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2026-02-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-02-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `gh-runner-01-ovh`, CPU: `Intel(R) Xeon(R) E-2236 CPU @ 3.40GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 @@ -56,8 +56,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_218_000 picoseconds. - Weight::from_parts(8_408_000, 0) + // Minimum execution time: 7_179_000 picoseconds. + Weight::from_parts(7_619_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `DappStaking::IntegratedDApps` (r:1 w:1) @@ -70,8 +70,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `3086` - // Minimum execution time: 16_500_000 picoseconds. - Weight::from_parts(16_772_000, 0) + // Minimum execution time: 14_628_000 picoseconds. + Weight::from_parts(15_365_000, 0) .saturating_add(Weight::from_parts(0, 3086)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -82,8 +82,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `97` // Estimated: `3086` - // Minimum execution time: 14_766_000 picoseconds. - Weight::from_parts(14_967_000, 0) + // Minimum execution time: 12_571_000 picoseconds. + Weight::from_parts(13_169_000, 0) .saturating_add(Weight::from_parts(0, 3086)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -94,8 +94,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `97` // Estimated: `3086` - // Minimum execution time: 14_077_000 picoseconds. - Weight::from_parts(14_713_000, 0) + // Minimum execution time: 12_703_000 picoseconds. + Weight::from_parts(13_355_000, 0) .saturating_add(Weight::from_parts(0, 3086)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -110,8 +110,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `97` // Estimated: `3086` - // Minimum execution time: 20_011_000 picoseconds. - Weight::from_parts(20_465_000, 0) + // Minimum execution time: 17_750_000 picoseconds. + Weight::from_parts(18_433_000, 0) .saturating_add(Weight::from_parts(0, 3086)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) @@ -130,8 +130,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `138` // Estimated: `4764` - // Minimum execution time: 38_183_000 picoseconds. - Weight::from_parts(38_650_000, 0) + // Minimum execution time: 33_998_000 picoseconds. + Weight::from_parts(35_003_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) @@ -148,8 +148,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `156` // Estimated: `4764` - // Minimum execution time: 39_542_000 picoseconds. - Weight::from_parts(40_046_000, 0) + // Minimum execution time: 34_280_000 picoseconds. + Weight::from_parts(35_279_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -166,8 +166,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `156` // Estimated: `4764` - // Minimum execution time: 35_821_000 picoseconds. - Weight::from_parts(36_591_000, 0) + // Minimum execution time: 31_496_000 picoseconds. + Weight::from_parts(32_547_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -185,11 +185,11 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `187` // Estimated: `4764` - // Minimum execution time: 38_015_000 picoseconds. - Weight::from_parts(40_043_292, 0) + // Minimum execution time: 33_853_000 picoseconds. + Weight::from_parts(35_632_069, 0) .saturating_add(Weight::from_parts(0, 4764)) - // Standard Error: 9_733 - .saturating_add(Weight::from_parts(252_507, 0).saturating_mul(x.into())) + // Standard Error: 1_675 + .saturating_add(Weight::from_parts(119_045, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -205,8 +205,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `182` // Estimated: `4764` - // Minimum execution time: 35_172_000 picoseconds. - Weight::from_parts(35_870_000, 0) + // Minimum execution time: 31_052_000 picoseconds. + Weight::from_parts(32_100_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -229,8 +229,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `272` // Estimated: `4764` - // Minimum execution time: 53_682_000 picoseconds. - Weight::from_parts(54_348_000, 0) + // Minimum execution time: 46_197_000 picoseconds. + Weight::from_parts(47_359_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) @@ -253,8 +253,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `453` // Estimated: `4764` - // Minimum execution time: 58_426_000 picoseconds. - Weight::from_parts(59_415_000, 0) + // Minimum execution time: 50_174_000 picoseconds. + Weight::from_parts(51_621_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) @@ -274,11 +274,11 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `522` // Estimated: `4764` - // Minimum execution time: 56_624_000 picoseconds. - Weight::from_parts(55_677_682, 0) + // Minimum execution time: 50_804_000 picoseconds. + Weight::from_parts(50_229_112, 0) .saturating_add(Weight::from_parts(0, 4764)) - // Standard Error: 5_007 - .saturating_add(Weight::from_parts(1_950_486, 0).saturating_mul(x.into())) + // Standard Error: 1_227 + .saturating_add(Weight::from_parts(1_721_753, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -295,11 +295,11 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `501` // Estimated: `4764` - // Minimum execution time: 52_994_000 picoseconds. - Weight::from_parts(52_316_116, 0) + // Minimum execution time: 48_112_000 picoseconds. + Weight::from_parts(47_598_326, 0) .saturating_add(Weight::from_parts(0, 4764)) - // Standard Error: 6_182 - .saturating_add(Weight::from_parts(1_999_131, 0).saturating_mul(x.into())) + // Standard Error: 1_268 + .saturating_add(Weight::from_parts(1_728_531, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -313,8 +313,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `271` // Estimated: `3775` - // Minimum execution time: 45_018_000 picoseconds. - Weight::from_parts(45_523_000, 0) + // Minimum execution time: 40_003_000 picoseconds. + Weight::from_parts(41_020_000, 0) .saturating_add(Weight::from_parts(0, 3775)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -327,8 +327,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `647` // Estimated: `5113` - // Minimum execution time: 29_934_000 picoseconds. - Weight::from_parts(30_849_000, 0) + // Minimum execution time: 26_638_000 picoseconds. + Weight::from_parts(27_401_000, 0) .saturating_add(Weight::from_parts(0, 5113)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -349,8 +349,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `317` // Estimated: `4764` - // Minimum execution time: 48_491_000 picoseconds. - Weight::from_parts(49_049_000, 0) + // Minimum execution time: 42_014_000 picoseconds. + Weight::from_parts(43_225_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) @@ -368,11 +368,11 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `255 + x * (73 ±0)` // Estimated: `4764 + x * (2653 ±0)` - // Minimum execution time: 45_909_000 picoseconds. - Weight::from_parts(42_688_809, 0) + // Minimum execution time: 41_916_000 picoseconds. + Weight::from_parts(38_121_351, 0) .saturating_add(Weight::from_parts(0, 4764)) - // Standard Error: 25_553 - .saturating_add(Weight::from_parts(6_474_373, 0).saturating_mul(x.into())) + // Standard Error: 4_913 + .saturating_add(Weight::from_parts(5_802_046, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(x.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -385,8 +385,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `1486` - // Minimum execution time: 11_725_000 picoseconds. - Weight::from_parts(11_947_000, 0) + // Minimum execution time: 10_168_000 picoseconds. + Weight::from_parts(10_691_000, 0) .saturating_add(Weight::from_parts(0, 1486)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -408,8 +408,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `547` // Estimated: `6296` - // Minimum execution time: 91_825_000 picoseconds. - Weight::from_parts(93_938_000, 0) + // Minimum execution time: 79_354_000 picoseconds. + Weight::from_parts(81_216_000, 0) .saturating_add(Weight::from_parts(0, 6296)) .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(7)) @@ -432,8 +432,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `414` // Estimated: `6296` - // Minimum execution time: 82_364_000 picoseconds. - Weight::from_parts(83_002_000, 0) + // Minimum execution time: 71_835_000 picoseconds. + Weight::from_parts(73_502_000, 0) .saturating_add(Weight::from_parts(0, 6296)) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(6)) @@ -444,18 +444,16 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh /// Proof: `DappStaking::EraRewards` (`max_values`: None, `max_size`: Some(789), added: 3264, mode: `MaxEncodedLen`) /// Storage: `DappStaking::StaticTierParams` (r:1 w:0) /// Proof: `DappStaking::StaticTierParams` (`max_values`: Some(1), `max_size`: Some(120), added: 615, mode: `MaxEncodedLen`) - /// Storage: `PriceAggregator::ValuesCircularBuffer` (r:1 w:0) - /// Proof: `PriceAggregator::ValuesCircularBuffer` (`max_values`: Some(1), `max_size`: Some(117), added: 612, mode: `MaxEncodedLen`) /// Storage: `DappStaking::TierConfig` (r:1 w:1) /// Proof: `DappStaking::TierConfig` (`max_values`: Some(1), `max_size`: Some(91), added: 586, mode: `MaxEncodedLen`) fn on_initialize_voting_to_build_and_earn() -> Weight { // Proof Size summary in bytes: - // Measured: `217` + // Measured: `213` // Estimated: `4254` - // Minimum execution time: 26_215_000 picoseconds. - Weight::from_parts(26_804_000, 0) + // Minimum execution time: 20_853_000 picoseconds. + Weight::from_parts(21_488_000, 0) .saturating_add(Weight::from_parts(0, 4254)) - .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `DappStaking::CurrentEraInfo` (r:1 w:1) @@ -468,20 +466,18 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh /// Proof: `DappStaking::EraRewards` (`max_values`: None, `max_size`: Some(789), added: 3264, mode: `MaxEncodedLen`) /// Storage: `DappStaking::StaticTierParams` (r:1 w:0) /// Proof: `DappStaking::StaticTierParams` (`max_values`: Some(1), `max_size`: Some(120), added: 615, mode: `MaxEncodedLen`) - /// Storage: `PriceAggregator::ValuesCircularBuffer` (r:1 w:0) - /// Proof: `PriceAggregator::ValuesCircularBuffer` (`max_values`: Some(1), `max_size`: Some(117), added: 612, mode: `MaxEncodedLen`) /// Storage: `DappStaking::TierConfig` (r:1 w:1) /// Proof: `DappStaking::TierConfig` (`max_values`: Some(1), `max_size`: Some(91), added: 586, mode: `MaxEncodedLen`) /// Storage: `DappStaking::DAppTiers` (r:0 w:1) /// Proof: `DappStaking::DAppTiers` (`max_values`: None, `max_size`: Some(1648), added: 4123, mode: `MaxEncodedLen`) fn on_initialize_build_and_earn_to_voting() -> Weight { // Proof Size summary in bytes: - // Measured: `319` + // Measured: `315` // Estimated: `4254` - // Minimum execution time: 43_593_000 picoseconds. - Weight::from_parts(44_523_000, 0) + // Minimum execution time: 35_318_000 picoseconds. + Weight::from_parts(36_096_000, 0) .saturating_add(Weight::from_parts(0, 4254)) - .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(7)) } /// Storage: `DappStaking::CurrentEraInfo` (r:1 w:1) @@ -490,20 +486,18 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh /// Proof: `DappStaking::EraRewards` (`max_values`: None, `max_size`: Some(789), added: 3264, mode: `MaxEncodedLen`) /// Storage: `DappStaking::StaticTierParams` (r:1 w:0) /// Proof: `DappStaking::StaticTierParams` (`max_values`: Some(1), `max_size`: Some(120), added: 615, mode: `MaxEncodedLen`) - /// Storage: `PriceAggregator::ValuesCircularBuffer` (r:1 w:0) - /// Proof: `PriceAggregator::ValuesCircularBuffer` (`max_values`: Some(1), `max_size`: Some(117), added: 612, mode: `MaxEncodedLen`) /// Storage: `DappStaking::TierConfig` (r:1 w:1) /// Proof: `DappStaking::TierConfig` (`max_values`: Some(1), `max_size`: Some(91), added: 586, mode: `MaxEncodedLen`) /// Storage: `DappStaking::DAppTiers` (r:0 w:1) /// Proof: `DappStaking::DAppTiers` (`max_values`: None, `max_size`: Some(1648), added: 4123, mode: `MaxEncodedLen`) fn on_initialize_build_and_earn_to_build_and_earn() -> Weight { // Proof Size summary in bytes: - // Measured: `271` + // Measured: `267` // Estimated: `4254` - // Minimum execution time: 30_321_000 picoseconds. - Weight::from_parts(30_746_000, 0) + // Minimum execution time: 24_798_000 picoseconds. + Weight::from_parts(25_452_000, 0) .saturating_add(Weight::from_parts(0, 4254)) - .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `DappStaking::ContractStake` (r:17 w:0) @@ -517,11 +511,11 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `210 + x * (33 ±0)` // Estimated: `3061 + x * (2071 ±0)` - // Minimum execution time: 10_351_000 picoseconds. - Weight::from_parts(14_594_020, 0) + // Minimum execution time: 9_172_000 picoseconds. + Weight::from_parts(12_911_154, 0) .saturating_add(Weight::from_parts(0, 3061)) - // Standard Error: 16_557 - .saturating_add(Weight::from_parts(3_096_286, 0).saturating_mul(x.into())) + // Standard Error: 3_966 + .saturating_add(Weight::from_parts(2_799_421, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(x.into()))) .saturating_add(Weight::from_parts(0, 2071).saturating_mul(x.into())) @@ -536,8 +530,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `293` // Estimated: `4254` - // Minimum execution time: 10_116_000 picoseconds. - Weight::from_parts(10_358_000, 0) + // Minimum execution time: 8_742_000 picoseconds. + Weight::from_parts(9_223_000, 0) .saturating_add(Weight::from_parts(0, 4254)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) @@ -548,8 +542,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_305_000 picoseconds. - Weight::from_parts(10_688_000, 0) + // Minimum execution time: 8_955_000 picoseconds. + Weight::from_parts(9_456_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/shiden/src/lib.rs b/runtime/shiden/src/lib.rs index f113252f2..59d0d3ad3 100644 --- a/runtime/shiden/src/lib.rs +++ b/runtime/shiden/src/lib.rs @@ -85,7 +85,7 @@ use xcm_runtime_apis::{ use astar_primitives::{ dapp_staking::{ AccountCheck as DappStakingAccountCheck, CycleConfiguration, DAppId, EraNumber, - PeriodNumber, RankedTier, SmartContract, FIXED_NUMBER_OF_TIER_SLOTS + PeriodNumber, RankedTier, SmartContract, FIXED_NUMBER_OF_TIER_SLOTS, }, evm::{EVMFungibleAdapterWrapper, EvmRevertCodeHandler}, governance::OracleMembershipInst, diff --git a/runtime/shiden/src/weights/pallet_dapp_staking.rs b/runtime/shiden/src/weights/pallet_dapp_staking.rs index ab99285af..e2c42f595 100644 --- a/runtime/shiden/src/weights/pallet_dapp_staking.rs +++ b/runtime/shiden/src/weights/pallet_dapp_staking.rs @@ -20,7 +20,7 @@ //! Autogenerated weights for `pallet_dapp_staking` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2026-02-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-02-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `gh-runner-01-ovh`, CPU: `Intel(R) Xeon(R) E-2236 CPU @ 3.40GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 @@ -56,8 +56,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_280_000 picoseconds. - Weight::from_parts(8_456_000, 0) + // Minimum execution time: 7_254_000 picoseconds. + Weight::from_parts(7_662_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `DappStaking::IntegratedDApps` (r:1 w:1) @@ -70,8 +70,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `3086` - // Minimum execution time: 16_622_000 picoseconds. - Weight::from_parts(16_904_000, 0) + // Minimum execution time: 14_855_000 picoseconds. + Weight::from_parts(15_510_000, 0) .saturating_add(Weight::from_parts(0, 3086)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -82,8 +82,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `97` // Estimated: `3086` - // Minimum execution time: 14_462_000 picoseconds. - Weight::from_parts(14_739_000, 0) + // Minimum execution time: 12_693_000 picoseconds. + Weight::from_parts(13_292_000, 0) .saturating_add(Weight::from_parts(0, 3086)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -94,8 +94,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `97` // Estimated: `3086` - // Minimum execution time: 14_468_000 picoseconds. - Weight::from_parts(14_671_000, 0) + // Minimum execution time: 12_741_000 picoseconds. + Weight::from_parts(13_319_000, 0) .saturating_add(Weight::from_parts(0, 3086)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -110,8 +110,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `97` // Estimated: `3086` - // Minimum execution time: 20_495_000 picoseconds. - Weight::from_parts(20_964_000, 0) + // Minimum execution time: 17_847_000 picoseconds. + Weight::from_parts(18_664_000, 0) .saturating_add(Weight::from_parts(0, 3086)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) @@ -130,8 +130,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `138` // Estimated: `4764` - // Minimum execution time: 38_428_000 picoseconds. - Weight::from_parts(38_798_000, 0) + // Minimum execution time: 33_608_000 picoseconds. + Weight::from_parts(34_732_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) @@ -148,8 +148,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `158` // Estimated: `4764` - // Minimum execution time: 38_829_000 picoseconds. - Weight::from_parts(39_266_000, 0) + // Minimum execution time: 34_202_000 picoseconds. + Weight::from_parts(35_224_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -166,8 +166,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `158` // Estimated: `4764` - // Minimum execution time: 35_863_000 picoseconds. - Weight::from_parts(36_365_000, 0) + // Minimum execution time: 31_835_000 picoseconds. + Weight::from_parts(32_848_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -185,11 +185,11 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `189` // Estimated: `4764` - // Minimum execution time: 38_247_000 picoseconds. - Weight::from_parts(40_280_703, 0) + // Minimum execution time: 34_159_000 picoseconds. + Weight::from_parts(36_062_143, 0) .saturating_add(Weight::from_parts(0, 4764)) - // Standard Error: 5_227 - .saturating_add(Weight::from_parts(125_927, 0).saturating_mul(x.into())) + // Standard Error: 836 + .saturating_add(Weight::from_parts(90_006, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -205,8 +205,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `200` // Estimated: `4764` - // Minimum execution time: 35_717_000 picoseconds. - Weight::from_parts(36_019_000, 0) + // Minimum execution time: 31_942_000 picoseconds. + Weight::from_parts(33_052_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -229,8 +229,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `274` // Estimated: `4764` - // Minimum execution time: 52_590_000 picoseconds. - Weight::from_parts(53_038_000, 0) + // Minimum execution time: 46_358_000 picoseconds. + Weight::from_parts(47_727_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) @@ -253,8 +253,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `459` // Estimated: `4764` - // Minimum execution time: 57_593_000 picoseconds. - Weight::from_parts(58_246_000, 0) + // Minimum execution time: 51_168_000 picoseconds. + Weight::from_parts(52_639_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) @@ -274,11 +274,11 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `542` // Estimated: `4764` - // Minimum execution time: 56_652_000 picoseconds. - Weight::from_parts(55_962_135, 0) + // Minimum execution time: 51_583_000 picoseconds. + Weight::from_parts(51_445_882, 0) .saturating_add(Weight::from_parts(0, 4764)) - // Standard Error: 5_616 - .saturating_add(Weight::from_parts(1_951_061, 0).saturating_mul(x.into())) + // Standard Error: 1_346 + .saturating_add(Weight::from_parts(1_727_992, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -295,11 +295,11 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `519` // Estimated: `4764` - // Minimum execution time: 54_015_000 picoseconds. - Weight::from_parts(52_814_143, 0) + // Minimum execution time: 48_526_000 picoseconds. + Weight::from_parts(48_155_882, 0) .saturating_add(Weight::from_parts(0, 4764)) - // Standard Error: 4_824 - .saturating_add(Weight::from_parts(1_967_369, 0).saturating_mul(x.into())) + // Standard Error: 1_359 + .saturating_add(Weight::from_parts(1_763_806, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -313,8 +313,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `276` // Estimated: `3775` - // Minimum execution time: 44_776_000 picoseconds. - Weight::from_parts(45_395_000, 0) + // Minimum execution time: 40_253_000 picoseconds. + Weight::from_parts(41_354_000, 0) .saturating_add(Weight::from_parts(0, 3775)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -327,8 +327,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `647` // Estimated: `5113` - // Minimum execution time: 29_711_000 picoseconds. - Weight::from_parts(30_057_000, 0) + // Minimum execution time: 27_223_000 picoseconds. + Weight::from_parts(27_990_000, 0) .saturating_add(Weight::from_parts(0, 5113)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -349,8 +349,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `322` // Estimated: `4764` - // Minimum execution time: 48_660_000 picoseconds. - Weight::from_parts(49_341_000, 0) + // Minimum execution time: 42_575_000 picoseconds. + Weight::from_parts(43_833_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) @@ -368,11 +368,11 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `256 + x * (73 ±0)` // Estimated: `4764 + x * (2653 ±0)` - // Minimum execution time: 46_407_000 picoseconds. - Weight::from_parts(43_255_547, 0) + // Minimum execution time: 42_707_000 picoseconds. + Weight::from_parts(39_526_209, 0) .saturating_add(Weight::from_parts(0, 4764)) - // Standard Error: 12_717 - .saturating_add(Weight::from_parts(6_228_978, 0).saturating_mul(x.into())) + // Standard Error: 3_170 + .saturating_add(Weight::from_parts(5_598_034, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(x.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -385,8 +385,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `1486` - // Minimum execution time: 11_856_000 picoseconds. - Weight::from_parts(11_948_000, 0) + // Minimum execution time: 10_390_000 picoseconds. + Weight::from_parts(10_934_000, 0) .saturating_add(Weight::from_parts(0, 1486)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -408,8 +408,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `553` // Estimated: `6296` - // Minimum execution time: 91_206_000 picoseconds. - Weight::from_parts(93_356_000, 0) + // Minimum execution time: 80_640_000 picoseconds. + Weight::from_parts(82_636_000, 0) .saturating_add(Weight::from_parts(0, 6296)) .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(7)) @@ -432,8 +432,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `419` // Estimated: `6296` - // Minimum execution time: 81_729_000 picoseconds. - Weight::from_parts(82_562_000, 0) + // Minimum execution time: 72_933_000 picoseconds. + Weight::from_parts(74_552_000, 0) .saturating_add(Weight::from_parts(0, 6296)) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(6)) @@ -444,18 +444,16 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh /// Proof: `DappStaking::EraRewards` (`max_values`: None, `max_size`: Some(789), added: 3264, mode: `MaxEncodedLen`) /// Storage: `DappStaking::StaticTierParams` (r:1 w:0) /// Proof: `DappStaking::StaticTierParams` (`max_values`: Some(1), `max_size`: Some(120), added: 615, mode: `MaxEncodedLen`) - /// Storage: `PriceAggregator::ValuesCircularBuffer` (r:1 w:0) - /// Proof: `PriceAggregator::ValuesCircularBuffer` (`max_values`: Some(1), `max_size`: Some(117), added: 612, mode: `MaxEncodedLen`) /// Storage: `DappStaking::TierConfig` (r:1 w:1) /// Proof: `DappStaking::TierConfig` (`max_values`: Some(1), `max_size`: Some(91), added: 586, mode: `MaxEncodedLen`) fn on_initialize_voting_to_build_and_earn() -> Weight { // Proof Size summary in bytes: - // Measured: `217` + // Measured: `213` // Estimated: `4254` - // Minimum execution time: 25_962_000 picoseconds. - Weight::from_parts(26_436_000, 0) + // Minimum execution time: 21_215_000 picoseconds. + Weight::from_parts(21_796_000, 0) .saturating_add(Weight::from_parts(0, 4254)) - .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `DappStaking::CurrentEraInfo` (r:1 w:1) @@ -468,20 +466,18 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh /// Proof: `DappStaking::EraRewards` (`max_values`: None, `max_size`: Some(789), added: 3264, mode: `MaxEncodedLen`) /// Storage: `DappStaking::StaticTierParams` (r:1 w:0) /// Proof: `DappStaking::StaticTierParams` (`max_values`: Some(1), `max_size`: Some(120), added: 615, mode: `MaxEncodedLen`) - /// Storage: `PriceAggregator::ValuesCircularBuffer` (r:1 w:0) - /// Proof: `PriceAggregator::ValuesCircularBuffer` (`max_values`: Some(1), `max_size`: Some(117), added: 612, mode: `MaxEncodedLen`) /// Storage: `DappStaking::TierConfig` (r:1 w:1) /// Proof: `DappStaking::TierConfig` (`max_values`: Some(1), `max_size`: Some(91), added: 586, mode: `MaxEncodedLen`) /// Storage: `DappStaking::DAppTiers` (r:0 w:1) /// Proof: `DappStaking::DAppTiers` (`max_values`: None, `max_size`: Some(1648), added: 4123, mode: `MaxEncodedLen`) fn on_initialize_build_and_earn_to_voting() -> Weight { // Proof Size summary in bytes: - // Measured: `872` + // Measured: `868` // Estimated: `4254` - // Minimum execution time: 50_891_000 picoseconds. - Weight::from_parts(51_993_000, 0) + // Minimum execution time: 42_268_000 picoseconds. + Weight::from_parts(43_025_000, 0) .saturating_add(Weight::from_parts(0, 4254)) - .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(7)) } /// Storage: `DappStaking::CurrentEraInfo` (r:1 w:1) @@ -490,20 +486,18 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh /// Proof: `DappStaking::EraRewards` (`max_values`: None, `max_size`: Some(789), added: 3264, mode: `MaxEncodedLen`) /// Storage: `DappStaking::StaticTierParams` (r:1 w:0) /// Proof: `DappStaking::StaticTierParams` (`max_values`: Some(1), `max_size`: Some(120), added: 615, mode: `MaxEncodedLen`) - /// Storage: `PriceAggregator::ValuesCircularBuffer` (r:1 w:0) - /// Proof: `PriceAggregator::ValuesCircularBuffer` (`max_values`: Some(1), `max_size`: Some(117), added: 612, mode: `MaxEncodedLen`) /// Storage: `DappStaking::TierConfig` (r:1 w:1) /// Proof: `DappStaking::TierConfig` (`max_values`: Some(1), `max_size`: Some(91), added: 586, mode: `MaxEncodedLen`) /// Storage: `DappStaking::DAppTiers` (r:0 w:1) /// Proof: `DappStaking::DAppTiers` (`max_values`: None, `max_size`: Some(1648), added: 4123, mode: `MaxEncodedLen`) fn on_initialize_build_and_earn_to_build_and_earn() -> Weight { // Proof Size summary in bytes: - // Measured: `271` + // Measured: `267` // Estimated: `4254` - // Minimum execution time: 29_688_000 picoseconds. - Weight::from_parts(30_217_000, 0) + // Minimum execution time: 24_941_000 picoseconds. + Weight::from_parts(25_530_000, 0) .saturating_add(Weight::from_parts(0, 4254)) - .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `DappStaking::ContractStake` (r:17 w:0) @@ -517,11 +511,11 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `210 + x * (33 ±0)` // Estimated: `3061 + x * (2071 ±0)` - // Minimum execution time: 10_061_000 picoseconds. - Weight::from_parts(14_133_143, 0) + // Minimum execution time: 9_228_000 picoseconds. + Weight::from_parts(12_950_088, 0) .saturating_add(Weight::from_parts(0, 3061)) - // Standard Error: 15_779 - .saturating_add(Weight::from_parts(3_146_293, 0).saturating_mul(x.into())) + // Standard Error: 4_020 + .saturating_add(Weight::from_parts(2_801_731, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(x.into()))) .saturating_add(Weight::from_parts(0, 2071).saturating_mul(x.into())) @@ -536,8 +530,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `293` // Estimated: `4254` - // Minimum execution time: 9_736_000 picoseconds. - Weight::from_parts(9_989_000, 0) + // Minimum execution time: 8_592_000 picoseconds. + Weight::from_parts(9_079_000, 0) .saturating_add(Weight::from_parts(0, 4254)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) @@ -548,8 +542,8 @@ impl pallet_dapp_staking::WeightInfo for SubstrateWeigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_985_000 picoseconds. - Weight::from_parts(10_242_000, 0) + // Minimum execution time: 9_151_000 picoseconds. + Weight::from_parts(9_654_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) }