mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 14:54:45 +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:
@@ -4,6 +4,7 @@ mod migration_schema_v24;
|
||||
mod migration_schema_v25;
|
||||
mod migration_schema_v26;
|
||||
mod migration_schema_v27;
|
||||
mod migration_schema_v28;
|
||||
|
||||
use crate::beacon_chain::BeaconChainTypes;
|
||||
use std::sync::Arc;
|
||||
@@ -79,6 +80,14 @@ pub fn migrate_schema<T: BeaconChainTypes>(
|
||||
migration_schema_v27::downgrade_from_v27::<T>(db.clone())?;
|
||||
db.store_schema_version_atomically(to, vec![])
|
||||
}
|
||||
(SchemaVersion(27), SchemaVersion(28)) => {
|
||||
let ops = migration_schema_v28::upgrade_to_v28::<T>(db.clone())?;
|
||||
db.store_schema_version_atomically(to, ops)
|
||||
}
|
||||
(SchemaVersion(28), SchemaVersion(27)) => {
|
||||
let ops = migration_schema_v28::downgrade_from_v28::<T>(db.clone())?;
|
||||
db.store_schema_version_atomically(to, ops)
|
||||
}
|
||||
// Anything else is an error.
|
||||
(_, _) => Err(HotColdDBError::UnsupportedSchemaVersion {
|
||||
target_version: to,
|
||||
|
||||
Reference in New Issue
Block a user