diff --git a/beacon-chain/sync/pending_blocks_queue.go b/beacon-chain/sync/pending_blocks_queue.go index 4c8cb12c3f..3a0bacbba4 100644 --- a/beacon-chain/sync/pending_blocks_queue.go +++ b/beacon-chain/sync/pending_blocks_queue.go @@ -147,6 +147,11 @@ func (s *Service) processPendingBlocks(ctx context.Context) error { } cancelFunction() + // Process pending attestations for this block. + if err := s.processPendingAttsForBlock(ctx, blkRoot); err != nil { + log.WithError(err).Debug("Failed to process pending attestations for block") + } + // Remove the processed block from the queue. if err := s.removeBlockFromQueue(b, blkRoot); err != nil { return err diff --git a/changelog/ttsao_optimize-pending-attestation-processing.md b/changelog/ttsao_optimize-pending-attestation-processing.md new file mode 100644 index 0000000000..44e571a324 --- /dev/null +++ b/changelog/ttsao_optimize-pending-attestation-processing.md @@ -0,0 +1,3 @@ +### Changed + +- Process pending attestations after pending blocks are cleared