Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
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

This file was deleted.

This file was deleted.

7 changes: 1 addition & 6 deletions synchronizer/synchronizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/0xPolygonHermez/zkevm-node/synchronizer/l1event_orders"
"github.com/0xPolygonHermez/zkevm-node/synchronizer/l2_sync/l2_shared"
"github.com/0xPolygonHermez/zkevm-node/synchronizer/l2_sync/l2_sync_etrog"
"github.com/0xPolygonHermez/zkevm-node/synchronizer/l2_sync/l2_sync_incaberry"
"github.com/0xPolygonHermez/zkevm-node/synchronizer/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/jackc/pgx/v4"
Expand Down Expand Up @@ -112,13 +111,9 @@ func NewSynchronizer(
}
L1SyncChecker := l2_sync_etrog.NewCheckSyncStatusToProcessBatch(res.zkEVMClient, res.state)

syncTrustedStateIncaberry := l2_sync_incaberry.NewSyncTrustedStateExecutor(res.zkEVMClient, res.state, res)
syncTrustedStateEtrog := l2_sync_etrog.NewSyncTrustedBatchExecutorForEtrog(res.zkEVMClient, res.state, res.state, res,
res.syncTrustedStateExecutor = l2_sync_etrog.NewSyncTrustedBatchExecutorForEtrog(res.zkEVMClient, res.state, res.state, res,
syncCommon.DefaultTimeProvider{}, L1SyncChecker)

res.syncTrustedStateExecutor = l2_shared.NewSyncTrustedStateExecutorSelector(
syncTrustedStateIncaberry, syncTrustedStateEtrog, st)

res.l1EventProcessors = defaultsL1EventProcessors(res)
switch cfg.L1SynchronizationMode {
case ParallelMode:
Expand Down
10 changes: 7 additions & 3 deletions synchronizer/synchronizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const (
ETROG_MODE_FLAG = true
RETRIEVE_BATCH_FROM_DB_FLAG = true
RETRIEVE_BATCH_FROM_CACHE_FLAG = false
PROCESS_BATCH_SELECTOR_ENABLED = false
)

type mocks struct {
Expand Down Expand Up @@ -130,8 +131,9 @@ func TestForcedBatchEtrog(t *testing.T) {
FromBatchNumber: 0,
ToBatchNumber: ^uint64(0),
}
m.State.EXPECT().GetForkIDInMemory(uint64(7)).Return(&forkIdInterval)

if PROCESS_BATCH_SELECTOR_ENABLED {
m.State.EXPECT().GetForkIDInMemory(uint64(7)).Return(&forkIdInterval)
}
m.State.
On("BeginStateTransaction", ctxMatchBy).
Run(func(args mock.Arguments) {
Expand Down Expand Up @@ -771,7 +773,9 @@ func expectedCallsForsyncTrustedState(t *testing.T, m *mocks, sync *ClientSynchr
FromBatchNumber: 0,
ToBatchNumber: ^uint64(0),
}
m.State.EXPECT().GetForkIDInMemory(uint64(7)).Return(&forkIdInterval)
if PROCESS_BATCH_SELECTOR_ENABLED {
m.State.EXPECT().GetForkIDInMemory(uint64(7)).Return(&forkIdInterval)
}
batchNumber := uint64(batchInTrustedNode.Number)
m.ZKEVMClient.
On("BatchNumber", mock.Anything).
Expand Down