Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlyguo committed Sep 23, 2024
1 parent bc40b7a commit 2662c6d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
6 changes: 2 additions & 4 deletions eth/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@ func (api *PrivateAdminAPI) SetRollupEventSyncedL1Height(height uint64) error {
}

log.Info("Setting rollup event synced L1 height", "height", height)

rollupSyncService.ResetToHeight(height)
rollupSyncService.ResetStartSyncHeight(height)

return nil
}
Expand All @@ -276,8 +275,7 @@ func (api *PrivateAdminAPI) SetL1MessageSyncedL1Height(height uint64) error {
}

log.Info("Setting L1 message synced L1 height", "height", height)

syncService.ResetToHeight(height)
syncService.ResetStartSyncHeight(height)

return nil
}
Expand Down
5 changes: 2 additions & 3 deletions rollup/rollup_sync_service/rollup_sync_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,13 @@ func (s *RollupSyncService) Stop() {
}
}

// ResetToHeight resets the RollupSyncService to a specific L1 block height
func (s *RollupSyncService) ResetToHeight(height uint64) {
// ResetStartSyncHeight resets the RollupSyncService to a specific L1 block height
func (s *RollupSyncService) ResetStartSyncHeight(height uint64) {
if s == nil {
return
}

s.latestProcessedBlock.Store(height)

log.Info("Reset sync service", "height", height)
}

Expand Down
5 changes: 2 additions & 3 deletions rollup/sync_service/sync_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,13 @@ func (s *SyncService) Stop() {
}
}

// ResetToHeight resets the SyncService to a specific L1 block height
func (s *SyncService) ResetToHeight(height uint64) {
// ResetStartSyncHeight resets the SyncService to a specific L1 block height
func (s *SyncService) ResetStartSyncHeight(height uint64) {
if s == nil {
return
}

s.latestProcessedBlock.Store(height)

log.Info("Reset sync service", "height", height)
}

Expand Down

0 comments on commit 2662c6d

Please sign in to comment.