Fix Deadline Again During Rollback (#14686)

* fix it again

* CHANGELOG
This commit is contained in:
Nishant Das
2024-12-02 21:29:36 +08:00
committed by GitHub
parent 9fa49e7bc9
commit dc643c9f32
3 changed files with 60 additions and 4 deletions

View File

@@ -404,10 +404,9 @@ func (s *Service) savePostStateInfo(ctx context.Context, r [32]byte, b interface
return errors.Wrapf(err, "could not save block from slot %d", b.Block().Slot())
}
if err := s.cfg.StateGen.SaveState(ctx, r, st); err != nil {
log.Warnf("Rolling back insertion of block with root %#x", r)
if err := s.cfg.BeaconDB.DeleteBlock(ctx, r); err != nil {
log.WithError(err).Errorf("Could not delete block with block root %#x", r)
}
// Do not use parent context in the event it deadlined
ctx = trace.NewContext(context.Background(), span)
s.rollbackBlock(ctx, r)
return errors.Wrap(err, "could not save state")
}
return nil