diff --git a/build.gradle b/build.gradle index 8402dfe8f..9fc414db7 100644 --- a/build.gradle +++ b/build.gradle @@ -116,6 +116,10 @@ dependencies { testImplementation libs.grpc.testing detektPlugins libs.detekt.formatting + + implementation(variantOf(libs.netty.tcnative.boringssl) { classifier("osx-aarch_64") }) + implementation(variantOf(libs.netty.tcnative.boringssl) { classifier("linux-x86_64") }) + implementation(variantOf(libs.netty.tcnative.boringssl) { classifier("osx-x86_64") }) } compileKotlin { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 446d239d0..3a9f63ad4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,13 +4,13 @@ etherjar = "0.11.1" groovy = "3.0.9" protoc = "3.21.7" jackson = "2.11.0" -grpc = "1.49.2" +grpc = "1.57.0" reactive-grpc = "1.2.0" -spring-boot = "2.6.0" +spring-boot = "2.6.15" spring-security = "5.5.3" -reactor = "3.4.10" -netty = "4.1.84.Final" -netty-tcnative = "2.0.48.Final" +reactor = "3.4.32" +netty = "4.1.96.Final" +netty-tcnative = "2.0.61.Final" kotlin = "1.7.20" httpcomponents = "4.5.8" @@ -88,17 +88,17 @@ netty-codec-http = { module = "io.netty:netty-codec-http", version.ref = "netty" netty-codec-http2 = { module = "io.netty:netty-codec-http2", version.ref = "netty" } netty-buffer = { module = "io.netty:netty-buffer", version.ref = "netty" } netty-tcnative-core = { module = "io.netty:netty-tcnative", version.ref = "netty-tcnative" } -netty-tcnative-boringssl = { module = "io.netty:netty-tcnative-boringssl-static", version.ref = "netty-tcnative" } -netty-macos = "io.netty:netty-resolver-dns-native-macos:4.1.72.Final" +netty-tcnative-boringssl = { module = "io.netty:netty-tcnative-boringssl-static", version.ref = "netty-tcnative"} +netty-macos = "io.netty:netty-resolver-dns-native-macos:4.1.96.Final" zeromq = "org.zeromq:jeromq:0.5.2" objgenesis = "org.objenesis:objenesis:3.1" reactor-core = { module = "io.projectreactor:reactor-core", version.ref = "reactor" } -reactor-netty = { module = "io.projectreactor.netty:reactor-netty", version = "1.0.11" } -reactor-extra = { module = "io.projectreactor.addons:reactor-extra", version = "3.4.5" } -reactor-kotlin = { module = "io.projectreactor.kotlin:reactor-kotlin-extensions", version = "1.1.4" } +reactor-netty = { module = "io.projectreactor.netty:reactor-netty", version = "1.1.10" } +reactor-extra = { module = "io.projectreactor.addons:reactor-extra", version = "3.5.1" } +reactor-kotlin = { module = "io.projectreactor.kotlin:reactor-kotlin-extensions", version = "1.1.7" } reactor-test = { module = "io.projectreactor:reactor-test", version.ref = "reactor" } reactor-grpc-stub = "com.salesforce.servicelibs:reactor-grpc-stub:1.2.0" @@ -131,7 +131,7 @@ grpc = ["grpc-protobuf", "grpc-stub", "grpc-netty", "grpc-proto-util", "grpc-ser httpcomponents = ["httpcomponents-httpmime", "httpcomponents-httpclient"] jackson = ["jackson-core", "jackson-databind", "jackson-datatype-jdk8", "jackson-datatype-jsr310", "jackson-module-kotlin"] kotlin = ["kotlin-stdlib-jdk8", "kotlin-reflect"] -netty = ["netty-common", "netty-transport", "netty-handler-core", "netty-handler-proxy", "netty-resolver-core", "netty-resolver-dns", "netty-codec-core", "netty-codec-http", "netty-codec-http2", "netty-buffer", "netty-tcnative-core", "netty-tcnative-boringssl"] +netty = ["netty-common", "netty-transport", "netty-handler-core", "netty-handler-proxy", "netty-resolver-core", "netty-resolver-dns", "netty-codec-core", "netty-codec-http", "netty-codec-http2", "netty-buffer", "netty-tcnative-core"] reactor = ["reactor-core", "reactor-netty", "reactor-extra", "reactor-kotlin"] spring-framework = ["spring-boot-starter", "spring-security-core", "spring-security-web", "spring-security-config"] testcontainers = ["testcontainers", "testcontainers-ganache"] diff --git a/src/main/kotlin/io/emeraldpay/dshackle/Starter.kt b/src/main/kotlin/io/emeraldpay/dshackle/Starter.kt index b1af07432..4fdb78134 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/Starter.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/Starter.kt @@ -16,6 +16,7 @@ */ package io.emeraldpay.dshackle +import io.netty.handler.ssl.OpenSsl import org.slf4j.LoggerFactory import org.springframework.boot.ResourceBanner import org.springframework.boot.SpringApplication @@ -30,6 +31,8 @@ open class Starter private val log = LoggerFactory.getLogger(Starter::class.java) fun main(args: Array) { + OpenSsl.ensureAvailability() + Schedulers.enableMetrics() val maxMemory: Long = Runtime.getRuntime().maxMemory() / (1024 * 1024).toLong() diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumLikeRpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumLikeRpcUpstream.kt index 9cb6c573b..0d5c720b1 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumLikeRpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumLikeRpcUpstream.kt @@ -89,10 +89,12 @@ open class EthereumLikeRpcUpstream( validatorSubscription = validator.start() .subscribe(this::setStatus) } - livenessSubscription = connector.hasLiveSubscriptionHead().subscribe { + livenessSubscription = connector.hasLiveSubscriptionHead().subscribe({ hasLiveSubscriptionHead.set(it) eventPublisher?.publishEvent(UpstreamChangeEvent(chain, this, UpstreamChangeEvent.ChangeType.UPDATED)) - } + }, { + log.debug("Error while checking live subscription for ${getId()}", it) + }) labelsDetector.detectLabels() .toStream() .forEach {