From 3dc1eb5eb6be9305388a7c206985ab06264c32fc Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Thu, 17 Jun 2021 02:10:48 +0000 Subject: [PATCH] Ignore inactive validators in validator monitor (#2396) ## Proposed Changes A user on Discord (`@ChewsMacRibs`) reported that the validator monitor was logging `WARN Attested to an incorrect head` for their validator while it was awaiting activation. This PR modifies the monitor so that it ignores inactive validators, by the logic that they are either awaiting activation, or have already exited. Either way, there's no way for an inactive validator to have their attestations included on chain, so no need for the monitor to report on them. ## Additional Info To reproduce the bug requires registering validator keys manually with `--validator-monitor-pubkeys`. I don't think the bug will present itself with `--validator-monitor-auto`. --- beacon_node/beacon_chain/src/validator_monitor.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/beacon_node/beacon_chain/src/validator_monitor.rs b/beacon_node/beacon_chain/src/validator_monitor.rs index f3ef3aa88..015efe0c6 100644 --- a/beacon_node/beacon_chain/src/validator_monitor.rs +++ b/beacon_node/beacon_chain/src/validator_monitor.rs @@ -353,8 +353,7 @@ impl ValidatorMonitor { "matched_head" => summary.is_previous_epoch_head_attester, "epoch" => prev_epoch, "validator" => id, - - ) + ); } else if summary.is_active_in_previous_epoch && !summary.is_previous_epoch_attester { @@ -364,6 +363,11 @@ impl ValidatorMonitor { "epoch" => prev_epoch, "validator" => id, ) + } else if !summary.is_active_in_previous_epoch { + // Monitored validator is not active, due to awaiting activation + // or being exited/withdrawn. Do not attempt to report on its + // attestations. + continue; } if summary.is_previous_epoch_attester {