Commit ff0723aa authored by Antonios Kogias's avatar Antonios Kogias Committed by GitHub

l2geth: verifier sync in parallel with dtl (#2656)

Co-authored-by: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 8dc50095
---
'@eth-optimism/l2geth': patch
---
Have L2Geth Verifier sync in parallel with the DTL.
...@@ -172,19 +172,21 @@ func NewSyncService(ctx context.Context, cfg Config, txpool *core.TxPool, bc *co ...@@ -172,19 +172,21 @@ func NewSyncService(ctx context.Context, cfg Config, txpool *core.TxPool, bc *co
} }
} }
// Wait until the remote service is done syncing if !cfg.IsVerifier || cfg.Backend == BackendL2 {
tStatus := time.NewTicker(10 * time.Second) // Wait until the remote service is done syncing
for ; true; <-tStatus.C { tStatus := time.NewTicker(10 * time.Second)
status, err := service.client.SyncStatus(service.backend) for ; true; <-tStatus.C {
if err != nil { status, err := service.client.SyncStatus(service.backend)
log.Error("Cannot get sync status") if err != nil {
continue log.Error("Cannot get sync status")
} continue
if !status.Syncing { }
tStatus.Stop() if !status.Syncing {
break 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 // Initialize the latest L1 data here to make sure that
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment