lighthouse/slasher/src
Michael Sproul 92d597ad23 Modularise slasher backend (#3443)
## Proposed Changes

Enable multiple database backends for the slasher, either MDBX (default) or LMDB. The backend can be selected using `--slasher-backend={lmdb,mdbx}`.

## Additional Info

In order to abstract over the two library's different handling of database lifetimes I've used `Box::leak` to give the `Environment` type a `'static` lifetime. This was the only way I could think of using 100% safe code to construct a self-referential struct `SlasherDB`, where the `OpenDatabases` refers to the `Environment`. I think this is OK, as the `Environment` is expected to live for the life of the program, and both database engines leave the database in a consistent state after each write. The memory claimed for memory-mapping will be freed by the OS and appropriately flushed regardless of whether the `Environment` is actually dropped.

We are depending on two `sigp` forks of `libmdbx-rs` and `lmdb-rs`, to give us greater control over MDBX OS support and LMDB's version.
2022-08-15 01:30:56 +00:00
..
database Modularise slasher backend (#3443) 2022-08-15 01:30:56 +00:00
array.rs Modularise slasher backend (#3443) 2022-08-15 01:30:56 +00:00
attestation_queue.rs De-duplicate attestations in the slasher (#2767) 2021-11-08 00:01:09 +00:00
attester_record.rs Optimise slasher DB layout and switch to MDBX (#2776) 2021-12-21 08:23:17 +00:00
batch_stats.rs Add slasher broadcast (#2079) 2020-12-16 03:44:01 +00:00
block_queue.rs rust 1.53.0 updates (#2411) 2021-06-18 05:58:01 +00:00
config.rs Modularise slasher backend (#3443) 2022-08-15 01:30:56 +00:00
database.rs Modularise slasher backend (#3443) 2022-08-15 01:30:56 +00:00
error.rs Modularise slasher backend (#3443) 2022-08-15 01:30:56 +00:00
lib.rs Modularise slasher backend (#3443) 2022-08-15 01:30:56 +00:00
metrics.rs Optimise slasher DB layout and switch to MDBX (#2776) 2021-12-21 08:23:17 +00:00
migrate.rs Optimise slasher DB layout and switch to MDBX (#2776) 2021-12-21 08:23:17 +00:00
slasher.rs Optimise slasher DB layout and switch to MDBX (#2776) 2021-12-21 08:23:17 +00:00
test_utils.rs Add test_logger as feature to logging (#2586) 2021-10-06 00:46:07 +00:00