mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-04 05:14:33 +00:00
Optimise slasher DB layout and switch to MDBX (#2776)
## Issue Addressed Closes #2286 Closes #2538 Closes #2342 ## Proposed Changes Part II of major slasher optimisations after #2767 These changes will be backwards-incompatible due to the move to MDBX (and the schema change) 😱 * [x] Shrink attester keys from 16 bytes to 7 bytes. * [x] Shrink attester records from 64 bytes to 6 bytes. * [x] Separate `DiskConfig` from regular `Config`. * [x] Add configuration for the LRU cache size. * [x] Add a "migration" that deletes any legacy LMDB database.
This commit is contained in:
@@ -9,7 +9,7 @@ use types::{Epoch, EthSpec};
|
||||
#[test]
|
||||
fn empty_pruning() {
|
||||
let tempdir = tempdir().unwrap();
|
||||
let config = Config::new(tempdir.path().into()).for_testing();
|
||||
let config = Config::new(tempdir.path().into());
|
||||
let slasher = Slasher::<E>::open(config, test_logger()).unwrap();
|
||||
slasher.prune_database(Epoch::new(0)).unwrap();
|
||||
}
|
||||
@@ -19,7 +19,7 @@ fn block_pruning() {
|
||||
let slots_per_epoch = E::slots_per_epoch();
|
||||
|
||||
let tempdir = tempdir().unwrap();
|
||||
let mut config = Config::new(tempdir.path().into()).for_testing();
|
||||
let mut config = Config::new(tempdir.path().into());
|
||||
config.chunk_size = 2;
|
||||
config.history_length = 2;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user