Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(en): Remove L1 client health check #2136

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions core/bin/external_node/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,6 @@ impl CheckHealth for MainNodeHealthCheck {
}
}

/// Ethereum client health check.
#[derive(Debug)]
pub(crate) struct EthClientHealthCheck(Box<DynClient<L1>>);

impl From<Box<DynClient<L1>>> for EthClientHealthCheck {
fn from(client: Box<DynClient<L1>>) -> Self {
Self(client.for_component("ethereum_health_check"))
}
}

#[async_trait]
impl CheckHealth for EthClientHealthCheck {
fn name(&self) -> &'static str {
"ethereum_http_rpc"
}

async fn check_health(&self) -> Health {
if let Err(err) = self.0.block_number().await {
tracing::warn!("Health-check call to Ethereum HTTP RPC failed: {err}");
let details = serde_json::json!({
"error": err.to_string(),
});
// Unlike main node client, losing connection to L1 is not fatal for the node
return Health::from(HealthStatus::Affected).with_details(details);
}
HealthStatus::Ready.into()
}
}

/// Task that validates chain IDs using main node and Ethereum clients.
#[derive(Debug)]
pub(crate) struct ValidateChainIdsTask {
Expand Down
3 changes: 1 addition & 2 deletions core/bin/external_node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use zksync_web3_decl::{

use crate::{
config::ExternalNodeConfig,
helpers::{EthClientHealthCheck, MainNodeHealthCheck, ValidateChainIdsTask},
helpers::{MainNodeHealthCheck, ValidateChainIdsTask},
init::ensure_storage_initialized,
metrics::RUST_METRICS,
};
Expand Down Expand Up @@ -854,7 +854,6 @@ async fn run_node(
app_health.insert_custom_component(Arc::new(MainNodeHealthCheck::from(
main_node_client.clone(),
)))?;
app_health.insert_custom_component(Arc::new(EthClientHealthCheck::from(eth_client.clone())))?;
app_health.insert_custom_component(Arc::new(ConnectionPoolHealthCheck::new(
connection_pool.clone(),
)))?;
Expand Down
Loading