Skip to content

Commit

Permalink
Merge branch 'develop' into update_libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
lemastero committed Sep 28, 2020
2 parents 0af25e1 + 51be0f4 commit 46141fa
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 1,428 deletions.
2 changes: 0 additions & 2 deletions src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,6 @@ mantis {
# Sets max number of blocks that can be stored in queue to import on fetcher side
# Warning! This setting affects ability to go back in case of branch resolution so it should not be too low
max-fetcher-queue-size = 1000

use-new-regular-sync = true
}

pruning {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.iohk.ethereum.blockchain.sync

import akka.actor.{Actor, ActorLogging, ActorRef, PoisonPill, Props, Scheduler}
import io.iohk.ethereum.blockchain.sync.regular.{OldRegularSync, RegularSync}
import io.iohk.ethereum.blockchain.sync.regular.RegularSync
import io.iohk.ethereum.consensus.validators.Validators
import io.iohk.ethereum.db.storage.{AppStateStorage, FastSyncStateStorage}
import io.iohk.ethereum.domain.Blockchain
Expand Down Expand Up @@ -85,9 +85,7 @@ class SyncController(
context become runningFastSync(fastSync)
}

def startRegularSync(): Unit = if (syncConfig.useNewRegularSync) startNewRegularSync() else startOldRegularSync()

def startNewRegularSync(): Unit = {
def startRegularSync(): Unit = {
val peersClient = context.actorOf(PeersClient.props(etcPeerManager, peerEventBus, syncConfig, scheduler), "peers-client")
val regularSync = context.actorOf(
RegularSync.props(
Expand All @@ -100,29 +98,12 @@ class SyncController(
ommersPool,
pendingTransactionsManager,
scheduler),
"new-regular-sync"
"regular-sync"
)
regularSync ! RegularSync.Start
context become runningRegularSync(regularSync)
}

def startOldRegularSync(): Unit = {
val regularSync = context.actorOf(OldRegularSync.props(
appStateStorage = appStateStorage,
etcPeerManager = etcPeerManager,
peerEventBus = peerEventBus,
ommersPool = ommersPool,
pendingTransactionsManager = pendingTransactionsManager,
broadcaster = new BlockBroadcast(etcPeerManager, syncConfig),
ledger = ledger,
blockchain = blockchain,
syncConfig = syncConfig,
scheduler = scheduler
), "old-regular-sync")

regularSync ! OldRegularSync.Start
context become runningRegularSync(regularSync)
}
}

object SyncController {
Expand Down
Loading

0 comments on commit 46141fa

Please sign in to comment.