Skip to content

Commit e5a67bb

Browse files
committed
remove redundant call
1 parent ade638e commit e5a67bb

3 files changed

Lines changed: 3 additions & 9 deletions

File tree

block/internal/syncing/p2p_handler.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ func (h *P2PHandler) SetProcessedHeight(height uint64) {
5555
h.mu.Unlock()
5656
}
5757

58-
// OnHeightProcessed records progress after a block is successfully applied.
59-
func (h *P2PHandler) OnHeightProcessed(height uint64) {
60-
h.SetProcessedHeight(height)
61-
}
62-
6358
// ProcessHeaderRange scans the provided heights and emits events when both the
6459
// header and data are available.
6560
func (h *P2PHandler) ProcessHeaderRange(ctx context.Context, startHeight, endHeight uint64, heightInCh chan<- common.DAHeightEvent) {

block/internal/syncing/p2p_handler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ func TestP2PHandler_OnHeightProcessedPreventsDuplicates(t *testing.T) {
261261
require.Len(t, events, 1)
262262

263263
// Mark the height as processed; a subsequent range should skip lookups.
264-
p.Handler.OnHeightProcessed(8)
264+
p.Handler.SetProcessedHeight(8)
265265

266266
p.HeaderStore.AssertExpectations(t)
267267
p.DataStore.AssertExpectations(t)

block/internal/syncing/syncer.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ type p2pHandler interface {
3333
ProcessHeaderRange(ctx context.Context, fromHeight, toHeight uint64, heightInCh chan<- common.DAHeightEvent)
3434
ProcessDataRange(ctx context.Context, fromHeight, toHeight uint64, heightInCh chan<- common.DAHeightEvent)
3535
SetProcessedHeight(height uint64)
36-
OnHeightProcessed(height uint64)
3736
}
3837

3938
// Syncer handles block synchronization from DA and P2P sources.
@@ -146,7 +145,7 @@ func (s *Syncer) Start(ctx context.Context) error {
146145
s.processLoop()
147146
}()
148147

149-
// Start dedicated workers for P2P, DA, and pending processing
148+
// Start dedicated workers for DA, and pending processing
150149
s.startSyncWorkers()
151150

152151
s.logger.Info().Msg("syncer started")
@@ -612,7 +611,7 @@ func (s *Syncer) trySyncNextBlock(event *common.DAHeightEvent) error {
612611
}
613612

614613
if s.p2pHandler != nil {
615-
s.p2pHandler.OnHeightProcessed(newState.LastBlockHeight)
614+
s.p2pHandler.SetProcessedHeight(newState.LastBlockHeight)
616615
}
617616

618617
return nil

0 commit comments

Comments
 (0)