diff --git a/buildSrc/src/main/groovy/net.consensys.zkevm.kotlin-common-conventions.gradle b/buildSrc/src/main/groovy/net.consensys.zkevm.kotlin-common-conventions.gradle index b4f878854..59f53d91b 100644 --- a/buildSrc/src/main/groovy/net.consensys.zkevm.kotlin-common-conventions.gradle +++ b/buildSrc/src/main/groovy/net.consensys.zkevm.kotlin-common-conventions.gradle @@ -2,41 +2,10 @@ plugins { id 'net.consensys.zkevm.kotlin-common-minimal-conventions' } -repositories { - // Use Maven Central for resolving dependencies. - mavenCentral() - maven { - url 'https://artifacts.consensys.net/public/teku/maven/' - content { includeGroupAndSubgroups('tech.pegasys') } - } - maven { - url "https://hyperledger.jfrog.io/artifactory/besu-maven/" - content { includeGroupAndSubgroups('org.hyperledger.besu') } - } - maven { - url "https://artifacts.consensys.net/public/maven/maven/" - } - // to allow locally published artifacts to be resolved uncomment enable mavenLocal() below - // build.linea:blob-compressor:2.0.0-SNAPSHOT - // useful to test WIP development versions - //mavenLocal() { - // content { - // includeModule('build.linea', 'blob-compressor') - // includeModule('build.linea', 'shnarf-calculator') - // } - //} -} - dependencies { - constraints { - // Define dependency versions as constraints - implementation 'org.apache.commons:commons-text:1.9' - } - api platform("io.vertx:vertx-stack-depchain:${libs.versions.vertx.get()}") // - implementation 'com.michael-bull.kotlin-result:kotlin-result:1.1.16' - implementation "tech.pegasys.teku.internal:bytes:${libs.versions.teku.get()}" + implementation "com.michael-bull.kotlin-result:kotlin-result:${libs.versions.kotlinResult.get()}" implementation ("tech.pegasys.teku.internal:async:${libs.versions.teku.get()}") { exclude group: 'org.slf4j' exclude group: 'com.github.jnr' @@ -44,10 +13,7 @@ dependencies { exclude group: 'org.apache.logging.log4j' exclude group: 'tech.pegasys.teku.internal', module: 'metrics' exclude group: 'tech.pegasys.teku.internal', module: 'time' - } - - implementation "io.tmio:tuweni-units:${libs.versions.tuweni.get()}" - // + } because("We are using Teku's SafeFuture, an improved/extension of CompletableFuture.") // implementation "org.apache.logging.log4j:log4j-api:${libs.versions.log4j.get()}" diff --git a/buildSrc/src/main/groovy/net.consensys.zkevm.kotlin-common-minimal-conventions.gradle b/buildSrc/src/main/groovy/net.consensys.zkevm.kotlin-common-minimal-conventions.gradle index af45bee41..34fb71301 100644 --- a/buildSrc/src/main/groovy/net.consensys.zkevm.kotlin-common-minimal-conventions.gradle +++ b/buildSrc/src/main/groovy/net.consensys.zkevm.kotlin-common-minimal-conventions.gradle @@ -12,6 +12,26 @@ java { repositories { mavenCentral() + maven { + url 'https://artifacts.consensys.net/public/teku/maven/' + content { includeGroupAndSubgroups('tech.pegasys') } + } + maven { + url "https://hyperledger.jfrog.io/artifactory/besu-maven/" + content { includeGroupAndSubgroups('org.hyperledger.besu') } + } + maven { + url "https://artifacts.consensys.net/public/maven/maven/" + } + // to allow locally published artifacts to be resolved uncomment enable mavenLocal() below + // build.linea:blob-compressor:2.0.0-SNAPSHOT + // useful to test WIP development versions + //mavenLocal() { + // content { + // includeModule('build.linea', 'blob-compressor') + // includeModule('build.linea', 'shnarf-calculator') + // } + //} } dependencies { diff --git a/buildSrc/src/main/groovy/net.consensys.zkevm.kotlin-library-conventions.gradle b/buildSrc/src/main/groovy/net.consensys.zkevm.kotlin-library-conventions.gradle index 637008eac..cb05f69b8 100644 --- a/buildSrc/src/main/groovy/net.consensys.zkevm.kotlin-library-conventions.gradle +++ b/buildSrc/src/main/groovy/net.consensys.zkevm.kotlin-library-conventions.gradle @@ -1,7 +1,4 @@ plugins { - // Apply the common convention plugin for shared build configuration between library and application projects. id 'net.consensys.zkevm.kotlin-common-conventions' - - // Apply the java-library plugin for API and implementation separation. id 'java-library' } diff --git a/buildSrc/src/main/groovy/net.consensys.zkevm.kotlin-library-minimal-conventions.gradle b/buildSrc/src/main/groovy/net.consensys.zkevm.kotlin-library-minimal-conventions.gradle new file mode 100644 index 000000000..3f9f2f562 --- /dev/null +++ b/buildSrc/src/main/groovy/net.consensys.zkevm.kotlin-library-minimal-conventions.gradle @@ -0,0 +1,4 @@ +plugins { + id 'net.consensys.zkevm.kotlin-common-minimal-conventions' + id 'java-library' +} diff --git a/coordinator/clients/prover-client/serialization/src/main/kotlin/net/consensys/zkevm/coordinator/clients/prover/serialization/JsonSerialization.kt b/coordinator/clients/prover-client/serialization/src/main/kotlin/net/consensys/zkevm/coordinator/clients/prover/serialization/JsonSerialization.kt index c04f86e9f..eda06b2aa 100644 --- a/coordinator/clients/prover-client/serialization/src/main/kotlin/net/consensys/zkevm/coordinator/clients/prover/serialization/JsonSerialization.kt +++ b/coordinator/clients/prover-client/serialization/src/main/kotlin/net/consensys/zkevm/coordinator/clients/prover/serialization/JsonSerialization.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.databind.JsonSerializer import com.fasterxml.jackson.databind.MapperFeature import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.SerializerProvider -import com.fasterxml.jackson.databind.module.SimpleModule import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule import com.fasterxml.jackson.module.kotlin.jacksonMapperBuilder import org.apache.tuweni.bytes.Bytes @@ -17,7 +16,6 @@ object JsonSerialization { .enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS) .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) .addModule(JavaTimeModule()) - .addModule(SimpleModule().addSerializer(Bytes::class.java, TuweniBytesSerializer())) .build() } diff --git a/coordinator/clients/type2-state-manager-client/build.gradle b/coordinator/clients/type2-state-manager-client/build.gradle index cb2f4eeb7..c40201b0e 100644 --- a/coordinator/clients/type2-state-manager-client/build.gradle +++ b/coordinator/clients/type2-state-manager-client/build.gradle @@ -15,6 +15,8 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-annotations:${libs.versions.jackson.get()}" implementation "com.fasterxml.jackson.core:jackson-databind:${libs.versions.jackson.get()}" implementation "com.fasterxml.jackson.module:jackson-module-kotlin:${libs.versions.jackson.get()}" + // TODO: to remove from our internal domain classes + implementation "io.tmio:tuweni-units:${libs.versions.tuweni.get()}" testImplementation "io.vertx:vertx-junit5" testImplementation "com.github.tomakehurst:wiremock-jre8:${libs.versions.wiremock.get()}" diff --git a/coordinator/ethereum/models-helper/build.gradle b/coordinator/ethereum/models-helper/build.gradle index db0af2225..10cd8f109 100644 --- a/coordinator/ethereum/models-helper/build.gradle +++ b/coordinator/ethereum/models-helper/build.gradle @@ -5,6 +5,7 @@ plugins { dependencies { api (project(":coordinator:core")) api project(":jvm-libs:linea:teku-execution-client") + implementation "tech.pegasys.teku.internal:bytes:${libs.versions.teku.get()}" implementation "org.hyperledger.besu:besu-datatypes:${libs.versions.besu.get()}" implementation "org.hyperledger.besu:evm:${libs.versions.besu.get()}" implementation "org.hyperledger.besu.internal:rlp:${libs.versions.besu.get()}" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a4204f80d..130696aa9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,6 +20,7 @@ picoli = "4.7.1" restassured = "5.3.0" teku = "23.1.1" tuweni = "2.4.2" +kotlinResult = "1.1.16" vertx = "4.5.0" web3j = "4.12.0" wiremock = "3.0.1" diff --git a/jvm-libs/generic/json-rpc/src/test/kotlin/net/consensys/linea/jsonrpc/client/VertxHttpJsonRpcClientTest.kt b/jvm-libs/generic/json-rpc/src/test/kotlin/net/consensys/linea/jsonrpc/client/VertxHttpJsonRpcClientTest.kt index b7506bfbd..645ba823b 100644 --- a/jvm-libs/generic/json-rpc/src/test/kotlin/net/consensys/linea/jsonrpc/client/VertxHttpJsonRpcClientTest.kt +++ b/jvm-libs/generic/json-rpc/src/test/kotlin/net/consensys/linea/jsonrpc/client/VertxHttpJsonRpcClientTest.kt @@ -18,6 +18,7 @@ import io.vertx.core.http.HttpClientOptions import io.vertx.core.http.HttpVersion import io.vertx.core.json.JsonArray import io.vertx.core.json.JsonObject +import net.consensys.decodeHex import net.consensys.linea.async.get import net.consensys.linea.async.toSafeFuture import net.consensys.linea.jsonrpc.JsonRpcError @@ -27,7 +28,6 @@ import net.consensys.linea.jsonrpc.JsonRpcSuccessResponse import org.apache.logging.log4j.Level import org.apache.logging.log4j.LogManager import org.apache.logging.log4j.Logger -import org.apache.tuweni.bytes.Bytes import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach @@ -81,7 +81,7 @@ class VertxHttpJsonRpcClientTest { JsonObject() .put("name", "Alice") .put("email", "alice@wonderland.io") - .put("address", Bytes.fromHexString("0xaabbccdd").toArray()) + .put("address", "0xaabbccdd".decodeHex()) ) client.makeRequest(JsonRpcRequestListParams("2.0", 1, "addUser", params)).get() diff --git a/jvm-libs/linea/core/domain-models/build.gradle b/jvm-libs/linea/core/domain-models/build.gradle index 2cbc631dc..366b652e4 100644 --- a/jvm-libs/linea/core/domain-models/build.gradle +++ b/jvm-libs/linea/core/domain-models/build.gradle @@ -4,7 +4,8 @@ plugins { dependencies { implementation project(":jvm-libs:generic:extensions:kotlin") - implementation "io.tmio:tuweni-units:${libs.versions.tuweni.get()}" + // TODO: to remove from our internal domain classes + api "io.tmio:tuweni-units:${libs.versions.tuweni.get()}" } jar { diff --git a/jvm-libs/linea/testing/teku-helper/build.gradle b/jvm-libs/linea/testing/teku-helper/build.gradle index 9fac0d672..fbc10f968 100644 --- a/jvm-libs/linea/testing/teku-helper/build.gradle +++ b/jvm-libs/linea/testing/teku-helper/build.gradle @@ -9,4 +9,5 @@ dependencies { implementation "tech.pegasys.teku.internal:spec:${libs.versions.teku.get()}" implementation "tech.pegasys.teku.internal:spec:${libs.versions.teku.get()}:test-fixtures" + implementation "io.tmio:tuweni-units:${libs.versions.tuweni.get()}" } diff --git a/jvm-libs/linea/web3j-extensions/build.gradle b/jvm-libs/linea/web3j-extensions/build.gradle index b0312af6c..84d8c85c6 100644 --- a/jvm-libs/linea/web3j-extensions/build.gradle +++ b/jvm-libs/linea/web3j-extensions/build.gradle @@ -9,6 +9,7 @@ dependencies { api project(':jvm-libs:generic:logging') // For domain mappers implementation project(":jvm-libs:generic:extensions:kotlin") + implementation "tech.pegasys.teku.internal:bytes:${libs.versions.teku.get()}" implementation "tech.pegasys.teku.internal:jackson:${libs.versions.teku.get()}" // Returned by domain mapper api project(":jvm-libs:linea:teku-execution-client")