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`.
This commit is contained in:
Michael Sproul 2021-06-17 02:10:48 +00:00
parent 98ab00cc52
commit 3dc1eb5eb6

View File

@ -353,8 +353,7 @@ impl<T: EthSpec> ValidatorMonitor<T> {
"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<T: EthSpec> ValidatorMonitor<T> {
"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 {