Remove schema migrations for v28 and earlier (#9031)

With LH v8.1.3 supporting Fulu-on-Gnosis, we no longer need these DB migrations. All Lighthouse nodes running in prod will soon be updated to LH v8.0.0+ and schema v28+.

This PR helps with Gloas fork choice changes, by allowing us to avoid updating old schema migrations when adding V29 for Gloas:

- https://github.com/sigp/lighthouse/pull/9025


  


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
Michael Sproul
2026-03-26 13:10:34 +11:00
committed by GitHub
parent c7055b604f
commit bd34bb1430
19 changed files with 23 additions and 1578 deletions

View File

@@ -16,5 +16,5 @@ pub use error::Error;
pub mod core {
pub use super::proto_array::{ProposerBoost, ProtoArray, ProtoNode};
pub use super::proto_array_fork_choice::VoteTracker;
pub use super::ssz_container::{SszContainer, SszContainerV17, SszContainerV28};
pub use super::ssz_container::{SszContainer, SszContainerV28};
}

View File

@@ -17,14 +17,12 @@ four_byte_option_impl!(four_byte_option_checkpoint, Checkpoint);
pub type SszContainer = SszContainerV28;
#[superstruct(
variants(V17, V28),
variants(V28),
variant_attributes(derive(Encode, Decode, Clone)),
no_enum
)]
pub struct SszContainer {
pub votes: Vec<VoteTracker>,
#[superstruct(only(V17))]
pub balances: Vec<u64>,
pub prune_threshold: usize,
// Deprecated, remove in a future schema migration
justified_checkpoint: Checkpoint,
@@ -73,34 +71,3 @@ impl TryFrom<(SszContainer, JustifiedBalances)> for ProtoArrayForkChoice {
})
}
}
// Convert V17 to V28 by dropping balances.
impl From<SszContainerV17> for SszContainerV28 {
fn from(v17: SszContainerV17) -> Self {
Self {
votes: v17.votes,
prune_threshold: v17.prune_threshold,
justified_checkpoint: v17.justified_checkpoint,
finalized_checkpoint: v17.finalized_checkpoint,
nodes: v17.nodes,
indices: v17.indices,
previous_proposer_boost: v17.previous_proposer_boost,
}
}
}
// Convert V28 to V17 by re-adding balances.
impl From<(SszContainerV28, JustifiedBalances)> for SszContainerV17 {
fn from((v28, balances): (SszContainerV28, JustifiedBalances)) -> Self {
Self {
votes: v28.votes,
balances: balances.effective_balances.clone(),
prune_threshold: v28.prune_threshold,
justified_checkpoint: v28.justified_checkpoint,
finalized_checkpoint: v28.finalized_checkpoint,
nodes: v28.nodes,
indices: v28.indices,
previous_proposer_boost: v28.previous_proposer_boost,
}
}
}