File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -225,6 +225,14 @@ func (g *gForkStateMigration) Migrate(
225225 if err := next .state .BlockDB .Put (itr .Key (), itr .Value ()); err != nil {
226226 return nil , fmt .Errorf ("failed to migrate block: %w" , err )
227227 }
228+
229+ if err := prevBlockDB .Delete (itr .Key ()); err != nil {
230+ return nil , fmt .Errorf ("failed to delete migrated block: %w" , err )
231+ }
232+
233+ if err := g .commit (baseDB ); err != nil {
234+ return nil , fmt .Errorf ("failed to commit db: %w" , err )
235+ }
228236 }
229237
230238 g .log .Debug ("migrating height index" )
Original file line number Diff line number Diff line change @@ -901,7 +901,10 @@ func TestVMLinearizeStateMigration(t *testing.T) {
901901
902902 for itr := wantBlkIDs .NewIterator (); itr .Next (); {
903903 _ , err := vm .GetBlock (context .Background (), itr .Key ())
904- require .NoError (err )
904+ require .ErrorIs (err , database .ErrNotFound )
905+
906+ _ , err = vm .GetBlockIDAtHeight (context .Background (), itr .Value ())
907+ require .NoError (err , database .ErrNotFound )
905908 }
906909
907910 for _ , txID := range wantTxs {
You can’t perform that action at this time.
0 commit comments