mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-19 16:57:40 +03:00
upgrade scalapb/netty/grpc/protobuf in proven combination (#12628)
* upgrade scalapb/netty/grpc/protobuf in proven combination CHANGELOG_BEGIN Upgrade scalapb, netty, grpc, protobuf and guava versions CHANGELOG_END * bazel reformat * match grpc version in deps.bzl * upgrade akka * keep grpc version to 1.43 that is used in latest nixpkgs-unstable * rebase and regen * update SHA for scalapb tarball Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
This commit is contained in:
parent
3ce272b9f0
commit
e70237a673
@ -685,7 +685,7 @@ proto_library(
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
""",
|
||||
sha256 = "42c14d407dd1e6018a302c0fb0fc805b3d36304b62aa4a1fc06267bca8f4f42f",
|
||||
sha256 = "2ddce4c5927fa8dd80069fba2fb60199f5b2b95e81e8da69b132665fae6c638c",
|
||||
strip_prefix = "ScalaPB-{}".format(scalapb_version),
|
||||
urls = ["https://github.com/scalapb/ScalaPB/archive/refs/tags/v{}.tar.gz".format(scalapb_version)],
|
||||
)
|
||||
|
@ -21,18 +21,37 @@ load(
|
||||
version_specific = {
|
||||
}
|
||||
|
||||
netty_version = "4.1.67.Final"
|
||||
|
||||
# ** Upgrading tcnative in sync with main netty version **
|
||||
# Look for "tcnative.version" in top-level pom.xml.
|
||||
# For example for netty version netty-4.1.68.Final look here https://github.com/netty/netty/blob/netty-4.1.68.Final/pom.xml#L511:
|
||||
# ```
|
||||
# <tcnative.version>2.0.42.Final</tcnative.version>
|
||||
# ```
|
||||
netty_tcnative_version = "2.0.40.Final"
|
||||
grpc_version = "1.42.0"
|
||||
akka_version = "2.6.13"
|
||||
|
||||
# Bumping versions of io.grpc:* has a few implications:
|
||||
# 1. io.grpc:grpc-protobuf has a dependency on com.google.protobuf:protobuf-java, which in
|
||||
# turn needs to be aligned with the version of protoc we are using (as declared in deps.bzl).
|
||||
# ScalaPB also depends on a specific version of protobuf-java, but it's not strict:
|
||||
# as long as the version we use is greater than or equal to the version required by ScalaPB,
|
||||
# everything should work.
|
||||
#
|
||||
# 2. To keep TLS for the Ledger API Server working, the following three artifacts need be updated
|
||||
# in sync according to https://github.com/grpc/grpc-java/blob/master/SECURITY.md#netty
|
||||
#
|
||||
# * io.grpc:grpc-netty
|
||||
# * io.netty:netty-handler
|
||||
# * io.netty:netty-tcnative-boringssl-static
|
||||
#
|
||||
# This effectively means all io.grpc:*, io.netty:*, and `com.google.protobuf:protobuf-java
|
||||
# need to be updated with careful consideration.
|
||||
|
||||
netty_tcnative_version = "2.0.46.Final"
|
||||
netty_version = "4.1.72.Final"
|
||||
grpc_version = "1.44.0"
|
||||
protobuf_version = "3.19.3"
|
||||
akka_version = "2.6.18"
|
||||
gatling_version = "3.5.1"
|
||||
guava_version = "31.0.1-jre"
|
||||
|
||||
def install_java_deps():
|
||||
maven_install(
|
||||
@ -50,7 +69,7 @@ def install_java_deps():
|
||||
"com.github.scopt:scopt_{}:4.0.0".format(scala_major_version),
|
||||
"com.google.code.findbugs:jsr305:3.0.2",
|
||||
"com.google.code.gson:gson:2.8.2",
|
||||
"com.google.guava:guava:29.0-jre",
|
||||
"com.google.guava:guava:{}".format(guava_version),
|
||||
"com.h2database:h2:2.1.210",
|
||||
"com.lihaoyi:pprint_{}:0.7.1".format(scala_major_version),
|
||||
"com.lihaoyi:sjsonnet_{}:0.3.0".format(scala_major_version),
|
||||
@ -93,24 +112,6 @@ def install_java_deps():
|
||||
"io.prometheus:simpleclient_dropwizard:0.8.1",
|
||||
"io.prometheus:simpleclient_httpserver:0.8.1",
|
||||
"io.prometheus:simpleclient_servlet:0.8.1",
|
||||
|
||||
# Bumping versions of io.grpc:* has a few implications:
|
||||
# 1. io.grpc:grpc-protobuf has a dependency on com.google.protobuf:protobuf-java, which in
|
||||
# turn needs to be aligned with the version of protoc we are using (as declared in deps.bzl).
|
||||
# ScalaPB also depends on a specific version of protobuf-java, but it's not strict:
|
||||
# as long as the version we use is greater than or equal to the version required by ScalaPB,
|
||||
# everything should work.
|
||||
#
|
||||
# 2. To keep TLS for the Ledger API Server working, the following three artifacts need be updated
|
||||
# in sync according to https://github.com/grpc/grpc-java/blob/master/SECURITY.md#netty
|
||||
#
|
||||
# * io.grpc:grpc-netty
|
||||
# * io.netty:netty-handler
|
||||
# * io.netty:netty-tcnative-boringssl-static
|
||||
#
|
||||
# This effectively means all io.grpc:*, io.netty:*, and `com.google.protobuf:protobuf-java
|
||||
# need to be updated with careful consideration.
|
||||
# grpc
|
||||
"io.grpc:grpc-api:{}".format(grpc_version),
|
||||
"io.grpc:grpc-core:{}".format(grpc_version),
|
||||
"io.grpc:grpc-netty:{}".format(grpc_version),
|
||||
@ -125,7 +126,7 @@ def install_java_deps():
|
||||
"io.netty:netty-resolver:{}".format(netty_version),
|
||||
"io.netty:netty-tcnative-boringssl-static:{}".format(netty_tcnative_version),
|
||||
# protobuf
|
||||
"com.google.protobuf:protobuf-java:3.17.3",
|
||||
"com.google.protobuf:protobuf-java:{}".format(protobuf_version),
|
||||
# scalapb
|
||||
"com.thesamet.scalapb:compilerplugin_{}:{}".format(scala_major_version, scalapb_version),
|
||||
"com.thesamet.scalapb:lenses_{}:{}".format(scala_major_version, scalapb_version),
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
scalapb_version = "0.11.6"
|
||||
scalapb_protoc_version = "0.9.3"
|
||||
scalapb_version = "0.11.8"
|
||||
scalapb_protoc_version = "0.9.5"
|
||||
|
12
deps.bzl
12
deps.bzl
@ -232,19 +232,19 @@ def daml_deps():
|
||||
if "com_google_protobuf" not in native.existing_rules():
|
||||
http_archive(
|
||||
name = "com_google_protobuf",
|
||||
sha256 = "c6003e1d2e7fefa78a3039f19f383b4f3a61e81be8c19356f85b6461998ad3db",
|
||||
strip_prefix = "protobuf-3.17.3",
|
||||
sha256 = "4dd35e788944b7686aac898f77df4e9a54da0ca694b8801bd6b2a9ffc1b3085e",
|
||||
strip_prefix = "protobuf-3.19.2",
|
||||
urls = [
|
||||
"https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.17.3.tar.gz",
|
||||
"https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.19.2.tar.gz",
|
||||
],
|
||||
)
|
||||
|
||||
if "io_grpc_grpc_java" not in native.existing_rules():
|
||||
http_archive(
|
||||
name = "io_grpc_grpc_java",
|
||||
strip_prefix = "grpc-java-1.35.0",
|
||||
urls = ["https://github.com/grpc/grpc-java/archive/v1.35.0.tar.gz"],
|
||||
sha256 = "537d01bdc5ae2bdb267853a75578d671db3075b33e3a00a93f5a572191d3a7b3",
|
||||
strip_prefix = "grpc-java-1.44.0",
|
||||
urls = ["https://github.com/grpc/grpc-java/archive/v1.44.0.tar.gz"],
|
||||
sha256 = "e3781bcab2a410a7cd138f13b2e6a643e111575f6811b154c570f4d020e87507",
|
||||
patch_args = ["-p1"],
|
||||
)
|
||||
|
||||
|
@ -59,7 +59,7 @@ object CommandRetryFlow {
|
||||
maxRetryTime: TemporalAmount,
|
||||
): SubmissionFlowType[RetryInfo[C, CommandSubmission]] =
|
||||
Flow
|
||||
.fromGraph(GraphDSL.create(commandSubmissionFlow) { implicit b => commandSubmission =>
|
||||
.fromGraph(GraphDSL.createGraph(commandSubmissionFlow) { implicit b => commandSubmission =>
|
||||
import GraphDSL.Implicits._
|
||||
|
||||
val merge =
|
||||
|
@ -15,7 +15,7 @@ object GraphExtensions {
|
||||
private val g: Graph[FanOutShape2[A, Y, Z], M]
|
||||
) extends AnyVal {
|
||||
private def divertToMat[N, O](oz: Sink[Z, N])(mat: (M, N) => O): Flow[A, Y, O] =
|
||||
Flow fromGraph GraphDSL.create(g, oz)(mat) { implicit b => (gs, zOut) =>
|
||||
Flow fromGraph GraphDSL.createGraph(g, oz)(mat) { implicit b => (gs, zOut) =>
|
||||
import GraphDSL.Implicits._
|
||||
gs.out1 ~> zOut
|
||||
new FlowShape(gs.in, gs.out0)
|
||||
|
@ -291,7 +291,7 @@ private class ContractsFetch(
|
||||
val startOffset = offsets.values.toList.minimum.cata(AbsoluteBookmark(_), LedgerBegin)
|
||||
|
||||
val graph = RunnableGraph.fromGraph(
|
||||
GraphDSL.create(
|
||||
GraphDSL.createGraph(
|
||||
Sink.queue[ConnectionIO[Unit]](),
|
||||
Sink.last[BeginBookmark[domain.Offset]],
|
||||
)(Keep.both) { implicit builder => (acsSink, offsetSink) =>
|
||||
|
@ -58,7 +58,7 @@ object CommandTrackerFlow {
|
||||
|
||||
val trackerExternal = new CommandTracker[Context](maximumCommandTimeout, timeoutDetectionPeriod)
|
||||
|
||||
Flow.fromGraph(GraphDSL.create(commandSubmissionFlow, trackerExternal)(Materialized.apply) {
|
||||
Flow.fromGraph(GraphDSL.createGraph(commandSubmissionFlow, trackerExternal)(Materialized.apply) {
|
||||
implicit builder => (submissionFlow, tracker) =>
|
||||
import GraphDSL.Implicits._
|
||||
|
||||
|
@ -63,12 +63,13 @@ object StaticTime {
|
||||
|
||||
RunnableGraph
|
||||
.fromGraph {
|
||||
GraphDSL.create(killSwitchExternal, sinkExternal) { case (killSwitch, futureOfFirstElem) =>
|
||||
// We serve this in a future which completes when the first element has passed through.
|
||||
// Thus we make sure that the object we serve already received time data from the ledger.
|
||||
futureOfFirstElem.map(_ => new StaticTime(timeService, clockRef, killSwitch, ledgerId))(
|
||||
ExecutionContext.parasitic
|
||||
)
|
||||
GraphDSL.createGraph(killSwitchExternal, sinkExternal) {
|
||||
case (killSwitch, futureOfFirstElem) =>
|
||||
// We serve this in a future which completes when the first element has passed through.
|
||||
// Thus we make sure that the object we serve already received time data from the ledger.
|
||||
futureOfFirstElem.map(_ => new StaticTime(timeService, clockRef, killSwitch, ledgerId))(
|
||||
ExecutionContext.parasitic
|
||||
)
|
||||
} { implicit b => (killSwitch, sinkHead) =>
|
||||
import GraphDSL.Implicits._
|
||||
val instantSource = b.add(
|
||||
|
@ -22,6 +22,8 @@ object InstrumentedSource {
|
||||
capacityCounter.dec(bufferSize.toLong)
|
||||
}
|
||||
|
||||
override def size(): Int = bufferSize
|
||||
|
||||
override def fail(ex: Throwable): Unit = delegate.fail(ex)
|
||||
|
||||
override def offer(elem: T): QueueOfferResult = {
|
||||
|
@ -178,6 +178,8 @@ class QueueBackedTrackerSpec
|
||||
override def offer(elem: QueueInput): QueueOfferResult =
|
||||
throw new IllegalArgumentException("test")
|
||||
|
||||
override def size(): Int = 0
|
||||
|
||||
override def complete(): Unit = ()
|
||||
|
||||
override def fail(ex: Throwable): Unit = ()
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -538,7 +538,7 @@ class Runner(
|
||||
// The materialized value of the flow is the (future) final state
|
||||
// of this process.
|
||||
@SuppressWarnings(Array("org.wartremover.warts.NonUnitStatements"))
|
||||
val graph = GraphDSL.create(Sink.last[SValue]) { implicit gb => saveLastState =>
|
||||
val graph = GraphDSL.createGraph(Sink.last[SValue]) { implicit gb => saveLastState =>
|
||||
import GraphDSL.Implicits._
|
||||
val msgIn = gb add Flow[TriggerMsg].wireTap(logReceivedMsg _)
|
||||
val initialState = gb add runInitialState
|
||||
|
@ -87,7 +87,7 @@ class UnfoldStateSpec
|
||||
val newSum = sum + ns.sum
|
||||
(newSum, (ns, newSum))
|
||||
}
|
||||
val graph = GraphDSL.create(Sink.seq[Int], Sink.seq[Int])(Keep.both) {
|
||||
val graph = GraphDSL.createGraph(Sink.seq[Int], Sink.seq[Int])(Keep.both) {
|
||||
implicit gb => (nsOut, stOut) =>
|
||||
import GraphDSL.Implicits._
|
||||
val fmc = gb add flatMapConcatNode { (sum: Int, ns: List[Int]) =>
|
||||
|
Loading…
Reference in New Issue
Block a user