Skip to content

Commit

Permalink
Don't prune finalized block
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Dec 24, 2024
1 parent bdf646f commit acd05bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions beacon_node/beacon_chain/src/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,10 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> BackgroundMigrator<E, Ho
// summaries is tricky since now we keep some hot state summaries beyond
// finalization. We will only prune blocks that still have an associated hot
// state summary, are above prior finalization and not in the canonical chain.
let should_prune = if block_roots_descendant_of_finalized.contains(&block_root) {
// Keep unfinalized blocks descendant of finalized
let should_prune = if block_roots_descendant_of_finalized.contains(&block_root)
|| block_root == new_finalized_checkpoint.root
{
// Keep unfinalized blocks descendant of finalized + finalized block itself
false
} else if newly_finalized_block_roots.contains(&block_root) {
// Keep recently finalized blocks
Expand Down

0 comments on commit acd05bf

Please sign in to comment.