ethereum-optimism / ethereum-optimism/optimism

only-L1 node fall into infinite loop with `SkipSyncStartCheck == true`

Open
#18,779 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
6.5k
Forks
4k
Avg merge
2d 15h
Merged PRs (30d)
145

Description

**Bug Description**
node with state `unsafe == safe != 0` will run into infinite loop during `FindL2Heads` if it restarts with `SkipSyncStartCheck == true`.

**Steps to Reproduce**
Simply spin up a node without any p2p settings to let it only derive blocks from L1. Once it derived some blocks (unsafe != 0), restart it with env `OP_NODE_L2_SKIP_SYNC_START_CHECK: true`. That is it. Then node will print this log infinitely `Found highest L2 block with canonical L1 origin. Skip further sanity check and jump to the safe head`

**Expected behavior**
skip walking back unsafe blocks(in this case, there is no unsafe blocks) and continue for safe blocks until finding a safe block of which sequence number is 0 and the belonging epoch has been fully rolled up(sequencing window passed).

**Environment Information:**
op-node v1.16.3

**Configurations:**
no p2p settings and restart with `OP_NODE_L2_SKIP_SYNC_START_CHECK: true`

**Logs:**
infinite `Found highest L2 block with canonical L1 origin. Skip further sanity check and jump to the safe head`

Contributor guide

Open the contributing guide

Research direction

Start at the FindL2Heads entry point and reproduce the restart scenario with no P2P settings and OP_NODE_L2_SKIP_SYNC_START_CHECK set to true. Trace the repeated “Found highest L2 block with canonical L1 origin” path and verify that the node skips unsafe-block walking, continues through safe blocks, and stops once it finds a fully rolled-up epoch with sequence number 0.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.