Skip to content

Commit

Permalink
chore: Upgrade Netty to Latest Stable Release Version 4.1.110 (#13833)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Moran <152873392+thomas-swirlds-labs@users.noreply.github.com>
Signed-off-by: Matt Hess <matt.hess@swirldslabs.com>
Signed-off-by: Jendrik Johannes <jendrik.johannes@gmail.com>
Co-authored-by: Matt Hess <matt.hess@swirldslabs.com>
Co-authored-by: Jendrik Johannes <jendrik.johannes@gmail.com>
  • Loading branch information
3 people authored Jun 24, 2024
1 parent 6970923 commit 98cfb26
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ plugins {
// Fix or enhance the metadata of third-party Modules. This is about the metadata in the
// repositories: '*.pom' and '*.module' files.
jvmDependencyConflicts.patch {
val grpcModule = "io.helidon.grpc:io.grpc"
// The following 'io.grpc' libraries are replaced with a singe dependency to
// 'io.helidon.grpc:io.grpc', which is a re-packaged Modular Jar of all the 'grpc' libraries.
val grpcComponents = listOf("io.grpc:grpc-api", "io.grpc:grpc-context", "io.grpc:grpc-core")

// These compile time annotation libraries are not of interest in our setup and are thus removed
// from the dependencies of all components that bring them in.
val annotationLibraries =
Expand All @@ -45,38 +40,20 @@ jvmDependencyConflicts.patch {
addFeature("linux-x86_64")
addFeature("linux-aarch_64")
}
module("io.grpc:grpc-netty") {
annotationLibraries.forEach { removeDependency(it) }
grpcComponents.forEach { removeDependency(it) }
addApiDependency(grpcModule)
}
module("io.grpc:grpc-protobuf") {
annotationLibraries.forEach { removeDependency(it) }
grpcComponents.forEach { removeDependency(it) }
addApiDependency(grpcModule)
}
module("io.grpc:grpc-api") { annotationLibraries.forEach { removeDependency(it) } }
module("io.grpc:grpc-core") { annotationLibraries.forEach { removeDependency(it) } }
module("io.grpc:grpc-context") { annotationLibraries.forEach { removeDependency(it) } }
module("io.grpc:grpc-netty") { annotationLibraries.forEach { removeDependency(it) } }
module("io.grpc:grpc-protobuf") { annotationLibraries.forEach { removeDependency(it) } }
module("io.grpc:grpc-protobuf-lite") {
annotationLibraries.forEach { removeDependency(it) }
grpcComponents.forEach { removeDependency(it) }
addApiDependency(grpcModule)
removeDependency("com.google.protobuf:protobuf-javalite")
addApiDependency("com.google.protobuf:protobuf-java")
}
module("io.grpc:grpc-services") {
annotationLibraries.forEach { removeDependency(it) }
grpcComponents.forEach { removeDependency(it) }
addApiDependency(grpcModule)
}
module("io.grpc:grpc-stub") {
annotationLibraries.forEach { removeDependency(it) }
grpcComponents.forEach { removeDependency(it) }
addApiDependency(grpcModule)
}
module("io.grpc:grpc-testing") {
annotationLibraries.forEach { removeDependency(it) }
grpcComponents.forEach { removeDependency(it) }
addApiDependency(grpcModule)
}
module("io.grpc:grpc-services") { annotationLibraries.forEach { removeDependency(it) } }
module("io.grpc:grpc-stub") { annotationLibraries.forEach { removeDependency(it) } }
module("io.grpc:grpc-testing") { annotationLibraries.forEach { removeDependency(it) } }
module("io.grpc:grpc-util") { annotationLibraries.forEach { removeDependency(it) } }
module("com.github.ben-manes.caffeine:caffeine") {
annotationLibraries.forEach { removeDependency(it) }
}
Expand All @@ -96,7 +73,6 @@ jvmDependencyConflicts.patch {
module("com.google.protobuf:protobuf-java-util") {
annotationLibraries.forEach { removeDependency(it) }
}
module("io.helidon.grpc:io.grpc") { annotationLibraries.forEach { removeDependency(it) } }
module("org.apache.tuweni:tuweni-bytes") { removeDependency("com.google.code.findbugs:jsr305") }
module("org.apache.tuweni:tuweni-units") { removeDependency("com.google.code.findbugs:jsr305") }
module("io.prometheus:simpleclient") {
Expand All @@ -116,20 +92,24 @@ jvmDependencyConflicts.patch {
extraJavaModuleInfo {
failOnAutomaticModules = true // Only allow Jars with 'module-info' on all module paths

module("io.grpc:grpc-netty", "grpc.netty") {
module("io.grpc:grpc-api", "io.grpc")
module("io.grpc:grpc-core", "io.grpc.internal")
module("io.grpc:grpc-context", "io.grpc.context")
module("io.grpc:grpc-netty", "io.grpc.netty") {
exportAllPackages()
requireAllDefinedDependencies()
requires("java.logging")
}
module("io.grpc:grpc-stub", "grpc.stub") {
module("io.grpc:grpc-stub", "io.grpc.stub") {
exportAllPackages()
requireAllDefinedDependencies()
requires("java.logging")
}
module("io.grpc:grpc-testing", "grpc.testing")
module("io.grpc:grpc-services", "grpc.services")
module("io.grpc:grpc-protobuf", "grpc.protobuf")
module("io.grpc:grpc-protobuf-lite", "grpc.protobuf.lite")
module("io.grpc:grpc-testing", "io.grpc.testing")
module("io.grpc:grpc-services", "io.grpc.services")
module("io.grpc:grpc-util", "io.grpc.util")
module("io.grpc:grpc-protobuf", "io.grpc.protobuf")
module("io.grpc:grpc-protobuf-lite", "io.grpc.protobuf.lite")
module("com.github.spotbugs:spotbugs-annotations", "com.github.spotbugs.annotations")
module("com.google.code.findbugs:jsr305", "java.annotation") {
exportAllPackages()
Expand Down Expand Up @@ -218,11 +198,11 @@ extraJavaModuleInfo {
// Need to use Jar file names here as there is currently no other way to address Jar with
// classifier directly for patching
module(
"netty-transport-native-epoll-4.1.87.Final-linux-x86_64.jar",
"netty-transport-native-epoll-4.1.110.Final-linux-x86_64.jar",
"io.netty.transport.epoll.linux.x86_64"
)
module(
"netty-transport-native-epoll-4.1.87.Final-linux-aarch_64.jar",
"netty-transport-native-epoll-4.1.110.Final-linux-aarch_64.jar",
"io.netty.transport.epoll.linux.aarch_64"
)

Expand Down
4 changes: 2 additions & 2 deletions hapi/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
requires transitive com.google.common;
requires transitive com.google.protobuf;
requires transitive com.hedera.pbj.runtime;
requires transitive grpc.stub;
requires transitive io.grpc.stub;
requires transitive io.grpc;
requires grpc.protobuf;
requires io.grpc.protobuf;
requires org.antlr.antlr4.runtime;
requires static com.github.spotbugs.annotations;
requires static java.annotation;
Expand Down
23 changes: 10 additions & 13 deletions hedera-dependency-versions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plugins {
}

dependencies {
api(enforcedPlatform("io.netty:netty-bom:4.1.87.Final"))
api(enforcedPlatform("io.netty:netty-bom:4.1.110.Final"))

// Force commons compress version to close a security vulnerability
api(javaModuleDependencies.gav("org.apache.commons.compress"))
Expand Down Expand Up @@ -80,14 +80,14 @@ dependencies.constraints {
api("com.google.dagger:dagger-compiler:2.42") {
because("dagger.compiler")
}
api("io.grpc:grpc-netty:1.54.1") {
because("grpc.netty")
api("io.grpc:grpc-netty:1.64.0") {
because("io.grpc.netty")
}
api("io.grpc:grpc-protobuf:1.54.1") {
because("grpc.protobuf")
api("io.grpc:grpc-protobuf:1.64.0") {
because("io.grpc.protobuf")
}
api("io.grpc:grpc-stub:1.54.1") {
because("grpc.stub")
api("io.grpc:grpc-stub:1.64.0") {
because("io.grpc.stub")
}
api("com.esaulpaugh:headlong:6.1.1") {
because("headlong")
Expand All @@ -98,16 +98,13 @@ dependencies.constraints {
api("io.github.classgraph:classgraph:4.8.65") {
because("io.github.classgraph")
}
api("io.helidon.grpc:io.grpc:3.2.1") {
because("io.grpc")
}
api("io.netty:netty-handler:4.1.87.Final") {
api("io.netty:netty-handler:4.1.110.Final") {
because("io.netty.handler")
}
api("io.netty:netty-transport:4.1.87.Final") {
api("io.netty:netty-transport:4.1.110.Final") {
because("io.netty.transport")
}
api("io.netty:netty-transport-classes-epoll:4.1.87.Final") {
api("io.netty:netty-transport-classes-epoll:4.1.110.Final") {
because("io.netty.transport.classes.epoll")
}
api("io.perfmark:perfmark-api:0.25.0") {
Expand Down
4 changes: 2 additions & 2 deletions hedera-node/hedera-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ itestModuleInfo {
requires("com.swirlds.platform.core.test.fixtures")
requires("com.hedera.node.hapi")
requires("com.swirlds.metrics.api")
requires("grpc.netty")
requires("grpc.stub")
requires("io.grpc")
requires("io.grpc.netty")
requires("io.grpc.stub")
requires("org.apache.logging.log4j")
requires("org.assertj.core")
requires("org.bouncycastle.provider")
Expand Down
4 changes: 2 additions & 2 deletions hedera-node/hedera-app/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
requires transitive com.swirlds.state.api;
requires transitive com.hedera.pbj.runtime;
requires transitive dagger;
requires transitive grpc.stub;
requires transitive io.grpc.stub;
requires transitive javax.inject;
requires com.hedera.node.app.hapi.fees;
requires com.hedera.node.app.hapi.utils;
Expand All @@ -42,7 +42,7 @@
requires com.google.common;
requires com.google.protobuf;
requires com.hedera.evm;
requires grpc.netty;
requires io.grpc.netty;
requires io.grpc;
requires io.netty.handler;
requires io.netty.transport.classes.epoll;
Expand Down
4 changes: 2 additions & 2 deletions hedera-node/test-clients/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
requires com.fasterxml.jackson.databind;
requires com.github.docker.java.api;
requires com.hedera.evm;
requires grpc.netty;
requires grpc.stub;
requires io.grpc.netty;
requires io.grpc.stub;
requires io.netty.handler;
requires java.desktop;
requires java.net.http;
Expand Down

0 comments on commit 98cfb26

Please sign in to comment.