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

Commit 107db5c

Browse files
author
parity-processbot
committed
Merge remote-tracking branch 'origin/master' into at/contract-env
2 parents 9592ce6 + 94be94b commit 107db5c

File tree

160 files changed

+6828
-5617
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+6828
-5617
lines changed

Cargo.lock

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

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-template/node/src/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub fn new_partial(
4949
FullClient,
5050
FullBackend,
5151
FullSelectChain,
52-
sc_consensus::DefaultImportQueue<Block, FullClient>,
52+
sc_consensus::DefaultImportQueue<Block>,
5353
sc_transaction_pool::FullPool<Block, FullClient>,
5454
(
5555
sc_consensus_grandpa::GrandpaBlockImport<

bin/node-template/pallets/template/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub mod pallet {
9494
// Read a value from storage.
9595
match <Something<T>>::get() {
9696
// Return an error if the value has not been set.
97-
None => return Err(Error::<T>::NoneValue.into()),
97+
None => Err(Error::<T>::NoneValue.into()),
9898
Some(old) => {
9999
// Increment the value read from storage; will error in the event of overflow.
100100
let new = old.checked_add(1).ok_or(Error::<T>::StorageOverflow)?;

bin/node/cli/benches/block_production.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,7 @@ fn extrinsic_set_time(now: u64) -> OpaqueExtrinsic {
112112
.into()
113113
}
114114

115-
fn import_block(
116-
mut client: &FullClient,
117-
built: BuiltBlock<
118-
node_primitives::Block,
119-
<FullClient as sp_api::CallApiAt<node_primitives::Block>>::StateBackend,
120-
>,
121-
) {
115+
fn import_block(mut client: &FullClient, built: BuiltBlock<node_primitives::Block>) {
122116
let mut params = BlockImportParams::new(BlockOrigin::File, built.block.header);
123117
params.state_action =
124118
StateAction::ApplyChanges(sc_consensus::StorageChanges::Changes(built.storage_changes));

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`."

bin/node/cli/src/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pub fn new_partial(
140140
FullClient,
141141
FullBackend,
142142
FullSelectChain,
143-
sc_consensus::DefaultImportQueue<Block, FullClient>,
143+
sc_consensus::DefaultImportQueue<Block>,
144144
sc_transaction_pool::FullPool<Block, FullClient>,
145145
(
146146
impl Fn(

bin/node/testing/src/client.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ pub type Client = client::Client<
3636
kitchensink_runtime::RuntimeApi,
3737
>;
3838

39-
/// Transaction for kitchensink-runtime.
40-
pub type Transaction = sc_client_api::backend::TransactionFor<Backend, node_primitives::Block>;
41-
4239
/// Genesis configuration parameters for `TestClient`.
4340
#[derive(Default)]
4441
pub struct GenesisParameters;

0 commit comments

Comments
 (0)