Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions op-acceptance-tests/tests/flashblocks/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package flashblocks
import (
"context"
"sync"
"time"

"github.com/ethereum-optimism/optimism/op-devstack/devtest"
"github.com/ethereum-optimism/optimism/op-devstack/presets"
Expand All @@ -28,6 +29,12 @@ func driveViaTestSequencer(t devtest.T, sys *presets.SingleChainWithFlashblocks,
// Ensure the sequencer EL has produced at least one unsafe block before subscribing.
sys.L2EL.WaitForBlockNumber(1)

// Wait until L2 time catches up to wall clock time before relying on flashblocks.
// During startup the builder may report "unsafe block timestamp is too old" /
// "FCU arrived too late" while the sequencer is still catching up, which makes
// early flashblock receipt assertions flaky.
sys.L2EL.WaitForTime(uint64(time.Now().Unix()))

// Log the latest unsafe head and L1 origin to confirm block production before listening.
head = sys.L2EL.BlockRefByLabel(eth.Unsafe)
sys.Log.Info("Pre-listen unsafe head", "unsafe", head)
Expand Down
Loading