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
before · pallets/collator-selection/Cargo.toml
1[package]2authors = ["Parity Technologies <admin@parity.io>", "Unique Network <support@uniquenetwork.io>"]3description = "Simple staking pallet with a fixed stake."4edition = "2021"5homepage = "https://unique.network"6license = "GPLv3"7name = "pallet-collator-selection"8repository = "https://github.com/UniqueNetwork/unique-chain"9version = "5.0.0"1011[package.metadata.docs.rs]12targets = ["x86_64-unknown-linux-gnu"]1314[dependencies]15log = { workspace = true }16parity-scale-codec = { workspace = true }17rand = { version = "0.8.5", default-features = false }18scale-info = { workspace = true }19serde = { workspace = true }2021frame-support = { workspace = true }22frame-system = { workspace = true }23pallet-authorship = { workspace = true }24pallet-session = { workspace = true }25sp-runtime = { workspace = true }26sp-staking = { workspace = true }27sp-std = { workspace = true }2829frame-benchmarking = { workspace = true, optional = true }3031[dev-dependencies]32pallet-aura = { workspace = true }33pallet-balances = { features = ["insecure_zero_ed"], workspace = true }34pallet-timestamp = { workspace = true }35sp-consensus-aura = { workspace = true }36sp-core = { workspace = true }37sp-io = { workspace = true }38sp-runtime = { workspace = true }39sp-tracing = { workspace = true }4041[features]42default = ["std"]43runtime-benchmarks = [44	"frame-benchmarking/runtime-benchmarks",45	"frame-support/runtime-benchmarks",46	"frame-system/runtime-benchmarks",47]48std = [49	"frame-benchmarking/std",50	"frame-support/std",51	"frame-system/std",52	"log/std",53	"pallet-authorship/std",54	"pallet-session/std",55	"parity-scale-codec/std",56	"rand/std",57	"scale-info/std",58	"sp-consensus-aura/std",59	"sp-runtime/std",60	"sp-staking/std",61	"sp-std/std",62	'pallet-aura/std',63	'pallet-balances/std',64]6566try-runtime = ["frame-support/try-runtime"]
after · pallets/collator-selection/Cargo.toml
1[package]2authors = ["Parity Technologies <admin@parity.io>", "Unique Network <support@uniquenetwork.io>"]3description = "Simple staking pallet with a fixed stake."4edition = "2021"5homepage = "https://unique.network"6license = "GPLv3"7name = "pallet-collator-selection"8repository = "https://github.com/UniqueNetwork/unique-chain"9version = "5.0.0"1011[package.metadata.docs.rs]12targets = ["x86_64-unknown-linux-gnu"]1314[dependencies]15log = { workspace = true }16parity-scale-codec = { workspace = true }17rand = { version = "0.8.5", default-features = false, features = ["std_rng"] }18scale-info = { workspace = true }19serde = { workspace = true }2021frame-support = { workspace = true }22frame-system = { workspace = true }23pallet-authorship = { workspace = true }24pallet-session = { workspace = true }25sp-runtime = { workspace = true }26sp-staking = { workspace = true }27sp-std = { workspace = true }2829frame-benchmarking = { workspace = true, optional = true }3031[dev-dependencies]32pallet-aura = { workspace = true }33pallet-balances = { features = ["insecure_zero_ed"], workspace = true }34pallet-timestamp = { workspace = true }35sp-consensus-aura = { workspace = true }36sp-core = { workspace = true }37sp-io = { workspace = true }38sp-runtime = { workspace = true }39sp-tracing = { workspace = true }4041[features]42default = ["std"]43runtime-benchmarks = [44	"frame-benchmarking/runtime-benchmarks",45	"frame-support/runtime-benchmarks",46	"frame-system/runtime-benchmarks",47]48std = [49	"frame-benchmarking/std",50	"frame-support/std",51	"frame-system/std",52	"log/std",53	"pallet-authorship/std",54	"pallet-session/std",55	"parity-scale-codec/std",56	"rand/std",57	"scale-info/std",58	"sp-consensus-aura/std",59	"sp-runtime/std",60	"sp-staking/std",61	"sp-std/std",62	'pallet-aura/std',63	'pallet-balances/std',64]6566try-runtime = ["frame-support/try-runtime"]
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
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -136,6 +136,7 @@
 	'sp-runtime/std',
 	'sp-session/std',
 	'sp-std/std',
+    'sp-storage/std',
 	'sp-transaction-pool/std',
 	'sp-version/std',
 	'staging-xcm-builder/std',
@@ -279,6 +280,7 @@
 sp-runtime = { workspace = true }
 sp-session = { workspace = true }
 sp-std = { workspace = true }
+sp-storage = { workspace = true }
 sp-transaction-pool = { workspace = true }
 sp-version = { workspace = true }
 staging-xcm = { workspace = true }