Skip to content

Commit

Permalink
chore: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
krish-nr committed Jun 6, 2024
1 parent 52a209d commit b1c179e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
4 changes: 1 addition & 3 deletions op-node/rollup/derive/engine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/ethereum-optimism/optimism/op-node/rollup/sync"
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum"
)

type syncStatusEnum int
Expand All @@ -32,8 +32,6 @@ const (
syncStatusFinishedEL // EL sync is done & we should be performing consolidation
)

const DefaultElTriggerGap = 3600

var errNoFCUNeeded = errors.New("no FCU call was needed")

var _ EngineControl = (*EngineController)(nil)
Expand Down
42 changes: 35 additions & 7 deletions op-node/rollup/derive/engine_queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,11 @@ func TestEngineQueue_Finalize(t *testing.T) {

prev := &fakeAttributesQueue{}

ec := NewEngineController(eng, logger, metrics, &rollup.Config{}, sync.CLSync)
ec := NewEngineController(eng, logger, metrics, &rollup.Config{}, &sync.Config{
SyncMode: sync.CLSync,
SkipSyncStartCheck: false,
ELTriggerGap: 0,
})
eq := NewEngineQueue(logger, cfg, eng, ec, metrics, prev, l1F, &sync.Config{}, safedb.Disabled)
require.ErrorIs(t, eq.Reset(context.Background(), eth.L1BlockRef{}, eth.SystemConfig{}), io.EOF)

Expand Down Expand Up @@ -493,7 +497,11 @@ func TestEngineQueue_ResetWhenUnsafeOriginNotCanonical(t *testing.T) {

prev := &fakeAttributesQueue{origin: refE}

ec := NewEngineController(eng, logger, metrics, &rollup.Config{}, sync.CLSync)
ec := NewEngineController(eng, logger, metrics, &rollup.Config{}, &sync.Config{
SyncMode: sync.CLSync,
SkipSyncStartCheck: false,
ELTriggerGap: 0,
})
eq := NewEngineQueue(logger, cfg, eng, ec, metrics, prev, l1F, &sync.Config{}, safedb.Disabled)
require.ErrorIs(t, eq.Reset(context.Background(), eth.L1BlockRef{}, eth.SystemConfig{}), io.EOF)

Expand Down Expand Up @@ -832,7 +840,11 @@ func TestVerifyNewL1Origin(t *testing.T) {
}, nil)

prev := &fakeAttributesQueue{origin: refE}
ec := NewEngineController(eng, logger, metrics, &rollup.Config{}, sync.CLSync)
ec := NewEngineController(eng, logger, metrics, &rollup.Config{}, &sync.Config{
SyncMode: sync.CLSync,
SkipSyncStartCheck: false,
ELTriggerGap: 0,
})
eq := NewEngineQueue(logger, cfg, eng, ec, metrics, prev, l1F, &sync.Config{}, safedb.Disabled)
require.ErrorIs(t, eq.Reset(context.Background(), eth.L1BlockRef{}, eth.SystemConfig{}), io.EOF)

Expand Down Expand Up @@ -934,7 +946,11 @@ func TestBlockBuildingRace(t *testing.T) {
}

prev := &fakeAttributesQueue{origin: refA, attrs: attrs, islastInSpan: true}
ec := NewEngineController(eng, logger, metrics, &rollup.Config{}, sync.CLSync)
ec := NewEngineController(eng, logger, metrics, &rollup.Config{}, &sync.Config{
SyncMode: sync.CLSync,
SkipSyncStartCheck: false,
ELTriggerGap: 0,
})
eq := NewEngineQueue(logger, cfg, eng, ec, metrics, prev, l1F, &sync.Config{}, safedb.Disabled)
require.ErrorIs(t, eq.Reset(context.Background(), eth.L1BlockRef{}, eth.SystemConfig{}), io.EOF)

Expand Down Expand Up @@ -1108,7 +1124,11 @@ func TestResetLoop(t *testing.T) {

prev := &fakeAttributesQueue{origin: refA, attrs: attrs, islastInSpan: true}

ec := NewEngineController(eng, logger, metrics.NoopMetrics, &rollup.Config{}, sync.CLSync)
ec := NewEngineController(eng, logger, metrics.NoopMetrics, &rollup.Config{}, &sync.Config{
SyncMode: sync.CLSync,
SkipSyncStartCheck: false,
ELTriggerGap: 0,
})
eq := NewEngineQueue(logger, cfg, eng, ec, metrics.NoopMetrics, prev, l1F, &sync.Config{}, safedb.Disabled)
eq.ec.SetUnsafeHead(refA2)
eq.ec.SetSafeHead(refA1)
Expand Down Expand Up @@ -1216,7 +1236,11 @@ func TestEngineQueue_StepPopOlderUnsafe(t *testing.T) {

prev := &fakeAttributesQueue{origin: refA}

ec := NewEngineController(eng, logger, metrics.NoopMetrics, &rollup.Config{}, sync.CLSync)
ec := NewEngineController(eng, logger, metrics.NoopMetrics, &rollup.Config{}, &sync.Config{
SyncMode: sync.CLSync,
SkipSyncStartCheck: false,
ELTriggerGap: 0,
})
eq := NewEngineQueue(logger, cfg, eng, ec, metrics.NoopMetrics, prev, l1F, &sync.Config{}, safedb.Disabled)
eq.ec.SetUnsafeHead(refA2)
eq.ec.SetSafeHead(refA0)
Expand Down Expand Up @@ -1296,7 +1320,11 @@ func TestPlasmaFinalityData(t *testing.T) {
SequenceNumber: 1,
}

ec := NewEngineController(eng, logger, metrics.NoopMetrics, &rollup.Config{}, sync.CLSync)
ec := NewEngineController(eng, logger, metrics.NoopMetrics, &rollup.Config{}, &sync.Config{
SyncMode: sync.CLSync,
SkipSyncStartCheck: false,
ELTriggerGap: 0,
})

eq := NewEngineQueue(logger, cfg, eng, ec, metrics.NoopMetrics, prev, l1F, &sync.Config{}, safedb.Disabled)
require.Equal(t, expFinalityLookback, cap(eq.finalityData))
Expand Down

0 comments on commit b1c179e

Please sign in to comment.