diff --git a/beacon-chain/blockchain/process_block.go b/beacon-chain/blockchain/process_block.go index ffa2138bcc0a..7325935ce11b 100644 --- a/beacon-chain/blockchain/process_block.go +++ b/beacon-chain/blockchain/process_block.go @@ -6,6 +6,7 @@ import ( "time" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "go.opencensus.io/trace" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" @@ -558,6 +559,20 @@ func (s *Service) isDataAvailable(ctx context.Context, root [32]byte, signed int // The gossip handler for blobs writes the index of each verified blob referencing the given // root to the channel returned by blobNotifiers.forRoot. nc := s.blobNotifiers.forRoot(root) + + // Log for DA checks that cross over into the next slot; helpful for debugging. + nextSlot := slots.BeginsAt(signed.Block().Slot()+1, s.genesisTime) + // Avoid logging if DA check is called after next slot start. + if nextSlot.After(time.Now()) { + nst := time.AfterFunc(time.Until(nextSlot), func() { + if len(missing) == 0 { + return + } + log.WithFields(daCheckLogFields(root, signed.Block().Slot(), expected, len(missing))). + Error("Still waiting for DA check at slot end.") + }) + defer nst.Stop() + } for { select { case idx := <-nc: @@ -576,6 +591,15 @@ func (s *Service) isDataAvailable(ctx context.Context, root [32]byte, signed int } } +func daCheckLogFields(root [32]byte, slot primitives.Slot, expected, missing int) logrus.Fields { + return logrus.Fields{ + "slot": slot, + "root": root, + "blobsExpected": expected, + "blobsWaiting": missing, + } +} + // lateBlockTasks is called 4 seconds into the slot and performs tasks // related to late blocks. It emits a MissedSlot state feed event. // It calls FCU and sets the right attributes if we are proposing next slot