From 991d0913605a042a16e95d7c90f475f6f9cd9124 Mon Sep 17 00:00:00 2001 From: SDartayet <44068466+SDartayet@users.noreply.github.com> Date: Mon, 10 Nov 2025 18:18:38 -0300 Subject: [PATCH 1/7] Added warning for no CL messages --- crates/networking/rpc/rpc.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/crates/networking/rpc/rpc.rs b/crates/networking/rpc/rpc.rs index d61a81a7c59..ab5183cdd09 100644 --- a/crates/networking/rpc/rpc.rs +++ b/crates/networking/rpc/rpc.rs @@ -75,8 +75,9 @@ use tokio::sync::{ mpsc::{UnboundedSender, unbounded_channel}, oneshot, }; +use tokio::time::timeout; use tower_http::cors::CorsLayer; -use tracing::{error, info}; +use tracing::{error, info, warn}; use tracing_subscriber::{EnvFilter, Registry, reload}; #[cfg(all(feature = "jemalloc_profiling", target_os = "linux"))] @@ -296,7 +297,24 @@ pub async fn start_api( .into_future(); info!("Starting HTTP server at {http_addr}"); - let authrpc_handler = |ctx, auth, body| async { handle_authrpc_request(ctx, auth, body).await }; + let (timer_sender, mut timer_receiver) = tokio::sync::watch::channel(()); + + tokio::spawn(async move { + loop { + let result = timeout(Duration::from_secs(30), timer_receiver.changed()).await; + if result.is_err() { + warn!("No messages from the consensus layer. Is the consensus client running? + Check the auth JWT coincides with the one used by the CL and the auth RPC address and port used by it and Ethrex match." + ); + } + } + }); + + let authrpc_handler = async move |ctx, auth, body| { + let _ = timer_sender.send(()); + handle_authrpc_request(ctx, auth, body).await + }; + let authrpc_router = Router::new() .route("/", post(authrpc_handler)) .with_state(service_context.clone()) From 83260af963ea7a073941f0d3644f2685a241a67b Mon Sep 17 00:00:00 2001 From: SDartayet <44068466+SDartayet@users.noreply.github.com> Date: Mon, 10 Nov 2025 18:49:53 -0300 Subject: [PATCH 2/7] bumped log level to error Log an error message if no messages are received from the consensus layer. --- crates/networking/rpc/rpc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/networking/rpc/rpc.rs b/crates/networking/rpc/rpc.rs index ab5183cdd09..7cf09e521c6 100644 --- a/crates/networking/rpc/rpc.rs +++ b/crates/networking/rpc/rpc.rs @@ -303,7 +303,7 @@ pub async fn start_api( loop { let result = timeout(Duration::from_secs(30), timer_receiver.changed()).await; if result.is_err() { - warn!("No messages from the consensus layer. Is the consensus client running? + error!("No messages from the consensus layer. Is the consensus client running? Check the auth JWT coincides with the one used by the CL and the auth RPC address and port used by it and Ethrex match." ); } From 3f6c425dfc8253ccfdf036b3ef1c970e7435c369 Mon Sep 17 00:00:00 2001 From: SDartayet <44068466+SDartayet@users.noreply.github.com> Date: Tue, 11 Nov 2025 10:27:00 -0300 Subject: [PATCH 3/7] fix unused import Removed 'warn' from tracing imports in rpc.rs --- crates/networking/rpc/rpc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/networking/rpc/rpc.rs b/crates/networking/rpc/rpc.rs index 7cf09e521c6..7ab415dd31b 100644 --- a/crates/networking/rpc/rpc.rs +++ b/crates/networking/rpc/rpc.rs @@ -77,7 +77,7 @@ use tokio::sync::{ }; use tokio::time::timeout; use tower_http::cors::CorsLayer; -use tracing::{error, info, warn}; +use tracing::{error, info}; use tracing_subscriber::{EnvFilter, Registry, reload}; #[cfg(all(feature = "jemalloc_profiling", target_os = "linux"))] From 2bcebc6899196944f5ac6a73848eae8f2a2eedd4 Mon Sep 17 00:00:00 2001 From: SDartayet <44068466+SDartayet@users.noreply.github.com> Date: Tue, 11 Nov 2025 12:15:28 -0300 Subject: [PATCH 4/7] change back to warn from error level --- crates/networking/rpc/rpc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/networking/rpc/rpc.rs b/crates/networking/rpc/rpc.rs index 7ab415dd31b..ab5183cdd09 100644 --- a/crates/networking/rpc/rpc.rs +++ b/crates/networking/rpc/rpc.rs @@ -77,7 +77,7 @@ use tokio::sync::{ }; use tokio::time::timeout; use tower_http::cors::CorsLayer; -use tracing::{error, info}; +use tracing::{error, info, warn}; use tracing_subscriber::{EnvFilter, Registry, reload}; #[cfg(all(feature = "jemalloc_profiling", target_os = "linux"))] @@ -303,7 +303,7 @@ pub async fn start_api( loop { let result = timeout(Duration::from_secs(30), timer_receiver.changed()).await; if result.is_err() { - error!("No messages from the consensus layer. Is the consensus client running? + warn!("No messages from the consensus layer. Is the consensus client running? Check the auth JWT coincides with the one used by the CL and the auth RPC address and port used by it and Ethrex match." ); } From 97a0682aceb356decc89529ce0dbea92113ea947 Mon Sep 17 00:00:00 2001 From: SDartayet <44068466+SDartayet@users.noreply.github.com> Date: Tue, 11 Nov 2025 12:21:03 -0300 Subject: [PATCH 5/7] simplify error message --- crates/networking/rpc/rpc.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/networking/rpc/rpc.rs b/crates/networking/rpc/rpc.rs index ab5183cdd09..9c913e0d280 100644 --- a/crates/networking/rpc/rpc.rs +++ b/crates/networking/rpc/rpc.rs @@ -303,8 +303,7 @@ pub async fn start_api( loop { let result = timeout(Duration::from_secs(30), timer_receiver.changed()).await; if result.is_err() { - warn!("No messages from the consensus layer. Is the consensus client running? - Check the auth JWT coincides with the one used by the CL and the auth RPC address and port used by it and Ethrex match." + warn!("No messages from the consensus layer. Is the consensus client running?" ); } } From 3359350f611655eadbeedaa321b1c41db4945b3c Mon Sep 17 00:00:00 2001 From: SDartayet <44068466+SDartayet@users.noreply.github.com> Date: Tue, 11 Nov 2025 17:58:46 -0300 Subject: [PATCH 6/7] cargo fmt --- crates/networking/rpc/rpc.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/networking/rpc/rpc.rs b/crates/networking/rpc/rpc.rs index 9c913e0d280..63393be92b9 100644 --- a/crates/networking/rpc/rpc.rs +++ b/crates/networking/rpc/rpc.rs @@ -303,8 +303,7 @@ pub async fn start_api( loop { let result = timeout(Duration::from_secs(30), timer_receiver.changed()).await; if result.is_err() { - warn!("No messages from the consensus layer. Is the consensus client running?" - ); + warn!("No messages from the consensus layer. Is the consensus client running?"); } } }); From 30d2cd4a1e4f4b91693a64843b035992e1550099 Mon Sep 17 00:00:00 2001 From: SDartayet <44068466+SDartayet@users.noreply.github.com> Date: Fri, 14 Nov 2025 17:17:33 -0300 Subject: [PATCH 7/7] Fix handler signature Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- crates/networking/rpc/rpc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/networking/rpc/rpc.rs b/crates/networking/rpc/rpc.rs index 63393be92b9..a1231891d4c 100644 --- a/crates/networking/rpc/rpc.rs +++ b/crates/networking/rpc/rpc.rs @@ -308,7 +308,7 @@ pub async fn start_api( } }); - let authrpc_handler = async move |ctx, auth, body| { + let authrpc_handler = move |ctx, auth, body| async move { let _ = timer_sender.send(()); handle_authrpc_request(ctx, auth, body).await };