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.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();
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.rsdiffbeforeafterboth24 erc::CrossAccountId,24 erc::CrossAccountId,25 Config as CommonConfig,25 Config as CommonConfig,26};26};27use sp_std::vec;27use sp_runtime::DispatchError;28use sp_runtime::DispatchError;28use sp_std::vec;29use up_data_structs::{29use up_data_structs::{30 CollectionId, CollectionLimits, CollectionMode, MAX_COLLECTION_DESCRIPTION_LENGTH,30 CollectionId, CollectionLimits, CollectionMode, MAX_COLLECTION_DESCRIPTION_LENGTH,31 MAX_COLLECTION_NAME_LENGTH, MAX_TOKEN_PREFIX_LENGTH,31 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 }