lighthouse/validator_client/slashing_protection
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
..
src Prune slashing protection DB (#2194) 2021-02-24 23:51:04 +00:00
tests Pretty-print EIP-3076 tests (#1977) 2020-12-03 22:07:12 +00:00
.gitignore Implement slashing protection interchange format (#1544) 2020-10-02 01:42:27 +00:00
Cargo.toml Update external deps (#1711) 2020-10-05 08:22:19 +00:00
Makefile Pretty-print EIP-3076 tests (#1977) 2020-12-03 22:07:12 +00:00