From 56f3dafb5469f845f70eb05df19e67ae1d48708f Mon Sep 17 00:00:00 2001 From: Potuz Date: Mon, 2 Oct 2023 14:07:03 -0300 Subject: [PATCH] Lock forkchoice on late block tasks (#12978) Co-authored-by: Nishant Das --- beacon-chain/blockchain/process_block.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/beacon-chain/blockchain/process_block.go b/beacon-chain/blockchain/process_block.go index df6c72372..a713a0b50 100644 --- a/beacon-chain/blockchain/process_block.go +++ b/beacon-chain/blockchain/process_block.go @@ -649,11 +649,13 @@ func (s *Service) lateBlockTasks(ctx context.Context) { return } s.headLock.RUnlock() + s.cfg.ForkChoiceStore.RLock() _, err = s.notifyForkchoiceUpdate(ctx, ¬ifyForkchoiceUpdateArg{ headState: headState, headRoot: headRoot, headBlock: headBlock.Block(), }) + s.cfg.ForkChoiceStore.RUnlock() if err != nil { log.WithError(err).Debug("could not perform late block tasks: failed to update forkchoice with engine") }