lighthouse/validator_client/src
Michael Sproul afd4786c59 Prune slashing protection DB (#2194)
## Proposed Changes

Prune the slashing protection database so that it doesn't exhibit unbounded growth. Prune by dropping attestations and blocks from more than 512 epochs ago, relying on the guards that prevent signing messages with slots or epochs less than the minimum recorded in the DB.

The pruning process is potentially time consuming, so it's scheduled to run only every 512 epochs, in the last 2/3rds of a slot. This gives it at least 4 seconds to run without impacting other signing, which I think should be sufficient. I've seen it run for several minutes (yikes!) on our Pyrmont nodes, but I suspect that 1) this will only occur on the first run when the database is still huge 2) no other production users will be impacted because they don't have enough validators per node.

Pruning also happens at start-up, as I figured this is a fairly infrequent event, and if a user is experiencing problems with the VC related to pruning, it's nice to be able to trigger it with a quick restart. Users are also conditioned to not mind missing a few attestations during a restart.

We need to include a note in the release notes that users may see the message `timed out waiting for connection` the first time they prune a huge database, but that this is totally fine and to be expected (the VC will miss those attestations in the meantime).

I'm also open to making this opt-in for now, although the sooner we get users doing it, the less painful it will be: prune early, prune often!
2021-02-24 23:51:04 +00:00
..
http_api Update to tokio 1.1 (#2172) 2021-02-10 23:29:49 +00:00
http_metrics Prune slashing protection DB (#2194) 2021-02-24 23:51:04 +00:00
attestation_service.rs Prune slashing protection DB (#2194) 2021-02-24 23:51:04 +00:00
beacon_node_fallback.rs Remove duplicate log in BN fallback (#2116) 2021-01-06 03:01:48 +00:00
block_service.rs BN Fallback v2 (#2080) 2020-12-18 09:17:03 +00:00
check_synced.rs Remove duplicate log in BN fallback (#2116) 2021-01-06 03:01:48 +00:00
cli.rs Remove default beacon node value from clap (#2121) 2020-12-28 08:23:59 +00:00
config.rs BN Fallback v2 (#2080) 2020-12-18 09:17:03 +00:00
duties_service.rs Update to tokio 1.1 (#2172) 2021-02-10 23:29:49 +00:00
fork_service.rs Update to tokio 1.1 (#2172) 2021-02-10 23:29:49 +00:00
initialized_validators.rs Update for clippy 1.50 (#2193) 2021-02-15 00:09:12 +00:00
key_cache.rs Implement key cache to reduce keystore loading times for validator_client (#1695) 2020-10-05 10:50:43 +00:00
lib.rs Prune slashing protection DB (#2194) 2021-02-24 23:51:04 +00:00
notifier.rs Update to tokio 1.1 (#2172) 2021-02-10 23:29:49 +00:00
validator_duty.rs Standard beacon api updates (#1831) 2020-11-09 23:13:56 +00:00
validator_store.rs Prune slashing protection DB (#2194) 2021-02-24 23:51:04 +00:00