From 5bddb0dc4fc341787234842406bd946f54d6b9f3 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 30 Mar 2026 11:14:53 +0200 Subject: [PATCH 1/3] chore(syncing): avoid sending duplicate events to channel --- block/internal/syncing/syncer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/internal/syncing/syncer.go b/block/internal/syncing/syncer.go index 42841f89ad..c9eaacd44d 100644 --- a/block/internal/syncing/syncer.go +++ b/block/internal/syncing/syncer.go @@ -517,6 +517,10 @@ func (s *Syncer) waitForGenesis() bool { } func (s *Syncer) PipeEvent(ctx context.Context, event common.DAHeightEvent) error { + if s.cache.IsHeaderSeen(event.Header.Hash().String()) { + return nil + } + select { case s.heightInCh <- event: return nil From 1c75ef57315abf98e5bf94c4fd0b95f3b645a270 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 30 Mar 2026 11:17:33 +0200 Subject: [PATCH 2/3] add comment --- block/internal/syncing/syncer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/block/internal/syncing/syncer.go b/block/internal/syncing/syncer.go index c9eaacd44d..3b4f414cff 100644 --- a/block/internal/syncing/syncer.go +++ b/block/internal/syncing/syncer.go @@ -517,6 +517,7 @@ func (s *Syncer) waitForGenesis() bool { } func (s *Syncer) PipeEvent(ctx context.Context, event common.DAHeightEvent) error { + // Avoid sending already seen events to channel if s.cache.IsHeaderSeen(event.Header.Hash().String()) { return nil } From fa31d6aea94831a580a8b312493bb98603d8dcbc Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 30 Mar 2026 13:50:31 +0200 Subject: [PATCH 3/3] improve comment --- block/internal/syncing/syncer.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/block/internal/syncing/syncer.go b/block/internal/syncing/syncer.go index 3b4f414cff..3ce6cd8095 100644 --- a/block/internal/syncing/syncer.go +++ b/block/internal/syncing/syncer.go @@ -517,7 +517,7 @@ func (s *Syncer) waitForGenesis() bool { } func (s *Syncer) PipeEvent(ctx context.Context, event common.DAHeightEvent) error { - // Avoid sending already seen events to channel + // Avoid sending already seen events to channel (would have been skipped in processHeightEvent anyway) if s.cache.IsHeaderSeen(event.Header.Hash().String()) { return nil } @@ -542,6 +542,7 @@ func (s *Syncer) processHeightEvent(ctx context.Context, event *common.DAHeightE Uint64("height", height). Uint64("da_height", event.DaHeight). Str("hash", headerHash). + Str("source", string(event.Source)). Msg("processing height event") currentHeight, err := s.store.Height(ctx) @@ -552,7 +553,10 @@ func (s *Syncer) processHeightEvent(ctx context.Context, event *common.DAHeightE // Skip if already processed if height <= currentHeight || s.cache.IsHeaderSeen(headerHash) { - s.logger.Debug().Uint64("height", height).Msg("height already processed") + s.logger.Debug(). + Uint64("height", height). + Str("source", string(event.Source)). + Msg("height already processed") return } @@ -661,6 +665,7 @@ func (s *Syncer) processHeightEvent(ctx context.Context, event *common.DAHeightE s.logger.Error().Err(err). Uint64("event-height", event.Header.Height()). Uint64("state-height", s.getLastState().LastBlockHeight). + Str("source", string(event.Source)). Msg("failed to sync next block") // If the error is not due to a validation error, re-store the event as pending switch {