mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 01:05:47 +00:00
Fix nodes not being marked as available
This commit is contained in:
@@ -207,7 +207,7 @@ impl<E: EthSpec> CandidateBeaconNode<E> {
|
|||||||
) -> Result<(), CandidateError> {
|
) -> Result<(), CandidateError> {
|
||||||
if let Err(e) = self.is_compatible(spec, log).await {
|
if let Err(e) = self.is_compatible(spec, log).await {
|
||||||
*self.health.write() = Err(e);
|
*self.health.write() = Err(e);
|
||||||
return Ok(());
|
return Err(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(slot_clock) = slot_clock {
|
if let Some(slot_clock) = slot_clock {
|
||||||
@@ -243,7 +243,7 @@ impl<E: EthSpec> CandidateBeaconNode<E> {
|
|||||||
Err(e) => {
|
Err(e) => {
|
||||||
// Set the health as `Err` which is sorted last in the list.
|
// Set the health as `Err` which is sorted last in the list.
|
||||||
*self.health.write() = Err(e);
|
*self.health.write() = Err(e);
|
||||||
Ok(())
|
Err(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -402,8 +402,9 @@ impl<T: SlotClock, E: EthSpec> BeaconNodeFallback<T, E> {
|
|||||||
pub async fn num_available(&self) -> usize {
|
pub async fn num_available(&self) -> usize {
|
||||||
let mut n = 0;
|
let mut n = 0;
|
||||||
for candidate in self.candidates.read().await.iter() {
|
for candidate in self.candidates.read().await.iter() {
|
||||||
if candidate.health().is_ok() {
|
match candidate.health() {
|
||||||
n += 1
|
Ok(_) | Err(CandidateError::Uninitialized) => n += 1,
|
||||||
|
Err(_) => continue,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
n
|
n
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ async fn notify<T: SlotClock + 'static, E: EthSpec>(
|
|||||||
"head_slot" => %health.head,
|
"head_slot" => %health.head,
|
||||||
"is_optimistic" => ?health.optimistic_status,
|
"is_optimistic" => ?health.optimistic_status,
|
||||||
"execution_engine_status" => ?health.execution_status,
|
"execution_engine_status" => ?health.execution_status,
|
||||||
"health_tier" => ?health.health_tier,
|
"health_tier" => %health.health_tier,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
debug!(
|
debug!(
|
||||||
|
|||||||
Reference in New Issue
Block a user