From f862c2c1d723128dac35b7dcec4417281f46883d Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Mon, 3 Feb 2020 15:52:17 +0100 Subject: [PATCH 01/22] Initial commit Forked at: 9195fac755df57e18ed59fbd358ee528d2a52d0e Parent branch: origin/master From e67bd7afe3d8ef1b6f3a77850318b292678ca905 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Mon, 3 Feb 2020 16:12:20 +0100 Subject: [PATCH 02/22] WIP Forked at: 9195fac755df57e18ed59fbd358ee528d2a52d0e Parent branch: origin/master --- client/cli/src/lib.rs | 35 ++++++++++++++++----------------- client/service/src/config.rs | 38 ++++++++++++++++++++++++++---------- 2 files changed, 45 insertions(+), 28 deletions(-) diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index c602d52ed9ea5..2f8cd066db825 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -271,15 +271,13 @@ where subcommand.run(config, builder) } -/// Initialize substrate and its configuration +/// Initialize substrate. This must be done only once. /// /// This method: /// /// 1. set the panic handler /// 2. raise the FD limit /// 3. initialize the logger -/// 4. update the configuration provided with the chain specification, config directory, -/// information (version, commit), database's path, boot nodes and telemetry endpoints pub fn init( mut config: &mut Configuration, spec_factory: F, @@ -300,21 +298,6 @@ where fdlimit::raise_fd_limit(); init_logger(shared_params.log.as_ref().map(|v| v.as_ref()).unwrap_or("")); - config.chain_spec = Some(load_spec(shared_params, spec_factory)?); - config.config_dir = Some(base_path(shared_params, version)); - config.impl_commit = version.commit; - config.impl_version = version.version; - - config.database = DatabaseConfig::Path { - path: config - .in_chain_config_dir(DEFAULT_DB_CONFIG_PATH) - .expect("We provided a base_path/config_dir."), - cache_size: None, - }; - - config.network.boot_nodes = config.expect_chain_spec().boot_nodes().to_vec(); - config.telemetry_endpoints = config.expect_chain_spec().telemetry_endpoints().clone(); - Ok(()) } @@ -553,10 +536,26 @@ where pub fn update_config_for_running_node( mut config: &mut Configuration, cli: RunCmd, + version: &VersionInfo, ) -> error::Result<()> where G: RuntimeGenesis, { + if config.config_dir.is_none() { + config.config_dir = Some(base_path(&cli.shared_params, version)); + } + + if config.database.is_none() { + // NOTE: the loading of the DatabaseConfig is voluntarily delayed to here + // in case config.config_dir has been customized + config.database = DatabaseConfig::Path { + path: config + .in_chain_config_dir(DEFAULT_DB_CONFIG_PATH) + .expect("We provided a base_path/config_dir."), + cache_size: None, + }; + } + fill_config_keystore_password_and_path(&mut config, &cli)?; let keyring = cli.get_keyring(); diff --git a/client/service/src/config.rs b/client/service/src/config.rs index cb8170f7f4966..441cc29039d10 100644 --- a/client/service/src/config.rs +++ b/client/service/src/config.rs @@ -49,7 +49,7 @@ pub struct Configuration { /// Configuration for the keystore. pub keystore: KeystoreConfig, /// Configuration for the database. - pub database: DatabaseConfig, + pub database: Option, /// Size of internal state cache in Bytes pub state_cache_size: usize, /// Size in percent of cache size dedicated to child tries @@ -147,7 +147,7 @@ pub enum DatabaseConfig { impl Default for Configuration { /// Create a default config fn default() -> Self { - let configuration = Configuration { + Configuration { impl_name: "parity-substrate", impl_version: "0.0.0", impl_commit: "", @@ -159,10 +159,7 @@ impl Default for Configuration { transaction_pool: Default::default(), network: Default::default(), keystore: KeystoreConfig::None, - database: DatabaseConfig::Path { - path: Default::default(), - cache_size: Default::default(), - }, + database: None, state_cache_size: Default::default(), state_cache_child_ratio: Default::default(), pruning: PruningMode::default(), @@ -183,14 +180,35 @@ impl Default for Configuration { dev_key_seed: None, tracing_targets: Default::default(), tracing_receiver: Default::default(), - }; - - configuration + } } - } impl Configuration { + /// Create a default config using `VersionInfo` + pub fn new(version: &crate::VersionInfo) -> Self { + let mut config = Configuration::default(); + config.impl_name = version.impl_name; + config.impl_version = version.impl_version; + config.impl_commit = version.impl_commit; + + config + } + + /// Load `chain_spec` using a factory + pub fn load_spec(&mut self, spec_factory: F) -> error::Result<()> + where + F: FnOnce(&str) -> Result>, String>, + { + let chain_spec = crate::load_spec(shared_params, spec_factory)?; + + self.network.boot_nodes = chain_spec.boot_nodes().to_vec(); + self.telemetry_endpoints = chain_spec.telemetry_endpoints().clone(); + self.chain_spec = Some(chain_spec); + + self.chain_spec.as_ref().unwrap() + } + /// Returns full version string of this configuration. pub fn full_version(&self) -> String { full_version_from_strs(self.impl_version, self.impl_commit) From 916b7d51f27cb21d84bd17a23de093a3d607838d Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Mon, 3 Feb 2020 16:23:36 +0100 Subject: [PATCH 03/22] WIP Forked at: 9195fac755df57e18ed59fbd358ee528d2a52d0e Parent branch: origin/master --- client/cli/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index 2f8cd066db825..c7ef144363c49 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -692,7 +692,8 @@ fn interface_str( } } -fn parse_address( +/// Parse an address and optionally set the port to `port` if provided in argument. +pub fn parse_address( address: &str, port: Option, ) -> Result { From 99cdfe6b7658b5cbeb5a991ee7da34aa6c8ec62d Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Mon, 3 Feb 2020 16:29:51 +0100 Subject: [PATCH 04/22] WIP Forked at: 9195fac755df57e18ed59fbd358ee528d2a52d0e Parent branch: origin/master --- client/cli/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index c7ef144363c49..cd6aa6bcf629a 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -624,16 +624,16 @@ where } }); - if config.rpc_http.is_none() { + if config.rpc_http.is_none() || cli.rpc_port.is_some() { let rpc_interface: &str = interface_str(cli.rpc_external, cli.unsafe_rpc_external, cli.validator)?; config.rpc_http = Some(parse_address(&format!("{}:{}", rpc_interface, 9933), cli.rpc_port)?); } - if config.rpc_ws.is_none() { + if config.rpc_ws.is_none() || cli.ws_port.is_some() { let ws_interface: &str = interface_str(cli.ws_external, cli.unsafe_ws_external, cli.validator)?; config.rpc_ws = Some(parse_address(&format!("{}:{}", ws_interface, 9944), cli.ws_port)?); } - if config.grafana_port.is_none() { + if config.grafana_port.is_none() || cli.grafana_port.is_some() { let grafana_interface: &str = if cli.grafana_external { "0.0.0.0" } else { "127.0.0.1" }; config.grafana_port = Some( parse_address(&format!("{}:{}", grafana_interface, 9955), cli.grafana_port)? From 5d9f054578b2042cd9de8db6d9c27aa7e4f5687f Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Mon, 3 Feb 2020 17:32:58 +0100 Subject: [PATCH 05/22] WIP Forked at: 9195fac755df57e18ed59fbd358ee528d2a52d0e Parent branch: origin/master --- client/cli/src/lib.rs | 81 ++++++++++++++++------------------- client/cli/src/params.rs | 5 ++- client/service/src/builder.rs | 4 +- client/service/src/config.rs | 52 ++++++++++++++-------- 4 files changed, 77 insertions(+), 65 deletions(-) diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index cd6aa6bcf629a..8eab1b7df9813 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -35,6 +35,7 @@ use sc_service::{ RuntimeGenesis, ChainSpecExtension, PruningMode, ChainSpec, AbstractService, Roles as ServiceRoles, }; +pub use sc_service::config::{VersionInfo}; use sc_network::{ self, multiaddr::Protocol, @@ -79,26 +80,18 @@ const DEFAULT_KEYSTORE_CONFIG_PATH : &'static str = "keystore"; /// The maximum number of characters for a node name. const NODE_NAME_MAX_LENGTH: usize = 32; -/// Executable version. Used to pass version information from the root crate. -#[derive(Clone)] -pub struct VersionInfo { - /// Implementaiton name. - pub name: &'static str, - /// Implementation version. - pub version: &'static str, - /// SCM Commit hash. - pub commit: &'static str, - /// Executable file name. - pub executable_name: &'static str, - /// Executable file description. - pub description: &'static str, - /// Executable file author. - pub author: &'static str, - /// Support URL. - pub support_url: &'static str, - /// Copyright starting year (x-current year) - pub copyright_start_year: i32, -} +#[cfg(test)] +#[doc(hidden)] +pub const TEST_VERSION_INFO: &'static VersionInfo = &VersionInfo { + name: "node-test", + version: "0.1.0", + commit: "some_commit", + executable_name: "node-test", + description: "description", + author: "author", + support_url: "http://example.org", + copyright_start_year: 2020, +}; fn get_chain_key(cli: &SharedParams) -> String { match cli.chain { @@ -120,8 +113,12 @@ fn generate_node_name() -> String { result } -/// Load spec give shared params and spec factory. -pub fn load_spec(cli: &SharedParams, factory: F) -> error::Result> where +/// Load spec to `Configuration` from shared params and spec factory. +pub fn load_spec<'a, G, E, F>( + mut config: &'a mut Configuration, + cli: &SharedParams, + factory: F, +) -> error::Result<&'a ChainSpec> where G: RuntimeGenesis, E: ChainSpecExtension, F: FnOnce(&str) -> Result>, String>, @@ -131,7 +128,13 @@ pub fn load_spec(cli: &SharedParams, factory: F) -> error::Result spec, None => ChainSpec::from_json_file(PathBuf::from(chain_key))? }; - Ok(spec) + + config.network.boot_nodes = spec.boot_nodes().to_vec(); + config.telemetry_endpoints = spec.telemetry_endpoints().clone(); + + config.chain_spec = Some(spec); + + Ok(config.chain_spec.as_ref().unwrap()) } fn base_path(cli: &SharedParams, version: &VersionInfo) -> PathBuf { @@ -243,8 +246,8 @@ where SL: AbstractService + Unpin, SF: AbstractService + Unpin, { - init(&mut config, spec_factory, &run_cmd.shared_params, version)?; - + init(&run_cmd.shared_params, version)?; + load_spec(&mut config, &run_cmd.shared_params, spec_factory)?; run_cmd.run(config, new_light, new_full, version) } @@ -266,8 +269,10 @@ where <<::Header as HeaderT>::Number as std::str::FromStr>::Err: std::fmt::Debug, ::Hash: std::str::FromStr, { - init(&mut config, spec_factory, &subcommand.get_shared_params(), version)?; + let shared_params = subcommand.get_shared_params(); + init(shared_params, version)?; + load_spec(&mut config, shared_params, spec_factory)?; subcommand.run(config, builder) } @@ -278,16 +283,7 @@ where /// 1. set the panic handler /// 2. raise the FD limit /// 3. initialize the logger -pub fn init( - mut config: &mut Configuration, - spec_factory: F, - shared_params: &SharedParams, - version: &VersionInfo, -) -> error::Result<()> -where - G: RuntimeGenesis, - E: ChainSpecExtension, - F: FnOnce(&str) -> Result>, String>, +pub fn init(shared_params: &SharedParams, version: &VersionInfo) -> error::Result<()> { let full_version = sc_service::config::full_version_from_strs( version.version, @@ -479,10 +475,8 @@ pub fn fill_import_params( where G: RuntimeGenesis, { - match config.database { - DatabaseConfig::Path { ref mut cache_size, .. } => - *cache_size = Some(cli.database_cache_size), - DatabaseConfig::Custom(_) => {}, + if let Some(DatabaseConfig::Path { ref mut cache_size, .. }) = config.database { + *cache_size = Some(cli.database_cache_size); } config.state_cache_size = cli.state_cache_size; @@ -532,7 +526,7 @@ where Ok(()) } -/// Update and prepare a `Configuration` with command line parameters of `RunCmd` +/// Update and prepare a `Configuration` with command line parameters of `RunCmd` and `VersionInfo` pub fn update_config_for_running_node( mut config: &mut Configuration, cli: RunCmd, @@ -548,12 +542,12 @@ where if config.database.is_none() { // NOTE: the loading of the DatabaseConfig is voluntarily delayed to here // in case config.config_dir has been customized - config.database = DatabaseConfig::Path { + config.database = Some(DatabaseConfig::Path { path: config .in_chain_config_dir(DEFAULT_DB_CONFIG_PATH) .expect("We provided a base_path/config_dir."), cache_size: None, - }; + }); } fill_config_keystore_password_and_path(&mut config, &cli)?; @@ -805,6 +799,7 @@ mod tests { update_config_for_running_node( &mut node_config, run_cmds.clone(), + TEST_VERSION_INFO, ).unwrap(); let expected_path = match keystore_path { diff --git a/client/cli/src/params.rs b/client/cli/src/params.rs index eddd8578b3917..3a4aa319c6e8f 100644 --- a/client/cli/src/params.rs +++ b/client/cli/src/params.rs @@ -936,6 +936,7 @@ impl RunCmd { crate::update_config_for_running_node( &mut config, self, + &version, )?; crate::run_node(config, new_light, new_full, &version) @@ -1003,7 +1004,7 @@ impl ExportBlocksCmd { crate::fill_config_keystore_in_memory(&mut config)?; - if let DatabaseConfig::Path { ref path, .. } = &config.database { + if let DatabaseConfig::Path { ref path, .. } = config.expect_database() { info!("DB path: {}", path.display()); } let from = self.from.as_ref().and_then(|f| f.parse().ok()).unwrap_or(1); @@ -1124,7 +1125,7 @@ impl PurgeChainCmd { crate::fill_config_keystore_in_memory(&mut config)?; - let db_path = match config.database { + let db_path = match config.expect_database() { DatabaseConfig::Path { path, .. } => path, _ => { eprintln!("Cannot purge custom database implementation"); diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 7a6ca8dc791c4..8f7fdc9b814c3 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -196,7 +196,7 @@ fn new_full_parts( state_cache_child_ratio: config.state_cache_child_ratio.map(|v| (v, 100)), pruning: config.pruning.clone(), - source: match &config.database { + source: match config.expect_database() { DatabaseConfig::Path { path, cache_size } => sc_client_db::DatabaseSettingsSrc::Path { path: path.clone(), @@ -307,7 +307,7 @@ where TGen: RuntimeGenesis, TCSExt: Extension { state_cache_child_ratio: config.state_cache_child_ratio.map(|v| (v, 100)), pruning: config.pruning.clone(), - source: match &config.database { + source: match config.expect_database() { DatabaseConfig::Path { path, cache_size } => sc_client_db::DatabaseSettingsSrc::Path { path: path.clone(), diff --git a/client/service/src/config.rs b/client/service/src/config.rs index 441cc29039d10..96e973431a286 100644 --- a/client/service/src/config.rs +++ b/client/service/src/config.rs @@ -28,6 +28,27 @@ use sp_core::crypto::Protected; use target_info::Target; use sc_telemetry::TelemetryEndpoints; +/// Executable version. Used to pass version information from the root crate. +#[derive(Clone)] +pub struct VersionInfo { + /// Implementation name. + pub name: &'static str, + /// Implementation version. + pub version: &'static str, + /// SCM Commit hash. + pub commit: &'static str, + /// Executable file name. + pub executable_name: &'static str, + /// Executable file description. + pub description: &'static str, + /// Executable file author. + pub author: &'static str, + /// Support URL. + pub support_url: &'static str, + /// Copyright starting year (x-current year) + pub copyright_start_year: i32, +} + /// Service configuration. pub struct Configuration { /// Implementation name @@ -186,29 +207,15 @@ impl Default for Configuration { impl Configuration { /// Create a default config using `VersionInfo` - pub fn new(version: &crate::VersionInfo) -> Self { + pub fn new(version: &VersionInfo) -> Self { let mut config = Configuration::default(); - config.impl_name = version.impl_name; - config.impl_version = version.impl_version; - config.impl_commit = version.impl_commit; + config.impl_name = version.name; + config.impl_version = version.version; + config.impl_commit = version.commit; config } - /// Load `chain_spec` using a factory - pub fn load_spec(&mut self, spec_factory: F) -> error::Result<()> - where - F: FnOnce(&str) -> Result>, String>, - { - let chain_spec = crate::load_spec(shared_params, spec_factory)?; - - self.network.boot_nodes = chain_spec.boot_nodes().to_vec(); - self.telemetry_endpoints = chain_spec.telemetry_endpoints().clone(); - self.chain_spec = Some(chain_spec); - - self.chain_spec.as_ref().unwrap() - } - /// Returns full version string of this configuration. pub fn full_version(&self) -> String { full_version_from_strs(self.impl_version, self.impl_commit) @@ -238,6 +245,15 @@ impl Configuration { pub fn expect_chain_spec(&self) -> &ChainSpec { self.chain_spec.as_ref().expect("chain_spec must be specified") } + + /// Return a reference to the `DatabaseConfig` of this `Configuration`. + /// + /// ### Panics + /// + /// This method panic if the `database` is `None` + pub fn expect_database(&self) -> &DatabaseConfig { + self.database.as_ref().expect("database must be specified") + } } /// Returns platform info From 70f9cd31b16d3bdb5f73490b7aa68ba1b9c805a8 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Mon, 3 Feb 2020 17:42:27 +0100 Subject: [PATCH 06/22] WIP Forked at: 9195fac755df57e18ed59fbd358ee528d2a52d0e Parent branch: origin/master --- bin/node/cli/src/command.rs | 4 ++-- client/service/test/src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/node/cli/src/command.rs b/bin/node/cli/src/command.rs index 3395717f2f7ed..64e1dc7421231 100644 --- a/bin/node/cli/src/command.rs +++ b/bin/node/cli/src/command.rs @@ -41,8 +41,8 @@ where &version, ), Some(Subcommand::Factory(cli_args)) => { - sc_cli::init(&mut config, load_spec, &cli_args.shared_params, &version)?; - + sc_cli::init(&cli_args.shared_params, &version)?; + sc_cli::load_spec(&mut config, &cli_args.shared_params, load_spec)?; sc_cli::fill_import_params( &mut config, &cli_args.import_params, diff --git a/client/service/test/src/lib.rs b/client/service/test/src/lib.rs index cb458d533fdf1..3e91221486540 100644 --- a/client/service/test/src/lib.rs +++ b/client/service/test/src/lib.rs @@ -183,10 +183,10 @@ fn node_config ( password: None }, config_dir: Some(root.clone()), - database: DatabaseConfig::Path { + database: Some(DatabaseConfig::Path { path: root.join("db"), cache_size: None - }, + }), state_cache_size: 16777216, state_cache_child_ratio: None, pruning: Default::default(), From dae2e9125989a30dcc517793832b341f44acdd90 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Mon, 3 Feb 2020 17:44:40 +0100 Subject: [PATCH 07/22] WIP Forked at: 9195fac755df57e18ed59fbd358ee528d2a52d0e Parent branch: origin/master --- bin/node-template/src/command.rs | 3 +-- bin/node/cli/src/command.rs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/node-template/src/command.rs b/bin/node-template/src/command.rs index 86058929b0871..43bcc254fae60 100644 --- a/bin/node-template/src/command.rs +++ b/bin/node-template/src/command.rs @@ -25,8 +25,7 @@ pub fn run(version: VersionInfo) -> error::Result<()> { let opt = sc_cli::from_args::(&version); - let mut config = sc_service::Configuration::default(); - config.impl_name = "node-template"; + let mut config = sc_service::Configuration::new(&version); match opt.subcommand { Some(subcommand) => sc_cli::run_subcommand( diff --git a/bin/node/cli/src/command.rs b/bin/node/cli/src/command.rs index 64e1dc7421231..ef66b0f793a33 100644 --- a/bin/node/cli/src/command.rs +++ b/bin/node/cli/src/command.rs @@ -28,8 +28,7 @@ where let args: Vec<_> = args.collect(); let opt = sc_cli::from_iter::(args.clone(), &version); - let mut config = sc_service::Configuration::default(); - config.impl_name = "substrate-node"; + let mut config = sc_service::Configuration::new(&version); match opt.subcommand { None => sc_cli::run( From c798e75d5daec94f17d4575a788c70a095b6450d Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Mon, 3 Feb 2020 17:50:33 +0100 Subject: [PATCH 08/22] WIP Forked at: 9195fac755df57e18ed59fbd358ee528d2a52d0e Parent branch: origin/master --- utils/browser/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/browser/src/lib.rs b/utils/browser/src/lib.rs index 4f985871f5a22..2686982e73361 100644 --- a/utils/browser/src/lib.rs +++ b/utils/browser/src/lib.rs @@ -57,12 +57,12 @@ where config.telemetry_external_transport = Some(transport); config.roles = Roles::LIGHT; config.name = format!("{} (Browser)", name); - config.database = { + config.database = Some({ info!("Opening Indexed DB database '{}'...", name); let db = kvdb_web::Database::open(name, 10) .await?; DatabaseConfig::Custom(Arc::new(db)) - }; + }); config.keystore = KeystoreConfig::InMemory; Ok(config) From 82ebab0a330035dc2c4a6fc563983a161f89a532 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Mon, 3 Feb 2020 18:15:12 +0100 Subject: [PATCH 09/22] WIP Forked at: 9195fac755df57e18ed59fbd358ee528d2a52d0e Parent branch: origin/master --- client/cli/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index 8eab1b7df9813..cb8b9008a8317 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -35,7 +35,7 @@ use sc_service::{ RuntimeGenesis, ChainSpecExtension, PruningMode, ChainSpec, AbstractService, Roles as ServiceRoles, }; -pub use sc_service::config::{VersionInfo}; +pub use sc_service::config::VersionInfo; use sc_network::{ self, multiaddr::Protocol, From c447ef0eec619d8adc431161be09acbdbd092e82 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Tue, 4 Feb 2020 11:55:37 +0100 Subject: [PATCH 10/22] WIP Forked at: 9195fac755df57e18ed59fbd358ee528d2a52d0e Parent branch: origin/master --- client/cli/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index cb8b9008a8317..d4129bc81d8f2 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -686,8 +686,7 @@ fn interface_str( } } -/// Parse an address and optionally set the port to `port` if provided in argument. -pub fn parse_address( +fn parse_address( address: &str, port: Option, ) -> Result { From 4691645e0dc88c17af64ba527b2cd7f5b8f97fd1 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Wed, 5 Feb 2020 09:29:28 +0100 Subject: [PATCH 11/22] task_executor is now Arc --- client/cli/src/runtime.rs | 6 ++++-- client/service/src/config.rs | 2 +- client/service/src/lib.rs | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/client/cli/src/runtime.rs b/client/cli/src/runtime.rs index 3eee94c0495ea..62a2245c9e174 100644 --- a/client/cli/src/runtime.rs +++ b/client/cli/src/runtime.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . +use std::sync::Arc; + use futures::{Future, future, future::FutureExt}; use futures::select; use futures::pin_mut; @@ -91,7 +93,7 @@ where config.task_executor = { let runtime_handle = runtime.handle().clone(); - Some(Box::new(move |fut| { runtime_handle.spawn(fut); })) + Some(Arc::new(move |fut| { runtime_handle.spawn(fut); })) }; let f = future_builder(config)?; @@ -117,7 +119,7 @@ where config.task_executor = { let runtime_handle = runtime.handle().clone(); - Some(Box::new(move |fut| { runtime_handle.spawn(fut); })) + Some(Arc::new(move |fut| { runtime_handle.spawn(fut); })) }; let service = service_builder(config)?; diff --git a/client/service/src/config.rs b/client/service/src/config.rs index 96e973431a286..f4043d533e190 100644 --- a/client/service/src/config.rs +++ b/client/service/src/config.rs @@ -60,7 +60,7 @@ pub struct Configuration { /// Node roles. pub roles: Roles, /// How to spawn background tasks. Mandatory, otherwise creating a `Service` will error. - pub task_executor: Option + Send>>) + Send>>, + pub task_executor: Option + Send>>) + Send + Sync>>, /// Extrinsic pool configuration. pub transaction_pool: TransactionPoolOptions, /// Network configuration. diff --git a/client/service/src/lib.rs b/client/service/src/lib.rs index dc158f1300a90..577f36572acbb 100644 --- a/client/service/src/lib.rs +++ b/client/service/src/lib.rs @@ -96,7 +96,7 @@ pub struct Service { /// Receiver for futures that must be spawned as background tasks. to_spawn_rx: mpsc::UnboundedReceiver<(Pin + Send>>, Cow<'static, str>)>, /// How to spawn background tasks. - task_executor: Box + Send>>) + Send>, + task_executor: Arc + Send>>) + Send + Sync>, rpc_handlers: sc_rpc_server::RpcHandler, _rpc: Box, _telemetry: Option, From c2e14c4c87959d9b848ed57992743c9e6acf8286 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Wed, 5 Feb 2020 09:32:35 +0100 Subject: [PATCH 12/22] WIP Forked at: 9195fac755df57e18ed59fbd358ee528d2a52d0e Parent branch: origin/master --- client/service/src/builder.rs | 2 +- client/service/src/error.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 8f7fdc9b814c3..ad1d225134ffd 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -1187,7 +1187,7 @@ ServiceBuilder< task_executor: if let Some(exec) = config.task_executor { exec } else { - return Err(Error::TasksExecutorRequired); + return Err(Error::TaskExecutorRequired); }, rpc_handlers, _rpc: rpc, diff --git a/client/service/src/error.rs b/client/service/src/error.rs index 14b03d7e95de7..059e1c19e490d 100644 --- a/client/service/src/error.rs +++ b/client/service/src/error.rs @@ -42,7 +42,7 @@ pub enum Error { SelectChainRequired, /// Tasks executor is missing. #[display(fmt="Tasks executor hasn't been provided.")] - TasksExecutorRequired, + TaskExecutorRequired, /// Other error. Other(String), } From 91757a4f0abaced35d2a9d4eca028eb83b805f94 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Wed, 5 Feb 2020 09:43:56 +0100 Subject: [PATCH 13/22] WIP Forked at: 9195fac755df57e18ed59fbd358ee528d2a52d0e Parent branch: origin/master --- client/service/test/src/lib.rs | 8 ++++---- utils/browser/src/lib.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/service/test/src/lib.rs b/client/service/test/src/lib.rs index 3e91221486540..2976e66a2982f 100644 --- a/client/service/test/src/lib.rs +++ b/client/service/test/src/lib.rs @@ -133,7 +133,7 @@ fn node_config ( index: usize, spec: &ChainSpec, role: Roles, - task_executor: Box + Send>>) + Send>, + task_executor: Arc + Send>>) + Send + Sync>, key_seed: Option, base_port: u16, root: &TempDir, @@ -256,7 +256,7 @@ impl TestNet where for (key, authority) in authorities { let task_executor = { let executor = executor.clone(); - Box::new(move |fut: Pin + Send>>| executor.spawn(fut.unit_error().compat())) + Arc::new(move |fut: Pin + Send>>| executor.spawn(fut.unit_error().compat())) }; let node_config = node_config( self.nodes, @@ -280,7 +280,7 @@ impl TestNet where for full in full { let task_executor = { let executor = executor.clone(); - Box::new(move |fut: Pin + Send>>| executor.spawn(fut.unit_error().compat())) + Arc::new(move |fut: Pin + Send>>| executor.spawn(fut.unit_error().compat())) }; let node_config = node_config(self.nodes, &self.chain_spec, Roles::FULL, task_executor, None, self.base_port, &temp); let addr = node_config.network.listen_addresses.iter().next().unwrap().clone(); @@ -296,7 +296,7 @@ impl TestNet where for light in light { let task_executor = { let executor = executor.clone(); - Box::new(move |fut: Pin + Send>>| executor.spawn(fut.unit_error().compat())) + Arc::new(move |fut: Pin + Send>>| executor.spawn(fut.unit_error().compat())) }; let node_config = node_config(self.nodes, &self.chain_spec, Roles::LIGHT, task_executor, None, self.base_port, &temp); let addr = node_config.network.listen_addresses.iter().next().unwrap().clone(); diff --git a/utils/browser/src/lib.rs b/utils/browser/src/lib.rs index 2686982e73361..d7ffdca1aa389 100644 --- a/utils/browser/src/lib.rs +++ b/utils/browser/src/lib.rs @@ -51,7 +51,7 @@ where allow_private_ipv4: true, enable_mdns: false, }; - config.task_executor = Some(Box::new(move |fut| { + config.task_executor = Some(Arc::new(move |fut| { wasm_bindgen_futures::spawn_local(fut) })); config.telemetry_external_transport = Some(transport); From eec9c0e5756080dc956978e839d0031f59fe2a1c Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Wed, 5 Feb 2020 11:26:22 +0100 Subject: [PATCH 14/22] WIP Forked at: 9195fac755df57e18ed59fbd358ee528d2a52d0e Parent branch: origin/master --- bin/node-template/src/command.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/node-template/src/command.rs b/bin/node-template/src/command.rs index 43bcc254fae60..585b8e1ca8eb9 100644 --- a/bin/node-template/src/command.rs +++ b/bin/node-template/src/command.rs @@ -25,7 +25,7 @@ pub fn run(version: VersionInfo) -> error::Result<()> { let opt = sc_cli::from_args::(&version); - let mut config = sc_service::Configuration::new(&version); + let config = sc_service::Configuration::new(&version); match opt.subcommand { Some(subcommand) => sc_cli::run_subcommand( From 95cf751d8eeb9d0bfffe6dc1d59f23d24c6b8742 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Wed, 5 Feb 2020 22:26:07 +0100 Subject: [PATCH 15/22] Added tests and clean-up code --- .gitlab-ci.yml | 9 --- .maintain/check_for_exit.sh | 16 ---- Cargo.lock | 59 +++++++++++++++ bin/node/cli/Cargo.toml | 2 + .../tests/running_the_node_and_interrupt.rs | 22 ++++++ client/cli/src/lib.rs | 73 ++++++++++++++++--- 6 files changed, 145 insertions(+), 36 deletions(-) delete mode 100755 .maintain/check_for_exit.sh create mode 100644 bin/node/cli/tests/running_the_node_and_interrupt.rs diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 828c830948a13..ced3e33eaabaa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -235,15 +235,6 @@ check-web-wasm: - time cargo build --manifest-path=bin/node/cli/Cargo.toml --no-default-features --features "browser" --target=wasm32-unknown-unknown - sccache -s -node-exits: - stage: test - <<: *docker-env - except: - - /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - script: - - ./.maintain/check_for_exit.sh - - test-full-crypto-feature: stage: test <<: *docker-env diff --git a/.maintain/check_for_exit.sh b/.maintain/check_for_exit.sh deleted file mode 100755 index edc2130e57113..0000000000000 --- a/.maintain/check_for_exit.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -# Script that checks that a node exits after `SIGINT` was send. - -set -e - -cargo build -./target/debug/substrate --dev & -PID=$! - -# Let the chain running for 60 seconds -sleep 60 - -# Send `SIGINT` and give the process 30 seconds to end -kill -INT $PID -timeout 30 tail --pid=$PID -f /dev/null diff --git a/Cargo.lock b/Cargo.lock index c468e3e7c870b..23a9aaab43903 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -133,6 +133,18 @@ dependencies = [ "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "assert_cmd" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "doc-comment 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "escargot 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates-tree 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "assert_matches" version = "1.3.0" @@ -1106,6 +1118,17 @@ dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "escargot" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "evm" version = "0.14.1" @@ -3040,12 +3063,14 @@ dependencies = [ name = "node-cli" version = "2.0.0" dependencies = [ + "assert_cmd 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "browser-utils 0.8.0", "frame-support 2.0.0", "frame-system 2.0.0", "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "node-executor 2.0.0", "node-primitives 2.0.0", @@ -4466,6 +4491,29 @@ name = "ppv-lite86" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "predicates" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "predicates-core" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "predicates-tree" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "pretty_assertions" version = "0.6.1" @@ -7611,6 +7659,11 @@ name = "traitobject" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "treeline" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "trie-bench" version = "0.19.0" @@ -8372,6 +8425,7 @@ dependencies = [ "checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" "checksum asn1_der 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6fce6b6a0ffdafebd82c87e79e3f40e8d2c523e5fea5566ff6b90509bf98d638" "checksum asn1_der_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d0864d84b8e07b145449be9a8537db86bf9de5ce03b913214694643b4743502" +"checksum assert_cmd 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6283bac8dd7226470d491bc4737816fea4ca1fba7a2847f2e9097fd6bfb4624c" "checksum assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7deb0a829ca7bcfaf5da70b073a8d128619259a7be8216a355e23f00763059e5" "checksum async-std 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0bf6039b315300e057d198b9d3ab92ee029e31c759b7f1afae538145e6f18a3e" "checksum async-task 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f20c6fda19d0fc02406779587ca4f9a4171cd32e4a5bda0bd016f0a1334c8d4a" @@ -8476,6 +8530,7 @@ dependencies = [ "checksum erased-serde 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)" = "cd7d80305c9bd8cd78e3c753eb9fb110f83621e5211f1a3afffcc812b104daf9" "checksum errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c2a071601ed01b988f896ab14b95e67335d1eeb50190932a1320f7fe3cadc84e" "checksum errno-dragonfly 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "14ca354e36190500e1e1fb267c647932382b54053c50b14970856c0b00a35067" +"checksum escargot 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74cf96bec282dcdb07099f7e31d9fed323bca9435a09aba7b6d99b7617bca96d" "checksum evm 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "32a2c6961fdc9952371fc5f0416f03a9d90378a9dfb6862f6a7a9a3b8986b8dd" "checksum evm-core 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bcde5af3d542874ddeb53de0919302d57586ea04b3f76f54d865f8a6cdc70ae" "checksum evm-gasometer 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b82bc9f275cb59d2bcc05d85c98736ddfaba003a7ef7b73893fa7c1c1fab29dc" @@ -8699,6 +8754,9 @@ dependencies = [ "checksum plain 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" "checksum plotters 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "4e3bb8da247d27ae212529352020f3e5ee16e83c0c258061d27b08ab92675eeb" "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" +"checksum predicates 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a9bfe52247e5cc9b2f943682a85a5549fb9662245caf094504e69a2f03fe64d4" +"checksum predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "06075c3a3e92559ff8929e7a280684489ea27fe44805174c3ebd9328dcb37178" +"checksum predicates-tree 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e63c4859013b38a76eca2414c64911fba30def9e3202ac461a2d22831220124" "checksum pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f81e1644e1b54f5a68959a29aa86cde704219254669da328ecfdf6a1f09d427" "checksum primitive-types 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e4336f4f5d5524fa60bcbd6fe626f9223d8142a50e7053e979acdf0da41ab975" "checksum proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e10d4b51f154c8a7fb96fd6dad097cb74b863943ec010ac94b9fd1be8861fe1e" @@ -8856,6 +8914,7 @@ dependencies = [ "checksum tracing-attributes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04cfd395def5a60236e187e1ff905cb55668a59f29928dec05e6e1b1fd2ac1f3" "checksum tracing-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "13a46f11e372b8bd4b4398ea54353412fdd7fd42a8370c7e543e218cf7661978" "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" +"checksum treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" "checksum trie-bench 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "26fd042d57ee9c987c562811162a78db78b5340ab674ac76056c85dca49b26bc" "checksum trie-db 0.19.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a0d747ae5b6f078df7e46477fcc7df66df9eb4f27a031cf4a7c890a8dd03d8e6" "checksum trie-root 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0b779f7c1c8fe9276365d9d5be5c4b5adeacf545117bb3f64c974305789c5c0b" diff --git a/bin/node/cli/Cargo.toml b/bin/node/cli/Cargo.toml index ef6e90f91a943..41fb629e5d4c7 100644 --- a/bin/node/cli/Cargo.toml +++ b/bin/node/cli/Cargo.toml @@ -95,6 +95,8 @@ sc-consensus-babe = { version = "0.8", features = ["test-helpers"], path = "../. sc-service-test = { version = "2.0.0", path = "../../../client/service/test" } futures = "0.3.1" tempfile = "3.1.0" +assert_cmd = "0.12" +libc = "0.2" [build-dependencies] build-script-utils = { version = "2.0.0", package = "substrate-build-script-utils", path = "../../../utils/build-script-utils" } diff --git a/bin/node/cli/tests/running_the_node_and_interrupt.rs b/bin/node/cli/tests/running_the_node_and_interrupt.rs new file mode 100644 index 0000000000000..fce5e610bec89 --- /dev/null +++ b/bin/node/cli/tests/running_the_node_and_interrupt.rs @@ -0,0 +1,22 @@ +use assert_cmd::cargo::cargo_bin; +use std::process::Command; +use std::thread::sleep; +use std::time::Duration; + +#[test] +#[cfg(unix)] +fn running_the_node_works_and_can_be_interrupted() { + use libc::{kill, SIGINT, SIGTERM}; + + let mut cmd = Command::new(cargo_bin("substrate")).spawn().unwrap(); + sleep(Duration::from_secs(30)); + assert!(cmd.try_wait().unwrap().is_none(), "the process should still be running"); + unsafe { kill(cmd.id() as i32, SIGINT) }; + assert!(cmd.wait().unwrap().success(), "the process must exit gracefully after SIGINT"); + + let mut cmd = Command::new(cargo_bin("substrate")).spawn().unwrap(); + sleep(Duration::from_secs(30)); + assert!(cmd.try_wait().unwrap().is_none(), "the process should still be running"); + unsafe { kill(cmd.id() as i32, SIGTERM) }; + assert!(cmd.wait().unwrap().success(), "the process must exit gracefully after SIGTERM"); +} diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index d4129bc81d8f2..2e80b83074a67 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -398,8 +398,6 @@ fn fill_network_configuration( ]; } - config.public_addresses = Vec::new(); - config.client_version = client_id; config.node_key = node_key::node_key_config(cli.node_key_params, &config.net_config_path)?; @@ -573,16 +571,13 @@ where (_, Some(keyring)) => keyring.to_string(), (None, None) => generate_node_name(), }; - match node_key::is_node_name_valid(&config.name) { - Ok(_) => (), - Err(msg) => Err( - error::Error::Input( - format!("Invalid node name '{}'. Reason: {}. If unsure, use none.", - config.name, - msg - ) + if let Err(msg) = node_key::is_node_name_valid(&config.name) { + return Err(error::Error::Input( + format!("Invalid node name '{}'. Reason: {}. If unsure, use none.", + config.name, + msg, ) - )? + )); } // set sentry mode (i.e. act as an authority but **never** actively participate) @@ -809,4 +804,60 @@ mod tests { assert_eq!(expected_path, node_config.keystore.path().unwrap().to_owned()); } } + + #[test] + fn ensure_load_spec_provide_defaults() { + let chain_spec = ChainSpec::from_genesis( + "test", + "test-id", + || (), + vec!["boo".to_string()], + Some(TelemetryEndpoints::new(vec![("foo".to_string(), 42)])), + None, + None, + None::<()>, + ); + + let args: Vec<&str> = vec![]; + let cli = RunCmd::from_iter(args); + + let mut config = Configuration::new(TEST_VERSION_INFO); + load_spec(&mut config, &cli.shared_params, |_| Ok(Some(chain_spec))).unwrap(); + + assert!(config.chain_spec.is_some()); + assert!(!config.network.boot_nodes.is_empty()); + assert!(config.telemetry_endpoints.is_some()); + } + + #[test] + fn ensure_update_config_for_running_node_provides_defaults() { + let chain_spec = ChainSpec::from_genesis( + "test", + "test-id", + || (), + vec![], + None, + None, + None, + None::<()>, + ); + + let args: Vec<&str> = vec![]; + let cli = RunCmd::from_iter(args); + + let mut config = Configuration::new(TEST_VERSION_INFO); + config.chain_spec = Some(chain_spec); + update_config_for_running_node(&mut config, cli, TEST_VERSION_INFO).unwrap(); + + assert!(config.config_dir.is_some()); + assert!(config.database.is_some()); + if let Some(DatabaseConfig::Path { ref cache_size, .. }) = config.database { + assert!(cache_size.is_some()); + } else { + panic!("invalid config.database variant"); + } + assert_ne!(config.name, ""); + assert!(config.network.config_path.is_some()); + assert!(!config.network.listen_addresses.is_empty()); + } } From 54d5e96f08c0de0650f2ce4f8a36f30e532a8d3e Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Wed, 5 Feb 2020 23:33:36 +0100 Subject: [PATCH 16/22] Update Cargo.lock --- Cargo.lock | 398 +++++++++++++++++++++++++++++------------------------ 1 file changed, 219 insertions(+), 179 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed976689870d0..6eaec0f58ac72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,9 +61,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f56c476256dc249def911d6f7580b5fc7e875895b5d7ee88f5d602208035744" +checksum = "743ad5a418686aad3b87fd14c43badd828cf26e214a00f92a384291cf22e1811" dependencies = [ "memchr", ] @@ -150,6 +150,19 @@ dependencies = [ "syn", ] +[[package]] +name = "assert_cmd" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6283bac8dd7226470d491bc4737816fea4ca1fba7a2847f2e9097fd6bfb4624c" +dependencies = [ + "doc-comment", + "escargot", + "predicates", + "predicates-core", + "predicates-tree", +] + [[package]] name = "assert_matches" version = "1.3.0" @@ -166,7 +179,7 @@ dependencies = [ "broadcaster", "crossbeam-channel", "crossbeam-deque", - "crossbeam-utils 0.7.0", + "crossbeam-utils", "futures-core", "futures-io", "futures-timer 2.0.2", @@ -198,7 +211,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce6977f57fa68da77ffe5542950d47e9c23d65f5bc7cb0a9f8700996913eec7" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "rustls", "webpki", "webpki-roots 0.17.0", @@ -416,7 +429,7 @@ dependencies = [ "console_error_panic_hook", "console_log", "futures 0.1.29", - "futures 0.3.1", + "futures 0.3.3", "js-sys", "kvdb-web", "libp2p", @@ -444,9 +457,9 @@ checksum = "b170cd256a3f9fa6b9edae3e44a7dfdfc77e8124dbc3e2612d75f9c3e2396dae" [[package]] name = "bstr" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe8a65814ca90dfc9705af76bb6ba3c6e2534489a72270e797e603783bb4990b" +checksum = "502ae1441a0a5adb8fbd38a5955a6416b9493e92b465de5e4a9bde6a539c2c48" dependencies = [ "lazy_static", "memchr", @@ -887,7 +900,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acec9a3b0b3559f15aee4f90746c4e5e293b701c0f7d3925d24e01645267b68c" dependencies = [ - "crossbeam-utils 0.7.0", + "crossbeam-utils", ] [[package]] @@ -897,7 +910,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3aa945d63861bfe624b55d153a39684da1e8c0bc8fba932f7ee3a3c16cea3ca" dependencies = [ "crossbeam-epoch", - "crossbeam-utils 0.7.0", + "crossbeam-utils", ] [[package]] @@ -908,21 +921,12 @@ checksum = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" dependencies = [ "autocfg 0.1.7", "cfg-if", - "crossbeam-utils 0.7.0", + "crossbeam-utils", "lazy_static", "memoffset", "scopeguard 1.0.0", ] -[[package]] -name = "crossbeam-queue" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" -dependencies = [ - "crossbeam-utils 0.6.6", -] - [[package]] name = "crossbeam-queue" version = "0.2.1" @@ -930,17 +934,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" dependencies = [ "cfg-if", - "crossbeam-utils 0.7.0", -] - -[[package]] -name = "crossbeam-utils" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" -dependencies = [ - "cfg-if", - "lazy_static", + "crossbeam-utils", ] [[package]] @@ -1227,6 +1221,18 @@ dependencies = [ "libc", ] +[[package]] +name = "escargot" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74cf96bec282dcdb07099f7e31d9fed323bca9435a09aba7b6d99b7617bca96d" +dependencies = [ + "lazy_static", + "log 0.4.8", + "serde", + "serde_json", +] + [[package]] name = "evm" version = "0.14.2" @@ -1279,7 +1285,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", ] [[package]] @@ -1357,7 +1363,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3cbb25bef9fcad97fb31e817da280b1c9174435b8769c770ee190a330dd181ea" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "futures-timer 2.0.2", "log 0.4.8", "num-traits", @@ -1603,9 +1609,9 @@ checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" [[package]] name = "futures" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6f16056ecbb57525ff698bb955162d0cd03bee84e6241c27ff75c08d8ca5987" +checksum = "ad6636318d07abeb4656157ef1936c64485f066c7f9ce5d7c5b879fcb6dd5ccb" dependencies = [ "futures-channel", "futures-core", @@ -1618,9 +1624,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcae98ca17d102fd8a3603727b9259fcf7fa4239b603d2142926189bc8999b86" +checksum = "7264eb65b194d2fa6ec31b898ead7c332854bfa42521659226e72a585fca5b85" dependencies = [ "futures-core", "futures-sink", @@ -1637,9 +1643,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79564c427afefab1dfb3298535b21eda083ef7935b4f0ecbfcb121f0aec10866" +checksum = "b597b16aa1a19ce2dfde5128a7c656d75346b35601a640be2d9efd4e9c83609d" [[package]] name = "futures-core-preview" @@ -1659,12 +1665,12 @@ dependencies = [ [[package]] name = "futures-diagnose" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebbb8371dd6ee87aa2aeaa8458a372fd82fe216032387b766255754c92dd7271" +checksum = "fdcef58a173af8148b182684c9f2d5250875adbcaff7b5794073894f9d8634a9" dependencies = [ "futures 0.1.29", - "futures 0.3.1", + "futures 0.3.3", "lazy_static", "log 0.4.8", "parking_lot 0.9.0", @@ -1675,9 +1681,9 @@ dependencies = [ [[package]] name = "futures-executor" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e274736563f686a837a0568b478bdabfeaec2dca794b5649b04e2fe1627c231" +checksum = "46a5e593d77bee52393c7f3b16b8b413214096d3f7dc4f5f4c57dee01ad2bdaf" dependencies = [ "futures-core", "futures-task", @@ -1687,15 +1693,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e676577d229e70952ab25f3945795ba5b16d63ca794ca9d2c860e5595d20b5ff" +checksum = "3d429f824b5e5dbd45fc8e54e1005a37e1f8c6d570cd64d0b59b24d3a80b8b8e" [[package]] name = "futures-macro" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e7c56c15537adb4f76d0b7a76ad131cb4d2f4f32d3b0bcabcbe1c7c5e87764" +checksum = "a1d75b72904b78044e0091355fc49d29f48bff07a68a719a41cf059711e071b4" dependencies = [ "proc-macro-hack", "proc-macro2 1.0.8", @@ -1705,15 +1711,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "171be33efae63c2d59e6dbba34186fe0d6394fb378069a76dfd80fdcffd43c16" +checksum = "04299e123547ea7c56f3e1b376703142f5fc0b6700433eed549e9d0b8a75a66c" [[package]] name = "futures-task" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bae52d6b29cf440e298856fec3965ee6fa71b06aa7495178615953fd669e5f9" +checksum = "86f9ceab4bce46555ee608b1ec7c414d6b2e76e196ef46fa5a8d4815a8571398" [[package]] name = "futures-timer" @@ -1734,9 +1740,9 @@ checksum = "a1de7508b218029b0f01662ed8f61b1c964b3ae99d6f25462d0f55a595109df6" [[package]] name = "futures-util" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0d66274fb76985d3c62c886d1da7ac4c0903a8c9f754e8fe0f35a6a6cc39e76" +checksum = "7d2f1296f7644d2cd908ebb2fa74645608e39f117c72bac251d40418c6d74c4f" dependencies = [ "futures 0.1.29", "futures-channel", @@ -1772,7 +1778,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0a73299e4718f5452e45980fc1d6957a070abe308d3700b63b8673f47e1c2b3" dependencies = [ "bytes 0.5.4", - "futures 0.3.1", + "futures 0.3.3", "memchr", "pin-project", ] @@ -1906,7 +1912,7 @@ dependencies = [ name = "grafana-data-source-test" version = "2.0.0" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "futures-timer 2.0.2", "grafana-data-source", "rand 0.7.3", @@ -2153,7 +2159,7 @@ dependencies = [ "time", "tokio 0.1.22", "tokio-buf", - "tokio-executor 0.1.9", + "tokio-executor 0.1.10", "tokio-io", "tokio-reactor", "tokio-tcp", @@ -2286,9 +2292,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.3.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b54058f0a6ff80b6803da8faf8997cde53872b38f4023728f6830b06cd3c0dc" +checksum = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" dependencies = [ "autocfg 1.0.0", ] @@ -2507,7 +2513,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8396be0e5561ccd1bf7ff0b2007487cdd7a87a056873fe6ea906b35d4dbf7ed8" dependencies = [ "parity-bytes", - "parity-util-mem 0.4.1", + "parity-util-mem 0.4.2", "smallvec 1.2.0", ] @@ -2518,15 +2524,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d25ef14155e418515c4839e9144c839de3506e68946f255a32b7f166095493d" dependencies = [ "kvdb", - "parity-util-mem 0.4.1", + "parity-util-mem 0.4.2", "parking_lot 0.9.0", ] [[package]] name = "kvdb-rocksdb" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af488cc16c3801705c8d681c3a32c8faa8fafc7fb5309dee0f573f3c6a19d395" +checksum = "5a1053e90a54421a842b6bf5d0e4a5cb5364c0bf570f713c58e44a9906f501d9" dependencies = [ "fs-swap", "interleaved-ordered", @@ -2534,7 +2540,7 @@ dependencies = [ "log 0.4.8", "num_cpus", "owning_ref", - "parity-util-mem 0.4.1", + "parity-util-mem 0.4.2", "parking_lot 0.9.0", "regex", "rocksdb", @@ -2547,12 +2553,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37a0e36637fb86454de401e7cb88f40eb0ad1b9bcee837d46785e7c451f1ebf4" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "js-sys", "kvdb", "kvdb-memorydb", "log 0.4.8", - "parity-util-mem 0.4.1", + "parity-util-mem 0.4.2", "send_wrapper 0.3.0", "wasm-bindgen", "web-sys", @@ -2599,7 +2605,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f84847789ab24b3fc5971a68656ac85886df640986d9ce3264c0327694eae471" dependencies = [ "bytes 0.5.4", - "futures 0.3.1", + "futures 0.3.3", "lazy_static", "libp2p-core", "libp2p-core-derive", @@ -2622,7 +2628,7 @@ dependencies = [ "libp2p-websocket", "libp2p-yamux", "parity-multiaddr 0.7.1", - "parity-multihash 0.2.1", + "parity-multihash 0.2.2", "parking_lot 0.10.0", "pin-project", "smallvec 1.2.0", @@ -2639,14 +2645,14 @@ dependencies = [ "bs58 0.3.0", "ed25519-dalek", "fnv", - "futures 0.3.1", + "futures 0.3.3", "futures-timer 2.0.2", "lazy_static", "libsecp256k1", "log 0.4.8", "multistream-select", "parity-multiaddr 0.7.1", - "parity-multihash 0.2.1", + "parity-multihash 0.2.2", "parking_lot 0.10.0", "pin-project", "prost", @@ -2680,7 +2686,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3be32697b42d040b325c3737f827ea04ede569ec956b7807700dd8d89d8210f9" dependencies = [ "flate2", - "futures 0.3.1", + "futures 0.3.3", "libp2p-core", ] @@ -2690,7 +2696,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f11c979b882f25d85726b15637d5bbc722dfa1be576605c54e99b8cf56906be3" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "libp2p-core", "log 0.4.8", ] @@ -2704,7 +2710,7 @@ dependencies = [ "bs58 0.3.0", "cuckoofilter", "fnv", - "futures 0.3.1", + "futures 0.3.3", "libp2p-core", "libp2p-swarm", "prost", @@ -2724,7 +2730,7 @@ dependencies = [ "byteorder 1.3.2", "bytes 0.5.4", "fnv", - "futures 0.3.1", + "futures 0.3.3", "futures_codec", "libp2p-core", "libp2p-swarm", @@ -2745,7 +2751,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1a6261b804111c2dbf53f8ca03f66edc5ad1c29b78a61cf0cc5354052e28e9" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "libp2p-core", "libp2p-swarm", "log 0.4.8", @@ -2765,12 +2771,12 @@ dependencies = [ "bytes 0.5.4", "either", "fnv", - "futures 0.3.1", + "futures 0.3.3", "futures_codec", "libp2p-core", "libp2p-swarm", "log 0.4.8", - "parity-multihash 0.2.1", + "parity-multihash 0.2.2", "prost", "prost-build", "rand 0.7.3", @@ -2792,7 +2798,7 @@ dependencies = [ "data-encoding", "dns-parser", "either", - "futures 0.3.1", + "futures 0.3.3", "lazy_static", "libp2p-core", "libp2p-swarm", @@ -2812,7 +2818,7 @@ checksum = "89d0b44dfdef80cc2be4b42d127de1c793905eca2459415a5c57d6b4fbd8ec30" dependencies = [ "bytes 0.5.4", "fnv", - "futures 0.3.1", + "futures 0.3.3", "futures_codec", "libp2p-core", "log 0.4.8", @@ -2827,7 +2833,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0845e8208d814cd41c26c90a6a2f2b720c31b588209cecc49a44c881a09f417f" dependencies = [ "curve25519-dalek 1.2.3", - "futures 0.3.1", + "futures 0.3.3", "lazy_static", "libp2p-core", "log 0.4.8", @@ -2846,7 +2852,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16ecced2949ae93b6ff29565303ecd1bef15c4e4efb689033ee744922561a36b" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "libp2p-core", "libp2p-swarm", "log 0.4.8", @@ -2862,7 +2868,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "195fda6b6a948a242fd30570e0e3418ae8e0a20055ea75d45458e1079a8efb05" dependencies = [ "bytes 0.5.4", - "futures 0.3.1", + "futures 0.3.3", "futures_codec", "libp2p-core", "log 0.4.8", @@ -2881,7 +2887,7 @@ checksum = "ceef68ca377b264f84d64c88739a8fa118b5db1e8f18297351dff75314504a5f" dependencies = [ "aes-ctr", "ctr", - "futures 0.3.1", + "futures 0.3.3", "hmac", "js-sys", "lazy_static", @@ -2909,7 +2915,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14ea00be81bc3985e36abad263ce2ad1b6aeb862aa743563eb70ad42880c05ae" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "libp2p-core", "log 0.4.8", "smallvec 1.2.0", @@ -2924,7 +2930,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e65ef381570df31cb047dfbc11483ab0fe7e6abbdcf2bdc2c60b5d11133d241" dependencies = [ "async-std", - "futures 0.3.1", + "futures 0.3.3", "futures-timer 2.0.2", "get_if_addrs", "ipnet", @@ -2939,7 +2945,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e4f4f7989b35f33d4b9738aab2f031310eb20fec513cab44d12b1bc985a8074" dependencies = [ "async-std", - "futures 0.3.1", + "futures 0.3.3", "libp2p-core", "log 0.4.8", ] @@ -2950,7 +2956,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b4d457adb91a5e2212343218a554394cd8ced64a79fb8e36e7aed2a16d49495" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -2967,7 +2973,7 @@ dependencies = [ "async-tls", "bytes 0.5.4", "either", - "futures 0.3.1", + "futures 0.3.3", "libp2p-core", "log 0.4.8", "quicksink", @@ -2985,7 +2991,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ca25b3aac78a3c93c2a567622abd3cfc16f96f26ae1bf6134f0056203d62d86" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "libp2p-core", "log 0.4.8", "parking_lot 0.10.0", @@ -3322,12 +3328,14 @@ dependencies = [ name = "node-cli" version = "2.0.0" dependencies = [ + "assert_cmd", "browser-utils", "frame-support", "frame-system", - "futures 0.3.1", + "futures 0.3.3", "hex-literal", "jsonrpc-core", + "libc", "log 0.4.8", "node-executor", "node-primitives", @@ -3517,7 +3525,7 @@ dependencies = [ name = "node-template" version = "2.0.0" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "log 0.4.8", "node-template-runtime", "sc-basic-authorship", @@ -3740,9 +3748,9 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] name = "openssl" -version = "0.10.27" +version = "0.10.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e176a45fedd4c990e26580847a525e39e16ec32ac78957dbf62ded31b3abfd6f" +checksum = "973293749822d7dd6370d6da1e523b0d1db19f06c459134c658b2a4261378b52" dependencies = [ "bitflags", "cfg-if", @@ -4481,7 +4489,7 @@ dependencies = [ "bs58 0.3.0", "byteorder 1.3.2", "data-encoding", - "parity-multihash 0.2.1", + "parity-multihash 0.2.2", "percent-encoding 2.1.0", "serde", "static_assertions", @@ -4506,9 +4514,9 @@ dependencies = [ [[package]] name = "parity-multihash" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a4d7b05e51bff5ae2c29c7b8c3d889985bbd8f4e15b3542fcc1f6f9666d292" +checksum = "b11f42bbd3a021c5061b77154bd3334d5a57e1a03eb162de0b962681cc25800d" dependencies = [ "blake2", "bytes 0.5.4", @@ -4563,9 +4571,9 @@ dependencies = [ [[package]] name = "parity-util-mem" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900dd84654b048e5bad420bb341658fc2c4d7fea628c22bcf4621733e54859b4" +checksum = "01b04e4d2588668d5aa93144b3bd719be963542e60042d66c7586ca763838a5b" dependencies = [ "cfg-if", "impl-trait-for-tuples", @@ -4802,6 +4810,32 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" +[[package]] +name = "predicates" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9bfe52247e5cc9b2f943682a85a5549fb9662245caf094504e69a2f03fe64d4" +dependencies = [ + "difference", + "predicates-core", +] + +[[package]] +name = "predicates-core" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06075c3a3e92559ff8929e7a280684489ea27fe44805174c3ebd9328dcb37178" + +[[package]] +name = "predicates-tree" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e63c4859013b38a76eca2414c64911fba30def9e3202ac461a2d22831220124" +dependencies = [ + "predicates-core", + "treeline", +] + [[package]] name = "pretty_assertions" version = "0.6.1" @@ -5216,8 +5250,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" dependencies = [ "crossbeam-deque", - "crossbeam-queue 0.2.1", - "crossbeam-utils 0.7.0", + "crossbeam-queue", + "crossbeam-utils", "lazy_static", "num_cpus", ] @@ -5298,9 +5332,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.16.10" +version = "0.16.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "113f53b644c5442e20ff3a299be3d6c61ba143737af5bd2ab298e248a7575b2d" +checksum = "741ba1704ae21999c00942f9f5944f801e977f54302af346b596287599ad1862" dependencies = [ "cc", "lazy_static", @@ -5349,7 +5383,7 @@ dependencies = [ "base64 0.11.0", "blake2b_simd", "constant_time_eq", - "crossbeam-utils 0.7.0", + "crossbeam-utils", ] [[package]] @@ -5403,7 +5437,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "pin-project", "static_assertions", ] @@ -5445,7 +5479,7 @@ dependencies = [ "bytes 0.4.12", "derive_more", "env_logger 0.7.1", - "futures 0.3.1", + "futures 0.3.3", "futures-timer 2.0.2", "libp2p", "log 0.4.8", @@ -5471,7 +5505,7 @@ dependencies = [ name = "sc-basic-authorship" version = "0.8.0" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "log 0.4.8", "parity-scale-codec", "parking_lot 0.10.0", @@ -5542,7 +5576,7 @@ dependencies = [ "derive_more", "env_logger 0.7.1", "fdlimit", - "futures 0.3.1", + "futures 0.3.3", "lazy_static", "log 0.4.8", "names", @@ -5573,7 +5607,7 @@ dependencies = [ "derive_more", "env_logger 0.7.1", "fnv", - "futures 0.3.1", + "futures 0.3.3", "hash-db", "hex-literal", "kvdb", @@ -5609,7 +5643,7 @@ version = "2.0.0" dependencies = [ "derive_more", "fnv", - "futures 0.3.1", + "futures 0.3.3", "hash-db", "hex-literal", "kvdb", @@ -5646,7 +5680,7 @@ dependencies = [ "linked-hash-map", "log 0.4.8", "parity-scale-codec", - "parity-util-mem 0.4.1", + "parity-util-mem 0.4.2", "parking_lot 0.10.0", "quickcheck", "sc-client", @@ -5671,7 +5705,7 @@ dependencies = [ "derive_more", "env_logger 0.7.1", "futures 0.1.29", - "futures 0.3.1", + "futures 0.3.3", "futures-timer 0.4.0", "log 0.4.8", "parity-scale-codec", @@ -5711,7 +5745,7 @@ dependencies = [ "env_logger 0.7.1", "fork-tree", "futures 0.1.29", - "futures 0.3.1", + "futures 0.3.3", "futures-timer 0.4.0", "log 0.4.8", "merlin", @@ -5758,7 +5792,7 @@ version = "0.8.0" dependencies = [ "derive_more", "env_logger 0.7.1", - "futures 0.3.1", + "futures 0.3.3", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -5785,7 +5819,7 @@ name = "sc-consensus-pow" version = "0.8.0" dependencies = [ "derive_more", - "futures 0.3.1", + "futures 0.3.3", "log 0.4.8", "parity-scale-codec", "sc-client-api", @@ -5804,7 +5838,7 @@ dependencies = [ name = "sc-consensus-slots" version = "0.8.0" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "futures-timer 2.0.2", "log 0.4.8", "parity-scale-codec", @@ -5930,7 +5964,7 @@ dependencies = [ "finality-grandpa", "fork-tree", "futures 0.1.29", - "futures 0.3.1", + "futures 0.3.3", "futures-timer 2.0.2", "log 0.4.8", "parity-scale-codec", @@ -5989,7 +6023,7 @@ dependencies = [ "erased-serde", "fnv", "fork-tree", - "futures 0.3.1", + "futures 0.3.3", "futures-timer 0.4.0", "futures_codec", "libp2p", @@ -6032,7 +6066,7 @@ name = "sc-network-gossip" version = "0.8.0" dependencies = [ "futures 0.1.29", - "futures 0.3.1", + "futures 0.3.3", "futures-timer 0.4.0", "libp2p", "log 0.4.8", @@ -6048,7 +6082,7 @@ version = "0.8.0" dependencies = [ "env_logger 0.7.1", "futures 0.1.29", - "futures 0.3.1", + "futures 0.3.3", "futures-timer 0.4.0", "libp2p", "log 0.4.8", @@ -6077,7 +6111,7 @@ dependencies = [ "env_logger 0.7.1", "fnv", "futures 0.1.29", - "futures 0.3.1", + "futures 0.3.3", "futures-timer 2.0.2", "hyper 0.12.35", "hyper-rustls", @@ -6105,7 +6139,7 @@ dependencies = [ name = "sc-peerset" version = "2.0.0" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "libp2p", "log 0.4.8", "rand 0.7.3", @@ -6118,7 +6152,7 @@ version = "2.0.0" dependencies = [ "assert_matches", "futures 0.1.29", - "futures 0.3.1", + "futures 0.3.3", "hash-db", "jsonrpc-core", "jsonrpc-pubsub", @@ -6154,7 +6188,7 @@ name = "sc-rpc-api" version = "0.8.0" dependencies = [ "derive_more", - "futures 0.3.1", + "futures 0.3.3", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -6204,7 +6238,7 @@ dependencies = [ "derive_more", "exit-future", "futures 0.1.29", - "futures 0.3.1", + "futures 0.3.3", "futures-diagnose", "futures-timer 2.0.2", "grafana-data-source", @@ -6245,7 +6279,7 @@ dependencies = [ "sysinfo", "target_info", "tokio 0.2.11", - "tokio-executor 0.1.9", + "tokio-executor 0.1.10", "tracing", ] @@ -6256,7 +6290,7 @@ dependencies = [ "env_logger 0.7.1", "fdlimit", "futures 0.1.29", - "futures 0.3.1", + "futures 0.3.3", "log 0.4.8", "sc-client", "sc-network", @@ -6285,7 +6319,7 @@ name = "sc-telemetry" version = "2.0.0" dependencies = [ "bytes 0.5.4", - "futures 0.3.1", + "futures 0.3.3", "futures-timer 2.0.2", "libp2p", "log 0.4.8", @@ -6323,7 +6357,7 @@ dependencies = [ "assert_matches", "criterion 0.3.1", "derive_more", - "futures 0.3.1", + "futures 0.3.3", "log 0.4.8", "parity-scale-codec", "parking_lot 0.10.0", @@ -6339,7 +6373,7 @@ name = "sc-transaction-pool" version = "2.0.0" dependencies = [ "derive_more", - "futures 0.3.1", + "futures 0.3.3", "futures-diagnose", "log 0.4.8", "parity-scale-codec", @@ -6358,9 +6392,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f550b06b6cba9c8b8be3ee73f391990116bf527450d2556e9b9ce263b9a021" +checksum = "507a9e6e8ffe0a4e0ebb9a10293e62fdf7657c06f1b8bb07a8fcf697d2abf295" dependencies = [ "lazy_static", "winapi 0.3.8", @@ -6670,7 +6704,7 @@ dependencies = [ "base64 0.11.0", "bytes 0.5.4", "flate2", - "futures 0.3.1", + "futures 0.3.3", "http 0.2.0", "httparse", "log 0.4.8", @@ -6830,7 +6864,7 @@ name = "sp-consensus" version = "0.8.0" dependencies = [ "derive_more", - "futures 0.3.1", + "futures 0.3.3", "futures-diagnose", "futures-timer 0.4.0", "libp2p", @@ -7217,7 +7251,7 @@ name = "sp-transaction-pool" version = "2.0.0" dependencies = [ "derive_more", - "futures 0.3.1", + "futures 0.3.3", "log 0.4.8", "parity-scale-codec", "serde", @@ -7409,7 +7443,7 @@ version = "2.0.0" dependencies = [ "frame-support", "frame-system", - "futures 0.3.1", + "futures 0.3.3", "jsonrpc-client-transports", "jsonrpc-core", "parity-scale-codec", @@ -7425,7 +7459,7 @@ version = "2.0.0" dependencies = [ "env_logger 0.7.1", "frame-system-rpc-runtime-api", - "futures 0.3.1", + "futures 0.3.3", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -7446,7 +7480,7 @@ dependencies = [ name = "substrate-test-client" version = "2.0.0" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "hash-db", "parity-scale-codec", "sc-client", @@ -7505,7 +7539,7 @@ dependencies = [ name = "substrate-test-runtime-client" version = "2.0.0" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "parity-scale-codec", "sc-block-builder", "sc-client", @@ -7523,7 +7557,7 @@ name = "substrate-test-runtime-transaction-pool" version = "2.0.0" dependencies = [ "derive_more", - "futures 0.3.1", + "futures 0.3.3", "parity-scale-codec", "parking_lot 0.10.0", "sc-transaction-graph", @@ -7780,11 +7814,11 @@ dependencies = [ "num_cpus", "tokio-codec", "tokio-current-thread", - "tokio-executor 0.1.9", + "tokio-executor 0.1.10", "tokio-fs", "tokio-io", "tokio-reactor", - "tokio-sync 0.1.7", + "tokio-sync 0.1.8", "tokio-tcp", "tokio-threadpool", "tokio-timer", @@ -7825,9 +7859,9 @@ dependencies = [ [[package]] name = "tokio-codec" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" +checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" dependencies = [ "bytes 0.4.12", "futures 0.1.29", @@ -7836,21 +7870,21 @@ dependencies = [ [[package]] name = "tokio-current-thread" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16217cad7f1b840c5a97dfb3c43b0c871fef423a6e8d2118c604e843662a443" +checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" dependencies = [ "futures 0.1.29", - "tokio-executor 0.1.9", + "tokio-executor 0.1.10", ] [[package]] name = "tokio-executor" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6df436c42b0c3330a82d855d2ef017cd793090ad550a6bc2184f4b933532ab" +checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" dependencies = [ - "crossbeam-utils 0.6.6", + "crossbeam-utils", "futures 0.1.29", ] @@ -7867,9 +7901,9 @@ dependencies = [ [[package]] name = "tokio-fs" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fe6dc22b08d6993916647d108a1a7d15b9cd29c4f4496c62b92c45b5041b7af" +checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" dependencies = [ "futures 0.1.29", "tokio-io", @@ -7878,9 +7912,9 @@ dependencies = [ [[package]] name = "tokio-io" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5090db468dad16e1a7a54c8c67280c5e4b544f3d3e018f0b913b400261f85926" +checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" dependencies = [ "bytes 0.4.12", "futures 0.1.29", @@ -7900,11 +7934,11 @@ dependencies = [ [[package]] name = "tokio-reactor" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6732fe6b53c8d11178dcb77ac6d9682af27fc6d4cb87789449152e5377377146" +checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" dependencies = [ - "crossbeam-utils 0.6.6", + "crossbeam-utils", "futures 0.1.29", "lazy_static", "log 0.4.8", @@ -7912,9 +7946,9 @@ dependencies = [ "num_cpus", "parking_lot 0.9.0", "slab", - "tokio-executor 0.1.9", + "tokio-executor 0.1.10", "tokio-io", - "tokio-sync 0.1.7", + "tokio-sync 0.1.8", ] [[package]] @@ -7933,9 +7967,9 @@ dependencies = [ [[package]] name = "tokio-sync" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d06554cce1ae4a50f42fba8023918afa931413aded705b560e29600ccf7c6d76" +checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" dependencies = [ "fnv", "futures 0.1.29", @@ -7954,9 +7988,9 @@ dependencies = [ [[package]] name = "tokio-tcp" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d14b10654be682ac43efee27401d792507e30fd8d26389e1da3b185de2e4119" +checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" dependencies = [ "bytes 0.4.12", "futures 0.1.29", @@ -7968,31 +8002,31 @@ dependencies = [ [[package]] name = "tokio-threadpool" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c32ffea4827978e9aa392d2f743d973c1dfa3730a2ed3f22ce1e6984da848c" +checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" dependencies = [ "crossbeam-deque", - "crossbeam-queue 0.1.2", - "crossbeam-utils 0.6.6", + "crossbeam-queue", + "crossbeam-utils", "futures 0.1.29", "lazy_static", "log 0.4.8", "num_cpus", "slab", - "tokio-executor 0.1.9", + "tokio-executor 0.1.10", ] [[package]] name = "tokio-timer" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1739638e364e558128461fc1ad84d997702c8e31c2e6b18fb99842268199e827" +checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" dependencies = [ - "crossbeam-utils 0.6.6", + "crossbeam-utils", "futures 0.1.29", "slab", - "tokio-executor 0.1.9", + "tokio-executor 0.1.10", ] [[package]] @@ -8008,9 +8042,9 @@ dependencies = [ [[package]] name = "tokio-udp" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f02298505547f73e60f568359ef0d016d5acd6e830ab9bc7c4a5b3403440121b" +checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" dependencies = [ "bytes 0.4.12", "futures 0.1.29", @@ -8023,9 +8057,9 @@ dependencies = [ [[package]] name = "tokio-uds" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445" +checksum = "5076db410d6fdc6523df7595447629099a1fdc47b3d9f896220780fa48faf798" dependencies = [ "bytes 0.4.12", "futures 0.1.29", @@ -8104,6 +8138,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" +[[package]] +name = "treeline" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" + [[package]] name = "trie-bench" version = "0.19.0" @@ -8190,7 +8230,7 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bfd5b7557925ce778ff9b9ef90e3ade34c524b5ff10e239c69a42d546d2af56" dependencies = [ - "rand 0.3.23", + "rand 0.7.3", ] [[package]] @@ -8523,7 +8563,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "324c5e65a08699c9c4334ba136597ab22b85dccd4b65dd1e36ccf8f723a95b54" dependencies = [ - "futures 0.3.1", + "futures 0.3.3", "js-sys", "parking_lot 0.9.0", "pin-utils", @@ -8855,12 +8895,12 @@ checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" [[package]] name = "yamux" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f937668802a2e862a4fed05267e10b20c310bf771adc89687710706d55a9a65" +checksum = "902f4cee32c401c211b6b69f4a3f6f4cf3515644db5bd822cf685a7dbd6201f9" dependencies = [ "bytes 0.5.4", - "futures 0.3.1", + "futures 0.3.3", "log 0.4.8", "nohash-hasher", "parking_lot 0.10.0", From e3e5531f5ec60ff57e1a35d5d27156b8c12a9c15 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Thu, 6 Feb 2020 09:04:43 +0100 Subject: [PATCH 17/22] Update client/cli/src/lib.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Bastian Köcher --- client/cli/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index 2e80b83074a67..36fabbb00b7d9 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -856,7 +856,7 @@ mod tests { } else { panic!("invalid config.database variant"); } - assert_ne!(config.name, ""); + assert!(!config.name.is_empty()); assert!(config.network.config_path.is_some()); assert!(!config.network.listen_addresses.is_empty()); } From 1b9e1f205dc8c89f99ad096b48aa90c79e35b399 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Thu, 6 Feb 2020 10:17:41 +0100 Subject: [PATCH 18/22] WIP Forked at: 9195fac755df57e18ed59fbd358ee528d2a52d0e Parent branch: origin/master --- Cargo.lock | 15 ++++- bin/node/cli/Cargo.toml | 2 +- .../tests/running_the_node_and_interrupt.rs | 61 ++++++++++++++----- client/cli/src/lib.rs | 26 ++++---- 4 files changed, 74 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6eaec0f58ac72..c31731cfa7409 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3324,6 +3324,19 @@ dependencies = [ "winapi 0.3.8", ] +[[package]] +name = "nix" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363" +dependencies = [ + "bitflags", + "cc", + "cfg-if", + "libc", + "void", +] + [[package]] name = "node-cli" version = "2.0.0" @@ -3335,8 +3348,8 @@ dependencies = [ "futures 0.3.3", "hex-literal", "jsonrpc-core", - "libc", "log 0.4.8", + "nix", "node-executor", "node-primitives", "node-rpc", diff --git a/bin/node/cli/Cargo.toml b/bin/node/cli/Cargo.toml index 41fb629e5d4c7..cf666ffdc518e 100644 --- a/bin/node/cli/Cargo.toml +++ b/bin/node/cli/Cargo.toml @@ -96,7 +96,7 @@ sc-service-test = { version = "2.0.0", path = "../../../client/service/test" } futures = "0.3.1" tempfile = "3.1.0" assert_cmd = "0.12" -libc = "0.2" +nix = "0.17" [build-dependencies] build-script-utils = { version = "2.0.0", package = "substrate-build-script-utils", path = "../../../utils/build-script-utils" } diff --git a/bin/node/cli/tests/running_the_node_and_interrupt.rs b/bin/node/cli/tests/running_the_node_and_interrupt.rs index fce5e610bec89..eb9dac77bfcde 100644 --- a/bin/node/cli/tests/running_the_node_and_interrupt.rs +++ b/bin/node/cli/tests/running_the_node_and_interrupt.rs @@ -1,22 +1,55 @@ +// Copyright 2017-2020 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Substrate is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Substrate. If not, see . + use assert_cmd::cargo::cargo_bin; -use std::process::Command; +use std::convert::TryInto; +use std::process::{Child, Command, ExitStatus}; use std::thread::sleep; use std::time::Duration; #[test] #[cfg(unix)] fn running_the_node_works_and_can_be_interrupted() { - use libc::{kill, SIGINT, SIGTERM}; - - let mut cmd = Command::new(cargo_bin("substrate")).spawn().unwrap(); - sleep(Duration::from_secs(30)); - assert!(cmd.try_wait().unwrap().is_none(), "the process should still be running"); - unsafe { kill(cmd.id() as i32, SIGINT) }; - assert!(cmd.wait().unwrap().success(), "the process must exit gracefully after SIGINT"); - - let mut cmd = Command::new(cargo_bin("substrate")).spawn().unwrap(); - sleep(Duration::from_secs(30)); - assert!(cmd.try_wait().unwrap().is_none(), "the process should still be running"); - unsafe { kill(cmd.id() as i32, SIGTERM) }; - assert!(cmd.wait().unwrap().success(), "the process must exit gracefully after SIGTERM"); + use nix::sys::signal::{kill, Signal::{self, SIGINT, SIGTERM}}; + use nix::unistd::Pid; + + fn wait_for(child: &mut Child, secs: usize) -> Option { + for _ in 0..secs { + match child.try_wait().unwrap() { + Some(status) => return Some(status), + None => sleep(Duration::from_secs(1)), + } + } + + None + } + + fn run_command_and_kill(signal: Signal) { + let mut cmd = Command::new(cargo_bin("substrate")).spawn().unwrap(); + sleep(Duration::from_secs(30)); + assert!(cmd.try_wait().unwrap().is_none(), "the process should still be running"); + kill(Pid::from_raw(cmd.id().try_into().unwrap()), signal).unwrap(); + assert_eq!( + wait_for(&mut cmd, 30).map(|x| x.success()), + Some(true), + "the pocess must exit gracefully after signal {}", + signal, + ); + } + + run_command_and_kill(SIGINT); + run_command_and_kill(SIGTERM); } diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index 36fabbb00b7d9..0ffea9a98f60d 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -75,24 +75,11 @@ const DEFAULT_NETWORK_CONFIG_PATH : &'static str = "network"; /// default sub directory to store database const DEFAULT_DB_CONFIG_PATH : &'static str = "db"; /// default sub directory for the key store -const DEFAULT_KEYSTORE_CONFIG_PATH : &'static str = "keystore"; +const DEFAULT_KEYSTORE_CONFIG_PATH : &'static str = "keystore"; /// The maximum number of characters for a node name. const NODE_NAME_MAX_LENGTH: usize = 32; -#[cfg(test)] -#[doc(hidden)] -pub const TEST_VERSION_INFO: &'static VersionInfo = &VersionInfo { - name: "node-test", - version: "0.1.0", - commit: "some_commit", - executable_name: "node-test", - description: "description", - author: "author", - support_url: "http://example.org", - copyright_start_year: 2020, -}; - fn get_chain_key(cli: &SharedParams) -> String { match cli.chain { Some(ref chain) => chain.clone(), @@ -769,6 +756,17 @@ fn kill_color(s: &str) -> String { mod tests { use super::*; + const TEST_VERSION_INFO: &'static VersionInfo = &VersionInfo { + name: "node-test", + version: "0.1.0", + commit: "some_commit", + executable_name: "node-test", + description: "description", + author: "author", + support_url: "http://example.org", + copyright_start_year: 2020, + }; + #[test] fn keystore_path_is_generated_correctly() { let chain_spec = ChainSpec::from_genesis( From 8d5894b5439c74024c27d5c0ff99a1d05c0147fb Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Thu, 6 Feb 2020 10:20:07 +0100 Subject: [PATCH 19/22] Update bin/node/cli/tests/running_the_node_and_interrupt.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Bastian Köcher --- bin/node/cli/tests/running_the_node_and_interrupt.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/node/cli/tests/running_the_node_and_interrupt.rs b/bin/node/cli/tests/running_the_node_and_interrupt.rs index eb9dac77bfcde..bfc8d2af23dac 100644 --- a/bin/node/cli/tests/running_the_node_and_interrupt.rs +++ b/bin/node/cli/tests/running_the_node_and_interrupt.rs @@ -1,4 +1,4 @@ -// Copyright 2017-2020 Parity Technologies (UK) Ltd. +// Copyright 2020 Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify From 1b22ae9f6d3de08e93b6a7c9cbf7e970d578661f Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Thu, 6 Feb 2020 10:24:37 +0100 Subject: [PATCH 20/22] WIP Forked at: 9195fac755df57e18ed59fbd358ee528d2a52d0e Parent branch: origin/master --- bin/node/cli/tests/running_the_node_and_interrupt.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/node/cli/tests/running_the_node_and_interrupt.rs b/bin/node/cli/tests/running_the_node_and_interrupt.rs index bfc8d2af23dac..668a6dc842b42 100644 --- a/bin/node/cli/tests/running_the_node_and_interrupt.rs +++ b/bin/node/cli/tests/running_the_node_and_interrupt.rs @@ -33,6 +33,8 @@ fn running_the_node_works_and_can_be_interrupted() { None => sleep(Duration::from_secs(1)), } } + eprintln!("Took to long to exit. Killing..."); + let _ = child.kill(); None } From 1d600930b030b77d878e6d9636800f87e93bf3b0 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Thu, 6 Feb 2020 10:26:24 +0100 Subject: [PATCH 21/22] WIP Forked at: 9195fac755df57e18ed59fbd358ee528d2a52d0e Parent branch: origin/master --- bin/node/cli/tests/running_the_node_and_interrupt.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/node/cli/tests/running_the_node_and_interrupt.rs b/bin/node/cli/tests/running_the_node_and_interrupt.rs index 668a6dc842b42..6b0d6963966d3 100644 --- a/bin/node/cli/tests/running_the_node_and_interrupt.rs +++ b/bin/node/cli/tests/running_the_node_and_interrupt.rs @@ -35,6 +35,7 @@ fn running_the_node_works_and_can_be_interrupted() { } eprintln!("Took to long to exit. Killing..."); let _ = child.kill(); + child.wait().unwrap(); None } From 41450d20aa3cbfae4af1161511cdd38168c85d30 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Thu, 6 Feb 2020 15:10:17 +0100 Subject: [PATCH 22/22] Cargo.lock --- Cargo.lock | 337 ++++++++++++++++++++++++++++------------------------- 1 file changed, 178 insertions(+), 159 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c31731cfa7409..f02b3ef1c4fb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,9 +61,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.8" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743ad5a418686aad3b87fd14c43badd828cf26e214a00f92a384291cf22e1811" +checksum = "5f56c476256dc249def911d6f7580b5fc7e875895b5d7ee88f5d602208035744" dependencies = [ "memchr", ] @@ -179,7 +179,7 @@ dependencies = [ "broadcaster", "crossbeam-channel", "crossbeam-deque", - "crossbeam-utils", + "crossbeam-utils 0.7.0", "futures-core", "futures-io", "futures-timer 2.0.2", @@ -211,7 +211,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce6977f57fa68da77ffe5542950d47e9c23d65f5bc7cb0a9f8700996913eec7" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "rustls", "webpki", "webpki-roots 0.17.0", @@ -429,7 +429,7 @@ dependencies = [ "console_error_panic_hook", "console_log", "futures 0.1.29", - "futures 0.3.3", + "futures 0.3.1", "js-sys", "kvdb-web", "libp2p", @@ -457,9 +457,9 @@ checksum = "b170cd256a3f9fa6b9edae3e44a7dfdfc77e8124dbc3e2612d75f9c3e2396dae" [[package]] name = "bstr" -version = "0.2.11" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "502ae1441a0a5adb8fbd38a5955a6416b9493e92b465de5e4a9bde6a539c2c48" +checksum = "fe8a65814ca90dfc9705af76bb6ba3c6e2534489a72270e797e603783bb4990b" dependencies = [ "lazy_static", "memchr", @@ -900,7 +900,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acec9a3b0b3559f15aee4f90746c4e5e293b701c0f7d3925d24e01645267b68c" dependencies = [ - "crossbeam-utils", + "crossbeam-utils 0.7.0", ] [[package]] @@ -910,7 +910,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3aa945d63861bfe624b55d153a39684da1e8c0bc8fba932f7ee3a3c16cea3ca" dependencies = [ "crossbeam-epoch", - "crossbeam-utils", + "crossbeam-utils 0.7.0", ] [[package]] @@ -921,12 +921,21 @@ checksum = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" dependencies = [ "autocfg 0.1.7", "cfg-if", - "crossbeam-utils", + "crossbeam-utils 0.7.0", "lazy_static", "memoffset", "scopeguard 1.0.0", ] +[[package]] +name = "crossbeam-queue" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" +dependencies = [ + "crossbeam-utils 0.6.6", +] + [[package]] name = "crossbeam-queue" version = "0.2.1" @@ -934,7 +943,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" dependencies = [ "cfg-if", - "crossbeam-utils", + "crossbeam-utils 0.7.0", +] + +[[package]] +name = "crossbeam-utils" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" +dependencies = [ + "cfg-if", + "lazy_static", ] [[package]] @@ -1285,7 +1304,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", ] [[package]] @@ -1363,7 +1382,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3cbb25bef9fcad97fb31e817da280b1c9174435b8769c770ee190a330dd181ea" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "futures-timer 2.0.2", "log 0.4.8", "num-traits", @@ -1609,9 +1628,9 @@ checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" [[package]] name = "futures" -version = "0.3.3" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad6636318d07abeb4656157ef1936c64485f066c7f9ce5d7c5b879fcb6dd5ccb" +checksum = "b6f16056ecbb57525ff698bb955162d0cd03bee84e6241c27ff75c08d8ca5987" dependencies = [ "futures-channel", "futures-core", @@ -1624,9 +1643,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.3" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7264eb65b194d2fa6ec31b898ead7c332854bfa42521659226e72a585fca5b85" +checksum = "fcae98ca17d102fd8a3603727b9259fcf7fa4239b603d2142926189bc8999b86" dependencies = [ "futures-core", "futures-sink", @@ -1643,9 +1662,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.3" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b597b16aa1a19ce2dfde5128a7c656d75346b35601a640be2d9efd4e9c83609d" +checksum = "79564c427afefab1dfb3298535b21eda083ef7935b4f0ecbfcb121f0aec10866" [[package]] name = "futures-core-preview" @@ -1665,12 +1684,12 @@ dependencies = [ [[package]] name = "futures-diagnose" -version = "1.0.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdcef58a173af8148b182684c9f2d5250875adbcaff7b5794073894f9d8634a9" +checksum = "ebbb8371dd6ee87aa2aeaa8458a372fd82fe216032387b766255754c92dd7271" dependencies = [ "futures 0.1.29", - "futures 0.3.3", + "futures 0.3.1", "lazy_static", "log 0.4.8", "parking_lot 0.9.0", @@ -1681,9 +1700,9 @@ dependencies = [ [[package]] name = "futures-executor" -version = "0.3.3" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a5e593d77bee52393c7f3b16b8b413214096d3f7dc4f5f4c57dee01ad2bdaf" +checksum = "1e274736563f686a837a0568b478bdabfeaec2dca794b5649b04e2fe1627c231" dependencies = [ "futures-core", "futures-task", @@ -1693,15 +1712,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.3" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d429f824b5e5dbd45fc8e54e1005a37e1f8c6d570cd64d0b59b24d3a80b8b8e" +checksum = "e676577d229e70952ab25f3945795ba5b16d63ca794ca9d2c860e5595d20b5ff" [[package]] name = "futures-macro" -version = "0.3.3" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d75b72904b78044e0091355fc49d29f48bff07a68a719a41cf059711e071b4" +checksum = "52e7c56c15537adb4f76d0b7a76ad131cb4d2f4f32d3b0bcabcbe1c7c5e87764" dependencies = [ "proc-macro-hack", "proc-macro2 1.0.8", @@ -1711,15 +1730,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.3" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04299e123547ea7c56f3e1b376703142f5fc0b6700433eed549e9d0b8a75a66c" +checksum = "171be33efae63c2d59e6dbba34186fe0d6394fb378069a76dfd80fdcffd43c16" [[package]] name = "futures-task" -version = "0.3.3" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f9ceab4bce46555ee608b1ec7c414d6b2e76e196ef46fa5a8d4815a8571398" +checksum = "0bae52d6b29cf440e298856fec3965ee6fa71b06aa7495178615953fd669e5f9" [[package]] name = "futures-timer" @@ -1740,9 +1759,9 @@ checksum = "a1de7508b218029b0f01662ed8f61b1c964b3ae99d6f25462d0f55a595109df6" [[package]] name = "futures-util" -version = "0.3.3" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d2f1296f7644d2cd908ebb2fa74645608e39f117c72bac251d40418c6d74c4f" +checksum = "c0d66274fb76985d3c62c886d1da7ac4c0903a8c9f754e8fe0f35a6a6cc39e76" dependencies = [ "futures 0.1.29", "futures-channel", @@ -1778,7 +1797,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0a73299e4718f5452e45980fc1d6957a070abe308d3700b63b8673f47e1c2b3" dependencies = [ "bytes 0.5.4", - "futures 0.3.3", + "futures 0.3.1", "memchr", "pin-project", ] @@ -1912,7 +1931,7 @@ dependencies = [ name = "grafana-data-source-test" version = "2.0.0" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "futures-timer 2.0.2", "grafana-data-source", "rand 0.7.3", @@ -2159,7 +2178,7 @@ dependencies = [ "time", "tokio 0.1.22", "tokio-buf", - "tokio-executor 0.1.10", + "tokio-executor 0.1.9", "tokio-io", "tokio-reactor", "tokio-tcp", @@ -2292,9 +2311,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.3.2" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" +checksum = "0b54058f0a6ff80b6803da8faf8997cde53872b38f4023728f6830b06cd3c0dc" dependencies = [ "autocfg 1.0.0", ] @@ -2513,7 +2532,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8396be0e5561ccd1bf7ff0b2007487cdd7a87a056873fe6ea906b35d4dbf7ed8" dependencies = [ "parity-bytes", - "parity-util-mem 0.4.2", + "parity-util-mem 0.4.1", "smallvec 1.2.0", ] @@ -2524,15 +2543,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d25ef14155e418515c4839e9144c839de3506e68946f255a32b7f166095493d" dependencies = [ "kvdb", - "parity-util-mem 0.4.2", + "parity-util-mem 0.4.1", "parking_lot 0.9.0", ] [[package]] name = "kvdb-rocksdb" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a1053e90a54421a842b6bf5d0e4a5cb5364c0bf570f713c58e44a9906f501d9" +checksum = "af488cc16c3801705c8d681c3a32c8faa8fafc7fb5309dee0f573f3c6a19d395" dependencies = [ "fs-swap", "interleaved-ordered", @@ -2540,7 +2559,7 @@ dependencies = [ "log 0.4.8", "num_cpus", "owning_ref", - "parity-util-mem 0.4.2", + "parity-util-mem 0.4.1", "parking_lot 0.9.0", "regex", "rocksdb", @@ -2553,12 +2572,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37a0e36637fb86454de401e7cb88f40eb0ad1b9bcee837d46785e7c451f1ebf4" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "js-sys", "kvdb", "kvdb-memorydb", "log 0.4.8", - "parity-util-mem 0.4.2", + "parity-util-mem 0.4.1", "send_wrapper 0.3.0", "wasm-bindgen", "web-sys", @@ -2605,7 +2624,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f84847789ab24b3fc5971a68656ac85886df640986d9ce3264c0327694eae471" dependencies = [ "bytes 0.5.4", - "futures 0.3.3", + "futures 0.3.1", "lazy_static", "libp2p-core", "libp2p-core-derive", @@ -2628,7 +2647,7 @@ dependencies = [ "libp2p-websocket", "libp2p-yamux", "parity-multiaddr 0.7.1", - "parity-multihash 0.2.2", + "parity-multihash 0.2.1", "parking_lot 0.10.0", "pin-project", "smallvec 1.2.0", @@ -2645,14 +2664,14 @@ dependencies = [ "bs58 0.3.0", "ed25519-dalek", "fnv", - "futures 0.3.3", + "futures 0.3.1", "futures-timer 2.0.2", "lazy_static", "libsecp256k1", "log 0.4.8", "multistream-select", "parity-multiaddr 0.7.1", - "parity-multihash 0.2.2", + "parity-multihash 0.2.1", "parking_lot 0.10.0", "pin-project", "prost", @@ -2686,7 +2705,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3be32697b42d040b325c3737f827ea04ede569ec956b7807700dd8d89d8210f9" dependencies = [ "flate2", - "futures 0.3.3", + "futures 0.3.1", "libp2p-core", ] @@ -2696,7 +2715,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f11c979b882f25d85726b15637d5bbc722dfa1be576605c54e99b8cf56906be3" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "libp2p-core", "log 0.4.8", ] @@ -2710,7 +2729,7 @@ dependencies = [ "bs58 0.3.0", "cuckoofilter", "fnv", - "futures 0.3.3", + "futures 0.3.1", "libp2p-core", "libp2p-swarm", "prost", @@ -2730,7 +2749,7 @@ dependencies = [ "byteorder 1.3.2", "bytes 0.5.4", "fnv", - "futures 0.3.3", + "futures 0.3.1", "futures_codec", "libp2p-core", "libp2p-swarm", @@ -2751,7 +2770,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1a6261b804111c2dbf53f8ca03f66edc5ad1c29b78a61cf0cc5354052e28e9" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "libp2p-core", "libp2p-swarm", "log 0.4.8", @@ -2771,12 +2790,12 @@ dependencies = [ "bytes 0.5.4", "either", "fnv", - "futures 0.3.3", + "futures 0.3.1", "futures_codec", "libp2p-core", "libp2p-swarm", "log 0.4.8", - "parity-multihash 0.2.2", + "parity-multihash 0.2.1", "prost", "prost-build", "rand 0.7.3", @@ -2798,7 +2817,7 @@ dependencies = [ "data-encoding", "dns-parser", "either", - "futures 0.3.3", + "futures 0.3.1", "lazy_static", "libp2p-core", "libp2p-swarm", @@ -2818,7 +2837,7 @@ checksum = "89d0b44dfdef80cc2be4b42d127de1c793905eca2459415a5c57d6b4fbd8ec30" dependencies = [ "bytes 0.5.4", "fnv", - "futures 0.3.3", + "futures 0.3.1", "futures_codec", "libp2p-core", "log 0.4.8", @@ -2833,7 +2852,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0845e8208d814cd41c26c90a6a2f2b720c31b588209cecc49a44c881a09f417f" dependencies = [ "curve25519-dalek 1.2.3", - "futures 0.3.3", + "futures 0.3.1", "lazy_static", "libp2p-core", "log 0.4.8", @@ -2852,7 +2871,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16ecced2949ae93b6ff29565303ecd1bef15c4e4efb689033ee744922561a36b" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "libp2p-core", "libp2p-swarm", "log 0.4.8", @@ -2868,7 +2887,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "195fda6b6a948a242fd30570e0e3418ae8e0a20055ea75d45458e1079a8efb05" dependencies = [ "bytes 0.5.4", - "futures 0.3.3", + "futures 0.3.1", "futures_codec", "libp2p-core", "log 0.4.8", @@ -2887,7 +2906,7 @@ checksum = "ceef68ca377b264f84d64c88739a8fa118b5db1e8f18297351dff75314504a5f" dependencies = [ "aes-ctr", "ctr", - "futures 0.3.3", + "futures 0.3.1", "hmac", "js-sys", "lazy_static", @@ -2915,7 +2934,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14ea00be81bc3985e36abad263ce2ad1b6aeb862aa743563eb70ad42880c05ae" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "libp2p-core", "log 0.4.8", "smallvec 1.2.0", @@ -2930,7 +2949,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e65ef381570df31cb047dfbc11483ab0fe7e6abbdcf2bdc2c60b5d11133d241" dependencies = [ "async-std", - "futures 0.3.3", + "futures 0.3.1", "futures-timer 2.0.2", "get_if_addrs", "ipnet", @@ -2945,7 +2964,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e4f4f7989b35f33d4b9738aab2f031310eb20fec513cab44d12b1bc985a8074" dependencies = [ "async-std", - "futures 0.3.3", + "futures 0.3.1", "libp2p-core", "log 0.4.8", ] @@ -2956,7 +2975,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b4d457adb91a5e2212343218a554394cd8ced64a79fb8e36e7aed2a16d49495" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -2973,7 +2992,7 @@ dependencies = [ "async-tls", "bytes 0.5.4", "either", - "futures 0.3.3", + "futures 0.3.1", "libp2p-core", "log 0.4.8", "quicksink", @@ -2991,7 +3010,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ca25b3aac78a3c93c2a567622abd3cfc16f96f26ae1bf6134f0056203d62d86" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "libp2p-core", "log 0.4.8", "parking_lot 0.10.0", @@ -3345,7 +3364,7 @@ dependencies = [ "browser-utils", "frame-support", "frame-system", - "futures 0.3.3", + "futures 0.3.1", "hex-literal", "jsonrpc-core", "log 0.4.8", @@ -3538,7 +3557,7 @@ dependencies = [ name = "node-template" version = "2.0.0" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "log 0.4.8", "node-template-runtime", "sc-basic-authorship", @@ -3761,9 +3780,9 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] name = "openssl" -version = "0.10.28" +version = "0.10.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "973293749822d7dd6370d6da1e523b0d1db19f06c459134c658b2a4261378b52" +checksum = "e176a45fedd4c990e26580847a525e39e16ec32ac78957dbf62ded31b3abfd6f" dependencies = [ "bitflags", "cfg-if", @@ -4502,7 +4521,7 @@ dependencies = [ "bs58 0.3.0", "byteorder 1.3.2", "data-encoding", - "parity-multihash 0.2.2", + "parity-multihash 0.2.1", "percent-encoding 2.1.0", "serde", "static_assertions", @@ -4527,9 +4546,9 @@ dependencies = [ [[package]] name = "parity-multihash" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b11f42bbd3a021c5061b77154bd3334d5a57e1a03eb162de0b962681cc25800d" +checksum = "70a4d7b05e51bff5ae2c29c7b8c3d889985bbd8f4e15b3542fcc1f6f9666d292" dependencies = [ "blake2", "bytes 0.5.4", @@ -4584,9 +4603,9 @@ dependencies = [ [[package]] name = "parity-util-mem" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01b04e4d2588668d5aa93144b3bd719be963542e60042d66c7586ca763838a5b" +checksum = "900dd84654b048e5bad420bb341658fc2c4d7fea628c22bcf4621733e54859b4" dependencies = [ "cfg-if", "impl-trait-for-tuples", @@ -5263,8 +5282,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" dependencies = [ "crossbeam-deque", - "crossbeam-queue", - "crossbeam-utils", + "crossbeam-queue 0.2.1", + "crossbeam-utils 0.7.0", "lazy_static", "num_cpus", ] @@ -5345,9 +5364,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.16.11" +version = "0.16.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "741ba1704ae21999c00942f9f5944f801e977f54302af346b596287599ad1862" +checksum = "113f53b644c5442e20ff3a299be3d6c61ba143737af5bd2ab298e248a7575b2d" dependencies = [ "cc", "lazy_static", @@ -5396,7 +5415,7 @@ dependencies = [ "base64 0.11.0", "blake2b_simd", "constant_time_eq", - "crossbeam-utils", + "crossbeam-utils 0.7.0", ] [[package]] @@ -5450,7 +5469,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "pin-project", "static_assertions", ] @@ -5492,7 +5511,7 @@ dependencies = [ "bytes 0.4.12", "derive_more", "env_logger 0.7.1", - "futures 0.3.3", + "futures 0.3.1", "futures-timer 2.0.2", "libp2p", "log 0.4.8", @@ -5518,7 +5537,7 @@ dependencies = [ name = "sc-basic-authorship" version = "0.8.0" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "log 0.4.8", "parity-scale-codec", "parking_lot 0.10.0", @@ -5589,7 +5608,7 @@ dependencies = [ "derive_more", "env_logger 0.7.1", "fdlimit", - "futures 0.3.3", + "futures 0.3.1", "lazy_static", "log 0.4.8", "names", @@ -5620,7 +5639,7 @@ dependencies = [ "derive_more", "env_logger 0.7.1", "fnv", - "futures 0.3.3", + "futures 0.3.1", "hash-db", "hex-literal", "kvdb", @@ -5656,7 +5675,7 @@ version = "2.0.0" dependencies = [ "derive_more", "fnv", - "futures 0.3.3", + "futures 0.3.1", "hash-db", "hex-literal", "kvdb", @@ -5693,7 +5712,7 @@ dependencies = [ "linked-hash-map", "log 0.4.8", "parity-scale-codec", - "parity-util-mem 0.4.2", + "parity-util-mem 0.4.1", "parking_lot 0.10.0", "quickcheck", "sc-client", @@ -5718,7 +5737,7 @@ dependencies = [ "derive_more", "env_logger 0.7.1", "futures 0.1.29", - "futures 0.3.3", + "futures 0.3.1", "futures-timer 0.4.0", "log 0.4.8", "parity-scale-codec", @@ -5758,7 +5777,7 @@ dependencies = [ "env_logger 0.7.1", "fork-tree", "futures 0.1.29", - "futures 0.3.3", + "futures 0.3.1", "futures-timer 0.4.0", "log 0.4.8", "merlin", @@ -5805,7 +5824,7 @@ version = "0.8.0" dependencies = [ "derive_more", "env_logger 0.7.1", - "futures 0.3.3", + "futures 0.3.1", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -5832,7 +5851,7 @@ name = "sc-consensus-pow" version = "0.8.0" dependencies = [ "derive_more", - "futures 0.3.3", + "futures 0.3.1", "log 0.4.8", "parity-scale-codec", "sc-client-api", @@ -5851,7 +5870,7 @@ dependencies = [ name = "sc-consensus-slots" version = "0.8.0" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "futures-timer 2.0.2", "log 0.4.8", "parity-scale-codec", @@ -5977,7 +5996,7 @@ dependencies = [ "finality-grandpa", "fork-tree", "futures 0.1.29", - "futures 0.3.3", + "futures 0.3.1", "futures-timer 2.0.2", "log 0.4.8", "parity-scale-codec", @@ -6036,7 +6055,7 @@ dependencies = [ "erased-serde", "fnv", "fork-tree", - "futures 0.3.3", + "futures 0.3.1", "futures-timer 0.4.0", "futures_codec", "libp2p", @@ -6079,7 +6098,7 @@ name = "sc-network-gossip" version = "0.8.0" dependencies = [ "futures 0.1.29", - "futures 0.3.3", + "futures 0.3.1", "futures-timer 0.4.0", "libp2p", "log 0.4.8", @@ -6095,7 +6114,7 @@ version = "0.8.0" dependencies = [ "env_logger 0.7.1", "futures 0.1.29", - "futures 0.3.3", + "futures 0.3.1", "futures-timer 0.4.0", "libp2p", "log 0.4.8", @@ -6124,7 +6143,7 @@ dependencies = [ "env_logger 0.7.1", "fnv", "futures 0.1.29", - "futures 0.3.3", + "futures 0.3.1", "futures-timer 2.0.2", "hyper 0.12.35", "hyper-rustls", @@ -6152,7 +6171,7 @@ dependencies = [ name = "sc-peerset" version = "2.0.0" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "libp2p", "log 0.4.8", "rand 0.7.3", @@ -6165,7 +6184,7 @@ version = "2.0.0" dependencies = [ "assert_matches", "futures 0.1.29", - "futures 0.3.3", + "futures 0.3.1", "hash-db", "jsonrpc-core", "jsonrpc-pubsub", @@ -6201,7 +6220,7 @@ name = "sc-rpc-api" version = "0.8.0" dependencies = [ "derive_more", - "futures 0.3.3", + "futures 0.3.1", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -6251,7 +6270,7 @@ dependencies = [ "derive_more", "exit-future", "futures 0.1.29", - "futures 0.3.3", + "futures 0.3.1", "futures-diagnose", "futures-timer 2.0.2", "grafana-data-source", @@ -6292,7 +6311,7 @@ dependencies = [ "sysinfo", "target_info", "tokio 0.2.11", - "tokio-executor 0.1.10", + "tokio-executor 0.1.9", "tracing", ] @@ -6303,7 +6322,7 @@ dependencies = [ "env_logger 0.7.1", "fdlimit", "futures 0.1.29", - "futures 0.3.3", + "futures 0.3.1", "log 0.4.8", "sc-client", "sc-network", @@ -6332,7 +6351,7 @@ name = "sc-telemetry" version = "2.0.0" dependencies = [ "bytes 0.5.4", - "futures 0.3.3", + "futures 0.3.1", "futures-timer 2.0.2", "libp2p", "log 0.4.8", @@ -6370,7 +6389,7 @@ dependencies = [ "assert_matches", "criterion 0.3.1", "derive_more", - "futures 0.3.3", + "futures 0.3.1", "log 0.4.8", "parity-scale-codec", "parking_lot 0.10.0", @@ -6386,7 +6405,7 @@ name = "sc-transaction-pool" version = "2.0.0" dependencies = [ "derive_more", - "futures 0.3.3", + "futures 0.3.1", "futures-diagnose", "log 0.4.8", "parity-scale-codec", @@ -6405,9 +6424,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.17" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507a9e6e8ffe0a4e0ebb9a10293e62fdf7657c06f1b8bb07a8fcf697d2abf295" +checksum = "87f550b06b6cba9c8b8be3ee73f391990116bf527450d2556e9b9ce263b9a021" dependencies = [ "lazy_static", "winapi 0.3.8", @@ -6717,7 +6736,7 @@ dependencies = [ "base64 0.11.0", "bytes 0.5.4", "flate2", - "futures 0.3.3", + "futures 0.3.1", "http 0.2.0", "httparse", "log 0.4.8", @@ -6877,7 +6896,7 @@ name = "sp-consensus" version = "0.8.0" dependencies = [ "derive_more", - "futures 0.3.3", + "futures 0.3.1", "futures-diagnose", "futures-timer 0.4.0", "libp2p", @@ -7264,7 +7283,7 @@ name = "sp-transaction-pool" version = "2.0.0" dependencies = [ "derive_more", - "futures 0.3.3", + "futures 0.3.1", "log 0.4.8", "parity-scale-codec", "serde", @@ -7456,7 +7475,7 @@ version = "2.0.0" dependencies = [ "frame-support", "frame-system", - "futures 0.3.3", + "futures 0.3.1", "jsonrpc-client-transports", "jsonrpc-core", "parity-scale-codec", @@ -7472,7 +7491,7 @@ version = "2.0.0" dependencies = [ "env_logger 0.7.1", "frame-system-rpc-runtime-api", - "futures 0.3.3", + "futures 0.3.1", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -7493,7 +7512,7 @@ dependencies = [ name = "substrate-test-client" version = "2.0.0" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "hash-db", "parity-scale-codec", "sc-client", @@ -7552,7 +7571,7 @@ dependencies = [ name = "substrate-test-runtime-client" version = "2.0.0" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "parity-scale-codec", "sc-block-builder", "sc-client", @@ -7570,7 +7589,7 @@ name = "substrate-test-runtime-transaction-pool" version = "2.0.0" dependencies = [ "derive_more", - "futures 0.3.3", + "futures 0.3.1", "parity-scale-codec", "parking_lot 0.10.0", "sc-transaction-graph", @@ -7827,11 +7846,11 @@ dependencies = [ "num_cpus", "tokio-codec", "tokio-current-thread", - "tokio-executor 0.1.10", + "tokio-executor 0.1.9", "tokio-fs", "tokio-io", "tokio-reactor", - "tokio-sync 0.1.8", + "tokio-sync 0.1.7", "tokio-tcp", "tokio-threadpool", "tokio-timer", @@ -7872,9 +7891,9 @@ dependencies = [ [[package]] name = "tokio-codec" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" +checksum = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" dependencies = [ "bytes 0.4.12", "futures 0.1.29", @@ -7883,21 +7902,21 @@ dependencies = [ [[package]] name = "tokio-current-thread" -version = "0.1.7" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" +checksum = "d16217cad7f1b840c5a97dfb3c43b0c871fef423a6e8d2118c604e843662a443" dependencies = [ "futures 0.1.29", - "tokio-executor 0.1.10", + "tokio-executor 0.1.9", ] [[package]] name = "tokio-executor" -version = "0.1.10" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" +checksum = "ca6df436c42b0c3330a82d855d2ef017cd793090ad550a6bc2184f4b933532ab" dependencies = [ - "crossbeam-utils", + "crossbeam-utils 0.6.6", "futures 0.1.29", ] @@ -7914,9 +7933,9 @@ dependencies = [ [[package]] name = "tokio-fs" -version = "0.1.7" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" +checksum = "3fe6dc22b08d6993916647d108a1a7d15b9cd29c4f4496c62b92c45b5041b7af" dependencies = [ "futures 0.1.29", "tokio-io", @@ -7925,9 +7944,9 @@ dependencies = [ [[package]] name = "tokio-io" -version = "0.1.13" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" +checksum = "5090db468dad16e1a7a54c8c67280c5e4b544f3d3e018f0b913b400261f85926" dependencies = [ "bytes 0.4.12", "futures 0.1.29", @@ -7947,11 +7966,11 @@ dependencies = [ [[package]] name = "tokio-reactor" -version = "0.1.12" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" +checksum = "6732fe6b53c8d11178dcb77ac6d9682af27fc6d4cb87789449152e5377377146" dependencies = [ - "crossbeam-utils", + "crossbeam-utils 0.6.6", "futures 0.1.29", "lazy_static", "log 0.4.8", @@ -7959,9 +7978,9 @@ dependencies = [ "num_cpus", "parking_lot 0.9.0", "slab", - "tokio-executor 0.1.10", + "tokio-executor 0.1.9", "tokio-io", - "tokio-sync 0.1.8", + "tokio-sync 0.1.7", ] [[package]] @@ -7980,9 +7999,9 @@ dependencies = [ [[package]] name = "tokio-sync" -version = "0.1.8" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" +checksum = "d06554cce1ae4a50f42fba8023918afa931413aded705b560e29600ccf7c6d76" dependencies = [ "fnv", "futures 0.1.29", @@ -8001,9 +8020,9 @@ dependencies = [ [[package]] name = "tokio-tcp" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" +checksum = "1d14b10654be682ac43efee27401d792507e30fd8d26389e1da3b185de2e4119" dependencies = [ "bytes 0.4.12", "futures 0.1.29", @@ -8015,31 +8034,31 @@ dependencies = [ [[package]] name = "tokio-threadpool" -version = "0.1.18" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" +checksum = "f0c32ffea4827978e9aa392d2f743d973c1dfa3730a2ed3f22ce1e6984da848c" dependencies = [ "crossbeam-deque", - "crossbeam-queue", - "crossbeam-utils", + "crossbeam-queue 0.1.2", + "crossbeam-utils 0.6.6", "futures 0.1.29", "lazy_static", "log 0.4.8", "num_cpus", "slab", - "tokio-executor 0.1.10", + "tokio-executor 0.1.9", ] [[package]] name = "tokio-timer" -version = "0.2.13" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" +checksum = "1739638e364e558128461fc1ad84d997702c8e31c2e6b18fb99842268199e827" dependencies = [ - "crossbeam-utils", + "crossbeam-utils 0.6.6", "futures 0.1.29", "slab", - "tokio-executor 0.1.10", + "tokio-executor 0.1.9", ] [[package]] @@ -8055,9 +8074,9 @@ dependencies = [ [[package]] name = "tokio-udp" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" +checksum = "f02298505547f73e60f568359ef0d016d5acd6e830ab9bc7c4a5b3403440121b" dependencies = [ "bytes 0.4.12", "futures 0.1.29", @@ -8070,9 +8089,9 @@ dependencies = [ [[package]] name = "tokio-uds" -version = "0.2.6" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5076db410d6fdc6523df7595447629099a1fdc47b3d9f896220780fa48faf798" +checksum = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445" dependencies = [ "bytes 0.4.12", "futures 0.1.29", @@ -8576,7 +8595,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "324c5e65a08699c9c4334ba136597ab22b85dccd4b65dd1e36ccf8f723a95b54" dependencies = [ - "futures 0.3.3", + "futures 0.3.1", "js-sys", "parking_lot 0.9.0", "pin-utils", @@ -8908,12 +8927,12 @@ checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" [[package]] name = "yamux" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "902f4cee32c401c211b6b69f4a3f6f4cf3515644db5bd822cf685a7dbd6201f9" +checksum = "9f937668802a2e862a4fed05267e10b20c310bf771adc89687710706d55a9a65" dependencies = [ "bytes 0.5.4", - "futures 0.3.3", + "futures 0.3.1", "log 0.4.8", "nohash-hasher", "parking_lot 0.10.0",