diff --git a/beacon-chain/blockchain/forkchoice_update_execution.go b/beacon-chain/blockchain/forkchoice_update_execution.go index 7de7a5f3cf01..dd4b5eb42de9 100644 --- a/beacon-chain/blockchain/forkchoice_update_execution.go +++ b/beacon-chain/blockchain/forkchoice_update_execution.go @@ -45,25 +45,20 @@ func (s *Service) getStateAndBlock(ctx context.Context, r [32]byte) (state.Beaco // fockchoiceUpdateWithExecution is a wrapper around notifyForkchoiceUpdate. It decides whether a new call to FCU should be made. func (s *Service) forkchoiceUpdateWithExecution(ctx context.Context, newHeadRoot [32]byte, proposingSlot primitives.Slot) error { isNewHead := s.isNewHead(newHeadRoot) - isNewProposer := s.isNewProposer(proposingSlot) - if !isNewHead && !isNewProposer { + if !isNewHead { return nil } - - if isNewHead && isNewProposer && !features.Get().DisableReorgLateBlocks { + isNewProposer := s.isNewProposer(proposingSlot) + if isNewProposer && !features.Get().DisableReorgLateBlocks { if proposingSlot == s.CurrentSlot() { proposerHead := s.ForkChoicer().GetProposerHead() if proposerHead != newHeadRoot { - isNewHead = false + return nil } } else if s.ForkChoicer().ShouldOverrideFCU() { - isNewHead = false + return nil } } - if !isNewHead { - return nil - } - headRoot := newHeadRoot headState, headBlock, err := s.getStateAndBlock(ctx, newHeadRoot) if err != nil { log.WithError(err).Error("Could not get forkchoice update argument") @@ -72,7 +67,7 @@ func (s *Service) forkchoiceUpdateWithExecution(ctx context.Context, newHeadRoot _, err = s.notifyForkchoiceUpdate(ctx, ¬ifyForkchoiceUpdateArg{ headState: headState, - headRoot: headRoot, + headRoot: newHeadRoot, headBlock: headBlock.Block(), }) if err != nil {