git.delta.rocks / unique-network / refs/commits / af2b5f4b26cc

difftreelog

fix build node with benchmarks

Yaroslav Bolyukin2023-10-11parent: #885f1d2.patch.diff
in: master

7 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6536,6 +6536,7 @@
  "sp-runtime",
  "sp-session",
  "sp-std",
+ "sp-storage",
  "sp-transaction-pool",
  "sp-version",
  "staging-xcm",
modifiedCargo.tomldiffbeforeafterboth
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -170,6 +170,7 @@
 sp-staking = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
 sp-state-machine = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
 sp-std = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
+sp-storage = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
 sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
 sp-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
 sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
modifiednode/cli/src/command.rsdiffbeforeafterboth
--- a/node/cli/src/command.rs
+++ b/node/cli/src/command.rs
@@ -354,30 +354,38 @@
 		}
 		#[cfg(feature = "runtime-benchmarks")]
 		Some(Subcommand::Benchmark(cmd)) => {
+			use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
 			use polkadot_cli::Block;
-			use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
+			use sp_io::SubstrateHostFunctions;
+
 			let runner = cli.create_runner(cmd)?;
 			// Switch on the concrete benchmark sub-command-
 			match cmd {
 				BenchmarkCmd::Pallet(cmd) => {
-					runner.sync_run(|config| cmd.run::<Block, DefaultRuntimeExecutor>(config))
+					runner.sync_run(|config| cmd.run::<Block, SubstrateHostFunctions>(config))
 				}
 				BenchmarkCmd::Block(cmd) => runner.sync_run(|config| {
 					let partials = new_partial::<
+						opal_runtime::Runtime,
+						opal_runtime::RuntimeApi,
+						OpalRuntimeExecutor,
 						_,
-						default_runtime::RuntimeApi,
-						DefaultRuntimeExecutor,
-						_,
-					>(&config, crate::service::parachain_build_import_queue)?;
+					>(
+						&config,
+						crate::service::parachain_build_import_queue::<opal_runtime::Runtime, _, _>,
+					)?;
 					cmd.run(partials.client)
 				}),
 				BenchmarkCmd::Storage(cmd) => runner.sync_run(|config| {
 					let partials = new_partial::<
+						opal_runtime::Runtime,
+						opal_runtime::RuntimeApi,
+						OpalRuntimeExecutor,
 						_,
-						default_runtime::RuntimeApi,
-						DefaultRuntimeExecutor,
-						_,
-					>(&config, crate::service::parachain_build_import_queue)?;
+					>(
+						&config,
+						crate::service::parachain_build_import_queue::<opal_runtime::Runtime, _, _>,
+					)?;
 					let db = partials.backend.expose_db();
 					let storage = partials.backend.expose_storage();
 
modifiedpallets/collator-selection/Cargo.tomldiffbeforeafterboth
--- a/pallets/collator-selection/Cargo.toml
+++ b/pallets/collator-selection/Cargo.toml
@@ -14,7 +14,7 @@
 [dependencies]
 log = { workspace = true }
 parity-scale-codec = { workspace = true }
-rand = { version = "0.8.5", default-features = false }
+rand = { version = "0.8.5", default-features = false, features = ["std_rng"] }
 scale-info = { workspace = true }
 serde = { workspace = true }
 
modifiedpallets/unique/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/unique/src/benchmarking.rs
+++ b/pallets/unique/src/benchmarking.rs
@@ -24,8 +24,8 @@
 	erc::CrossAccountId,
 	Config as CommonConfig,
 };
+use sp_runtime::DispatchError;
 use sp_std::vec;
-use sp_runtime::DispatchError;
 use up_data_structs::{
 	CollectionId, CollectionLimits, CollectionMode, MAX_COLLECTION_DESCRIPTION_LENGTH,
 	MAX_COLLECTION_NAME_LENGTH, MAX_TOKEN_PREFIX_LENGTH,
modifiedruntime/common/runtime_apis.rsdiffbeforeafterboth
--- a/runtime/common/runtime_apis.rs
+++ b/runtime/common/runtime_apis.rs
@@ -569,7 +569,8 @@
 				fn dispatch_benchmark(
 					config: frame_benchmarking::BenchmarkConfig
 				) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
-					use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
+					use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark};
+					use sp_storage::TrackedStorageKey;
 
 					let allowlist: Vec<TrackedStorageKey> = vec![
 						// Total Issuance
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
136 'sp-runtime/std',136 'sp-runtime/std',
137 'sp-session/std',137 'sp-session/std',
138 'sp-std/std',138 'sp-std/std',
139 'sp-storage/std',
139 'sp-transaction-pool/std',140 'sp-transaction-pool/std',
140 'sp-version/std',141 'sp-version/std',
141 'staging-xcm-builder/std',142 'staging-xcm-builder/std',
279sp-runtime = { workspace = true }280sp-runtime = { workspace = true }
280sp-session = { workspace = true }281sp-session = { workspace = true }
281sp-std = { workspace = true }282sp-std = { workspace = true }
283sp-storage = { workspace = true }
282sp-transaction-pool = { workspace = true }284sp-transaction-pool = { workspace = true }
283sp-version = { workspace = true }285sp-version = { workspace = true }
284staging-xcm = { workspace = true }286staging-xcm = { workspace = true }