From 6480d5a0fd7a6283de518b1c7d7b7090507301a2 Mon Sep 17 00:00:00 2001 From: terencechain Date: Sun, 19 Mar 2023 16:25:58 -0700 Subject: [PATCH] Send missing slot event at the correct place (#12160) --- beacon-chain/blockchain/process_block.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/beacon-chain/blockchain/process_block.go b/beacon-chain/blockchain/process_block.go index bb8d6751a..3496d237c 100644 --- a/beacon-chain/blockchain/process_block.go +++ b/beacon-chain/blockchain/process_block.go @@ -671,9 +671,6 @@ func (s *Service) fillMissingPayloadIDRoutine(ctx context.Context, stateFeed *ev for { select { case <-ticker.C(): - s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ - Type: statefeed.MissedSlot, - }) if err := s.fillMissingBlockPayloadId(ctx); err != nil { log.WithError(err).Error("Could not fill missing payload ID") } @@ -692,6 +689,10 @@ func (s *Service) fillMissingBlockPayloadId(ctx context.Context) error { if s.CurrentSlot() == s.HeadSlot() { return nil } + s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ + Type: statefeed.MissedSlot, + }) + // Head root should be empty when retrieving proposer index for the next slot. _, id, has := s.cfg.ProposerSlotIndexCache.GetProposerPayloadIDs(s.CurrentSlot()+1, [32]byte{} /* head root */) // There exists proposer for next slot, but we haven't called fcu w/ payload attribute yet.