Skip to content

Commit

Permalink
Delete bad blocks during migration
Browse files Browse the repository at this point in the history
  • Loading branch information
piersy committed Oct 25, 2024
1 parent 1b60358 commit c4528fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion op-chain-ops/cmd/celo-migrate/non-ancients.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ func copyDbExceptAncients(oldDbPath, newDbPath string) error {
func migrateNonAncientsDb(newDB ethdb.Database, lastBlock, numAncients, batchSize uint64) (uint64, error) {
defer timer("migrateNonAncientsDb")()

// The genesis block is also migrated in the ancient db migration as it is stored in both places.
// Delete bad blocks, we could migrate them, but we have no need of the historical bad blocks. AFAICS bad blocks
// are stored solely so that they can be retrieved or traced via the debug API, but we are no longer interested
// in these old bad blocks.
rawdb.DeleteBadBlocks(newDB)

// The genesis block is the only block that should remain stored in the non-ancient db even after it is frozen.
if numAncients > 0 {
log.Info("Migrating genesis block in non-ancient db", "process", "non-ancients")
Expand Down

0 comments on commit c4528fd

Please sign in to comment.