Skip to content
Closed
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
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ val commonSettings = Seq(
val malletDeps = Seq(
Dependencies.scopt
).flatten ++ Seq(
"org.jline" % "jline" % "3.1.2",
"net.java.dev.jna" % "jna" % "4.5.1"
Dependencies.jline,
Dependencies.jna
)

val dep = {
Expand Down
36 changes: 20 additions & 16 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ object Dependencies {
)
}

val boopickle = Seq("io.suzaku" %% "boopickle" % "1.3.0")
val boopickle = Seq("io.suzaku" %% "boopickle" % "1.3.3")

val rocksDb = Seq(
"org.rocksdb" % "rocksdbjni" % "6.11.4"
Expand All @@ -54,7 +54,7 @@ object Dependencies {
"org.scalatest" %% "scalatest" % "3.2.2" % "it,test",
"org.scalamock" %% "scalamock" % "5.0.0" % "test",
"org.scalatestplus" %% "scalacheck-1-14" % "3.2.2.0" % "test",
"org.scalacheck" %% "scalacheck" % "1.14.1" % "it,test"
"org.scalacheck" %% "scalacheck" % "1.14.3" % "it,test"
)

val cats: Seq[ModuleID] = {
Expand All @@ -72,33 +72,37 @@ object Dependencies {

val logging = Seq(
"ch.qos.logback" % "logback-classic" % "1.2.3",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.0",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.2",
"net.logstash.logback" % "logstash-logback-encoder" % "6.4",
"org.codehaus.janino" % "janino" % "3.0.6"
"org.codehaus.janino" % "janino" % "3.1.2"
)

val twitterUtilCollection = Seq("com.twitter" %% "util-collection" % "18.5.0")
val twitterUtilCollection = Seq("com.twitter" %% "util-collection" % "19.1.0")

val crypto = Seq("org.bouncycastle" % "bcprov-jdk15on" % "1.59")
val crypto = Seq("org.bouncycastle" % "bcprov-jdk15on" % "1.66")

val scopt = Seq("com.github.scopt" % "scopt_2.12" % "3.7.0")
val scopt = Seq("com.github.scopt" % "scopt_2.12" % "3.7.1")

val apacheCommons = Seq(
"commons-io" % "commons-io" % "2.6"
"commons-io" % "commons-io" % "2.8.0"
)

val jline = "org.jline" % "jline" % "3.16.0"

val jna = "net.java.dev.jna" % "jna" % "5.6.0"

val dependencies = Seq(
"org.jline" % "jline" % "3.1.2",
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.0",
"org.scala-sbt.ipcsocket" % "ipcsocket" % "1.0.0",
"com.google.guava" % "guava" % "28.0-jre",
"org.xerial.snappy" % "snappy-java" % "1.1.7.2",
"org.web3j" % "core" % "3.4.0" % "test"
jline,
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2",
"org.scala-sbt.ipcsocket" % "ipcsocket" % "1.1.0",
"com.google.guava" % "guava" % "29.0-jre",
"org.xerial.snappy" % "snappy-java" % "1.1.7.7",
"org.web3j" % "core" % "5.0.0" % Test
)

val prometheus: Seq[ModuleID] = {
val provider = "io.prometheus"
val version = "0.8.0"
val version = "0.9.0"
Seq(
provider % "simpleclient" % version,
provider % "simpleclient_logback" % version,
Expand All @@ -109,7 +113,7 @@ object Dependencies {

val micrometer: Seq[ModuleID] = {
val provider = "io.micrometer"
val version = "1.0.4"
val version = "1.5.5"
Seq(
// Required to compile metrics library https://github.com/micrometer-metrics/micrometer/issues/1133#issuecomment-452434205
"com.google.code.findbugs" % "jsr305" % "3.0.2" % Optional,
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.2.8
sbt.version = 1.3.13
10 changes: 5 additions & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
logLevel := sbt.Level.Warn
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.5")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "2.1.0")
addSbtPlugin("com.thesamet" % "sbt-protoc" % "0.99.25")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.4.2")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.0")
addSbtPlugin("com.thesamet" % "sbt-protoc" % "0.99.34")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.1")

libraryDependencies += "com.trueaccord.scalapb" %% "compilerplugin" % "0.6.6"
libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.10.8"
2,082 changes: 1,039 additions & 1,043 deletions project/project/repo.nix

Large diffs are not rendered by default.

2,400 changes: 1,222 additions & 1,178 deletions project/repo.nix

Large diffs are not rendered by default.

2,173 changes: 1,017 additions & 1,156 deletions repo.nix

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions src/main/scala/io/iohk/ethereum/extvm/MessageHandler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import java.math.BigInteger
import akka.stream.scaladsl.{SinkQueueWithCancel, SourceQueueWithComplete}
import akka.util.ByteString
import com.google.protobuf.CodedInputStream
import com.trueaccord.scalapb.{GeneratedMessage, GeneratedMessageCompanion, LiteParser, Message}
import org.bouncycastle.util.BigIntegers
import scalapb.{GeneratedMessage, GeneratedMessageCompanion, LiteParser}

import scala.concurrent.duration._
import scala.concurrent.Await
Expand All @@ -24,9 +24,12 @@ class MessageHandler(in: SinkQueueWithCancel[ByteString], out: SourceQueueWithCo
out offer (lengthBytes ++ ByteString(bytes))
}

def awaitMessage[M <: GeneratedMessage with Message[M]](implicit companion: GeneratedMessageCompanion[M]): M = {
def awaitMessage[M <: GeneratedMessage](implicit companion: GeneratedMessageCompanion[M]): M = {
val resF = in.pull() map {
case Some(bytes) => LiteParser.parseFrom(companion, CodedInputStream.newInstance(bytes.toArray[Byte]))
case Some(bytes) =>
LiteParser
.parseDelimitedFrom(CodedInputStream.newInstance(bytes.toArray[Byte]))
.getOrElse( throw new RuntimeException(s"Unable to parse message: $bytes") )
case None => throw new RuntimeException("Stream completed")
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/io/iohk/ethereum/extvm/VMClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class VMClient(
log.debug("Client received msg: CallResult")
res

case Query.GetAccount(msg.GetAccount(address)) =>
case Query.GetAccount(msg.GetAccount(address, _)) =>
log.debug("Client received msg: GetAccount")
val accountMsg = world.getAccount(address) match {
case Some(acc) =>
Expand All @@ -65,20 +65,20 @@ class VMClient(
messageHandler.sendMessage(accountMsg)
messageLoop[W, S](world)

case Query.GetStorageData(msg.GetStorageData(address, offset)) =>
case Query.GetStorageData(msg.GetStorageData(address, offset, _)) =>
log.debug("Client received msg: GetStorageData")
val value = world.getStorage(address).load(offset)
val storageDataMsg = msg.StorageData(data = value)
messageHandler.sendMessage(storageDataMsg)
messageLoop[W, S](world)

case Query.GetCode(msg.GetCode(address)) =>
case Query.GetCode(msg.GetCode(address, _)) =>
log.debug("Client received msg: GetCode")
val codeMsg = msg.Code(world.getCode(address))
messageHandler.sendMessage(codeMsg)
messageLoop[W, S](world)

case Query.GetBlockhash(msg.GetBlockhash(offset)) =>
case Query.GetBlockhash(msg.GetBlockhash(offset, _)) =>
log.debug("Client received msg: GetBlockhash")
val blockhashMsg = world.getBlockHash(offset) match {
case Some(value) => msg.Blockhash(hash = value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import akka.stream.OverflowStrategy
import akka.stream.scaladsl.{Keep, Sink, SinkQueueWithCancel, Source, SourceQueueWithComplete}
import akka.testkit.TestProbe
import akka.util.ByteString
import com.trueaccord.scalapb.GeneratedMessage
import io.iohk.ethereum.vm.Generators
import java.math.BigInteger
import org.bouncycastle.util.BigIntegers
Expand All @@ -14,6 +13,7 @@ import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scala.concurrent.ExecutionContext.Implicits.global
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import scalapb.GeneratedMessage

class MessageHandlerSpec extends AnyFlatSpec with Matchers with MockFactory with ScalaCheckPropertyChecks {

Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/io/iohk/ethereum/extvm/VMClientSpec.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.iohk.ethereum.extvm

import akka.util.ByteString
import com.trueaccord.scalapb.GeneratedMessageCompanion
import io.iohk.ethereum.domain.{Account, Address, UInt256}
import io.iohk.ethereum.extvm.msg.CallContext.Config
import io.iohk.ethereum.utils.VmConfig
Expand All @@ -11,6 +10,7 @@ import org.scalamock.scalatest.MockFactory
import org.bouncycastle.util.encoders.Hex
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import scalapb.GeneratedMessageCompanion

class VMClientSpec extends AnyFlatSpec with Matchers with MockFactory {

Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/io/iohk/ethereum/extvm/VMServerSpec.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.iohk.ethereum.extvm

import akka.util.ByteString
import com.trueaccord.scalapb.GeneratedMessageCompanion
import io.iohk.ethereum.domain.{Account, Address}
import io.iohk.ethereum.extvm.msg.{CallContext, VMQuery}
import org.scalamock.scalatest.MockFactory
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import scalapb.GeneratedMessageCompanion

class VMServerSpec extends AnyFlatSpec with Matchers with MockFactory {

Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/io/iohk/ethereum/extvm/WorldSpec.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.iohk.ethereum.extvm

import akka.util.ByteString
import com.trueaccord.scalapb.GeneratedMessageCompanion
import io.iohk.ethereum.domain.{Account, Address, UInt256}
import org.scalamock.scalatest.MockFactory
import org.bouncycastle.util.encoders.Hex
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import scalapb.GeneratedMessageCompanion

class WorldSpec extends AnyFlatSpec with Matchers with MockFactory {

Expand Down