From 61bc700fdfa93870f223f810a477cb7ecb703297 Mon Sep 17 00:00:00 2001 From: Mac L Date: Thu, 22 Jun 2023 11:51:30 +1000 Subject: [PATCH] Fix nodes not being marked as available --- validator_client/src/beacon_node_fallback.rs | 9 +++++---- validator_client/src/notifier.rs | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/validator_client/src/beacon_node_fallback.rs b/validator_client/src/beacon_node_fallback.rs index 73c7b7d0b0..759148060a 100644 --- a/validator_client/src/beacon_node_fallback.rs +++ b/validator_client/src/beacon_node_fallback.rs @@ -207,7 +207,7 @@ impl CandidateBeaconNode { ) -> Result<(), CandidateError> { if let Err(e) = self.is_compatible(spec, log).await { *self.health.write() = Err(e); - return Ok(()); + return Err(e); } if let Some(slot_clock) = slot_clock { @@ -243,7 +243,7 @@ impl CandidateBeaconNode { Err(e) => { // Set the health as `Err` which is sorted last in the list. *self.health.write() = Err(e); - Ok(()) + Err(e) } } } else { @@ -402,8 +402,9 @@ impl BeaconNodeFallback { pub async fn num_available(&self) -> usize { let mut n = 0; for candidate in self.candidates.read().await.iter() { - if candidate.health().is_ok() { - n += 1 + match candidate.health() { + Ok(_) | Err(CandidateError::Uninitialized) => n += 1, + Err(_) => continue, } } n diff --git a/validator_client/src/notifier.rs b/validator_client/src/notifier.rs index 984ffadf89..1e7940de57 100644 --- a/validator_client/src/notifier.rs +++ b/validator_client/src/notifier.rs @@ -96,7 +96,7 @@ async fn notify( "head_slot" => %health.head, "is_optimistic" => ?health.optimistic_status, "execution_engine_status" => ?health.execution_status, - "health_tier" => ?health.health_tier, + "health_tier" => %health.health_tier, ); } else { debug!(