Skip to content

Commit

Permalink
Send missing slot event at the correct place (#12160)
Browse files Browse the repository at this point in the history
  • Loading branch information
terencechain authored Mar 19, 2023
1 parent d1c45b4 commit 6480d5a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions beacon-chain/blockchain/process_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand All @@ -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.
Expand Down

0 comments on commit 6480d5a

Please sign in to comment.