diff --git a/validator_client/src/beacon_node_health.rs b/validator_client/src/beacon_node_health.rs index 3ab6b473e0..33940102c1 100644 --- a/validator_client/src/beacon_node_health.rs +++ b/validator_client/src/beacon_node_health.rs @@ -98,7 +98,19 @@ impl Display for BeaconNodeHealthTier { impl Ord for BeaconNodeHealthTier { fn cmp(&self, other: &Self) -> Ordering { - self.tier.cmp(&other.tier) + let ordering = self.tier.cmp(&other.tier); + if ordering == Ordering::Equal { + // These tiers represent `synced`. + if [1, 3, 5, 6].contains(&self.tier) { + // Don't tie-break on sync distance in these cases. + // This ensures validator clients don't artificially prefer one node. + ordering + } else { + self.sync_distance.cmp(&other.sync_distance) + } + } else { + ordering + } } }