Detailed validator monitoring (#2151)

## Issue Addressed

- Resolves #2064

## Proposed Changes

Adds a `ValidatorMonitor` struct which provides additional logging and Grafana metrics for specific validators.

Use `lighthouse bn --validator-monitor` to automatically enable monitoring for any validator that hits the [subnet subscription](https://ethereum.github.io/eth2.0-APIs/#/Validator/prepareBeaconCommitteeSubnet) HTTP API endpoint.

Also, use `lighthouse bn --validator-monitor-pubkeys` to supply a list of validators which will always be monitored.

See the new docs included in this PR for more info.

## TODO

- [x] Track validator balance, `slashed` status, etc.
- [x] ~~Register slashings in current epoch, not offense epoch~~
- [ ] Publish Grafana dashboard, update TODO link in docs
- [x] ~~#2130 is merged into this branch, resolve that~~
This commit is contained in:
Paul Hauner
2021-01-20 19:19:38 +00:00
parent 1eb0915301
commit 2b2a358522
29 changed files with 1646 additions and 37 deletions

View File

@@ -451,4 +451,29 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
.value_name("WSS_CHECKPOINT")
.takes_value(true)
)
.arg(
Arg::with_name("validator-monitor-auto")
.long("validator-monitor-auto")
.help("Enables the automatic detection and monitoring of validators connected to the \
HTTP API and using the subnet subscription endpoint. This generally has the \
effect of providing additional logging and metrics for locally controlled \
validators.")
)
.arg(
Arg::with_name("validator-monitor-pubkeys")
.long("validator-monitor-pubkeys")
.help("A comma-separated list of 0x-prefixed validator public keys. \
These validators will receive special monitoring and additional \
logging.")
.value_name("PUBKEYS")
.takes_value(true)
)
.arg(
Arg::with_name("validator-monitor-file")
.long("validator-monitor-file")
.help("As per --validator-monitor-pubkeys, but the comma-separated list is \
contained within a file at the given path.")
.value_name("PATH")
.takes_value(true)
)
}