diff --git a/pallets/processor/src/benchmarking.rs b/pallets/processor/src/benchmarking.rs index 2bbc353..587b6a8 100644 --- a/pallets/processor/src/benchmarking.rs +++ b/pallets/processor/src/benchmarking.rs @@ -20,7 +20,7 @@ use super::*; use frame_benchmarking::v2::*; -use frame_support::{assert_ok, traits::fungible::Mutate}; +use frame_support::assert_ok; use frame_system::RawOrigin; use pallet_broker::{CoreMask, RegionId, RegionRecord}; use sp_runtime::SaturatedConversion; @@ -71,6 +71,9 @@ mod benchmarks { let para_id: ParaId = 2000.into(); let region_id = RegionId { begin: 0, core: 0, mask: CoreMask::complete() }; + let record: RegionRecordOf = RegionRecord { end: 8, owner: caller.clone(), paid: None }; + T::Regions::create_region(region_id, record, caller.clone())?; + crate::RegionAssignments::::insert(®ion_id, para_id); #[extrinsic_call] diff --git a/runtime/cocos/src/lib.rs b/runtime/cocos/src/lib.rs index 6e24211..63ec51a 100644 --- a/runtime/cocos/src/lib.rs +++ b/runtime/cocos/src/lib.rs @@ -194,7 +194,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("regionx-parachain"), impl_name: create_runtime_str!("regionx-parachain"), authoring_version: 1, - spec_version: 1_000_001, + spec_version: 1_001_000, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -801,7 +801,7 @@ impl pallet_processor::Config for Runtime { type RegionAssigner = XcmRegionAssigner; type CoretimeChain = CoretimeChainLocation; type WeightToFee = parachains_common::rococo::fee::WeightToFee; - type WeightInfo = (); + type WeightInfo = weights::pallet_processor::WeightInfo; } // Create the runtime by composing the FRAME pallets that were previously configured. diff --git a/runtime/cocos/src/weights/mod.rs b/runtime/cocos/src/weights/mod.rs index f2fbd28..9ee6642 100644 --- a/runtime/cocos/src/weights/mod.rs +++ b/runtime/cocos/src/weights/mod.rs @@ -44,6 +44,7 @@ pub mod pallet_conviction_voting_native_conviction_voting; pub mod pallet_market; pub mod pallet_multisig; pub mod pallet_orders; +pub mod pallet_processor; pub mod pallet_proxy; pub mod pallet_regions; pub mod pallet_session; diff --git a/runtime/cocos/src/weights/pallet_processor.rs b/runtime/cocos/src/weights/pallet_processor.rs index 5be1442..34407fe 100644 --- a/runtime/cocos/src/weights/pallet_processor.rs +++ b/runtime/cocos/src/weights/pallet_processor.rs @@ -16,7 +16,7 @@ //! Autogenerated weights for `pallet_processor` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-07-26, STEPS: `20`, REPEAT: `50`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-04, STEPS: `20`, REPEAT: `50`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `cocos-instance-1`, CPU: `Intel(R) Xeon(R) CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("cocos")`, DB CACHE: `1024` @@ -60,29 +60,34 @@ impl pallet_processor::WeightInfo for WeightInfo { /// Proof: `Orders::Orders` (`max_values`: None, `max_size`: Some(66), added: 2541, mode: `MaxEncodedLen`) /// Storage: `Tokens::Accounts` (r:1 w:0) /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Processor::RegionAssignments` (r:0 w:1) - /// Proof: `Processor::RegionAssignments` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`) fn fulfill_order() -> Weight { // Proof Size summary in bytes: - // Measured: `572` + // Measured: `602` // Estimated: `3584` - // Minimum execution time: 75_897_000 picoseconds. - Weight::from_parts(84_457_000, 3584) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Minimum execution time: 94_910_000 picoseconds. + Weight::from_parts(97_937_000, 3584) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `Processor::RegionAssignments` (r:1 w:0) /// Proof: `Processor::RegionAssignments` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Regions::Regions` (r:1 w:1) + /// Proof: `Regions::Regions` (`max_values`: None, `max_size`: Some(119), added: 2594, mode: `MaxEncodedLen`) fn assign() -> Weight { // Proof Size summary in bytes: - // Measured: `141` - // Estimated: `3501` - // Minimum execution time: 48_346_000 picoseconds. - Weight::from_parts(49_659_000, 3501) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `417` + // Estimated: `3584` + // Minimum execution time: 68_127_000 picoseconds. + Weight::from_parts(70_199_000, 3584) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } } diff --git a/scripts/benchmarker.sh b/scripts/benchmarker.sh index f7c4d4e..536cae9 100755 --- a/scripts/benchmarker.sh +++ b/scripts/benchmarker.sh @@ -16,6 +16,7 @@ modules=( "cumulus_pallet_xcmp_queue" "pallet_regions" "pallet_market" + "pallet_processor" "pallet_orders" "pallet_referenda" "pallet_conviction_voting"