Skip to content

Commit

Permalink
permissionless: removed compatibility with trusted Incaberry (#3218)
Browse files Browse the repository at this point in the history
* removed class Processor Selector, and set etrog as processor
  • Loading branch information
joanestebanr authored Feb 7, 2024
1 parent 68338dc commit 2ee5030
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 158 deletions.
88 changes: 0 additions & 88 deletions synchronizer/l2_sync/l2_shared/processor_trusted_batch_selector.go

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

0 comments on commit 2ee5030

Please sign in to comment.