Skip to content

Commit 3fe8870

Browse files
committed
Fix nodes not being marked as available
1 parent 45d47b2 commit 3fe8870

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

validator_client/src/beacon_node_fallback.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl<E: EthSpec> CandidateBeaconNode<E> {
207207
) -> Result<(), CandidateError> {
208208
if let Err(e) = self.is_compatible(spec, log).await {
209209
*self.health.write() = Err(e);
210-
return Ok(());
210+
return Err(e);
211211
}
212212

213213
if let Some(slot_clock) = slot_clock {
@@ -243,7 +243,7 @@ impl<E: EthSpec> CandidateBeaconNode<E> {
243243
Err(e) => {
244244
// Set the health as `Err` which is sorted last in the list.
245245
*self.health.write() = Err(e);
246-
Ok(())
246+
Err(e)
247247
}
248248
}
249249
} else {
@@ -402,8 +402,9 @@ impl<T: SlotClock, E: EthSpec> BeaconNodeFallback<T, E> {
402402
pub async fn num_available(&self) -> usize {
403403
let mut n = 0;
404404
for candidate in self.candidates.read().await.iter() {
405-
if candidate.health().is_ok() {
406-
n += 1
405+
match candidate.health() {
406+
Ok(_) | Err(CandidateError::Uninitialized) => n += 1,
407+
Err(_) => continue,
407408
}
408409
}
409410
n

validator_client/src/notifier.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ async fn notify<T: SlotClock + 'static, E: EthSpec>(
9696
"head_slot" => %health.head,
9797
"is_optimistic" => ?health.optimistic_status,
9898
"execution_engine_status" => ?health.execution_status,
99-
"health_tier" => ?health.health_tier,
99+
"health_tier" => %health.health_tier,
100100
);
101101
} else {
102102
debug!(

0 commit comments

Comments
 (0)