From de8893f25327d77f7a237e022bd1275576f4cc93 Mon Sep 17 00:00:00 2001 From: Kelvin Fichter Date: Sat, 28 May 2022 02:55:51 -0400 Subject: [PATCH] feat(l2geth): parallel dtl sync --- .changeset/sharp-cats-explode.md | 5 +++++ l2geth/rollup/sync_service.go | 26 ++++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 .changeset/sharp-cats-explode.md diff --git a/.changeset/sharp-cats-explode.md b/.changeset/sharp-cats-explode.md new file mode 100644 index 000000000000..1d48723a4fee --- /dev/null +++ b/.changeset/sharp-cats-explode.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/l2geth': patch +--- + +Have l2geth sync in parallel with DTL for Verifiers diff --git a/l2geth/rollup/sync_service.go b/l2geth/rollup/sync_service.go index 709e11db442e..15b0540c42e9 100644 --- a/l2geth/rollup/sync_service.go +++ b/l2geth/rollup/sync_service.go @@ -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