diff --git a/Cargo.lock b/Cargo.lock index 8b0a023b0ce..6db7f256f8a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9198,7 +9198,6 @@ dependencies = [ "substrate-build-script-utils", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", - "try-runtime-cli", "xcm", ] @@ -10600,7 +10599,6 @@ dependencies = [ "substrate-state-trie-migration-rpc", "tempfile", "tokio", - "try-runtime-cli", "wait-timeout", "xcm", ] @@ -15848,7 +15846,6 @@ dependencies = [ "async-trait", "clap", "frame-remote-externalities", - "frame-try-runtime", "hex", "log", "parity-scale-codec", diff --git a/parachain-template/node/Cargo.toml b/parachain-template/node/Cargo.toml index 83a60b126c6..62ce3ca8d5d 100644 --- a/parachain-template/node/Cargo.toml +++ b/parachain-template/node/Cargo.toml @@ -51,7 +51,6 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master" } substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "master" } substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "master" } -try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true } # Polkadot polkadot-cli = { git = "https://github.com/paritytech/polkadot", features = ["rococo-native"] , branch = "master" } @@ -80,7 +79,6 @@ runtime-benchmarks = [ "polkadot-cli/runtime-benchmarks", ] try-runtime = [ - "try-runtime-cli/try-runtime", "parachain-template-runtime/try-runtime" ] network-protocol-staging = [ diff --git a/parachain-template/node/src/cli.rs b/parachain-template/node/src/cli.rs index b72579c86b9..098f59b0f37 100644 --- a/parachain-template/node/src/cli.rs +++ b/parachain-template/node/src/cli.rs @@ -35,12 +35,9 @@ pub enum Subcommand { #[command(subcommand)] Benchmark(frame_benchmarking_cli::BenchmarkCmd), - /// Try some testing command against a specified runtime state. - #[cfg(feature = "try-runtime")] - TryRuntime(try_runtime_cli::TryRuntimeCmd), - - /// Errors since the binary was not build with `--features try-runtime`. - #[cfg(not(feature = "try-runtime"))] + /// Try-runtime has migrated to a standalone + /// [CLI](). The subcommand exists as a stub and + /// deprecation notice. It will be removed entirely some time after Janurary 2024. TryRuntime, } diff --git a/parachain-template/node/src/command.rs b/parachain-template/node/src/command.rs index 5ba88126fcd..7acfb0c2035 100644 --- a/parachain-template/node/src/command.rs +++ b/parachain-template/node/src/command.rs @@ -216,32 +216,7 @@ pub fn run() -> Result<()> { _ => Err("Benchmarking sub-command unsupported".into()), } }, - #[cfg(feature = "try-runtime")] - Some(Subcommand::TryRuntime(cmd)) => { - use parachain_template_runtime::MILLISECS_PER_BLOCK; - use try_runtime_cli::block_building_info::timestamp_with_aura_info; - - let runner = cli.create_runner(cmd)?; - - type HostFunctions = - (sp_io::SubstrateHostFunctions, frame_benchmarking::benchmarking::HostFunctions); - - // grab the task manager. - let registry = &runner.config().prometheus_config.as_ref().map(|cfg| &cfg.registry); - let task_manager = - sc_service::TaskManager::new(runner.config().tokio_handle.clone(), *registry) - .map_err(|e| format!("Error: {:?}", e))?; - - let info_provider = timestamp_with_aura_info(MILLISECS_PER_BLOCK); - - runner.async_run(|_| { - Ok((cmd.run::(Some(info_provider)), task_manager)) - }) - }, - #[cfg(not(feature = "try-runtime"))] - Some(Subcommand::TryRuntime) => Err("Try-runtime was not enabled when building the node. \ - You can enable it with `--features try-runtime`." - .into()), + Some(Subcommand::TryRuntime) => Err("The `try-runtime` subcommand has been migrated to a standalone CLI (https://github.com/paritytech/try-runtime-cli). It is no longer being maintained here and will be removed entirely some time after January 2024. Please remove this subcommand from your runtime and use the standalone CLI.".into()), None => { let runner = cli.create_runner(&cli.run.normalize())?; let collator_options = cli.run.collator_options(); diff --git a/polkadot-parachain/Cargo.toml b/polkadot-parachain/Cargo.toml index cb58b7705ae..9ed44e36559 100644 --- a/polkadot-parachain/Cargo.toml +++ b/polkadot-parachain/Cargo.toml @@ -67,7 +67,6 @@ sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "master" } substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "master" } -try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true } sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "master" } frame-rpc-system = { package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "master" } pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" } @@ -124,5 +123,4 @@ try-runtime = [ "asset-hub-kusama-runtime/try-runtime", "asset-hub-westend-runtime/try-runtime", "shell-runtime/try-runtime", - "try-runtime-cli/try-runtime", ] diff --git a/polkadot-parachain/src/cli.rs b/polkadot-parachain/src/cli.rs index 7be61810a7d..11b2e105ecb 100644 --- a/polkadot-parachain/src/cli.rs +++ b/polkadot-parachain/src/cli.rs @@ -55,12 +55,9 @@ pub enum Subcommand { #[command(subcommand)] Benchmark(frame_benchmarking_cli::BenchmarkCmd), - /// Try some testing command against a specified runtime state. - #[cfg(feature = "try-runtime")] - TryRuntime(try_runtime_cli::TryRuntimeCmd), - - /// Errors since the binary was not build with `--features try-runtime`. - #[cfg(not(feature = "try-runtime"))] + /// Try-runtime has migrated to a standalone + /// [CLI](). The subcommand exists as a stub and + /// deprecation notice. It will be removed entirely some time after January 2024. TryRuntime, } diff --git a/polkadot-parachain/src/command.rs b/polkadot-parachain/src/command.rs index a502b40fe6c..008e5435f0b 100644 --- a/polkadot-parachain/src/command.rs +++ b/polkadot-parachain/src/command.rs @@ -731,29 +731,7 @@ pub fn run() -> Result<()> { _ => Err("Benchmarking sub-command unsupported".into()), } }, - #[cfg(feature = "try-runtime")] - Some(Subcommand::TryRuntime(cmd)) => { - use try_runtime_cli::block_building_info::timestamp_with_aura_info; - - // grab the task manager. - let runner = cli.create_runner(cmd)?; - let registry = &runner.config().prometheus_config.as_ref().map(|cfg| &cfg.registry); - let task_manager = - sc_service::TaskManager::new(runner.config().tokio_handle.clone(), *registry) - .map_err(|e| format!("Error: {:?}", e))?; - type HostFunctions = - (sp_io::SubstrateHostFunctions, frame_benchmarking::benchmarking::HostFunctions); - - let info_provider = timestamp_with_aura_info(6000); - - runner.async_run(|_| { - Ok((cmd.run::(Some(info_provider)), task_manager)) - }) - }, - #[cfg(not(feature = "try-runtime"))] - Some(Subcommand::TryRuntime) => Err("Try-runtime was not enabled when building the node. \ - You can enable it with `--features try-runtime`." - .into()), + Some(Subcommand::TryRuntime) => Err("The `try-runtime` subcommand has been migrated to a standalone CLI (https://github.com/paritytech/try-runtime-cli). It is no longer being maintained here and will be removed entirely some time after January 2024. Please remove this subcommand from your runtime and use the standalone CLI.".into()), Some(Subcommand::Key(cmd)) => Ok(cmd.run(&cli)?), None => { let runner = cli.create_runner(&cli.run.normalize())?; diff --git a/scripts/ci/gitlab/pipeline/test.yml b/scripts/ci/gitlab/pipeline/test.yml index 81d8fbf4d1d..2d84010cb74 100644 --- a/scripts/ci/gitlab/pipeline/test.yml +++ b/scripts/ci/gitlab/pipeline/test.yml @@ -65,6 +65,8 @@ cargo-check-try-runtime: extends: - .docker-env - .common-refs + variables: + RUSTFLAGS: "-D warnings" # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs needs: - job: check-runtime-benchmarks