diff --git a/beacon_node/beacon_chain/src/migrate.rs b/beacon_node/beacon_chain/src/migrate.rs index 59079344c92..83eae0ae71d 100644 --- a/beacon_node/beacon_chain/src/migrate.rs +++ b/beacon_node/beacon_chain/src/migrate.rs @@ -202,11 +202,6 @@ impl, Cold: ItemStore> Migrate old_finalized_block_hash: SignedBeaconBlockHash, new_finalized_block_hash: SignedBeaconBlockHash, ) { - if let Err(e) = process_finalization(self.db.clone(), state_root, &new_finalized_state) { - // This migrator is only used for testing, so we just log to stderr without a logger. - eprintln!("Migration error: {:?}", e); - } - if let Err(e) = Self::prune_abandoned_forks( self.db.clone(), head_tracker, @@ -216,6 +211,11 @@ impl, Cold: ItemStore> Migrate ) { eprintln!("Pruning error: {:?}", e); } + + if let Err(e) = process_finalization(self.db.clone(), state_root, &new_finalized_state) { + // This migrator is only used for testing, so we just log to stderr without a logger. + eprintln!("Migration error: {:?}", e); + } } } @@ -325,6 +325,17 @@ impl, Cold: ItemStore> BackgroundMigrator {} + Err(e) => warn!(log, "Block pruning failed: {:?}", e), + } + match process_finalization(db.clone(), state_root, &state) { Ok(()) => {} Err(Error::HotColdDBError(HotColdDBError::FreezeSlotUnaligned(slot))) => { @@ -342,17 +353,6 @@ impl, Cold: ItemStore> BackgroundMigrator {} - Err(e) => warn!(log, "Block pruning failed: {:?}", e), - } } });