From 33ed06f5269f0745aa743d0d20062361531264ec Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Fri, 10 Jul 2020 12:55:09 +0200 Subject: [PATCH 1/2] Remove warning about networking taking a lot of time --- client/service/src/lib.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/client/service/src/lib.rs b/client/service/src/lib.rs index 5daa23a173214..501305147e1ca 100644 --- a/client/service/src/lib.rs +++ b/client/service/src/lib.rs @@ -156,7 +156,7 @@ pub struct ServiceComponents, TSc, TExPool, pub client: Arc, /// A shared transaction pool instance. pub transaction_pool: Arc, - /// The chain task manager. + /// The chain task manager. pub task_manager: TaskManager, /// A keystore that stores keys. pub keystore: sc_keystore::KeyStorePtr, @@ -216,8 +216,6 @@ async fn build_network_future< }; loop { - let before_polling = Instant::now(); - futures::select!{ // List of blocks that the client has imported. notification = imported_blocks_stream.next() => { @@ -334,15 +332,6 @@ async fn build_network_future< ready_sink.send((status, state)); } } - - // Now some diagnostic for performances. - let polling_dur = before_polling.elapsed(); - log!( - target: "service", - if polling_dur >= Duration::from_secs(1) { Level::Warn } else { Level::Trace }, - "⚠️ Polling the network future took {:?}", - polling_dur - ); } } From 35ba3ebfd09ca45eee5897596f816dee3ee4804d Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Fri, 10 Jul 2020 13:08:01 +0200 Subject: [PATCH 2/2] Fix warnings --- client/service/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/service/src/lib.rs b/client/service/src/lib.rs index 501305147e1ca..b8b722503749c 100644 --- a/client/service/src/lib.rs +++ b/client/service/src/lib.rs @@ -38,13 +38,12 @@ use std::{io, pin::Pin}; use std::net::SocketAddr; use std::collections::HashMap; use std::time::Duration; -use wasm_timer::Instant; use std::task::Poll; use parking_lot::Mutex; use futures::{Future, FutureExt, Stream, StreamExt, stream, compat::*}; use sc_network::{NetworkStatus, network_state::NetworkState, PeerId}; -use log::{log, warn, debug, error, Level}; +use log::{warn, debug, error}; use codec::{Encode, Decode}; use sp_runtime::generic::BlockId; use sp_runtime::traits::{Block as BlockT, Header as HeaderT};