Skip to content

Commit

Permalink
feat: restore old scehduler weights
Browse files Browse the repository at this point in the history
  • Loading branch information
lrazovic committed Mar 5, 2025
1 parent 6ce4f5b commit 0c19e33
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 106 deletions.
9 changes: 5 additions & 4 deletions pallets/funding/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ parameter_types! {
pub const ApprovalDeposit: Balance = EXISTENTIAL_DEPOSIT;

}

impl pallet_assets::Config<ContributionTokensInstance> for TestRuntime {
type ApprovalDeposit = ApprovalDeposit;
type AssetAccountDeposit = ZeroAssetAccountDeposit;
Expand All @@ -180,12 +181,14 @@ impl pallet_assets::Config<ContributionTokensInstance> for TestRuntime {

#[cfg(feature = "runtime-benchmarks")]
pub struct PalletAssetsBenchmarkHelper;

#[cfg(feature = "runtime-benchmarks")]
impl pallet_assets::BenchmarkHelper<Location> for PalletAssetsBenchmarkHelper {
fn create_asset_id_parameter(id: u32) -> Location {
(Parent, Parachain(id)).into()
}
}

impl pallet_assets::Config<ForeignAssetsInstance> for TestRuntime {
type ApprovalDeposit = ApprovalDeposit;
type AssetAccountDeposit = AssetAccountDeposit;
Expand All @@ -208,6 +211,7 @@ impl pallet_assets::Config<ForeignAssetsInstance> for TestRuntime {
type StringLimit = AssetsStringLimit;
type WeightInfo = ();
}

parameter_types! {
pub const BlockHashCount: u32 = 250;
}
Expand Down Expand Up @@ -281,10 +285,6 @@ parameter_types! {
pub const MinVestedTransfer: u64 = 256 * 2;
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
pub PolimecReceiverInfo: XcmPalletInfo = XcmPalletInfo::new(
51, "PolimecReceiver".into(), "polimec_receiver".into(), 0, 1, 0
).unwrap();
}

#[cfg(feature = "runtime-benchmarks")]
parameter_types! {
Expand Down Expand Up @@ -406,6 +406,7 @@ parameter_types! {
pub const FeeRecipient: AccountId = 80085;
pub const RootId: PalletId = PalletId(*b"treasury");
}

impl pallet_proxy_bonding::Config for TestRuntime {
type BondingToken = Balances;
type BondingTokenDecimals = ConstU8<PLMC_DECIMALS>;
Expand Down
62 changes: 13 additions & 49 deletions runtimes/polimec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use frame_support::{
fungible::{Credit, HoldConsideration, Inspect},
fungibles,
tokens::{self, ConversionToAssetBalance, PayFromAccount, UnityAssetBalanceConversion},
AsEnsureOriginWithArg, ConstU32, Contains, EitherOfDiverse, InstanceFilter, LinearStoragePrice, PrivilegeCmp,
AsEnsureOriginWithArg, ConstU32, EitherOfDiverse, Everything, InstanceFilter, LinearStoragePrice, PrivilegeCmp,
TransformOrigin,
},
weights::{ConstantMultiplier, Weight},
Expand Down Expand Up @@ -225,7 +225,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_version: 1_000_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 6,
transaction_version: 7,
state_version: 1,
};

Expand All @@ -240,39 +240,6 @@ parameter_types! {
pub const SS58Prefix: u16 = 41;
}

pub struct BaseCallFilter;
impl Contains<RuntimeCall> for BaseCallFilter {
fn contains(c: &RuntimeCall) -> bool {
match c {
RuntimeCall::Funding(call) => {
if cfg!(feature = "development-settings") {
true
} else {
matches!(
call,
pallet_funding::Call::create_project { .. }
| pallet_funding::Call::remove_project { .. }
| pallet_funding::Call::edit_project { .. }
| pallet_funding::Call::start_evaluation { .. }
| pallet_funding::Call::evaluate { .. }
| pallet_funding::Call::end_evaluation { .. }
| pallet_funding::Call::bid { .. }
| pallet_funding::Call::end_funding { .. }
| pallet_funding::Call::start_settlement { .. }
| pallet_funding::Call::settle_evaluation { .. }
| pallet_funding::Call::settle_bid { .. }
| pallet_funding::Call::mark_project_as_settled { .. }
| pallet_funding::Call::start_offchain_migration { .. }
| pallet_funding::Call::confirm_offchain_migration { .. }
| pallet_funding::Call::mark_project_ct_migration_as_finished { .. }
)
}
},
_ => true,
}
}
}

impl InstanceFilter<RuntimeCall> for Type {
fn filter(&self, c: &RuntimeCall) -> bool {
match self {
Expand Down Expand Up @@ -301,20 +268,17 @@ impl InstanceFilter<RuntimeCall> for Type {
),
proxy::Type::Governance => matches!(
c,
RuntimeCall::Treasury(..)
| RuntimeCall::Democracy(..)
| RuntimeCall::Council(..)
| RuntimeCall::TechnicalCommittee(..)
| RuntimeCall::Elections(..)
| RuntimeCall::Preimage(..)
| RuntimeCall::Scheduler(..)
RuntimeCall::Treasury(..) |
RuntimeCall::Democracy(..) |
RuntimeCall::Council(..) |
RuntimeCall::TechnicalCommittee(..) |
RuntimeCall::Elections(..) |
RuntimeCall::Preimage(..) |
RuntimeCall::Scheduler(..)
),
proxy::Type::Staking => {
matches!(c, RuntimeCall::ParachainStaking(..))
},
proxy::Type::IdentityJudgement => {
matches!(c, RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }))
},
proxy::Type::Staking => matches!(c, RuntimeCall::ParachainStaking(..)),
proxy::Type::IdentityJudgement =>
matches!(c, RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. })),
}
}

Expand All @@ -336,7 +300,7 @@ impl frame_system::Config for Runtime {
/// The identifier used to distinguish between accounts.
type AccountId = AccountId;
/// The basic call filter to use in dispatchable.
type BaseCallFilter = BaseCallFilter;
type BaseCallFilter = Everything;
/// The block type.
type Block = Block;
/// Maximum number of block number to block hash mappings to keep (oldest pruned first).
Expand Down
107 changes: 54 additions & 53 deletions runtimes/polimec/src/weights/pallet_scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! Autogenerated weights for `pallet_scheduler`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 39.0.0
//! DATE: 2025-02-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-08-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `ip-172-31-23-147`, CPU: `AMD EPYC 9R14`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("polimec-paseo-local")`, DB CACHE: 1024
Expand Down Expand Up @@ -36,8 +36,8 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `31`
// Estimated: `1489`
// Minimum execution time: 3_150_000 picoseconds.
Weight::from_parts(3_340_000, 0)
// Minimum execution time: 2_990_000 picoseconds.
Weight::from_parts(3_170_000, 0)
.saturating_add(Weight::from_parts(0, 1489))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
Expand All @@ -49,24 +49,24 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `78 + s * (177 ±0)`
// Estimated: `42428`
// Minimum execution time: 3_550_000 picoseconds.
Weight::from_parts(5_723_705, 0)
// Minimum execution time: 3_280_000 picoseconds.
Weight::from_parts(5_264_100, 0)
.saturating_add(Weight::from_parts(0, 42428))
// Standard Error: 984
.saturating_add(Weight::from_parts(285_866, 0).saturating_mul(s.into()))
// Standard Error: 903
.saturating_add(Weight::from_parts(281_751, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
fn service_task_base() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 1_970_000 picoseconds.
Weight::from_parts(2_110_000, 0)
// Minimum execution time: 2_120_000 picoseconds.
Weight::from_parts(2_240_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// Storage: `Preimage::PreimageFor` (r:1 w:1)
/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `Measured`)
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
Expand All @@ -75,48 +75,49 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
fn service_task_fetched(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `179 + s * (1 ±0)`
// Estimated: `4197809`
// Minimum execution time: 14_311_000 picoseconds.
Weight::from_parts(14_810_000, 0)
.saturating_add(Weight::from_parts(0, 4197809))
// Standard Error: 5
.saturating_add(Weight::from_parts(705, 0).saturating_mul(s.into()))
// Estimated: `3644 + s * (1 ±0)`
// Minimum execution time: 13_680_000 picoseconds.
Weight::from_parts(13_990_000, 0)
.saturating_add(Weight::from_parts(0, 3644))
// Standard Error: 0
.saturating_add(Weight::from_parts(675, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
.saturating_add(Weight::from_parts(0, 1).saturating_mul(s.into()))
}
/// Storage: `Scheduler::Lookup` (r:0 w:1)
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
fn service_task_named() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_910_000 picoseconds.
Weight::from_parts(3_160_000, 0)
// Minimum execution time: 3_050_000 picoseconds.
Weight::from_parts(3_220_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
fn service_task_periodic() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_020_000 picoseconds.
Weight::from_parts(2_120_000, 0)
// Minimum execution time: 2_120_000 picoseconds.
Weight::from_parts(2_240_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
fn execute_dispatch_signed() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 1_370_000 picoseconds.
Weight::from_parts(1_470_000, 0)
// Minimum execution time: 1_430_000 picoseconds.
Weight::from_parts(1_540_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
fn execute_dispatch_unsigned() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 1_360_000 picoseconds.
Weight::from_parts(1_480_000, 0)
// Minimum execution time: 1_330_000 picoseconds.
Weight::from_parts(1_460_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// Storage: `Scheduler::Agenda` (r:1 w:1)
Expand All @@ -126,11 +127,11 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `78 + s * (177 ±0)`
// Estimated: `42428`
// Minimum execution time: 7_531_000 picoseconds.
Weight::from_parts(9_350_752, 0)
// Minimum execution time: 7_370_000 picoseconds.
Weight::from_parts(9_052_492, 0)
.saturating_add(Weight::from_parts(0, 42428))
// Standard Error: 1_003
.saturating_add(Weight::from_parts(311_567, 0).saturating_mul(s.into()))
// Standard Error: 870
.saturating_add(Weight::from_parts(303_988, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand All @@ -145,11 +146,11 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `78 + s * (177 ±0)`
// Estimated: `42428`
// Minimum execution time: 11_590_000 picoseconds.
Weight::from_parts(11_013_013, 0)
// Minimum execution time: 11_120_000 picoseconds.
Weight::from_parts(10_709_113, 0)
.saturating_add(Weight::from_parts(0, 42428))
// Standard Error: 881
.saturating_add(Weight::from_parts(479_214, 0).saturating_mul(s.into()))
// Standard Error: 748
.saturating_add(Weight::from_parts(458_934, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(3))
}
Expand All @@ -162,11 +163,11 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `255 + s * (185 ±0)`
// Estimated: `42428`
// Minimum execution time: 9_930_000 picoseconds.
Weight::from_parts(13_072_200, 0)
// Minimum execution time: 9_820_000 picoseconds.
Weight::from_parts(12_920_198, 0)
.saturating_add(Weight::from_parts(0, 42428))
// Standard Error: 1_820
.saturating_add(Weight::from_parts(334_502, 0).saturating_mul(s.into()))
// Standard Error: 1_825
.saturating_add(Weight::from_parts(328_024, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
Expand All @@ -181,11 +182,11 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `281 + s * (185 ±0)`
// Estimated: `42428`
// Minimum execution time: 13_470_000 picoseconds.
Weight::from_parts(13_629_213, 0)
// Minimum execution time: 13_150_000 picoseconds.
Weight::from_parts(13_327_341, 0)
.saturating_add(Weight::from_parts(0, 42428))
// Standard Error: 933
.saturating_add(Weight::from_parts(500_166, 0).saturating_mul(s.into()))
// Standard Error: 876
.saturating_add(Weight::from_parts(481_053, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(3))
}
Expand All @@ -198,11 +199,11 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `118`
// Estimated: `42428`
// Minimum execution time: 7_251_000 picoseconds.
Weight::from_parts(7_567_002, 0)
// Minimum execution time: 7_050_000 picoseconds.
Weight::from_parts(7_457_450, 0)
.saturating_add(Weight::from_parts(0, 42428))
// Standard Error: 469
.saturating_add(Weight::from_parts(20_312, 0).saturating_mul(s.into()))
// Standard Error: 424
.saturating_add(Weight::from_parts(16_593, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
}
Expand All @@ -214,8 +215,8 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `8928`
// Estimated: `42428`
// Minimum execution time: 19_250_000 picoseconds.
Weight::from_parts(20_471_000, 0)
// Minimum execution time: 18_210_000 picoseconds.
Weight::from_parts(19_060_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
Expand All @@ -230,8 +231,8 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `9606`
// Estimated: `42428`
// Minimum execution time: 24_490_000 picoseconds.
Weight::from_parts(25_270_000, 0)
// Minimum execution time: 23_120_000 picoseconds.
Weight::from_parts(24_030_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
Expand All @@ -244,8 +245,8 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `8940`
// Estimated: `42428`
// Minimum execution time: 18_790_000 picoseconds.
Weight::from_parts(19_400_000, 0)
// Minimum execution time: 17_950_000 picoseconds.
Weight::from_parts(18_380_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
Expand All @@ -260,10 +261,10 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `9618`
// Estimated: `42428`
// Minimum execution time: 23_540_000 picoseconds.
Weight::from_parts(24_480_000, 0)
// Minimum execution time: 22_420_000 picoseconds.
Weight::from_parts(23_171_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
}
}

0 comments on commit 0c19e33

Please sign in to comment.