diff --git a/chain-signatures/node/src/mesh/connection.rs b/chain-signatures/node/src/mesh/connection.rs index 20a578eb..12098eeb 100644 --- a/chain-signatures/node/src/mesh/connection.rs +++ b/chain-signatures/node/src/mesh/connection.rs @@ -49,17 +49,13 @@ impl Pool { continue; }; - tracing::debug!( - "going to send /state call to {:?} url {} /state", - participant, - info.url - ); - let Ok(resp) = self.http.get(url.clone()).timeout(Duration::from_secs(2)).send().await else { - tracing::debug!( - "finish send /state call to {:?} url {} /state", - participant, - info.url - ); + let Ok(resp) = self + .http + .get(url.clone()) + .timeout(Duration::from_secs(2)) + .send() + .await + else { tracing::warn!( "Pool.ping resp err participant {:?} url {}", participant, @@ -68,12 +64,6 @@ impl Pool { continue; }; - tracing::debug!( - "finish send /state call to {:?} url {} /state", - participant, - info.url - ); - let Ok(state): Result = resp.json().await else { tracing::warn!( "Pool.ping state view err participant {:?} url {}", @@ -109,7 +99,13 @@ impl Pool { continue; }; - let Ok(resp) = self.http.get(url).timeout(Duration::from_secs(2)).send().await else { + let Ok(resp) = self + .http + .get(url) + .timeout(Duration::from_secs(2)) + .send() + .await + else { continue; }; diff --git a/chain-signatures/node/src/metrics.rs b/chain-signatures/node/src/metrics.rs index ea7f14f9..57e71afc 100644 --- a/chain-signatures/node/src/metrics.rs +++ b/chain-signatures/node/src/metrics.rs @@ -389,19 +389,19 @@ pub(crate) static SIGNATURE_PUBLISH_FAILURES: Lazy = Lazy::new(|| { .unwrap() }); -pub(crate) static PROTOCOL_LATENCY_ITER_CNT: Lazy = Lazy::new(|| { +pub(crate) static SIGNATURE_PUBLISH_RESPONSE_ERRORS: Lazy = Lazy::new(|| { try_create_counter_vec( - "multichain_protocol_iter_count", - "Count of multichain protocol iter", + "multichain_signature_publish_response_errors", + "number of respond calls with response that cannot be converted to json", &["node_account_id"], ) .unwrap() }); -pub(crate) static SIGNATURE_PUBLISH_RESPONSE_ERRORS: Lazy = Lazy::new(|| { +pub(crate) static PROTOCOL_LATENCY_ITER_CNT: Lazy = Lazy::new(|| { try_create_counter_vec( - "multichain_signature_publish_response_errors", - "number of respond calls with response that cannot be converted to json", + "multichain_protocol_iter_count", + "Count of multichain protocol iter", &["node_account_id"], ) .unwrap() diff --git a/chain-signatures/node/src/protocol/mod.rs b/chain-signatures/node/src/protocol/mod.rs index 5ff7f882..33fb58c5 100644 --- a/chain-signatures/node/src/protocol/mod.rs +++ b/chain-signatures/node/src/protocol/mod.rs @@ -230,6 +230,7 @@ impl MpcSignProtocol { crate::metrics::PROTOCOL_LATENCY_ITER_CNT .with_label_values(&[my_account_id.as_str()]) .inc(); + loop { let msg_result = self.receiver.try_recv(); match msg_result { @@ -287,22 +288,15 @@ impl MpcSignProtocol { } if last_pinged.elapsed() > Duration::from_millis(300) { - tracing::debug!("doing ping now"); - let start = Instant::now(); self.ctx.mesh.ping().await; - let ping_latency = start.elapsed().as_secs(); - tracing::debug!("ping latency was {ping_latency} seconds"); last_pinged = Instant::now(); } - tracing::debug!("finish ping now"); - let state = { let guard = self.state.read().await; guard.clone() }; - tracing::debug!("finish reading state now"); let crypto_time = Instant::now(); let mut state = match state.progress(&mut self).await { Ok(state) => {