Rollback Block With Context Deadline (#14608)

* Rollback deadline

* Fix it

* Preston's Suggestion
This commit is contained in:
Nishant Das
2024-11-04 23:47:30 +08:00
committed by GitHub
parent 91c15247e5
commit 928b707ef1
3 changed files with 82 additions and 0 deletions

View File

@@ -76,6 +76,8 @@ func (s *Service) postBlockProcess(cfg *postBlockProcessConfig) error {
err := s.cfg.ForkChoiceStore.InsertNode(ctx, cfg.postState, cfg.roblock)
if err != nil {
// Do not use parent context in the event it deadlined
ctx = trace.NewContext(context.Background(), span)
s.rollbackBlock(ctx, cfg.roblock.Root())
return errors.Wrapf(err, "could not insert block %d to fork choice store", cfg.roblock.Block().Slot())
}