mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-19 21:04:41 +00:00
Shrink persisted fork choice data (#7805)
Closes: - https://github.com/sigp/lighthouse/issues/7760 - [x] Remove `balances_cache` from `PersistedForkChoiceStore` (~65 MB saving on mainnet) - [x] Remove `justified_balances` from `PersistedForkChoiceStore` (~16 MB saving on mainnet) - [x] Remove `balances` from `ProtoArray`/`SszContainer`. - [x] Implement zstd compression for votes - [x] Fix bug in justified state usage - [x] Bump schema version to V28 and implement migration.
This commit is contained in:
@@ -394,7 +394,7 @@ where
|
||||
.map_err(|e| format!("Failed to initialize genesis data column info: {:?}", e))?,
|
||||
);
|
||||
|
||||
let fc_store = BeaconForkChoiceStore::get_forkchoice_store(store, &genesis)
|
||||
let fc_store = BeaconForkChoiceStore::get_forkchoice_store(store, genesis.clone())
|
||||
.map_err(|e| format!("Unable to initialize fork choice store: {e:?}"))?;
|
||||
let current_slot = None;
|
||||
|
||||
@@ -616,7 +616,7 @@ where
|
||||
beacon_state: weak_subj_state,
|
||||
};
|
||||
|
||||
let fc_store = BeaconForkChoiceStore::get_forkchoice_store(store, &snapshot)
|
||||
let fc_store = BeaconForkChoiceStore::get_forkchoice_store(store, snapshot.clone())
|
||||
.map_err(|e| format!("Unable to initialize fork choice store: {e:?}"))?;
|
||||
|
||||
let fork_choice = ForkChoice::from_anchor(
|
||||
@@ -887,8 +887,9 @@ where
|
||||
self.pending_io_batch.push(BeaconChain::<
|
||||
Witness<TSlotClock, E, THotStore, TColdStore>,
|
||||
>::persist_fork_choice_in_batch_standalone(
|
||||
&fork_choice
|
||||
));
|
||||
&fork_choice,
|
||||
store.get_config(),
|
||||
).map_err(|e| format!("Fork choice compression error: {e:?}"))?);
|
||||
store
|
||||
.hot_db
|
||||
.do_atomically(self.pending_io_batch)
|
||||
|
||||
Reference in New Issue
Block a user