git.delta.rocks / unique-network / refs/commits / 5f71c376196c

difftreelog

fix benchmarks

Grigoriy Simonov2023-10-12parent: #af2b5f4.patch.diff
in: master

6 files changed

modifiednode/cli/src/command.rsdiffbeforeafterboth
--- a/node/cli/src/command.rs
+++ b/node/cli/src/command.rs
@@ -42,10 +42,6 @@
 use sp_runtime::traits::AccountIdConversion;
 use up_common::types::opaque::RuntimeId;
 
-#[cfg(feature = "runtime-benchmarks")]
-use crate::chain_spec::default_runtime;
-#[cfg(feature = "runtime-benchmarks")]
-use crate::service::DefaultRuntimeExecutor;
 #[cfg(feature = "quartz-runtime")]
 use crate::service::QuartzRuntimeExecutor;
 #[cfg(feature = "unique-runtime")]
modifiednode/cli/src/service.rsdiffbeforeafterboth
before · node/cli/src/service.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617// std18use std::{19	collections::BTreeMap,20	marker::PhantomData,21	pin::Pin,22	sync::{Arc, Mutex},23	time::Duration,24};2526use cumulus_client_cli::CollatorOptions;27use cumulus_client_collator::service::CollatorService;28#[cfg(not(feature = "lookahead"))]29use cumulus_client_consensus_aura::collators::basic::{30	run as run_aura, Params as BuildAuraConsensusParams,31};32#[cfg(feature = "lookahead")]33use cumulus_client_consensus_aura::collators::lookahead::{34	run as run_aura, Params as BuildAuraConsensusParams,35};36use cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImport;37use cumulus_client_consensus_proposer::Proposer;38use cumulus_client_network::RequireSecondedInBlockAnnounce;39use cumulus_client_service::{40	build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks, DARecoveryProfile,41	StartRelayChainTasksParams,42};43use cumulus_primitives_core::ParaId;44use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface};45use fc_mapping_sync::{kv::MappingSyncWorker, EthereumBlockNotificationSinks, SyncStrategy};46use fc_rpc::{47	frontier_backend_client::SystemAccountId32StorageOverride, EthBlockDataCacheTask, EthConfig,48	EthTask, OverrideHandle, RuntimeApiStorageOverride, SchemaV1Override, SchemaV2Override,49	SchemaV3Override, StorageOverride,50};51use fc_rpc_core::types::{FeeHistoryCache, FilterPool};52use fp_rpc::EthereumRuntimeRPCApi;53use fp_storage::EthereumStorageSchema;54use futures::{55	stream::select,56	task::{Context, Poll},57	Stream, StreamExt,58};59use jsonrpsee::RpcModule;60use polkadot_service::CollatorPair;61use sc_client_api::{AuxStore, Backend, BlockOf, BlockchainEvents, StorageProvider};62use sc_consensus::ImportQueue;63use sc_executor::{NativeElseWasmExecutor, NativeExecutionDispatch};64use sc_network::NetworkBlock;65use sc_network_sync::SyncingService;66use sc_rpc::SubscriptionTaskExecutor;67use sc_service::{Configuration, PartialComponents, TaskManager};68use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};69use serde::{Deserialize, Serialize};70use sp_api::{ProvideRuntimeApi, StateBackend};71use sp_block_builder::BlockBuilder;72use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};73use sp_consensus_aura::sr25519::AuthorityPair as AuraAuthorityPair;74use sp_keystore::KeystorePtr;75use sp_runtime::traits::BlakeTwo256;76use substrate_prometheus_endpoint::Registry;77use tokio::time::Interval;78use up_common::types::{opaque::*, Nonce};7980use crate::{81	chain_spec::RuntimeIdentification,82	rpc::{create_eth, create_full, EthDeps, FullDeps},83};8485/// Unique native executor instance.86#[cfg(feature = "unique-runtime")]87pub struct UniqueRuntimeExecutor;8889#[cfg(feature = "quartz-runtime")]90/// Quartz native executor instance.91pub struct QuartzRuntimeExecutor;9293/// Opal native executor instance.94pub struct OpalRuntimeExecutor;9596#[cfg(all(feature = "unique-runtime", feature = "runtime-benchmarks"))]97pub type DefaultRuntimeExecutor = UniqueRuntimeExecutor;9899#[cfg(all(100	not(feature = "unique-runtime"),101	feature = "quartz-runtime",102	feature = "runtime-benchmarks"103))]104pub type DefaultRuntimeExecutor = QuartzRuntimeExecutor;105106#[cfg(all(107	not(feature = "unique-runtime"),108	not(feature = "quartz-runtime"),109	feature = "runtime-benchmarks"110))]111pub type DefaultRuntimeExecutor = OpalRuntimeExecutor;112113#[cfg(feature = "unique-runtime")]114impl NativeExecutionDispatch for UniqueRuntimeExecutor {115	/// Only enable the benchmarking host functions when we actually want to benchmark.116	#[cfg(feature = "runtime-benchmarks")]117	type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;118	/// Otherwise we only use the default Substrate host functions.119	#[cfg(not(feature = "runtime-benchmarks"))]120	type ExtendHostFunctions = ();121122	fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {123		unique_runtime::api::dispatch(method, data)124	}125126	fn native_version() -> sc_executor::NativeVersion {127		unique_runtime::native_version()128	}129}130131#[cfg(feature = "quartz-runtime")]132impl NativeExecutionDispatch for QuartzRuntimeExecutor {133	/// Only enable the benchmarking host functions when we actually want to benchmark.134	#[cfg(feature = "runtime-benchmarks")]135	type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;136	/// Otherwise we only use the default Substrate host functions.137	#[cfg(not(feature = "runtime-benchmarks"))]138	type ExtendHostFunctions = ();139140	fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {141		quartz_runtime::api::dispatch(method, data)142	}143144	fn native_version() -> sc_executor::NativeVersion {145		quartz_runtime::native_version()146	}147}148149impl NativeExecutionDispatch for OpalRuntimeExecutor {150	/// Only enable the benchmarking host functions when we actually want to benchmark.151	#[cfg(feature = "runtime-benchmarks")]152	type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;153	/// Otherwise we only use the default Substrate host functions.154	#[cfg(not(feature = "runtime-benchmarks"))]155	type ExtendHostFunctions = ();156157	fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {158		opal_runtime::api::dispatch(method, data)159	}160161	fn native_version() -> sc_executor::NativeVersion {162		opal_runtime::native_version()163	}164}165166pub struct AutosealInterval {167	interval: Interval,168}169170impl AutosealInterval {171	pub fn new(config: &Configuration, interval: u64) -> Self {172		let _tokio_runtime = config.tokio_handle.enter();173		let interval = tokio::time::interval(Duration::from_millis(interval));174175		Self { interval }176	}177}178179impl Stream for AutosealInterval {180	type Item = tokio::time::Instant;181182	fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {183		self.interval.poll_tick(cx).map(Some)184	}185}186187pub fn open_frontier_backend<C: HeaderBackend<Block>>(188	client: Arc<C>,189	config: &Configuration,190) -> Result<Arc<fc_db::kv::Backend<Block>>, String> {191	let config_dir = config.base_path.config_dir(config.chain_spec.id());192	let database_dir = config_dir.join("frontier").join("db");193194	Ok(Arc::new(fc_db::kv::Backend::<Block>::new(195		client,196		&fc_db::kv::DatabaseSettings {197			source: fc_db::DatabaseSource::RocksDb {198				path: database_dir,199				cache_size: 0,200			},201		},202	)?))203}204205type FullClient<RuntimeApi, ExecutorDispatch> =206	sc_service::TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<ExecutorDispatch>>;207type FullBackend = sc_service::TFullBackend<Block>;208type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;209type ParachainBlockImport<RuntimeApi, ExecutorDispatch> =210	TParachainBlockImport<Block, Arc<FullClient<RuntimeApi, ExecutorDispatch>>, FullBackend>;211212/// Generate a supertrait based on bounds, and blanket impl for it.213macro_rules! ez_bounds {214	($vis:vis trait $name:ident$(<$($gen:ident $(: $($(+)? $bound:path)*)?),* $(,)?>)? $(:)? $($(+)? $super:path)* {}) => {215		$vis trait $name $(<$($gen $(: $($bound+)*)?,)*>)?: $($super +)* {}216		impl<T, $($($gen $(: $($bound+)*)?,)*)?> $name$(<$($gen,)*>)? for T217		where T: $($super +)* {}218	}219}220ez_bounds!(221	pub trait RuntimeApiDep<Runtime: RuntimeInstance>:222		sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>223		+ sp_consensus_aura::AuraApi<Block, AuraId>224		+ fp_rpc::EthereumRuntimeRPCApi<Block>225		+ sp_session::SessionKeys<Block>226		+ sp_block_builder::BlockBuilder<Block>227		+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>228		+ sp_api::ApiExt<Block>229		+ up_rpc::UniqueApi<Block, Runtime::CrossAccountId, AccountId>230		+ app_promotion_rpc::AppPromotionApi<Block, BlockNumber, Runtime::CrossAccountId, AccountId>231		+ up_pov_estimate_rpc::PovEstimateApi<Block>232		+ substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>233		+ sp_api::Metadata<Block>234		+ sp_offchain::OffchainWorkerApi<Block>235		+ cumulus_primitives_core::CollectCollationInfo<Block>236		// Deprecated, not used.237		+ fp_rpc::ConvertTransactionRuntimeApi<Block>238	{239	}240);241242/// Starts a `ServiceBuilder` for a full service.243///244/// Use this macro if you don't actually need the full service, but just the builder in order to245/// be able to perform chain operations.246#[allow(clippy::type_complexity)]247pub fn new_partial<Runtime, RuntimeApi, ExecutorDispatch, BIQ>(248	config: &Configuration,249	build_import_queue: BIQ,250) -> Result<251	PartialComponents<252		FullClient<RuntimeApi, ExecutorDispatch>,253		FullBackend,254		FullSelectChain,255		sc_consensus::DefaultImportQueue<Block>,256		sc_transaction_pool::FullPool<Block, FullClient<RuntimeApi, ExecutorDispatch>>,257		OtherPartial,258	>,259	sc_service::Error,260>261where262	sc_client_api::StateBackendFor<FullBackend, Block>: sp_api::StateBackend<BlakeTwo256>,263	RuntimeApi: sp_api::ConstructRuntimeApi<Block, FullClient<RuntimeApi, ExecutorDispatch>>264		+ Send265		+ Sync266		+ 'static,267	RuntimeApi::RuntimeApi: RuntimeApiDep<Runtime> + 'static,268	Runtime: RuntimeInstance,269	ExecutorDispatch: NativeExecutionDispatch + 'static,270	BIQ: FnOnce(271		Arc<FullClient<RuntimeApi, ExecutorDispatch>>,272		Arc<FullBackend>,273		&Configuration,274		Option<TelemetryHandle>,275		&TaskManager,276	) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error>,277{278	let telemetry = config279		.telemetry_endpoints280		.clone()281		.filter(|x| !x.is_empty())282		.map(|endpoints| -> Result<_, sc_telemetry::Error> {283			let worker = TelemetryWorker::new(16)?;284			let telemetry = worker.handle().new_telemetry(endpoints);285			Ok((worker, telemetry))286		})287		.transpose()?;288289	let executor = sc_service::new_native_or_wasm_executor(config);290291	let (client, backend, keystore_container, task_manager) =292		sc_service::new_full_parts::<Block, RuntimeApi, _>(293			config,294			telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),295			executor,296		)?;297	let client = Arc::new(client);298299	let telemetry_worker_handle = telemetry.as_ref().map(|(worker, _)| worker.handle());300301	let telemetry = telemetry.map(|(worker, telemetry)| {302		task_manager303			.spawn_handle()304			.spawn("telemetry", None, worker.run());305		telemetry306	});307308	let select_chain = sc_consensus::LongestChain::new(backend.clone());309310	let transaction_pool = sc_transaction_pool::BasicPool::new_full(311		config.transaction_pool.clone(),312		config.role.is_authority().into(),313		config.prometheus_registry(),314		task_manager.spawn_essential_handle(),315		client.clone(),316	);317318	let eth_filter_pool: Option<FilterPool> = Some(Arc::new(Mutex::new(BTreeMap::new())));319320	let eth_backend = open_frontier_backend(client.clone(), config)?;321322	let import_queue = build_import_queue(323		client.clone(),324		backend.clone(),325		config,326		telemetry.as_ref().map(|telemetry| telemetry.handle()),327		&task_manager,328	)?;329330	let params = PartialComponents {331		backend,332		client,333		import_queue,334		keystore_container,335		task_manager,336		transaction_pool,337		select_chain,338		other: OtherPartial {339			telemetry,340			eth_filter_pool,341			eth_backend,342			telemetry_worker_handle,343		},344	};345346	Ok(params)347}348349macro_rules! clone {350    ($($i:ident),* $(,)?) => {351		$(352			let $i = $i.clone();353		)*354    };355}356357/// Start a node with the given parachain `Configuration` and relay chain `Configuration`.358///359/// This is the actual implementation that is abstract over the executor and the runtime api.360#[sc_tracing::logging::prefix_logs_with("Parachain")]361pub async fn start_node<Runtime, RuntimeApi, ExecutorDispatch>(362	parachain_config: Configuration,363	polkadot_config: Configuration,364	collator_options: CollatorOptions,365	para_id: ParaId,366	hwbench: Option<sc_sysinfo::HwBench>,367) -> sc_service::error::Result<(TaskManager, Arc<FullClient<RuntimeApi, ExecutorDispatch>>)>368where369	sc_client_api::StateBackendFor<FullBackend, Block>: sp_api::StateBackend<BlakeTwo256>,370	Runtime: RuntimeInstance + Send + Sync + 'static,371	<Runtime as RuntimeInstance>::CrossAccountId: Serialize,372	for<'de> <Runtime as RuntimeInstance>::CrossAccountId: Deserialize<'de>,373	RuntimeApi: sp_api::ConstructRuntimeApi<Block, FullClient<RuntimeApi, ExecutorDispatch>>374		+ Send375		+ Sync376		+ 'static,377	RuntimeApi::RuntimeApi: RuntimeApiDep<Runtime> + 'static,378	Runtime: RuntimeInstance,379	ExecutorDispatch: NativeExecutionDispatch + 'static,380{381	let parachain_config = prepare_node_config(parachain_config);382383	let params = new_partial::<Runtime, RuntimeApi, ExecutorDispatch, _>(384		&parachain_config,385		parachain_build_import_queue,386	)?;387	let OtherPartial {388		mut telemetry,389		telemetry_worker_handle,390		eth_filter_pool,391		eth_backend,392	} = params.other;393	let net_config = sc_network::config::FullNetworkConfiguration::new(&parachain_config.network);394395	let client = params.client.clone();396	let backend = params.backend.clone();397	let mut task_manager = params.task_manager;398399	let (relay_chain_interface, collator_key) = build_relay_chain_interface(400		polkadot_config,401		&parachain_config,402		telemetry_worker_handle,403		&mut task_manager,404		collator_options.clone(),405		hwbench.clone(),406	)407	.await408	.map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?;409410	let block_announce_validator =411		RequireSecondedInBlockAnnounce::new(relay_chain_interface.clone(), para_id);412413	let validator = parachain_config.role.is_authority();414	let prometheus_registry = parachain_config.prometheus_registry().cloned();415	let transaction_pool = params.transaction_pool.clone();416	let import_queue_service = params.import_queue.service();417418	let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =419		sc_service::build_network(sc_service::BuildNetworkParams {420			config: &parachain_config,421			net_config,422			client: client.clone(),423			transaction_pool: transaction_pool.clone(),424			spawn_handle: task_manager.spawn_handle(),425			import_queue: params.import_queue,426			block_announce_validator_builder: Some(Box::new(|_| {427				Box::new(block_announce_validator)428			})),429			warp_sync_params: None,430		})?;431432	let select_chain = params.select_chain.clone();433434	let runtime_id = parachain_config.chain_spec.runtime_id();435436	// Frontier437	let fee_history_cache: FeeHistoryCache = Arc::new(Mutex::new(BTreeMap::new()));438	let fee_history_limit = 2048;439440	let eth_pubsub_notification_sinks: Arc<441		EthereumBlockNotificationSinks<fc_mapping_sync::EthereumBlockNotification<Block>>,442	> = Default::default();443444	let overrides = overrides_handle(client.clone());445	let eth_block_data_cache = spawn_frontier_tasks(446		FrontierTaskParams {447			client: client.clone(),448			substrate_backend: backend.clone(),449			eth_filter_pool: eth_filter_pool.clone(),450			eth_backend: eth_backend.clone(),451			fee_history_limit,452			fee_history_cache: fee_history_cache.clone(),453			task_manager: &task_manager,454			prometheus_registry: prometheus_registry.clone(),455			overrides: overrides.clone(),456			sync_strategy: SyncStrategy::Parachain,457		},458		sync_service.clone(),459		eth_pubsub_notification_sinks.clone(),460	);461462	// Rpc463	let rpc_builder = Box::new({464		clone!(465			client,466			backend,467			eth_backend,468			eth_pubsub_notification_sinks,469			fee_history_cache,470			eth_block_data_cache,471			overrides,472			transaction_pool,473			network,474			sync_service,475		);476		move |deny_unsafe, subscription_task_executor: SubscriptionTaskExecutor| {477			clone!(478				backend,479				eth_block_data_cache,480				client,481				eth_backend,482				eth_filter_pool,483				eth_pubsub_notification_sinks,484				fee_history_cache,485				eth_block_data_cache,486				network,487				runtime_id,488				transaction_pool,489				select_chain,490				overrides,491			);492493			#[cfg(not(feature = "pov-estimate"))]494			let _ = backend;495496			let mut rpc_handle = RpcModule::new(());497498			let full_deps = FullDeps {499				client: client.clone(),500				runtime_id,501502				#[cfg(feature = "pov-estimate")]503				exec_params: uc_rpc::pov_estimate::ExecutorParams {504					wasm_method: parachain_config.wasm_method,505					default_heap_pages: parachain_config.default_heap_pages,506					max_runtime_instances: parachain_config.max_runtime_instances,507					runtime_cache_size: parachain_config.runtime_cache_size,508				},509510				#[cfg(feature = "pov-estimate")]511				backend,512513				deny_unsafe,514				pool: transaction_pool.clone(),515				select_chain,516			};517518			create_full::<_, _, _, Runtime, RuntimeApi, _>(&mut rpc_handle, full_deps)?;519520			let eth_deps = EthDeps {521				client,522				graph: transaction_pool.pool().clone(),523				pool: transaction_pool,524				is_authority: validator,525				network,526				eth_backend,527				// TODO: Unhardcode528				max_past_logs: 10000,529				fee_history_limit,530				fee_history_cache,531				eth_block_data_cache,532				// TODO: Unhardcode533				enable_dev_signer: false,534				eth_filter_pool,535				eth_pubsub_notification_sinks,536				overrides,537				sync: sync_service.clone(),538				pending_create_inherent_data_providers: |_, ()| async move { Ok(()) },539			};540541			create_eth::<542				_,543				_,544				_,545				_,546				_,547				_,548				DefaultEthConfig<FullClient<RuntimeApi, ExecutorDispatch>>,549			>(550				&mut rpc_handle,551				eth_deps,552				subscription_task_executor.clone(),553			)?;554555			Ok(rpc_handle)556		}557	});558559	sc_service::spawn_tasks(sc_service::SpawnTasksParams {560		rpc_builder,561		client: client.clone(),562		transaction_pool: transaction_pool.clone(),563		task_manager: &mut task_manager,564		config: parachain_config,565		keystore: params.keystore_container.keystore(),566		backend: backend.clone(),567		network: network.clone(),568		sync_service: sync_service.clone(),569		system_rpc_tx,570		telemetry: telemetry.as_mut(),571		tx_handler_controller,572	})?;573574	if let Some(hwbench) = hwbench {575		sc_sysinfo::print_hwbench(&hwbench);576577		if let Some(ref mut telemetry) = telemetry {578			let telemetry_handle = telemetry.handle();579			task_manager.spawn_handle().spawn(580				"telemetry_hwbench",581				None,582				sc_sysinfo::initialize_hwbench_telemetry(telemetry_handle, hwbench),583			);584		}585	}586587	let announce_block = {588		let sync_service = sync_service.clone();589		Arc::new(Box::new(move |hash, data| {590			sync_service.announce_block(hash, data)591		}))592	};593594	let relay_chain_slot_duration = Duration::from_secs(6);595596	let overseer_handle = relay_chain_interface597		.overseer_handle()598		.map_err(|e| sc_service::Error::Application(Box::new(e)))?;599600	start_relay_chain_tasks(StartRelayChainTasksParams {601		client: client.clone(),602		announce_block: announce_block.clone(),603		para_id,604		relay_chain_interface: relay_chain_interface.clone(),605		task_manager: &mut task_manager,606		da_recovery_profile: if validator {607			DARecoveryProfile::Collator608		} else {609			DARecoveryProfile::FullNode610		},611		import_queue: import_queue_service,612		relay_chain_slot_duration,613		recovery_handle: Box::new(overseer_handle.clone()),614		sync_service: sync_service.clone(),615	})?;616617	if validator {618		start_consensus(619			client.clone(),620			backend.clone(),621			prometheus_registry.as_ref(),622			telemetry.as_ref().map(|t| t.handle()),623			&task_manager,624			relay_chain_interface.clone(),625			transaction_pool,626			sync_service.clone(),627			params.keystore_container.keystore(),628			overseer_handle,629			relay_chain_slot_duration,630			para_id,631			collator_key.expect("cli args do not allow this"),632			announce_block,633		)?;634	}635636	start_network.start_network();637638	Ok((task_manager, client))639}640641/// Build the import queue for the the parachain runtime.642pub fn parachain_build_import_queue<Runtime, RuntimeApi, ExecutorDispatch>(643	client: Arc<FullClient<RuntimeApi, ExecutorDispatch>>,644	backend: Arc<FullBackend>,645	config: &Configuration,646	telemetry: Option<TelemetryHandle>,647	task_manager: &TaskManager,648) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error>649where650	RuntimeApi: sp_api::ConstructRuntimeApi<Block, FullClient<RuntimeApi, ExecutorDispatch>>651		+ Send652		+ Sync653		+ 'static,654	RuntimeApi::RuntimeApi: RuntimeApiDep<Runtime> + 'static,655	Runtime: RuntimeInstance,656	ExecutorDispatch: NativeExecutionDispatch + 'static,657{658	let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;659660	let block_import = ParachainBlockImport::new(client.clone(), backend);661662	cumulus_client_consensus_aura::import_queue::<663		sp_consensus_aura::sr25519::AuthorityPair,664		_,665		_,666		_,667		_,668		_,669	>(cumulus_client_consensus_aura::ImportQueueParams {670		block_import,671		client,672		create_inherent_data_providers: move |_, _| async move {673			let time = sp_timestamp::InherentDataProvider::from_system_time();674675			let slot =676				sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(677					*time,678					slot_duration,679				);680681			Ok((slot, time))682		},683		registry: config.prometheus_registry(),684		spawner: &task_manager.spawn_essential_handle(),685		telemetry,686	})687	.map_err(Into::into)688}689690pub fn start_consensus<ExecutorDispatch, RuntimeApi, Runtime>(691	client: Arc<FullClient<RuntimeApi, ExecutorDispatch>>,692	backend: Arc<FullBackend>,693	prometheus_registry: Option<&Registry>,694	telemetry: Option<TelemetryHandle>,695	task_manager: &TaskManager,696	relay_chain_interface: Arc<dyn RelayChainInterface>,697	transaction_pool: Arc<698		sc_transaction_pool::FullPool<Block, FullClient<RuntimeApi, ExecutorDispatch>>,699	>,700	sync_oracle: Arc<SyncingService<Block>>,701	keystore: KeystorePtr,702	overseer_handle: OverseerHandle,703	relay_chain_slot_duration: Duration,704	para_id: ParaId,705	collator_key: CollatorPair,706	announce_block: Arc<dyn Fn(Hash, Option<Vec<u8>>) + Send + Sync>,707) -> Result<(), sc_service::Error>708where709	ExecutorDispatch: NativeExecutionDispatch + 'static,710	RuntimeApi: sp_api::ConstructRuntimeApi<Block, FullClient<RuntimeApi, ExecutorDispatch>>711		+ Send712		+ Sync713		+ 'static,714	RuntimeApi::RuntimeApi: RuntimeApiDep<Runtime> + 'static,715	Runtime: RuntimeInstance,716{717	let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;718719	let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording(720		task_manager.spawn_handle(),721		client.clone(),722		transaction_pool,723		prometheus_registry,724		telemetry.clone(),725	);726	let proposer = Proposer::new(proposer_factory);727728	let collator_service = CollatorService::new(729		client.clone(),730		Arc::new(task_manager.spawn_handle()),731		announce_block,732		client.clone(),733	);734735	let block_import = ParachainBlockImport::new(client.clone(), backend);736737	let params = BuildAuraConsensusParams {738		create_inherent_data_providers: move |_, ()| async move { Ok(()) },739		block_import,740		para_client: client,741		#[cfg(feature = "lookahead")]742		para_backend: backend,743		para_id,744		relay_client: relay_chain_interface,745		sync_oracle,746		keystore,747		slot_duration,748		proposer,749		collator_service,750		// With async-baking, we allowed to be both slower (longer authoring) and faster (multiple para blocks per relay block)751		authoring_duration: Duration::from_millis(500),752		overseer_handle,753		#[cfg(feature = "lookahead")]754		code_hash_provider: || {},755		collator_key,756		relay_chain_slot_duration,757	};758759	task_manager.spawn_essential_handle().spawn(760		"aura",761		None,762		run_aura::<_, AuraAuthorityPair, _, _, _, _, _, _, _>(params),763	);764	Ok(())765}766767fn dev_build_import_queue<RuntimeApi, ExecutorDispatch>(768	client: Arc<FullClient<RuntimeApi, ExecutorDispatch>>,769	_: Arc<FullBackend>,770	config: &Configuration,771	_: Option<TelemetryHandle>,772	task_manager: &TaskManager,773) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error>774where775	RuntimeApi: sp_api::ConstructRuntimeApi<Block, FullClient<RuntimeApi, ExecutorDispatch>>776		+ Send777		+ Sync778		+ 'static,779	RuntimeApi::RuntimeApi:780		sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> + sp_api::ApiExt<Block>,781	ExecutorDispatch: NativeExecutionDispatch + 'static,782{783	Ok(sc_consensus_manual_seal::import_queue(784		Box::new(client),785		&task_manager.spawn_essential_handle(),786		config.prometheus_registry(),787	))788}789790pub struct OtherPartial {791	pub telemetry: Option<Telemetry>,792	pub telemetry_worker_handle: Option<TelemetryWorkerHandle>,793	pub eth_filter_pool: Option<FilterPool>,794	pub eth_backend: Arc<fc_db::kv::Backend<Block>>,795}796797struct DefaultEthConfig<C>(PhantomData<C>);798impl<C> EthConfig<Block, C> for DefaultEthConfig<C>799where800	C: StorageProvider<Block, FullBackend> + Sync + Send + 'static,801{802	type EstimateGasAdapter = ();803	type RuntimeStorageOverride = SystemAccountId32StorageOverride<Block, C, FullBackend>;804}805806/// Builds a new development service. This service uses instant seal, and mocks807/// the parachain inherent808pub fn start_dev_node<Runtime, RuntimeApi, ExecutorDispatch>(809	config: Configuration,810	autoseal_interval: u64,811	autoseal_finalize_delay: Option<u64>,812	disable_autoseal_on_tx: bool,813) -> sc_service::error::Result<TaskManager>814where815	Runtime: RuntimeInstance + Send + Sync + 'static,816	<Runtime as RuntimeInstance>::CrossAccountId: Serialize,817	for<'de> <Runtime as RuntimeInstance>::CrossAccountId: Deserialize<'de>,818	RuntimeApi: sp_api::ConstructRuntimeApi<Block, FullClient<RuntimeApi, ExecutorDispatch>>819		+ Send820		+ Sync821		+ 'static,822	RuntimeApi::RuntimeApi: RuntimeApiDep<Runtime> + 'static,823	ExecutorDispatch: NativeExecutionDispatch + 'static,824{825	use fc_consensus::FrontierBlockImport;826	use sc_consensus_manual_seal::{827		run_delayed_finalize, run_manual_seal, DelayedFinalizeParams, EngineCommand,828		ManualSealParams,829	};830831	let sc_service::PartialComponents {832		client,833		backend,834		mut task_manager,835		import_queue,836		keystore_container,837		select_chain: maybe_select_chain,838		transaction_pool,839		other:840			OtherPartial {841				telemetry,842				eth_filter_pool,843				eth_backend,844				telemetry_worker_handle: _,845			},846	} = new_partial::<Runtime, RuntimeApi, ExecutorDispatch, _>(847		&config,848		dev_build_import_queue::<RuntimeApi, ExecutorDispatch>,849	)?;850	let net_config = sc_network::config::FullNetworkConfiguration::new(&config.network);851	let prometheus_registry = config.prometheus_registry().cloned();852853	let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =854		sc_service::build_network(sc_service::BuildNetworkParams {855			config: &config,856			net_config,857			client: client.clone(),858			transaction_pool: transaction_pool.clone(),859			spawn_handle: task_manager.spawn_handle(),860			import_queue,861			block_announce_validator_builder: None,862			warp_sync_params: None,863		})?;864865	let collator = config.role.is_authority();866867	let select_chain = maybe_select_chain;868869	if collator {870		let block_import = FrontierBlockImport::new(client.clone(), client.clone());871872		let env = sc_basic_authorship::ProposerFactory::new(873			task_manager.spawn_handle(),874			client.clone(),875			transaction_pool.clone(),876			prometheus_registry.as_ref(),877			telemetry.as_ref().map(|x| x.handle()),878		);879880		let transactions_commands_stream: Box<881			dyn Stream<Item = EngineCommand<Hash>> + Send + Sync + Unpin,882		> = Box::new(883			transaction_pool884				.pool()885				.validated_pool()886				.import_notification_stream()887				.filter(move |_| futures::future::ready(!disable_autoseal_on_tx))888				.map(|_| EngineCommand::SealNewBlock {889					create_empty: true,890					finalize: false,891					parent_hash: None,892					sender: None,893				}),894		);895896		let autoseal_interval = Box::pin(AutosealInterval::new(&config, autoseal_interval));897898		let idle_commands_stream: Box<899			dyn Stream<Item = EngineCommand<Hash>> + Send + Sync + Unpin,900		> = Box::new(autoseal_interval.map(|_| EngineCommand::SealNewBlock {901			create_empty: true,902			finalize: false,903			parent_hash: None,904			sender: None,905		}));906907		let commands_stream = select(transactions_commands_stream, idle_commands_stream);908909		let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;910		let client_set_aside_for_cidp = client.clone();911912		if let Some(delay_sec) = autoseal_finalize_delay {913			let spawn_handle = task_manager.spawn_handle();914915			task_manager.spawn_essential_handle().spawn_blocking(916				"finalization_task",917				Some("block-authoring"),918				run_delayed_finalize(DelayedFinalizeParams {919					client: client.clone(),920					delay_sec,921					spawn_handle,922				}),923			);924		}925926		task_manager.spawn_essential_handle().spawn_blocking(927			"authorship_task",928			Some("block-authoring"),929			run_manual_seal(ManualSealParams {930				block_import,931				env,932				client: client.clone(),933				pool: transaction_pool.clone(),934				commands_stream,935				select_chain: select_chain.clone(),936				consensus_data_provider: None,937				create_inherent_data_providers: move |block: Hash, ()| {938					let current_para_block = client_set_aside_for_cidp939						.number(block)940						.expect("Header lookup should succeed")941						.expect("Header passed in as parent should be present in backend.");942943					let client_for_xcm = client_set_aside_for_cidp.clone();944					async move {945						let time = sp_timestamp::InherentDataProvider::from_system_time();946947						let mocked_parachain = cumulus_primitives_parachain_inherent::MockValidationDataInherentDataProvider {948							current_para_block,949							relay_offset: 1000,950							relay_blocks_per_para_block: 2,951							para_blocks_per_relay_epoch: 0,952							xcm_config: cumulus_primitives_parachain_inherent::MockXcmConfig::new(953								&*client_for_xcm,954								block,955								Default::default(),956								Default::default(),957							),958							relay_randomness_config: (),959							raw_downward_messages: vec![],960							raw_horizontal_messages: vec![],961						};962963						let slot =964						sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(965							*time,966							slot_duration,967						);968969						Ok((time, slot, mocked_parachain))970					}971				},972			}),973		);974	}975976	#[cfg(feature = "pov-estimate")]977	let rpc_backend = backend.clone();978979	let runtime_id = config.chain_spec.runtime_id();980981	// Frontier982	let fee_history_cache: FeeHistoryCache = Arc::new(Mutex::new(BTreeMap::new()));983	let fee_history_limit = 2048;984985	let eth_pubsub_notification_sinks: Arc<986		EthereumBlockNotificationSinks<fc_mapping_sync::EthereumBlockNotification<Block>>,987	> = Default::default();988989	let overrides = overrides_handle(client.clone());990	let eth_block_data_cache = spawn_frontier_tasks(991		FrontierTaskParams {992			client: client.clone(),993			substrate_backend: backend.clone(),994			eth_filter_pool: eth_filter_pool.clone(),995			eth_backend: eth_backend.clone(),996			fee_history_limit,997			fee_history_cache: fee_history_cache.clone(),998			task_manager: &task_manager,999			prometheus_registry,1000			overrides: overrides.clone(),1001			sync_strategy: SyncStrategy::Normal,1002		},1003		sync_service.clone(),1004		eth_pubsub_notification_sinks.clone(),1005	);10061007	// Rpc1008	let rpc_builder = Box::new({1009		clone!(1010			client,1011			backend,1012			eth_backend,1013			eth_pubsub_notification_sinks,1014			fee_history_cache,1015			eth_block_data_cache,1016			overrides,1017			transaction_pool,1018			network,1019			sync_service,1020		);1021		move |deny_unsafe, subscription_task_executor: SubscriptionTaskExecutor| {1022			clone!(1023				backend,1024				eth_block_data_cache,1025				client,1026				eth_backend,1027				eth_filter_pool,1028				eth_pubsub_notification_sinks,1029				fee_history_cache,1030				eth_block_data_cache,1031				network,1032				runtime_id,1033				transaction_pool,1034				select_chain,1035				overrides,1036			);10371038			#[cfg(not(feature = "pov-estimate"))]1039			let _ = backend;10401041			let mut rpc_module = RpcModule::new(());10421043			let full_deps = FullDeps {1044				runtime_id,10451046				#[cfg(feature = "pov-estimate")]1047				exec_params: uc_rpc::pov_estimate::ExecutorParams {1048					wasm_method: config.wasm_method,1049					default_heap_pages: config.default_heap_pages,1050					max_runtime_instances: config.max_runtime_instances,1051					runtime_cache_size: config.runtime_cache_size,1052				},10531054				#[cfg(feature = "pov-estimate")]1055				backend,1056				// eth_backend,1057				deny_unsafe,1058				client: client.clone(),1059				pool: transaction_pool.clone(),1060				select_chain,1061			};10621063			create_full::<_, _, _, Runtime, RuntimeApi, _>(&mut rpc_module, full_deps)?;10641065			let eth_deps = EthDeps {1066				client,1067				graph: transaction_pool.pool().clone(),1068				pool: transaction_pool,1069				is_authority: true,1070				network,1071				eth_backend,1072				// TODO: Unhardcode1073				max_past_logs: 10000,1074				fee_history_limit,1075				fee_history_cache,1076				eth_block_data_cache,1077				// TODO: Unhardcode1078				enable_dev_signer: false,1079				eth_filter_pool,1080				eth_pubsub_notification_sinks,1081				overrides,1082				sync: sync_service.clone(),1083				// We don't have any inherents except parachain built-ins, which we can't even extract from inside `run_aura`.1084				pending_create_inherent_data_providers: |_, ()| async move { Ok(()) },1085			};10861087			create_eth::<1088				_,1089				_,1090				_,1091				_,1092				_,1093				_,1094				DefaultEthConfig<FullClient<RuntimeApi, ExecutorDispatch>>,1095			>(1096				&mut rpc_module,1097				eth_deps,1098				subscription_task_executor.clone(),1099			)?;11001101			Ok(rpc_module)1102		}1103	});11041105	sc_service::spawn_tasks(sc_service::SpawnTasksParams {1106		network,1107		sync_service,1108		client,1109		keystore: keystore_container.keystore(),1110		task_manager: &mut task_manager,1111		transaction_pool,1112		rpc_builder,1113		backend,1114		system_rpc_tx,1115		config,1116		telemetry: None,1117		tx_handler_controller,1118	})?;11191120	network_starter.start_network();1121	Ok(task_manager)1122}11231124fn overrides_handle<C, BE>(client: Arc<C>) -> Arc<OverrideHandle<Block>>1125where1126	C: ProvideRuntimeApi<Block> + StorageProvider<Block, BE> + AuxStore,1127	C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError>,1128	C: Send + Sync + 'static,1129	C::Api: fp_rpc::EthereumRuntimeRPCApi<Block>,1130	BE: Backend<Block> + 'static,1131	BE::State: StateBackend<BlakeTwo256>,1132{1133	let mut overrides_map = BTreeMap::new();1134	overrides_map.insert(1135		EthereumStorageSchema::V1,1136		Box::new(SchemaV1Override::new(client.clone())) as Box<dyn StorageOverride<_> + 'static>,1137	);1138	overrides_map.insert(1139		EthereumStorageSchema::V2,1140		Box::new(SchemaV2Override::new(client.clone())) as Box<dyn StorageOverride<_> + 'static>,1141	);1142	overrides_map.insert(1143		EthereumStorageSchema::V3,1144		Box::new(SchemaV3Override::new(client.clone())) as Box<dyn StorageOverride<_> + 'static>,1145	);11461147	Arc::new(OverrideHandle {1148		schemas: overrides_map,1149		fallback: Box::new(RuntimeApiStorageOverride::new(client)),1150	})1151}11521153pub struct FrontierTaskParams<'a, C, B> {1154	pub task_manager: &'a TaskManager,1155	pub client: Arc<C>,1156	pub substrate_backend: Arc<B>,1157	pub eth_backend: Arc<fc_db::kv::Backend<Block>>,1158	pub eth_filter_pool: Option<FilterPool>,1159	pub overrides: Arc<OverrideHandle<Block>>,1160	pub fee_history_limit: u64,1161	pub fee_history_cache: FeeHistoryCache,1162	pub sync_strategy: SyncStrategy,1163	pub prometheus_registry: Option<Registry>,1164}11651166pub fn spawn_frontier_tasks<C, B>(1167	params: FrontierTaskParams<C, B>,1168	sync: Arc<SyncingService<Block>>,1169	pubsub_notification_sinks: Arc<1170		EthereumBlockNotificationSinks<fc_mapping_sync::EthereumBlockNotification<Block>>,1171	>,1172) -> Arc<EthBlockDataCacheTask<Block>>1173where1174	C: ProvideRuntimeApi<Block> + BlockOf,1175	C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError> + 'static,1176	C: BlockchainEvents<Block> + StorageProvider<Block, B>,1177	C: Send + Sync + 'static,1178	C::Api: EthereumRuntimeRPCApi<Block>,1179	C::Api: BlockBuilder<Block>,1180	B: Backend<Block> + 'static,1181	B::State: StateBackend<BlakeTwo256>,1182{1183	let FrontierTaskParams {1184		task_manager,1185		client,1186		substrate_backend,1187		eth_backend,1188		eth_filter_pool,1189		overrides,1190		fee_history_limit,1191		fee_history_cache,1192		sync_strategy,1193		prometheus_registry,1194	} = params;1195	// Frontier offchain DB task. Essential.1196	// Maps emulated ethereum data to substrate native data.1197	params.task_manager.spawn_essential_handle().spawn(1198		"frontier-mapping-sync-worker",1199		Some("frontier"),1200		MappingSyncWorker::new(1201			client.import_notification_stream(),1202			Duration::new(6, 0),1203			client.clone(),1204			substrate_backend,1205			overrides.clone(),1206			eth_backend,1207			3,1208			0,1209			sync_strategy,1210			sync,1211			pubsub_notification_sinks,1212		)1213		.for_each(|()| futures::future::ready(())),1214	);12151216	// Frontier `EthFilterApi` maintenance.1217	// Manages the pool of user-created Filters.1218	if let Some(eth_filter_pool) = eth_filter_pool {1219		// Each filter is allowed to stay in the pool for 100 blocks.1220		const FILTER_RETAIN_THRESHOLD: u64 = 100;1221		params.task_manager.spawn_essential_handle().spawn(1222			"frontier-filter-pool",1223			Some("frontier"),1224			EthTask::filter_pool_task(client.clone(), eth_filter_pool, FILTER_RETAIN_THRESHOLD),1225		);1226	}12271228	// Spawn Frontier FeeHistory cache maintenance task.1229	params.task_manager.spawn_essential_handle().spawn(1230		"frontier-fee-history",1231		Some("frontier"),1232		EthTask::fee_history_task(1233			client,1234			overrides.clone(),1235			fee_history_cache,1236			fee_history_limit,1237		),1238	);12391240	Arc::new(EthBlockDataCacheTask::new(1241		task_manager.spawn_handle(),1242		overrides,1243		50,1244		50,1245		prometheus_registry,1246	))1247}
modifiedpallets/app-promotion/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/app-promotion/src/benchmarking.rs
+++ b/pallets/app-promotion/src/benchmarking.rs
@@ -109,7 +109,7 @@
 	}
 
 	#[benchmark]
-	fn payout_stakers(b: Linear<0, 100>) -> Result<(), BenchmarkError> {
+	fn payout_stakers(b: Linear<1, 100>) -> Result<(), BenchmarkError> {
 		let pallet_admin = account::<T::AccountId>("admin", 1, SEED);
 		PromototionPallet::<T>::set_admin_address(
 			RawOrigin::Root.into(),
modifiedpallets/collator-selection/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/collator-selection/src/benchmarking.rs
+++ b/pallets/collator-selection/src/benchmarking.rs
@@ -171,7 +171,8 @@
 	// Both invulnerables and candidates count together against MaxCollators.
 	// Maybe try putting it in braces? 1 .. (T::MaxCollators::get() - 2)
 	#[benchmark]
-	fn add_invulnerable<T>(b: Linear<1, MAX_COLLATORS>) -> Result<(), BenchmarkError> {
+	fn add_invulnerable<T>(b: Linear<2, MAX_INVULNERABLES>) -> Result<(), BenchmarkError> {
+		let b = b - 1;
 		register_validators::<T>(b);
 		register_invulnerables::<T>(b);
 
@@ -268,7 +269,8 @@
 	// worst case is when we have all the max-candidate slots filled except one, and we fill that
 	// one.
 	#[benchmark]
-	fn onboard(c: Linear<1, MAX_INVULNERABLES>) -> Result<(), BenchmarkError> {
+	fn onboard(c: Linear<2, MAX_INVULNERABLES>) -> Result<(), BenchmarkError> {
+		let c = c - 1;
 		register_validators::<T>(c);
 		register_candidates::<T>(c);
 
@@ -293,9 +295,7 @@
 
 	// worst case is the last candidate leaving.
 	#[benchmark]
-	fn offboard(c: Linear<0, MAX_INVULNERABLES>) -> Result<(), BenchmarkError> {
-		let c = c + 1;
-
+	fn offboard(c: Linear<1, MAX_INVULNERABLES>) -> Result<(), BenchmarkError> {
 		register_validators::<T>(c);
 		register_candidates::<T>(c);
 
@@ -317,8 +317,7 @@
 
 	// worst case is the last candidate leaving.
 	#[benchmark]
-	fn release_license(c: Linear<0, MAX_INVULNERABLES>) -> Result<(), BenchmarkError> {
-		let c = c + 1;
+	fn release_license(c: Linear<1, MAX_INVULNERABLES>) -> Result<(), BenchmarkError> {
 		let bond = balance_unit::<T>();
 
 		register_validators::<T>(c);
@@ -343,8 +342,7 @@
 
 	// worst case is the last candidate leaving.
 	#[benchmark]
-	fn force_release_license(c: Linear<0, MAX_INVULNERABLES>) -> Result<(), BenchmarkError> {
-		let c = c + 1;
+	fn force_release_license(c: Linear<1, MAX_INVULNERABLES>) -> Result<(), BenchmarkError> {
 		let bond = balance_unit::<T>();
 
 		register_validators::<T>(c);
@@ -400,12 +398,9 @@
 	// worst case for new session.
 	#[benchmark]
 	fn new_session(
-		r: Linear<0, MAX_INVULNERABLES>,
-		c: Linear<0, MAX_INVULNERABLES>,
+		r: Linear<1, MAX_INVULNERABLES>,
+		c: Linear<1, MAX_INVULNERABLES>,
 	) -> Result<(), BenchmarkError> {
-		let r = r + 1;
-		let c = c + 1;
-
 		frame_system::Pallet::<T>::set_block_number(0u32.into());
 
 		register_validators::<T>(c);
modifiedpallets/nonfungible/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/benchmarking.rs
+++ b/pallets/nonfungible/src/benchmarking.rs
@@ -17,9 +17,7 @@
 use frame_benchmarking::v2::{account, benchmarks, BenchmarkError};
 use pallet_common::{
 	bench_init,
-	benchmarking::{
-		create_collection_raw, load_is_admin_and_property_permissions, property_key, property_value,
-	},
+	benchmarking::{create_collection_raw, property_key, property_value},
 	CommonCollectionOperations,
 };
 use sp_std::prelude::*;
@@ -334,49 +332,51 @@
 		Ok(())
 	}
 
+	// TODO:
 	#[benchmark]
 	fn init_token_properties(b: Linear<0, MAX_PROPERTIES_PER_ITEM>) -> Result<(), BenchmarkError> {
-		bench_init! {
-			owner: sub; collection: collection(owner);
-			owner: cross_from_sub;
-		};
+		// bench_init! {
+		// 	owner: sub; collection: collection(owner);
+		// 	owner: cross_from_sub;
+		// };
 
-		let perms = (0..b)
-			.map(|k| PropertyKeyPermission {
-				key: property_key(k as usize),
-				permission: PropertyPermission {
-					mutable: false,
-					collection_admin: true,
-					token_owner: true,
-				},
-			})
-			.collect::<Vec<_>>();
-		<Pallet<T>>::set_token_property_permissions(&collection, &owner, perms)?;
-		let props = (0..b)
-			.map(|k| Property {
-				key: property_key(k as usize),
-				value: property_value(),
-			})
-			.collect::<Vec<_>>();
-		let item = create_max_item(&collection, &owner, owner.clone())?;
+		// let perms = (0..b)
+		// 	.map(|k| PropertyKeyPermission {
+		// 		key: property_key(k as usize),
+		// 		permission: PropertyPermission {
+		// 			mutable: false,
+		// 			collection_admin: true,
+		// 			token_owner: true,
+		// 		},
+		// 	})
+		// 	.collect::<Vec<_>>();
+		// <Pallet<T>>::set_token_property_permissions(&collection, &owner, perms)?;
+		#[block]
+		{}
+		// let props = (0..b)
+		// 	.map(|k| Property {
+		// 		key: property_key(k as usize),
+		// 		value: property_value(),
+		// 	})
+		// 	.collect::<Vec<_>>();
+		// let item = create_max_item(&collection, &owner, owner.clone())?;
 
 		// let (is_collection_admin, property_permissions) =
 		// 	load_is_admin_and_property_permissions(&collection, &owner);
-		todo!();
-		#[block]
-		{
-			// let mut property_writer =
-			// 	pallet_common::BenchmarkPropertyWriter::new(&collection, lazy_collection_info);
+		// #[block]
+		// {
+		// 	let mut property_writer =
+		// 		pallet_common::BenchmarkPropertyWriter::new(&collection, lazy_collection_info);
 
-			// property_writer.write_token_properties(
-			// 	item,
-			// 	props.into_iter(),
-			// 	crate::erc::ERC721TokenEvent::TokenChanged {
-			// 		token_id: item.into(),
-			// 	}
-			// 	.to_log(T::ContractAddress::get()),
-			// )?;
-		}
+		// 	property_writer.write_token_properties(
+		// 		item,
+		// 		props.into_iter(),
+		// 		crate::erc::ERC721TokenEvent::TokenChanged {
+		// 			token_id: item.into(),
+		// 		}
+		// 		.to_log(T::ContractAddress::get()),
+		// 	)?;
+		// }
 
 		Ok(())
 	}
modifiedpallets/refungible/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/refungible/src/benchmarking.rs
+++ b/pallets/refungible/src/benchmarking.rs
@@ -490,35 +490,35 @@
 		Ok(())
 	}
 
+	// TODO:
 	#[benchmark]
 	fn init_token_properties(b: Linear<0, MAX_PROPERTIES_PER_ITEM>) -> Result<(), BenchmarkError> {
-		bench_init! {
-			owner: sub; collection: collection(owner);
-			owner: cross_from_sub;
-		};
+		// bench_init! {
+		// 	owner: sub; collection: collection(owner);
+		// 	owner: cross_from_sub;
+		// };
+
+		// let perms = (0..b)
+		// 	.map(|k| PropertyKeyPermission {
+		// 		key: property_key(k as usize),
+		// 		permission: PropertyPermission {
+		// 			mutable: false,
+		// 			collection_admin: true,
+		// 			token_owner: true,
+		// 		},
+		// 	})
+		// 	.collect::<Vec<_>>();
+		// <Pallet<T>>::set_token_property_permissions(&collection, &owner, perms)?;
 
-		let perms = (0..b)
-			.map(|k| PropertyKeyPermission {
-				key: property_key(k as usize),
-				permission: PropertyPermission {
-					mutable: false,
-					collection_admin: true,
-					token_owner: true,
-				},
-			})
-			.collect::<Vec<_>>();
-		<Pallet<T>>::set_token_property_permissions(&collection, &owner, perms)?;
+		#[block]
+		{}
 		// let props = (0..b).map(|k| Property {
 		// 	key: property_key(k as usize),
 		// 	value: property_value(),
 		// }).collect::<Vec<_>>();
 		// let item = create_max_item(&collection, &owner, [(owner.clone(), 200)])?;
 
-		// let (is_collection_admin, property_permissions) = load_is_admin_and_property_permissions(&collection, &owner);
-
-		#[block]
-		{}
-		todo!();
+		// let (is_collection_admin, property_permissions) = load_is_admin_and_property_permissions(&collection, &owner)
 		// let mut property_writer = pallet_common::collection_info_loaded_property_writer(
 		// 	&collection,
 		// 	is_collection_admin,