From bf3d6b690e868f21cdb94eb9a1e6443baf4bb975 Mon Sep 17 00:00:00 2001 From: dapplion <35266934+dapplion@users.noreply.github.com> Date: Wed, 18 Dec 2024 18:48:00 +0800 Subject: [PATCH] Complete migration --- beacon_node/beacon_chain/src/migrate.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/beacon_node/beacon_chain/src/migrate.rs b/beacon_node/beacon_chain/src/migrate.rs index 6ba9e78ab1..f435d6adb6 100644 --- a/beacon_node/beacon_chain/src/migrate.rs +++ b/beacon_node/beacon_chain/src/migrate.rs @@ -11,6 +11,7 @@ use std::sync::{mpsc, Arc}; use std::thread; use std::time::{Duration, SystemTime, UNIX_EPOCH}; use store::hot_cold_store::{migrate_database, HotColdDBError}; +use store::iter::StateRootsIterator; use store::{DBColumn, Error, HotStateSummary, ItemStore, StoreItem, StoreOp}; pub use store::{HotColdDB, MemoryStore}; use types::{ @@ -354,6 +355,7 @@ impl, Cold: ItemStore> BackgroundMigrator, Cold: ItemStore> BackgroundMigrator>, + new_finalized_state_hash: Hash256, new_finalized_state: &BeaconState, new_finalized_checkpoint: Checkpoint, genesis_block_root: Hash256, @@ -564,6 +567,20 @@ impl, Cold: ItemStore> BackgroundMigrator= old_finalized_slot) + }) + .map(|res| res.map(|(_, state_root)| state_root)) + .collect::, _>>()?; + // Compute the set of finalized state roots that we must keep to make the dynamic HDiff system // work. // TODO(hdiff): must not delete *all* finalized hdiffs. Instead, keep @@ -584,6 +601,11 @@ impl, Cold: ItemStore> BackgroundMigrator