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 de8893f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/sharp-cats-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/l2geth': patch
---

Have l2geth sync in parallel with DTL for Verifiers
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 de8893f

Please sign in to comment.