From ec0ed47b990ac2b1d2a3cbf282c80c7363f566b7 Mon Sep 17 00:00:00 2001 From: Vyatcheslav Suharnikov Date: Fri, 13 Oct 2023 10:58:11 +0400 Subject: [PATCH 1/5] - zwaves (bls12) and zwaves-bn256 now in zwaves library; - removed a hack with reflection in Curve25519. --- .../main/scala/com/wavesplatform/crypto/Curve25519.scala | 9 +-------- project/Dependencies.scala | 6 +++--- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/lang/jvm/src/main/scala/com/wavesplatform/crypto/Curve25519.scala b/lang/jvm/src/main/scala/com/wavesplatform/crypto/Curve25519.scala index 3e19e95287c..40f876471ff 100644 --- a/lang/jvm/src/main/scala/com/wavesplatform/crypto/Curve25519.scala +++ b/lang/jvm/src/main/scala/com/wavesplatform/crypto/Curve25519.scala @@ -1,16 +1,9 @@ package com.wavesplatform.crypto -import java.lang.reflect.Constructor - import org.whispersystems.curve25519.OpportunisticCurve25519Provider object Curve25519 { - private lazy val provider: OpportunisticCurve25519Provider = { - val constructor = classOf[OpportunisticCurve25519Provider].getDeclaredConstructors.head - .asInstanceOf[Constructor[OpportunisticCurve25519Provider]] - constructor.setAccessible(true) - constructor.newInstance() - } + private lazy val provider = new OpportunisticCurve25519Provider() val KeyLength: Int = 32 diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 001304596ec..3957eda9a9e 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -31,7 +31,7 @@ object Dependencies { val logback = "ch.qos.logback" % "logback-classic" % "1.3.11" // 1.4.x and later is built for Java 11 val janino = "org.codehaus.janino" % "janino" % "3.1.10" val asyncHttpClient = "org.asynchttpclient" % "async-http-client" % "2.12.3" - val curve25519 = "com.wavesplatform" % "curve25519-java" % "0.6.5" + val curve25519 = "com.wavesplatform" % "curve25519-java" % "0.6.6" val nettyHandler = "io.netty" % "netty-handler" % "4.1.94.Final" val catsCore = catsModule("core", "2.9.0") @@ -66,10 +66,10 @@ object Dependencies { shapeless.value, "org.typelevel" %%% "cats-mtl" % "1.3.1", "ch.obermuhlner" % "big-math" % "2.3.2", + googleGuava, curve25519, bouncyCastleProvider, - "com.wavesplatform" % "zwaves" % "0.1.0-SNAPSHOT", - "com.wavesplatform" % "zwaves-bn256" % "0.1.5-SNAPSHOT", + "com.wavesplatform" % "zwaves" % "0.1.7-23-SNAPSHOT", web3jModule("crypto") ) ++ langCompilerPlugins.value ++ scalapbRuntime.value ++ protobuf.value ) From 36ffa8f487e7784048a29555b2261a004a0dfeb5 Mon Sep 17 00:00:00 2001 From: Vyatcheslav Suharnikov Date: Fri, 13 Oct 2023 18:23:15 +0400 Subject: [PATCH 2/5] zwaves: 0.1.7-23-SNAPSHOT -> 0.2.0 --- build.sbt | 6 ++++-- project/Dependencies.scala | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index 9cd1eea4451..a4b95a47754 100644 --- a/build.sbt +++ b/build.sbt @@ -159,8 +159,10 @@ inScope(Global)( testOptions += Tests.Setup(_ => sys.props("sbt-testing") = "true"), network := Network.default(), instrumentation := false, - resolvers ++= Resolver.sonatypeOssRepos("snapshots") ++ Seq(Resolver.mavenLocal) ++ - Seq(MavenRepository("wvservices-releases", "https://nexus.wvservices.com/repository/maven-releases/")), + resolvers ++= + Resolver.sonatypeOssRepos("releases") ++ + Resolver.sonatypeOssRepos("snapshots") ++ + Seq(Resolver.mavenLocal, MavenRepository("wvservices-releases", "https://nexus.wvservices.com/repository/maven-releases/")), Compile / doc / sources := Seq.empty, Compile / packageDoc / publishArtifact := false, concurrentRestrictions := Seq(Tags.limit(Tags.Test, math.min(EvaluateTask.SystemProcessors, 8))), diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 3957eda9a9e..3f579d4c91f 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -69,7 +69,7 @@ object Dependencies { googleGuava, curve25519, bouncyCastleProvider, - "com.wavesplatform" % "zwaves" % "0.1.7-23-SNAPSHOT", + "com.wavesplatform" % "zwaves" % "0.2.0", web3jModule("crypto") ) ++ langCompilerPlugins.value ++ scalapbRuntime.value ++ protobuf.value ) From eb8d19bc4062bb6420a419cd82ea2fb136a573f8 Mon Sep 17 00:00:00 2001 From: Vyatcheslav Suharnikov Date: Mon, 16 Oct 2023 11:17:00 +0400 Subject: [PATCH 3/5] additional logging in tests --- .../scala/com/wavesplatform/http/UtilsRouteSpec.scala | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/node/src/test/scala/com/wavesplatform/http/UtilsRouteSpec.scala b/node/src/test/scala/com/wavesplatform/http/UtilsRouteSpec.scala index 9e7ebc1b668..5a91c0095d3 100644 --- a/node/src/test/scala/com/wavesplatform/http/UtilsRouteSpec.scala +++ b/node/src/test/scala/com/wavesplatform/http/UtilsRouteSpec.scala @@ -576,10 +576,13 @@ class UtilsRouteSpec extends RouteSpec("/utils") with RestAPISettingsHelper with } Post(routePath("/script/compileCode?compact=true"), bigSizeDApp) ~> route ~> check { - (responseAs[JsValue] \ "script").toOption shouldBe defined - (responseAs[JsValue] \ "complexity").as[Long] shouldBe 0 - (responseAs[JsValue] \ "verifierComplexity").as[Long] shouldBe 0 - (responseAs[JsValue] \ "extraFee").as[Long] shouldBe 400000 + val r = responseAs[JsValue] + withClue(s"json=$r ") { + (r \ "script").toOption shouldBe defined + (r \ "complexity").as[Long] shouldBe 0 + (r \ "verifierComplexity").as[Long] shouldBe 0 + (r \ "extraFee").as[Long] shouldBe 400000 + } } Post(routePath("/script/compileCode"), "{-# STDLIB_VERSION 2 #-}\n(1 == 2)") ~> route ~> check { From ec6979ee2f11cd05202c079efd312f1d772fdba0 Mon Sep 17 00:00:00 2001 From: Vyatcheslav Suharnikov Date: Mon, 16 Oct 2023 12:28:34 +0400 Subject: [PATCH 4/5] Removed an excess resolver --- build.sbt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index a4b95a47754..1896241299f 100644 --- a/build.sbt +++ b/build.sbt @@ -159,10 +159,7 @@ inScope(Global)( testOptions += Tests.Setup(_ => sys.props("sbt-testing") = "true"), network := Network.default(), instrumentation := false, - resolvers ++= - Resolver.sonatypeOssRepos("releases") ++ - Resolver.sonatypeOssRepos("snapshots") ++ - Seq(Resolver.mavenLocal, MavenRepository("wvservices-releases", "https://nexus.wvservices.com/repository/maven-releases/")), + resolvers ++= Resolver.sonatypeOssRepos("releases") ++ Resolver.sonatypeOssRepos("snapshots") ++ Seq(Resolver.mavenLocal), Compile / doc / sources := Seq.empty, Compile / packageDoc / publishArtifact := false, concurrentRestrictions := Seq(Tags.limit(Tags.Test, math.min(EvaluateTask.SystemProcessors, 8))), From 2b74a87655eb22a1de165671b2a25043e0443a8c Mon Sep 17 00:00:00 2001 From: Vyatcheslav Suharnikov Date: Mon, 16 Oct 2023 15:39:16 +0400 Subject: [PATCH 5/5] zwaves: 0.2.0 -> 0.2.1 --- project/Dependencies.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 3f579d4c91f..d1a8feef3c2 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -69,7 +69,7 @@ object Dependencies { googleGuava, curve25519, bouncyCastleProvider, - "com.wavesplatform" % "zwaves" % "0.2.0", + "com.wavesplatform" % "zwaves" % "0.2.1", web3jModule("crypto") ) ++ langCompilerPlugins.value ++ scalapbRuntime.value ++ protobuf.value )