lighthouse/validator_client/slashing_protection/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
..
bin Pretty-print EIP-3076 tests (#1977) 2020-12-03 22:07:12 +00:00
attestation_tests.rs Fix clippy errors on tests (#2160) 2021-01-28 23:31:06 +00:00
block_tests.rs Fix clippy errors on tests (#2160) 2021-01-28 23:31:06 +00:00
interchange_test.rs Refine and test slashing protection semantics (#1885) 2020-11-24 07:21:14 +00:00
interchange.rs Clippy 1.49.0 updates and dht persistence test fix (#2156) 2021-01-19 00:34:28 +00:00
lib.rs Prune slashing protection DB (#2194) 2021-02-24 23:51:04 +00:00
parallel_tests.rs Implement Slashing Protection (#1116) 2020-05-18 16:25:16 +10:00
registration_tests.rs Implement slashing protection interchange format (#1544) 2020-10-02 01:42:27 +00:00
signed_attestation.rs Refine and test slashing protection semantics (#1885) 2020-11-24 07:21:14 +00:00
signed_block.rs Refine and test slashing protection semantics (#1885) 2020-11-24 07:21:14 +00:00
slashing_database.rs Prune slashing protection DB (#2194) 2021-02-24 23:51:04 +00:00
test_utils.rs Refine and test slashing protection semantics (#1885) 2020-11-24 07:21:14 +00:00