@@ -437,8 +437,11 @@ func (s *Store[H]) deleteRange(ctx context.Context, from, to uint64) (rerr error
437
437
defer func () {
438
438
// make new context to always save progress
439
439
ctx := context .Background ()
440
+
441
+ log .Infow ("deleted headers" , "from_height" , from , "to_height" , to )
440
442
newTailHeight := to
441
443
if rerr != nil {
444
+ log .Warnw ("partial delete with error" , "expected_to_height" , newTailHeight , "actual_to_height" , height , "err" , err )
442
445
newTailHeight = height
443
446
}
444
447
@@ -480,7 +483,6 @@ func (s *Store[H]) deleteRange(ctx context.Context, from, to uint64) (rerr error
480
483
s .pending .DeleteRange (height , height + 1 )
481
484
}
482
485
483
- log .Infow ("deleted headers" , "from_height" , from , "to_height" , to )
484
486
return nil
485
487
}
486
488
@@ -498,7 +500,8 @@ func (s *Store[H]) setTail(ctx context.Context, batch datastore.Batch, to uint64
498
500
if err := writeHeaderHashTo (ctx , batch , newTail , tailKey ); err != nil {
499
501
return fmt .Errorf ("writing tailKey in batch: %w" , err )
500
502
}
501
- log .Debug ("set tail" , "height" , to )
503
+ log .Infow ("new tail" , "height" , newTail .Height (), "hash" , newTail .Hash ())
504
+ s .metrics .newTail (newTail .Height ())
502
505
503
506
// update head as well, if delete went over it
504
507
head , err := s .Head (ctx )
0 commit comments