Commit Graph

117 Commits

Author SHA1 Message Date
Soren Bleikertz
e1a13babed
Added CSV export of test evidence (#13483)
changelog_begin
changelog_end
2022-04-05 14:02:12 +02:00
Brian Healey
befde5fdb5
update telemetry version to 1.12.0 to fix grpc reflection and other assorted fixes (#13357)
* update telemetry version to 1.19.1 to match canton

CHANGELOG_BEGIN
Update telemetry version to 1.19.1
CHANGELOG_END

* update opentelemetry to 1.12.0.  Avoid repetition on dropwizard and prometheus versions

* bazel reformat
2022-03-30 16:37:42 +00:00
Sergey Kisel
9eeacdca94
Library for test evidence [DPP-959] (#13319)
* Test library for test evidence to annotate scala and ledger api tests. [DPP-959]

changelog_begin
changelog_end
2022-03-22 11:02:34 +01:00
Stephen Compall
c9b5750968
NonEmpty utilities, new nonempty-cats library (#13115)
New instances and collection methods, many of which included
as-is from @andreaslochbihler-da's experiments downstream.

* mk, a version of apply with special inference
* new names for the conversion functions suggested by
  @andreaslochbihler-da
* groupBy1, zipWithIndex, reduceLeft, last1, distinct, toVector1
* a derived Semigroup instance
* a more explicit subtyping utility to specify implicit preference than
  what we get with shapeless @@
* from method, alias for unapply
* cats functorial, foldable instances in the new nonempty-cats library
* new NonEmpty utilities

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Andreas Lochbihler <36634420+andreaslochbihler-da@users.noreply.github.com>
2022-03-10 16:30:42 +00:00
Brian Healey
7c8221e931
Upgrade akka_http version to 10.2.8 (#13149)
CHANGELOG_BEGIN
Upgrade akka_http version to 10.2.8
CHANGELOG_END
2022-03-03 17:15:14 +00:00
Samir Talwar
3dccabf6ba
ledger/cli-opts: Add tests for --auth-* CLI parameters. (#12894)
These were previously untested.

CHANGELOG_BEGIN
CHANGELOG_END
2022-02-11 19:42:21 +01:00
Moritz Kiefer
b7fc9f5731
Downgrade pgjdbc to 42.2.25 (#12834)
This also includes a fix for the CVE and 42.3 resulted in performance
degredations for Canton.

changelog_begin
changelog_end
2022-02-09 12:41:31 +01:00
Moritz Kiefer
a9bc821c21
Bump postgres jdbc to address CVE (#12826)
addresses https://nvd.nist.gov/vuln/detail/CVE-2022-21724

changelog_begin
changelog_end
2022-02-08 18:32:11 +00:00
Brian Healey
e70237a673
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>
2022-02-03 08:38:38 -05:00
Victor Peter Rouven Müller
aa45f48798
Upgrade to Scala 2.13.8 (#12506)
* Upgrade to Scala 2.13.8

changelog_begin
changelog_end

* Update hash for scala in nixpkgs

* update more hashes for scala upgrade

* Fix most warnings etc.

* Fix remaining errors etc.

* Fix formatting

* Resolve last errors hopefully

* Fix ledger api common build file

* Combine imports & revert accidental change that broke the CI run

* Rename exporting vals to scriptExport & minimize diff

* Remove more wrong changes

* moved warning around
2022-02-03 09:05:31 +00:00
Hubert Slojewski
7aabc492a9
Update OpenTelemetry from 0.16.0 to 1.1.0 [KVL-1256] (#12568)
CHANGELOG_BEGIN
CHANGELOG_END
2022-01-31 18:30:29 +01:00
Kamil Bozek
49f37b8e67
Allow defining ledger-begin and ledger-end offset conditions in ledger-api-bench-tool [DPP-836] (#12521)
* Allow defining ledger-begin and ledger-end offset conditions for transactions and transaction-trees streams in ledger-api-bench-tool

CHANGELOG_BEGIN
- [Integration Kit] - ledger-api-bench-tool allow to define ledger-begin and ledger-end offset boundaries for streams.
CHANGELOG_END

* Print ledger-api-bench-tool config in black&white to avoid colouring special characters printed

* Reduce duplication

* Add more unit tests for offset
2022-01-31 10:04:02 +01:00
Victor Peter Rouven Müller
5f58698ba6
[JSON-API] Add list-specific-users-rights, grant & revoke user rights endpoints (#12352)
* Add an endpoint used for querying user rights of a specific user

changelog_begin

- [HTTP-JSON] Added endpoint /user/rights that if called with POST will return user rights of the user specified via the payload

changelog_end

* Add grant&revoke user rights endpoint

changelog_begin

- [HTTP-JSON] Added endpoints user/rights/grant & user/rights/revoke which allow granting & revoking user rights for a specific user

changelog_end

* Switch to using the UserRights list instead of a case class with fields

* fix type annotation

* Rename allocateUser func to createUser to comform with the endpoint path

* Response format simplification & cleanup

* Add one last test that ensure that the JSON format of UserRight doesn't change without us noticing

* Apply suggestions from code review

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

* Remove unnecessary conversations and also just use unwrap for tagged strings

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2022-01-25 11:21:55 +00:00
Stefano Baghino
f1cd4b1c7c
Remove dependencies on compatibility libraries (#12548)
Continues the work started in https://github.com/digital-asset/daml/pull/12543

These libraries were only needed to transition from Scala 2.12 to 2.13
and are no longer useful as all the necessary items are now available
in Scala 2.13.

changelog_begin
changelog_end
2022-01-24 18:04:07 +00:00
Kamil Bozek
ca3b11ce85
Upgrade H2 to v2.1.210 (#12461)
CHANGELOG_BEGIN
CHANGELOG_END
2022-01-18 18:44:34 +01:00
Moritz Kiefer
903df7c230
Bump flyway to version 8.4.1 (#12379)
This fixes a warning due to an h2 version that is too new.

changelog_begin
changelog_end
2022-01-13 08:18:54 +01:00
Moritz Kiefer
0793bdf744
Upgrade h2 to version 2.0.206 (#12307)
* Upgrade h2 to version 2.0.206

changelog_begin
changelog_end
2022-01-10 14:22:40 +01:00
Gary Verhaegen
d2e2c21684
update copyright headers (#12240)
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.

I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 16:36:51 +00:00
Gerolf Seitz
717772850d
Update Logback to 1.2.8 (#12141)
This is to remove a JNDI and JDBC related vulnerability.
See https://jira.qos.ch/browse/LOGBACK-1591.

The vulnerability is only exploitable if the logback configuration
already makes use of JNDI lookups. This is _NOT_ the case for
logback configuration files shipped with any Daml components.

Nevertheless, it is good practice to upgrade dependencies known to be
vulnerable.

Regenerating the bazel dependency files also revealed that a previous
update to gRPC 1.42.0 was committed without running
`bazel run @unpinned_maven//:pin`.

CHANGELOG_BEGIN
CHANGELOG_END
2021-12-14 18:37:16 +00:00
nicu-da
bf239882f0
Update nix to include bazel fix for Monterey (#11929)
changelog_begin
changelog_end
2021-12-01 04:01:46 -08:00
Hubert Slojewski
6356f13cde
Properly upgrade gRPC to 1.41.0 (#11858)
CHANGELOG_BEGIN
CHANGELOG_END
2021-11-25 08:50:33 +00:00
Moritz Kiefer
fa7663148a
Drop 2.12 versioned_scala_deps (#11748)
I’ve kept the infrastructure for versioned_scala_deps around because
I’m optimistic and hope that eventually we’ll do another Scala upgrade.

changelog_begin
changelog_end
2021-11-17 22:13:08 +00:00
Moritz Kiefer
bb19c0de91
Drop Scala 2.12 support (#11619)
* Drop Scala 2.12 support

This only includes the CI/build system infrastructure
changes. Dropping compatibility layers from our code for 2.12 can be
done separately.

This is fine even in the context of backport builds since we already
disable the Scala 2.12 job for those anyway.

fixes #11315

changelog_begin
changelog_end

* Update bazel-java-deps.bzl

Co-authored-by: pbatko-da <pawel.batko@digitalasset.com>

Co-authored-by: pbatko-da <pawel.batko@digitalasset.com>
2021-11-17 18:38:43 +01:00
Hubert Slojewski
ac28e615b8
Update ScalaPB to the latest version (0.11.6) (#11409)
CHANGELOG_BEGIN
CHANGELOG_END
2021-10-28 09:28:02 +02:00
Hubert Slojewski
ad42dfa915
Update gRPC to the latest (1.41.0) and Protobuf (#11380)
CHANGELOG_BEGIN
CHANGELOG_END
2021-10-25 17:26:55 +00:00
pbatko-da
8de162baec
[DPP-586] Upgrade to netty 4.1.67.Final and netty-tcnative-boringssl-static 2.0.40.Final (#10956)
1. Upgrading netty to 4.1.67.Final. 
    Netty release notes: https://netty.io/news/2021/08/16/4-1-67-Final.html
2. Upgrading netty-tcnative-boringssl-static to corresponding version as listed here:
    https://github.com/netty/netty/blob/netty-4.1.67.Final/pom.xml#L511: 
   `<tcnative.version>2.0.40.Final</tcnative.version>`

NOTE: As of this upgrade TLS 1.1 and 1.0 are getting disabled by default  (see https://netty.io/news/2021/05/19/4-1-65-Final.html)


CHANGELOG_BEGIN
Daml on SQL, Integration Kit, Sandbox: Drop support for TLS 1.0 and 1.1 in Ledger API.
CHANGELOG_END
2021-09-23 10:39:55 +02:00
tudor-da
97e14de644
[Ledger API error codes] ErrorCode interfaces and generator [DPP-591] (#10836)
* [Ledger API error codes] ErrorCode interfaces and generator
* Implementation of annotation processor
* Implementation of DocItem generator
* Unit testing of the generator and error code logging

CHANGELOG_BEGIN
CHANGELOG_END

* Addressed review comments
2021-09-14 13:50:00 +02:00
pbatko-da
6dcdaa411c
[DPP-589] Add CLI flag to select minimum enabled TLS version (#10854)
- Add support for specifying either 1.2 or 1.3 as minimum TLS versions for ledger api server.
- Log enabled protocols (~TLS versions) and cipher suites at server and client startup.
- Add integration tests against Sandbox-classic and Sandbox

CHANGELOG_BEGIN
Sandbox: Add CLI flag to select minimum enabled TLS version for ledger API server.
CHANGELOG_END
2021-09-14 12:37:38 +02:00
Samir Talwar
386965c466
Upgrade Flyway to v7. (#10594)
Flyway v6.5 does not officially support the latest versions of
PostgreSQL.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-17 10:29:13 +00:00
Samir Talwar
4b8b67a1b5
Upgrade Scalatest to v3.2.9. (#10576)
* Upgrade Scalatest to v3.2.9.

Because of some coupling we also have to upgrade Scalaz to the latest
v7.2 point release, v7.2.33.

The Scalatest changes are quite involved because the JAR has been broken
up into several smaller JARs. Because Bazel expects us to specify all
dependencies and doesn't allow transitive dependencies to be used
directly, this means that we need to specify the explicit Scalatest
components that we use.

As you can imagine, this results in quite a big set of changes. They
are, however, constrained to dependency management; all the code remains
the same.

CHANGELOG_BEGIN
CHANGELOG_END

* http-json-oracle: Fix a Scalatest dependency.

* ledger-api-client: Fix a Scalatest dependency.
2021-08-12 23:19:35 +00:00
Samir Talwar
41e60f7302
Upgrade to Scala 2.12.14 and 2.13.6. (#10573)
* Upgrade to Scala 2.12.14.

* Upgrade Scala to 2.13.6.

CHANGELOG_BEGIN
CHANGELOG_END

* compability: Re-pin the Maven dependencies.
2021-08-12 14:25:53 +00:00
Moritz Kiefer
95cf3d82e8
Upgrade sqlite dependency (#10547)
Looks like the old version does not have support for Arm macs. I don’t
actually have one to test but I can see that it at least shows up in
the JAR with this change:

   972888  2010-01-01 00:00   org/sqlite/native/Mac/aarch64/libsqlitejdbc.jnilib

changelog_begin
changelog_end
2021-08-11 09:46:05 +02:00
Moritz Kiefer
1c4ae5023d
Revert "Upgrade hikari to latest jdk8 version (#10406)" (#10421)
This reverts commit d88dc7129b.

This causes some issues for Canton so reverting until we figure that
out. Tracked in https://github.com/digital-asset/daml/issues/10420

changelog_begin
changelog_end
2021-07-27 14:03:03 +00:00
Moritz Kiefer
d88dc7129b
Upgrade hikari to latest jdk8 version (#10406)
Thought it might help with something, it didn’t but no reason to stick
to an older version.

Note that 5.x don’t work on jdk8 so this is the latest we can get.

changelog_begin
changelog_end
2021-07-26 14:22:46 +02:00
Moritz Kiefer
b7cf42d173
Upgrade doobie to version 0.13.4 (#10326)
Was curious if there were any relevant performance improvements in
newer versions. Looks like the answer is no but we might as well
upgrade anyway.

changelog_begin
changelog_end
2021-07-20 19:19:11 +02:00
Miklos
0eba812109
Remove trace_context field from Ledger API [KVL-1021] (#10256)
CHANGELOG_BEGIN
* [Integration Kit] Removed trace_context field from Ledger API and its bindings as we now have trace context propagation support via gRPC metadata. If you are constructing or consuming Ledger API requests or responses directly, you may need to update your code.
CHANGELOG_END
2021-07-15 19:06:25 +02:00
Stephen Compall
401069ef00
prepare for upgrade to Scalaz 7.3.3 (#9997)
* upgrade scalacheck to 1.14.3

* regenerate maven_install files

* some different names and implicits

* remove some fromTryCatchNonFatal

* more porting

* port fromTryCatchNonFatal to attempt

* factor the assertions in SignatureSpec to avoid \/

* deal with invariant \/

* make partial unification do what we want

* \/, parse*, and toNel

* many uses of the .right method

* a legitimate use of fromTryCatchThrowable

* rebuild maven pins

* further invariant \/

* OneAnd and Nel interface changes

* further Either games

* \/ and reformatting

* \/ in http-json

* \/ in http-json

* deprecations

* more invariance

* cleanup unused

* more invariance; http-json compiles

* final either follies

* small 2.12 extra incompatibility

* rebuild deps

* revisit a couple earlier fixes using nicer expressions I learned later

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* repin 2.12
2021-06-15 14:41:48 -04:00
danielporterda
dd42a5a641
update maven_install_2.12.json (#9999)
* update maven_install_2.12.json

* update maven_install_2.12.json
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-14 18:01:44 -04:00
danielporterda
b6faace335
Changing oracle backend from using varray to json array (#9943)
* oracle varray to json

CHANGELOG_BEGIN
CHANGELOG_END

* various cleanup, mostly removing printlns

* remove oracle connection from conversions and dependencies, cleaning up vestigial scala side varray code

* fix lazylist/stream issue by using java stream. remove braces
2021-06-14 09:34:05 -04:00
Samir Talwar
63c471fa79
Upgrade protobuf-java and scalapb. [KVL-938] (#9713)
* Upgrade protobuf-java and scalapb.

CHANGELOG_BEGIN
CHANGELOG_END

* Bazel: Generate ScalaPB classes without `unknownFields`.

This is very annoying because it means that extractors need an extra
`_` for no good reason. It also breaks Circe's automatic derivation.

Including unknown fields is the default behavior in Protocol Buffers for
Java now, and we'll probably have to reckon with it at some point, but
let's kick that can down the road a little.

* Upgrade protobuf-java to 3.17.1.

This is identical to 3.17.0, but let's track it anyway.

* Bazel: Move ScalaPB versions into their own file.

They don't need to go into the generated one.
2021-05-27 13:41:28 +00:00
Kamil Bożek
3241ad6a41
ledger-api-bench-tool - updated metrics reporting model [DPP-400] (#9749)
* Simplified metrics names

* Metrics returning domain values instead of formatted strings

* Always returning metric Value objects with possibly optional contents

* Use the new metric Value classes

* Remove the old metric reporting mechanism

* CHANGELOG_BEGIN
CHANGELOG_END

* Fixed 2.12 build

* Removed random generators from metric tests

* Fixed 2.12 build

* Improved readability of the size metric calculation

* Minor change

* `ledger-api-bench-tool`: max consumption delay SLO [DPP-400] (#9785)

* ServiceLevelObjective trait

* Added copyright to a new file

* A model for combining metrics and objectives in type families

* Mechanism for returning metric violation information

* Return error code when SLOs violated

* Use type parameter for the result of transaction service methods

* max-delay command line parameter for the max delay SLO

* Logging violated objectives in the final report

* Simplified size rate metric value

* CHANGELOG_BEGIN
- [Integration Kit] - ledger-api-bench-tool - new parameter max-delay for specifying the service-level objective for max delay
CHANGELOG_END

* Fixed tests

* Simplified MetricsManager.Message trait

* Fixed build errors

* Changed objectives violated message

* Removed DelayObjective trait

* Comments improvement

* Ordering for MaxDelay.Value

* Removed redundant method from the ServiceLevelObjective trait
2021-05-26 13:16:57 +02:00
Moritz Kiefer
6f631da09d
Use munit for diffs in ledger-api-test-tool (#9765)
As everyone knows that has worked on the ledger API test tool, diffx
makes compilation very very slow (>150s for TransactionServiceIT).

As some people (myself included) know, trying to get diffx to not be
slow is also a giant nightmare (have fun debugging mutually recursive
implicits derived by Scala macros)

So this PR takes a different approach:

Drop diffx completely and replace it by munit. This leads to slightly
different diffs but I think they’re close enough and importantly munit
involves absolutely no macros for those diffs so compilation takes 5s
for TransactionServiceIT.

changelog_begin
changelog_end
2021-05-21 08:40:17 +02:00
Victor Peter Rouven Müller
beb2d138f2
Add cli option & system property to enable json only logging for http json service (#9725)
changelog_begin
- [Ledger HTTP Json Service] Logging output can now be in JSON either via providing the cli option `--log-encoder json` or via setting the env var `LOG_FORMAT_JSON=true`
changelog_end
2021-05-20 13:28:34 +00:00
Moritz Kiefer
66d039eb5b
Upgrade gatling to version 3.5.1 (#9714)
Ths is required to get a version of Gatling that supports Scala
2.13 (and only that because they do not cross build).

Unfortunately the upgrade is a bit more annoying than I was hoping for:

Our custom gatling utils rely on parsing the simulation log. This is
an internal file format with zero documentation or stabilityt
guarantees and as expected it has changed in incompatible ways during
the upgrade.

Rather than trying to reverse engineer and adapt to changes everytime
we upgrade, this PR switches us to a slightly more supported codepath
by parsing the `stats.json` and `assertions.json` produced by the
highcharts stuff. Afaict this is also what for example the Jenkins
integration relies on so while it’s not completely public API it seems
like the best option I could find.

There are a few pieces of information we can’t get out of those
files. Specifically:

1. maxUsers: we only ever need one users anyway so not really relevant.
2. start, duration, end: no idea why we would want those. we want per
   request metrics not the total duration.
3. geometric mean: slightly annoying, but avg & stdev should be good
enough™.
4. The scenario name: Not really an issue but if it is, we can
   disambiguate by changing request names.

changelog_begin
changelog_end
2021-05-18 16:54:37 +00:00
Hubert Slojewski
2e93de79a4
Fix recording exceptions in Spans, add unit tests [KVL-874] (#9544)
* Fix recording exceptions in Spans, add unit tests
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-04 17:06:57 +02:00
Moritz Kiefer
4aca199bbd
Upgrade to Scala 2.13.5 (#9528)
changelog_begin
changelog_end
2021-04-29 13:05:57 +00:00
Hubert Slojewski
d761853832
KVL-874 Add unit tests for Telemetry (#9500)
* Add unit tests for Telemetry
CHANGELOG_BEGIN
CHANGELOG_END

* Make Tracers injectable, improve the TelemetryContextSpec, add a metrics-test-lib package
2021-04-27 23:59:39 +02:00
Samir Talwar
e1af564bcc
Switch from @silent to @nowarn. (#9498)
* Switch from `@silent` to `@nowarn`.

This annotation is native to Scala 2.12.13+ and 2.13.2+. It replaces
most usages of `@silent`.

I had to get creative about a couple of use cases that didn't work.
Specifically:

  1.  Suppressing deprecation warnings works, but Scala 2.12 erroneously
      complains that the `@nowarn` is unnecessary.  I had to suppress
      this warning too with `-Ywarn-unused:-nowarn`.
  2.  I can't seem to suppress the warning, "The outer reference in this
      type test cannot be checked at run time." Instead, I have
      refactored the code to remove the warning.

We still need to use the silencer plugin to suppress some warnings about
unused imports (because of compatibility between Scala 2.12 and 2.13),
but this means we no longer need the library, and therefore it is not a
transitive dependency that downstream consumers need to worry about.

CHANGELOG_BEGIN
CHANGELOG_END

* Add some comments around `@nowarn` support.

* language-support/scala: Fix a warning suppression.

* Revert to the default warnings.

Compatibility was complaining.
2021-04-26 19:46:14 +00:00
Hubert Slojewski
9706d9fe2a
KVL-874 Change the TelemetryContext to use SpanAttributes instead of raw AttributeKeys and remove an unused object (#9474)
* Change the TelemetryContext to use SpanAttributes instead of raw AttributeKeys
and remove an unused object along with its dependencies

CHANGELOG_BEGIN
CHANGELOG_END

* Change the Tracer name and the instrumentation name from participant to com.daml.telemetry
2021-04-26 15:31:46 +02:00
Hubert Slojewski
f4316bddf3
KVL-874 Add telemetry classes from the oem integration kit and use it for command submissions (#9436)
* Add telemetry classes from the oem integration kit and use it for command submissions

* Change submitTransaction to submitTransactionWithTelemetry and add a deprecation

* Fix tests

* Revert "Change submitTransaction to submitTransactionWithTelemetry and add a deprecation"

CHANGELOG_BEGIN

- [Integration Kit] TelemetryContext has been introduced to the WriteService.submitTransaction method to support distributed tracing

CHANGELOG_END
2021-04-23 13:00:39 +02:00