Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit aa70241

Browse files
liamaharonrcnyggwpez
authored
deprecate try-runtime subcommand and direct users to standalone cli (#14731)
* add deprecation notice * remove try-runtime-cli tests * update docs * add estimated removal date * deprecate and remove from node-cli and node-template * try fix build script * update comment * fix link * typo in build script * Move `try-runtime-cli` install step outside of `check_dependent_project.sh` execution scope * Update scripts/ci/gitlab/pipeline/build.yml Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * remove chain arg * build runtime with try-runtime feature * kick ci * kick ci * use main branch * specify sha in try-runtime-cli cargo install * kick ci * kick ci --------- Co-authored-by: Vladimir Istyufeev <vladimir@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
1 parent 0c60003 commit aa70241

File tree

9 files changed

+20
-627
lines changed

9 files changed

+20
-627
lines changed

bin/node-template/node/src/cli.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,9 @@ pub enum Subcommand {
4141
#[command(subcommand)]
4242
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
4343

44-
/// Try some command against runtime state.
45-
#[cfg(feature = "try-runtime")]
46-
TryRuntime(try_runtime_cli::TryRuntimeCmd),
47-
48-
/// Try some command against runtime state. Note: `try-runtime` feature must be enabled.
49-
#[cfg(not(feature = "try-runtime"))]
44+
/// Try-runtime has migrated to a standalone CLI
45+
/// (<https://github.com/paritytech/try-runtime-cli>). The subcommand exists as a stub and
46+
/// deprecation notice. It will be removed entirely some time after Janurary 2024.
5047
TryRuntime,
5148

5249
/// Db meta columns information.

bin/node-template/node/src/command.rs

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ use sc_cli::SubstrateCli;
1010
use sc_service::PartialComponents;
1111
use sp_keyring::Sr25519Keyring;
1212

13-
#[cfg(feature = "try-runtime")]
14-
use try_runtime_cli::block_building_info::timestamp_with_aura_info;
15-
1613
impl SubstrateCli for Cli {
1714
fn impl_name() -> String {
1815
"Substrate Node".into()
@@ -172,28 +169,7 @@ pub fn run() -> sc_cli::Result<()> {
172169
})
173170
},
174171
#[cfg(feature = "try-runtime")]
175-
Some(Subcommand::TryRuntime(cmd)) => {
176-
use crate::service::ExecutorDispatch;
177-
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
178-
let runner = cli.create_runner(cmd)?;
179-
runner.async_run(|config| {
180-
// we don't need any of the components of new_partial, just a runtime, or a task
181-
// manager to do `async_run`.
182-
let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry);
183-
let task_manager =
184-
sc_service::TaskManager::new(config.tokio_handle.clone(), registry)
185-
.map_err(|e| sc_cli::Error::Service(sc_service::Error::Prometheus(e)))?;
186-
let info_provider = timestamp_with_aura_info(6000);
187-
188-
Ok((
189-
cmd.run::<Block, ExtendedHostFunctions<
190-
sp_io::SubstrateHostFunctions,
191-
<ExecutorDispatch as NativeExecutionDispatch>::ExtendHostFunctions,
192-
>, _>(Some(info_provider)),
193-
task_manager,
194-
))
195-
})
196-
},
172+
Some(Subcommand::TryRuntime) => Err(try_runtime_cli::DEPRECATION_NOTICE.into()),
197173
#[cfg(not(feature = "try-runtime"))]
198174
Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \
199175
You can enable it with `--features try-runtime`."

bin/node/cli/src/cli.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,9 @@ pub enum Subcommand {
5757
#[command(subcommand)]
5858
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
5959

60-
/// Try some command against runtime state.
61-
#[cfg(feature = "try-runtime")]
62-
TryRuntime(try_runtime_cli::TryRuntimeCmd),
63-
64-
/// Try some command against runtime state. Note: `try-runtime` feature must be enabled.
65-
#[cfg(not(feature = "try-runtime"))]
60+
/// Try-runtime has migrated to a standalone CLI
61+
/// (<https://github.com/paritytech/try-runtime-cli>). The subcommand exists as a stub and
62+
/// deprecation notice. It will be removed entirely some time after Janurary 2024.
6663
TryRuntime,
6764

6865
/// Key management cli utilities

bin/node/cli/src/command.rs

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ use sp_keyring::Sr25519Keyring;
3232

3333
use std::sync::Arc;
3434

35-
#[cfg(feature = "try-runtime")]
36-
use {
37-
kitchensink_runtime::constants::time::SLOT_DURATION,
38-
try_runtime_cli::block_building_info::substrate_info,
39-
};
40-
4135
impl SubstrateCli for Cli {
4236
fn impl_name() -> String {
4337
"Substrate Node".into()
@@ -227,28 +221,7 @@ pub fn run() -> Result<()> {
227221
})
228222
},
229223
#[cfg(feature = "try-runtime")]
230-
Some(Subcommand::TryRuntime(cmd)) => {
231-
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
232-
let runner = cli.create_runner(cmd)?;
233-
runner.async_run(|config| {
234-
// we don't need any of the components of new_partial, just a runtime, or a task
235-
// manager to do `async_run`.
236-
let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry);
237-
let task_manager =
238-
sc_service::TaskManager::new(config.tokio_handle.clone(), registry)
239-
.map_err(|e| sc_cli::Error::Service(sc_service::Error::Prometheus(e)))?;
240-
241-
let info_provider = substrate_info(SLOT_DURATION);
242-
243-
Ok((
244-
cmd.run::<Block, ExtendedHostFunctions<
245-
sp_io::SubstrateHostFunctions,
246-
<ExecutorDispatch as NativeExecutionDispatch>::ExtendHostFunctions,
247-
>, _>(Some(info_provider)),
248-
task_manager,
249-
))
250-
})
251-
},
224+
Some(Subcommand::TryRuntime) => Err(try_runtime_cli::DEPRECATION_NOTICE.into()),
252225
#[cfg(not(feature = "try-runtime"))]
253226
Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \
254227
You can enable it with `--features try-runtime`."

scripts/ci/gitlab/pipeline/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
variables:
1616
RUSTFLAGS: "-D warnings"
1717
script:
18+
- cargo install --locked --git https://github.com/paritytech/try-runtime-cli --rev a93c9b5abe5d31a4cf1936204f7e5c489184b521
1819
- git clone
1920
--depth=1
2021
--branch="$PIPELINE_SCRIPTS_TAG"
@@ -36,10 +37,9 @@
3637
substrate: polkadot-v*
3738
polkadot: release-v*
3839
COMPANION_CHECK_COMMAND: >
39-
time cargo build --release -p "$NETWORK"-runtime &&
40-
time cargo run --release --features try-runtime try-runtime \
40+
time cargo build --release -p "$NETWORK"-runtime --features try-runtime &&
41+
time try-runtime \
4142
--runtime ./target/release/wbuild/"$NETWORK"-runtime/target/wasm32-unknown-unknown/release/"$NETWORK"_runtime.wasm \
42-
--chain=${NETWORK}-dev \
4343
on-runtime-upgrade --checks=pre-and-post live --uri wss://${NETWORK}-try-runtime-node.parity-chains.parity.io:443
4444
4545
# Individual jobs are set up for each dependent project so that they can be ran in parallel.

0 commit comments

Comments
 (0)