Skip to content

Commit

Permalink
feat(l2geth): parallel dtl sync
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcontracts committed May 28, 2022
1 parent dfab86f commit 02d6ec9
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions l2geth/rollup/sync_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,21 @@ func NewSyncService(ctx context.Context, cfg Config, txpool *core.TxPool, bc *co
}
}

// Wait until the remote service is done syncing
tStatus := time.NewTicker(10 * time.Second)
for ; true; <-tStatus.C {
status, err := service.client.SyncStatus(service.backend)
if err != nil {
log.Error("Cannot get sync status")
continue
}
if !status.Syncing {
tStatus.Stop()
break
if !cfg.IsVerifier {
// Wait until the remote service is done syncing
tStatus := time.NewTicker(10 * time.Second)
for ; true; <-tStatus.C {
status, err := service.client.SyncStatus(service.backend)
if err != nil {
log.Error("Cannot get sync status")
continue
}
if !status.Syncing {
tStatus.Stop()
break
}
log.Info("Still syncing", "index", status.CurrentTransactionIndex, "tip", status.HighestKnownTransactionIndex)
}
log.Info("Still syncing", "index", status.CurrentTransactionIndex, "tip", status.HighestKnownTransactionIndex)
}

// Initialize the latest L1 data here to make sure that
Expand Down

0 comments on commit 02d6ec9

Please sign in to comment.