Skip to content

Commit dc6fe9a

Browse files
authored
Fix CI check and remove try-runtime command (#3046)
* CI: Fix check-try-runtime (preparation for the monorepo) Warnings should be treated as errors here, since this is how it will be done in the monorepo. I expect to see two errors in this check now. Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Allow deprecated Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Remove try-runtime command Signed-off-by: Oliver Tale-Yazdi <[email protected]> * make it compile Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Remove try-runtime-cli dependency Signed-off-by: Oliver Tale-Yazdi <[email protected]> --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]>
1 parent 81c68c5 commit dc6fe9a

File tree

8 files changed

+10
-68
lines changed

8 files changed

+10
-68
lines changed

cumulus/Cargo.lock

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cumulus/parachain-template/node/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master
5151
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master" }
5252
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "master" }
5353
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "master" }
54-
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }
5554

5655
# Polkadot
5756
polkadot-cli = { git = "https://github.com/paritytech/polkadot", features = ["rococo-native"] , branch = "master" }
@@ -80,7 +79,6 @@ runtime-benchmarks = [
8079
"polkadot-cli/runtime-benchmarks",
8180
]
8281
try-runtime = [
83-
"try-runtime-cli/try-runtime",
8482
"parachain-template-runtime/try-runtime"
8583
]
8684
network-protocol-staging = [

cumulus/parachain-template/node/src/cli.rs

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

38-
/// Try some testing command against a specified runtime state.
39-
#[cfg(feature = "try-runtime")]
40-
TryRuntime(try_runtime_cli::TryRuntimeCmd),
41-
42-
/// Errors since the binary was not build with `--features try-runtime`.
43-
#[cfg(not(feature = "try-runtime"))]
38+
/// Try-runtime has migrated to a standalone
39+
/// [CLI](<https://github.com/paritytech/try-runtime-cli>). The subcommand exists as a stub and
40+
/// deprecation notice. It will be removed entirely some time after Janurary 2024.
4441
TryRuntime,
4542
}
4643

cumulus/parachain-template/node/src/command.rs

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -216,32 +216,7 @@ pub fn run() -> Result<()> {
216216
_ => Err("Benchmarking sub-command unsupported".into()),
217217
}
218218
},
219-
#[cfg(feature = "try-runtime")]
220-
Some(Subcommand::TryRuntime(cmd)) => {
221-
use parachain_template_runtime::MILLISECS_PER_BLOCK;
222-
use try_runtime_cli::block_building_info::timestamp_with_aura_info;
223-
224-
let runner = cli.create_runner(cmd)?;
225-
226-
type HostFunctions =
227-
(sp_io::SubstrateHostFunctions, frame_benchmarking::benchmarking::HostFunctions);
228-
229-
// grab the task manager.
230-
let registry = &runner.config().prometheus_config.as_ref().map(|cfg| &cfg.registry);
231-
let task_manager =
232-
sc_service::TaskManager::new(runner.config().tokio_handle.clone(), *registry)
233-
.map_err(|e| format!("Error: {:?}", e))?;
234-
235-
let info_provider = timestamp_with_aura_info(MILLISECS_PER_BLOCK);
236-
237-
runner.async_run(|_| {
238-
Ok((cmd.run::<Block, HostFunctions, _>(Some(info_provider)), task_manager))
239-
})
240-
},
241-
#[cfg(not(feature = "try-runtime"))]
242-
Some(Subcommand::TryRuntime) => Err("Try-runtime was not enabled when building the node. \
243-
You can enable it with `--features try-runtime`."
244-
.into()),
219+
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()),
245220
None => {
246221
let runner = cli.create_runner(&cli.run.normalize())?;
247222
let collator_options = cli.run.collator_options();

cumulus/polkadot-parachain/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
6767
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "master" }
6868
sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "master" }
6969
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "master" }
70-
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }
7170
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
7271
frame-rpc-system = { package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "master" }
7372
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
@@ -124,5 +123,4 @@ try-runtime = [
124123
"asset-hub-kusama-runtime/try-runtime",
125124
"asset-hub-westend-runtime/try-runtime",
126125
"shell-runtime/try-runtime",
127-
"try-runtime-cli/try-runtime",
128126
]

cumulus/polkadot-parachain/src/cli.rs

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

58-
/// Try some testing command against a specified runtime state.
59-
#[cfg(feature = "try-runtime")]
60-
TryRuntime(try_runtime_cli::TryRuntimeCmd),
61-
62-
/// Errors since the binary was not build with `--features try-runtime`.
63-
#[cfg(not(feature = "try-runtime"))]
58+
/// Try-runtime has migrated to a standalone
59+
/// [CLI](<https://github.com/paritytech/try-runtime-cli>). The subcommand exists as a stub and
60+
/// deprecation notice. It will be removed entirely some time after January 2024.
6461
TryRuntime,
6562
}
6663

cumulus/polkadot-parachain/src/command.rs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -731,29 +731,7 @@ pub fn run() -> Result<()> {
731731
_ => Err("Benchmarking sub-command unsupported".into()),
732732
}
733733
},
734-
#[cfg(feature = "try-runtime")]
735-
Some(Subcommand::TryRuntime(cmd)) => {
736-
use try_runtime_cli::block_building_info::timestamp_with_aura_info;
737-
738-
// grab the task manager.
739-
let runner = cli.create_runner(cmd)?;
740-
let registry = &runner.config().prometheus_config.as_ref().map(|cfg| &cfg.registry);
741-
let task_manager =
742-
sc_service::TaskManager::new(runner.config().tokio_handle.clone(), *registry)
743-
.map_err(|e| format!("Error: {:?}", e))?;
744-
type HostFunctions =
745-
(sp_io::SubstrateHostFunctions, frame_benchmarking::benchmarking::HostFunctions);
746-
747-
let info_provider = timestamp_with_aura_info(6000);
748-
749-
runner.async_run(|_| {
750-
Ok((cmd.run::<Block, HostFunctions, _>(Some(info_provider)), task_manager))
751-
})
752-
},
753-
#[cfg(not(feature = "try-runtime"))]
754-
Some(Subcommand::TryRuntime) => Err("Try-runtime was not enabled when building the node. \
755-
You can enable it with `--features try-runtime`."
756-
.into()),
734+
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()),
757735
Some(Subcommand::Key(cmd)) => Ok(cmd.run(&cli)?),
758736
None => {
759737
let runner = cli.create_runner(&cli.run.normalize())?;

cumulus/scripts/ci/gitlab/pipeline/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ cargo-check-try-runtime:
6565
extends:
6666
- .docker-env
6767
- .common-refs
68+
variables:
69+
RUSTFLAGS: "-D warnings"
6870
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
6971
needs:
7072
- job: check-runtime-benchmarks

0 commit comments

Comments
 (0)