difftreelog
fix build node with benchmarks
in: master
7 files changed
Cargo.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",
Cargo.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" }
node/cli/src/command.rsdiffbeforeafterboth354 }354 }355 #[cfg(feature = "runtime-benchmarks")]355 #[cfg(feature = "runtime-benchmarks")]356 Some(Subcommand::Benchmark(cmd)) => {356 Some(Subcommand::Benchmark(cmd)) => {357 use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};357 use polkadot_cli::Block;358 use polkadot_cli::Block;358 use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};359 use sp_io::SubstrateHostFunctions;360359 let runner = cli.create_runner(cmd)?;361 let runner = cli.create_runner(cmd)?;360 // Switch on the concrete benchmark sub-command-362 // Switch on the concrete benchmark sub-command-361 match cmd {363 match cmd {362 BenchmarkCmd::Pallet(cmd) => {364 BenchmarkCmd::Pallet(cmd) => {363 runner.sync_run(|config| cmd.run::<Block, DefaultRuntimeExecutor>(config))365 runner.sync_run(|config| cmd.run::<Block, SubstrateHostFunctions>(config))364 }366 }365 BenchmarkCmd::Block(cmd) => runner.sync_run(|config| {367 BenchmarkCmd::Block(cmd) => runner.sync_run(|config| {366 let partials = new_partial::<368 let partials = new_partial::<367 _,369 opal_runtime::Runtime,368 default_runtime::RuntimeApi,370 opal_runtime::RuntimeApi,369 DefaultRuntimeExecutor,371 OpalRuntimeExecutor,370 _,372 _,371 >(&config, crate::service::parachain_build_import_queue)?;373 >(374 &config,375 crate::service::parachain_build_import_queue::<opal_runtime::Runtime, _, _>,376 )?;372 cmd.run(partials.client)377 cmd.run(partials.client)373 }),378 }),374 BenchmarkCmd::Storage(cmd) => runner.sync_run(|config| {379 BenchmarkCmd::Storage(cmd) => runner.sync_run(|config| {375 let partials = new_partial::<380 let partials = new_partial::<376 _,381 opal_runtime::Runtime,377 default_runtime::RuntimeApi,382 opal_runtime::RuntimeApi,378 DefaultRuntimeExecutor,383 OpalRuntimeExecutor,379 _,384 _,380 >(&config, crate::service::parachain_build_import_queue)?;385 >(386 &config,387 crate::service::parachain_build_import_queue::<opal_runtime::Runtime, _, _>,388 )?;381 let db = partials.backend.expose_db();389 let db = partials.backend.expose_db();382 let storage = partials.backend.expose_storage();390 let storage = partials.backend.expose_storage();pallets/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 }
pallets/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,
runtime/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
runtime/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 }