From f8c2820d05165ae1e31fe4e0a4e7e175ebed3a2d Mon Sep 17 00:00:00 2001 From: Minhyuk Kim Date: Sun, 28 Jul 2024 14:29:02 +0900 Subject: [PATCH 1/2] Update readme and default flags for using execution-layer sync --- README.md | 16 +++++++++++++++- cmd/utils/flags.go | 4 +--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1208f9219f8..016617da297 100644 --- a/README.md +++ b/README.md @@ -153,8 +153,22 @@ $ op-node \ --l2.jwt-secret=$JWT_SECRET_FILE \ --network=op-mainnet \ --rpc.addr=0.0.0.0 \ - --rpc.port=9545 + --rpc.port=9545 \ + --l2.enginekind=erigon ``` + +#### Execution Layer Syncing +By default, op-node and op-erigon work together to derive every L2 block from the chain. However, this can take a while if the chain is large. + +Instead, you can use `execution-layer` syncmode on op-node to download L2 blocks from the peers in the network. +This will allow op-erigon to download and execute large number of blocks at once, resulting in a shorter sync time. + +To enable execution layer syncing, set the following flags on op-node +```bash + --syncmode=execution-layer \ + --l2.enginekind=erigon +``` + For more information for op-node, refer the [Optimism's node operator guide](https://community.optimism.io/docs/developers/bedrock/node-operator-guide/#configuring-op-node). ## Need any help? diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index cfaa40f6e8e..beb5d048913 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1401,9 +1401,7 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config, nodeName, datadir string, l cfg.NoDiscovery = true } - if ctx.IsSet(DiscoveryV5Flag.Name) { - cfg.DiscoveryV5 = ctx.Bool(DiscoveryV5Flag.Name) - } + cfg.DiscoveryV5 = ctx.Bool(DiscoveryV5Flag.Name) if ctx.IsSet(MetricsEnabledFlag.Name) { cfg.MetricsEnabled = ctx.Bool(MetricsEnabledFlag.Name) From 7b78537b082995041e8186f5677d60f5b63684d0 Mon Sep 17 00:00:00 2001 From: Minhyuk Kim Date: Wed, 31 Jul 2024 09:09:58 +0900 Subject: [PATCH 2/2] Add link to optimism docs --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 016617da297..2b4c3a0f805 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,8 @@ By default, op-node and op-erigon work together to derive every L2 block from th Instead, you can use `execution-layer` syncmode on op-node to download L2 blocks from the peers in the network. This will allow op-erigon to download and execute large number of blocks at once, resulting in a shorter sync time. +Refer to [Optimism's guide for execution layer syncing here](https://docs.optimism.io/builders/node-operators/management/snap-sync#enabling-execution-layer-sync-for-alternative-clients). + To enable execution layer syncing, set the following flags on op-node ```bash --syncmode=execution-layer \