Skip to content

Commit e43bcff

Browse files
author
Michal Mrozek
committed
[CHORE] Update akka (v2.6.9), akka http (v10.2.0)
1 parent 101a363 commit e43bcff

File tree

22 files changed

+78
-111
lines changed

22 files changed

+78
-111
lines changed

build.sbt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@ val commonSettings = Seq(
1111
resolvers += "rocksDb" at "https://dl.bintray.com/ethereum/maven/"
1212

1313
val dep = {
14-
val akkaVersion = "2.5.12"
15-
val akkaHttpVersion = "10.1.1"
14+
val akkaVersion = "2.6.9"
15+
val akkaHttpVersion = "10.2.0"
1616
val circeVersion = "0.9.3"
1717
val rocksDb = "5.9.2"
1818

1919
Seq(
2020
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
2121
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
2222
"com.typesafe.akka" %% "akka-testkit" % akkaVersion,
23+
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
2324
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
24-
"ch.megard" %% "akka-http-cors" % "0.3.0",
25+
"ch.megard" %% "akka-http-cors" % "1.1.0",
2526
"org.json4s" %% "json4s-native" % "3.5.4",
26-
"de.heikoseeberger" %% "akka-http-json4s" % "1.21.0",
27+
"de.heikoseeberger" %% "akka-http-json4s" % "1.34.0",
2728
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % "it,test",
2829
"io.suzaku" %% "boopickle" % "1.3.0",
2930
"org.ethereum" % "rocksdbjni" % rocksDb,
@@ -37,9 +38,8 @@ val dep = {
3738
"io.circe" %% "circe-generic" % circeVersion,
3839
"io.circe" %% "circe-parser" % circeVersion,
3940
"io.circe" %% "circe-generic-extras" % circeVersion,
40-
"com.miguno.akka" %% "akka-mock-scheduler" % "0.5.1" % "it,test",
41+
"com.miguno.akka" %% "akka-mock-scheduler" % "0.5.5" % "it,test",
4142
"commons-io" % "commons-io" % "2.6",
42-
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
4343
"org.scala-sbt.ipcsocket" % "ipcsocket" % "1.0.0",
4444
"org.bouncycastle" % "bcprov-jdk15on" % "1.59",
4545
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.0",
@@ -50,7 +50,6 @@ val dep = {
5050
// mallet deps
5151
"org.jline" % "jline" % "3.1.2",
5252
"net.java.dev.jna" % "jna" % "4.5.1",
53-
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.5",
5453
"com.github.scopt" %% "scopt" % "3.7.0",
5554

5655
// Metrics (https://github.com/DataDog/java-dogstatsd-client)

src/it/scala/io/iohk/ethereum/txExecTest/util/DumpChainActor.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,9 @@ class DumpChainActor(peerManager: ActorRef, peerMessageBus: ActorRef, startBlock
6262
}
6363

6464
//Periodically try to connect to bootstrap peer in case the connection failed before dump termination
65-
val connectToBootstrapTimeout: Cancellable = context.system.scheduler.schedule(0 seconds, 4 seconds, () =>
66-
peerManager ! PeerManagerActor.ConnectToPeer(new URI(bootstrapNode)))
65+
val connectToBootstrapTimeout: Cancellable = context.system.scheduler.scheduleWithFixedDelay(0 seconds, 4 seconds, peerManager, PeerManagerActor.ConnectToPeer(new URI(bootstrapNode)))
6766

68-
val assignWorkTimeout: Cancellable = context.system.scheduler.schedule(0 seconds, 2 seconds, () => assignWork())
67+
val assignWorkTimeout: Cancellable = context.system.scheduler.scheduleWithFixedDelay(0 seconds, 2 seconds)(() => assignWork())
6968

7069
// scalastyle:off
7170
override def receive: Receive = {

src/main/scala/io/iohk/ethereum/blockchain/sync/FastSync.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ class FastSync(
117117

118118
//Delay before starting to persist snapshot. It should be 0, as the presence of it marks that fast sync was started
119119
private val persistStateSnapshotDelay: FiniteDuration = 0.seconds
120-
private val syncStatePersistCancellable = scheduler.schedule(persistStateSnapshotDelay, persistStateSnapshotInterval, self, PersistSyncState)
121-
private val printStatusCancellable = scheduler.schedule(printStatusInterval, printStatusInterval, self, PrintStatus)
122-
private val heartBeat = scheduler.schedule(syncRetryInterval, syncRetryInterval * 2, self, ProcessSyncing)
120+
private val syncStatePersistCancellable = scheduler.scheduleWithFixedDelay(persistStateSnapshotDelay, persistStateSnapshotInterval, self, PersistSyncState)
121+
private val printStatusCancellable = scheduler.scheduleWithFixedDelay(printStatusInterval, printStatusInterval, self, PrintStatus)
122+
private val heartBeat = scheduler.scheduleWithFixedDelay(syncRetryInterval, syncRetryInterval * 2, self, ProcessSyncing)
123123

124124
def receive: Receive = handleCommonMessages orElse {
125125
case UpdateTargetBlock(state) => updateTargetBlock(state)

src/main/scala/io/iohk/ethereum/blockchain/sync/PeerListSupport.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ trait PeerListSupport {
2222

2323
var handshakedPeers: PeersMap = Map.empty
2424

25-
scheduler.schedule(0.seconds, syncConfig.peersScanInterval, etcPeerManager, EtcPeerManagerActor.GetHandshakedPeers)(global, context.self)
25+
scheduler.scheduleWithFixedDelay(0.seconds, syncConfig.peersScanInterval, etcPeerManager, EtcPeerManagerActor.GetHandshakedPeers)(global, context.self)
2626

2727
def removePeer(peerId: PeerId): Unit = {
2828
peerEventBus ! Unsubscribe(PeerDisconnectedClassifier(PeerSelector.WithId(peerId)))

src/main/scala/io/iohk/ethereum/blockchain/sync/PeersClient.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class PeersClient(
2525
implicit val ec: ExecutionContext = context.dispatcher
2626

2727
val statusSchedule: Cancellable =
28-
scheduler.schedule(syncConfig.printStatusInterval, syncConfig.printStatusInterval, self, PrintStatus)
28+
scheduler.scheduleWithFixedDelay(syncConfig.printStatusInterval, syncConfig.printStatusInterval, self, PrintStatus)
2929

3030
def receive: Receive = running(Map())
3131

src/main/scala/io/iohk/ethereum/blockchain/sync/regular/OldRegularSync.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class OldRegularSync(
4343
import OldRegularSync._
4444
import syncConfig._
4545

46-
scheduler.schedule(printStatusInterval, printStatusInterval, self, PrintStatus)(global)
46+
scheduler.scheduleWithFixedDelay(printStatusInterval, printStatusInterval, self, PrintStatus)(global)
4747

4848
peerEventBus ! Subscribe(MessageClassifier(Set(NewBlock.code, NewBlockHashes.code), PeerSelector.AllPeers))
4949

src/main/scala/io/iohk/ethereum/blockchain/sync/regular/RegularSync.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ class RegularSync(
3131
"block-importer")
3232

3333
val printFetcherSchedule: Cancellable =
34-
scheduler.schedule(syncConfig.printStatusInterval, syncConfig.printStatusInterval, fetcher, BlockFetcher.PrintStatus)(context.dispatcher)
34+
scheduler.scheduleWithFixedDelay(syncConfig.printStatusInterval, syncConfig.printStatusInterval, fetcher, BlockFetcher.PrintStatus)(context.dispatcher)
3535
val printImporterSchedule: Cancellable =
36-
scheduler.schedule(syncConfig.printStatusInterval, syncConfig.printStatusInterval, importer, BlockImporter.PrintStatus)(context.dispatcher)
36+
scheduler.scheduleWithFixedDelay(syncConfig.printStatusInterval, syncConfig.printStatusInterval, importer, BlockImporter.PrintStatus)(context.dispatcher)
3737

3838
override def receive: Receive = {
3939
case Start =>

src/main/scala/io/iohk/ethereum/extvm/ExtVMInterface.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
package io.iohk.ethereum.extvm
22

3-
import java.nio.ByteOrder
4-
53
import akka.actor.ActorSystem
6-
import akka.stream.{ActorMaterializer, OverflowStrategy}
4+
import akka.stream.OverflowStrategy
75
import akka.stream.scaladsl.{Framing, Keep, Sink, SinkQueueWithCancel, Source, SourceQueueWithComplete, Tcp}
86
import akka.util.ByteString
97
import io.iohk.ethereum.ledger.{InMemoryWorldStateProxy, InMemoryWorldStateProxyStorage}
108
import io.iohk.ethereum.utils.{BlockchainConfig, VmConfig}
119
import io.iohk.ethereum.vm._
12-
10+
import java.nio.ByteOrder
1311
import scala.annotation.tailrec
1412
import scala.util.{Failure, Success, Try}
1513

1614
class ExtVMInterface(externaVmConfig: VmConfig.ExternalConfig, blockchainConfig: BlockchainConfig, testMode: Boolean)(implicit system: ActorSystem)
1715
extends VM[InMemoryWorldStateProxy, InMemoryWorldStateProxyStorage]{
1816

19-
private implicit val materializer = ActorMaterializer()
20-
2117
private var out: Option[SourceQueueWithComplete[ByteString]] = None
2218

2319
private var in: Option[SinkQueueWithCancel[ByteString]] = None

src/main/scala/io/iohk/ethereum/extvm/VMServer.scala

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
11
package io.iohk.ethereum.extvm
22

3-
import java.nio.ByteOrder
4-
53
import akka.NotUsed
64
import akka.actor.ActorSystem
5+
import akka.stream.OverflowStrategy
76
import akka.stream.scaladsl.{Flow, Framing, Keep, Sink, Source, Tcp}
8-
import akka.stream.{ActorMaterializer, OverflowStrategy}
97
import akka.util.ByteString
108
import com.google.protobuf.{ByteString => GByteString}
119
import com.typesafe.config.ConfigFactory
1210
import io.iohk.ethereum.domain.{Address, BlockHeader}
1311
import io.iohk.ethereum.extvm.Implicits._
1412
import io.iohk.ethereum.utils._
15-
import io.iohk.ethereum.vm._
16-
import io.iohk.ethereum.vm.BlockchainConfigForEvm
17-
import io.iohk.ethereum.vm.ProgramResult
18-
13+
import io.iohk.ethereum.vm.{BlockchainConfigForEvm, ProgramResult, _}
14+
import java.nio.ByteOrder
1915
import scala.annotation.tailrec
2016
import scala.util.{Failure, Success, Try}
2117

2218
object VmServerApp extends Logger {
2319

2420
implicit val system = ActorSystem("EVM_System")
25-
implicit val materializer = ActorMaterializer()
2621

2722
def main(args: Array[String]): Unit = {
2823
val config = ConfigFactory.load()

src/main/scala/io/iohk/ethereum/faucet/Faucet.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import java.security.SecureRandom
44

55
import akka.actor.ActorSystem
66
import akka.http.scaladsl.Http
7-
import akka.stream.ActorMaterializer
87
import com.typesafe.config.ConfigFactory
98
import io.iohk.ethereum.keystore.KeyStoreImpl
109
import io.iohk.ethereum.mallet.service.RpcClient
@@ -19,13 +18,12 @@ object Faucet extends Logger {
1918
val config = FaucetConfig(ConfigFactory.load())
2019

2120
implicit val system = ActorSystem("Faucet-system")
22-
implicit val materializer = ActorMaterializer()
2321

2422
val keyStore = new KeyStoreImpl(KeyStoreConfig.customKeyStoreConfig(config.keyStoreDir), new SecureRandom())
2523
val rpcClient = new RpcClient(config.rpcAddress)
2624
val api = new FaucetApi(rpcClient, keyStore, config)
2725

28-
val bindingResultF = Http().bindAndHandle(api.route, config.listenInterface, config.listenPort)
26+
val bindingResultF = Http().newServerAt(config.listenInterface, config.listenPort).bind(api.route)
2927

3028
bindingResultF onComplete {
3129
case Success(serverBinding) => log.info(s"Faucet HTTP server listening on ${serverBinding.localAddress}")

0 commit comments

Comments
 (0)