Commit Graph

6161 Commits

Author SHA1 Message Date
Samir Talwar
694a7213d1
resources: Remove the default factories. (#8645)
* resources: Wrapper constructors around the normal Resource types.

* resources: Factor out `ResourceFactories#apply`.

* resources: Remove the global factories.

They're no longer necessary, and could cause confusion. Users should use
their own factory object, not a generic one.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-27 15:56:29 +00:00
tudor-da
1351b08234
[Participant] Pipelined transaction indexing (#8571)
* Pipelined transaction indexing

CHANGELOG_BEGIN
[Integration Kit] The participant indexer (for PostgreSQL)
can now execute DAML transaction insertions in three pipelined stages.
CHANGELOG_END

* Make participant-integration-api test suite `large` for BAZEL
* Fixed constant timeout for MacOS builds

* Moved ledger end guard to TransactionReader
* Removed TransactionServiceResponseValidator

* Removed MetadataUpdate intermediary level from Update

* Added back store_ledger_entry timer

* Updated comment for idempotent insertions.
2021-01-27 16:36:55 +01:00
Stephen Compall
e51bcd54d4
lengthen timeout for FlowUtilTest from 150ms to 5s (#8639)
- found by @stefanobaghino-da; thanks

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-27 14:48:14 +00:00
Remy
ef8264408f
LF: do not serialized type and field in transaction values. (#8062)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-27 15:45:10 +01:00
Samir Talwar
d2e0cb2689
resources: Less context. (#8643)
* resources: Extract out `Resource.nest` into its own class.

* resources: Avoid needing a context for "pure" resources.

CHANGELOG_BEGIN
CHANGELOG_END

* resources: Turns out the higher kinds import fails in Scala 2.13.
2021-01-27 12:50:23 +00:00
azure-pipelines[bot]
9fff5027f6
rotate release duty after 1.10.0-snapshot.20210126.6155.0.a3f3ec1d (#8641)
@aherrmann-da is taking care of 1.10.0-snapshot.20210126.6155.0.a3f3ec1d (#8640), so they get pushed back to the end of the line.

Please do not merge this before #8640.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-01-27 08:25:42 +01:00
Stefano Baghino
a3f3ec1d44
Add test to verify that TLSv1.2 and TLSv1.3 work (#8638)
* Add test to verify that TLSv1.2 and TLSv1.3 work

As raised here: https://discuss.daml.com/t/what-version-of-tls-is-supported-by-the-ledger-api/1982

This has been effectively fixed by upgrading Netty here: https://github.com/digital-asset/daml/pull/8558

Note that this is an integration test for sandbox-classic only, but the
infrastructure used is shared with other Ledger API server
implementations, so this should be enough.

changelog_begin
changelog_end

* Fix Scala 2.13 compatibility issue

* Fix warning by adding type annotation to public field
2021-01-26 19:59:06 +00:00
Andreas Herrmann
6bfbaf021d
Auth0 example configuration (#8622)
* Auth0 example configuration

changelog_begin
changelog_end

* Update docs/source/tools/trigger-service/auth0_example.rst

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Disclaimer that rule doesn't validate

https://github.com/digital-asset/daml/pull/8622#discussion_r564341409

* Explain access to Alice in code

https://github.com/digital-asset/daml/pull/8622#discussion_r564341821

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-01-26 17:38:56 +00:00
Stefano Baghino
95874462b4
Add the first non-repudiation middleware prototype (#8608)
* Add the first non-repudiation middleware prototype, passing all conformance tests

Closes #8598

changelog_begin
changelog_end

* Address https://github.com/digital-asset/daml/pull/8608#discussion_r563780495

* Address https://github.com/digital-asset/daml/pull/8608#discussion_r563781026

* Address https://github.com/digital-asset/daml/pull/8608#discussion_r563795509

* Address https://github.com/digital-asset/daml/pull/8608#discussion_r563789111

* Address https://github.com/digital-asset/daml/pull/8608#discussion_r563792789

* Address https://github.com/digital-asset/daml/pull/8608#discussion_r563788373

* Address https://github.com/digital-asset/daml/pull/8608#discussion_r563789111
2021-01-26 15:08:41 +00:00
Richard Kapolnai
ce5d3bed1e
Add note about loglevel to trace and debug api doc (#4756)
* Add note about loglevel to trace and debug api doc

CHANGELOG_BEGIN
CHANGELOG_END

* Explain log level in comment of debug

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* fix typo

* propagate explanation to trace, traceId and debug

* Fix DA.Internal.Prelude location

changelog_begin
changelog_end

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-01-26 14:56:11 +00:00
Robin Krom
fdbe6cc7e9
fix: set LOCAL_ARCHIVE when unset (#8627)
Fixes #8573.
Fixes #8574.

We set the LOCA_ARCHIVE environment variable when a locales archive
exists and the variable is unset.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-26 15:52:24 +01:00
Richard Kapolnai
03a1fd960e
change comment of listknownparties: known instead of hosted (#8632)
* change comment of listknownparties: known instead of hosted

* CHANGELOG_BEGIN
CHANGELOG_END
2021-01-26 14:30:35 +00:00
Moritz Kiefer
6326822907
Upgrade grpc and protobuf libraries (#8558)
* Upgrade grpc and protobuf libraries

changelog_begin

- [Dependencies] Upgrade
  iou.grpc:grpc-(api|core|netty|protobuf|services|stub) to
  1.35.0.

- [Dependencies] Upgrade
  io.netty:netty-(codec-http2|handler|handler-proxy|resolver)
  to 4.1.58.Final.

- [Dependencies] Upgrade
  io.netty:netty-tcnative-boringssl-static to 2.0.36.Final.

- [Dependencies] Upgrade com.google.protobuf:protobuf-java to 3.14.0.

changelog_end

* Factor out netty and grpc version

changelog_begin
changelog_end
2021-01-26 14:17:18 +00:00
azure-pipelines[bot]
94c10116d1
update NOTICES file (#8624)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-01-26 14:02:27 +01:00
Robin Krom
036e46a1ee
damlc: check for inconsistent dependencies (#8619)
* damlc: check for inconsistent dependencies

This fixes #8553.

We check that all dependencies have the expected LF version.

CHANGELOG_BEGIN
CHANGELOG_END

* move filter to guard

* turn mainUnitId lookup into set lookup
2021-01-26 12:57:24 +01:00
Remy
46bde7dc1e
LF: Move transaction validation is in is own object. (#8626)
+ clean-up
+ rewrite value comparison. Do not use Equality as it may not be symmetric.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-26 12:25:32 +01:00
Remy
de14275528
triggers: do not use the type information from SRecord (#8623)
This type information is there for debugging purpose, one should not
use it.  We use type from SAny instead.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-26 12:08:53 +01:00
Andreas Herrmann
01ec6e8771
1.10.0-snapshot.20210125.6143.0.550aa48f (#8625)
changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-01-26 11:18:38 +01:00
Robin Krom
550aa48fc5
Revert "fix: package locale-archive with binaries (#8609)" (#8621)
This reverts commit 535ed8a337.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-25 18:13:51 +01:00
Gary Verhaegen
3e8d474b4b
docs: fix URL parsing for search page (#8618)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-25 15:03:57 +00:00
Stefano Baghino
ed89e58a76
Enable ledger-api-test-tool to be used as a library (#8607)
* Enable ledger-api-test-tool to be used as a library

This is the third of four PRs in which 6ea70c4b45
has been broken up to facilitate review.

The endgame is to have the non-repudiation prototype merged. The
Ledger API test tool will be used to check that the proxy can be
safely put in front of a conformant ledger implementation without
causing conformance tests to not pass. The ability to use is as
a library facilitates the process, ensuring we don't have to set
up three running processes in Bazel (the participant, the proxy
and the test tool).

changelog_begin
changelog_end

* Address https://github.com/digital-asset/daml/pull/8607#discussion_r563685495

* Address https://github.com/digital-asset/daml/pull/8607#discussion_r563688955

* Address https://github.com/digital-asset/daml/pull/8607#discussion_r563692051
2021-01-25 14:12:50 +00:00
Stefano Baghino
7de057192c
Enhance grpc-test-utils and grpc-reverse-proxy to use Resources (#8606)
* Enhance grpc-test-utils and grpc-reverse-proxy to use Resources

This is the second of four PRs in which 6ea70c4b45
has been broken up to facilitate review.

The endgame is to have the non-repudiation prototype merged. The
grpc-test-utils and grpc-server-proxy libraries have been
enhanced to use the ResouceOwner/Resource abstraction to handle
the lifecycle of components, making resource management easier
when testing.

changelog_begin
changelog_end

* Solve shadowing issue with more specific imports

* Address https://github.com/digital-asset/daml/pull/8606#discussion_r563628581
2021-01-25 13:27:48 +01:00
Moritz Kiefer
e0c5abd647
Switch to GHC 8.10.3 (#8394)
* Switch to GHC 8.10.3

changelog_begin
changelog_end

* Update bazel-haskell-deps.bzl

Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>

* Comment on rules_haskell patch

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
2021-01-25 11:53:53 +00:00
Robin Krom
535ed8a337
fix: package locale-archive with binaries (#8609)
Fixes #8573.
Fixes #8574.

We ship the `locale-archive` packaged with `nix` along binaries and set
the LOCALE_ARCHIVE environment variable. This makes sure the shipped
binaries behave the same as in our dev-env.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-25 11:54:11 +01:00
Stefano Baghino
fc69db02b4
Add a library that defines Resource factory methods for gRPC servers and channels (#8604)
* Add a library that defines Resource factory methods for gRPC servers and channels

This is the first of four PRs in which 6ea70c4b45
has been broken up to facilitate review.

The endgame is to have the non-repudiation prototype merged. These
factory methods have been used to make resource management easier,
specifically as part of testing.

changelog_begin
changelog_end

* Let warning log output in tests

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Address https://github.com/digital-asset/daml/pull/8604#discussion_r562634032

* Address https://github.com/digital-asset/daml/pull/8604#discussion_r562634865

* Address https://github.com/digital-asset/daml/pull/8604#discussion_r562635148

* Address https://github.com/digital-asset/daml/pull/8604#discussion_r562635684

* Add resources-grpc to release/artifacts.yaml

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-01-25 10:32:36 +01:00
Andreas Herrmann
5693394650
Publish JARs for trigger service and OAuth 2.0 middleware (#8614)
* include oauth2 logback config in release tarball

overlooked in https://github.com/digital-asset/daml/pull/8611

* Release trigger-service and oauth2-middleware JARs

changelog_begin
changelog_end

* drop from artifacts.yaml

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-01-25 09:14:13 +00:00
azure-pipelines[bot]
e559057129
update NOTICES file (#8616)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-01-23 10:53:43 +01:00
azure-pipelines[bot]
49a54e816f
update compat versions for 1.9.0 (#8586)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-01-22 18:43:11 +01:00
Remy
0757f2e7eb
LF: remove versionning of the individual values in transaction proto. (#8519)
We now use directly the version from the node.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-22 17:32:31 +01:00
Andreas Herrmann
5706f5e15d
Drop early access tag on trigger service and auth middleware (#8611)
* add livez endpoint to auth middleware

* Add OAuth 2.0 middleware to Daml SDK

* unhide trigger service auth flags

changelog_begin
- [Triggers] The trigger service now supports authorization through an
  auth middleware. The feature is enabled using the `--auth` and
  `--auth-callback` command-line flags. Please refer to the
  Authorization chapter of the trigger service documentation for further
  instructions.
- [OAuth 2.0 middleware] Daml Connect now includes an implementation of
  the auth middleware API that supports OAuth 2.0 Authorization Code
  Grant. Please refer to the Auth Middleware and OAuth 2.0 Auth
  Middleware chapters of the documentation.
changelog_end

* drop early access flag on triggers

Daml triggers, the trigger service, and the auth middleware are no
longer marked as early access features.

changelog_begin
- [Triggers] Daml Triggers and the Trigger Service are no longer in
  early access status.
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-01-22 17:02:24 +01:00
Robin Krom
1cac3aa073
fix: check for CI env variable before prompting (#8605)
To avoid prompting the user to set the PATH variable on CI, we check the
`CI` environment variable and do nothing if set.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-22 16:44:40 +01:00
Gary Verhaegen
ce8c38bac1
copyright updates (#8610)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-22 15:03:36 +00:00
Sofia Faro
438c204fc4
Add choice observers in LF spec. (#8592)
* Add choice observers in LF spec.

Part of #7709. Adds choice observers to the syntax, type system, and
and operational semantics of LF. Adds a test for the operational
semantics of choice observers.

changelog_begin
changelog_end

* typo

* remove duplicate rule

* Always have choice observers

* Add comment in serialization section
2021-01-22 13:10:41 +00:00
Bernhard Elsner
34fe171c46
Change case of DAML on docs landing page (#8600)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-22 13:03:33 +00:00
Andreas Herrmann
7543c6fdc0
Document authorization with trigger service (#8581)
* Docs for trigger-service auth and auth middleware

changelog_begin
changelog_end

* Document OAuth 2.0 authorization middleware

* Explain 401 Unauthorized resonse

* Add JS frontend example

* Update docs/source/tools/auth-middleware/index.rst

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update docs/source/tools/auth-middleware/index.rst

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update docs/source/tools/auth-middleware/index.rst

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update docs/source/tools/auth-middleware/index.rst

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update docs/source/tools/auth-middleware/oauth2.rst

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* trigger service don't redirect by default

3a5dba7a70 (r562497928)

* Call it Auth Middleware

https://github.com/digital-asset/daml/pull/8581#discussion_r562442571

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-01-22 11:53:26 +01:00
Georg Schneider
56c1405b60
Fix stdlib docs for unless (#8597)
* Fix stdlib docs for unless

* Fix stdlib docs for unless

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Georg Schneider <georg.schneider@digitalasset.com>
2021-01-22 06:18:55 +01:00
Robin Krom
03e3d1b20c
fix: assistant: parsing of parties field failed. (#8593)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-21 17:56:31 +01:00
Andreas Herrmann
33e13aeb3d
Improve browser compatbility of auth middleware (#8590)
* Include auth challenge in response body

changelog_begin
changelog_end

Some browsers make it difficult to access the `WWW-Authenticate`
response header from Javascript. For example, Firefox 84.0.2 (64-bit) on
Linux does not expose the `WWW-Authenticate` header in the result of the
`fetch` function, independent of the server's access control headers.
In that case the header is only accessible through the `XMLHttpRequest`
API, which is more cumbersome to use.

This adds the challenge to the response body in JSON format as well to
avoid exposing users to any such browser related issues.

* Make Secure Set-Cookie attribute configurable

changelog_begin
changelog_end

Since Chrome 80 Set-Cookie with the Secure attribute enabled is rejected
for connections that don't use https [1]. This includes localhost.
Firefox, at least as of version 84.0.2, allows such cookies on
localhost.

This adds a command-line flag to the authorization middleware to make
the value of the Secure attribute configurable. This way it can be
disabled for development purposes.

[1]: https://blog.chromium.org/2019/10/developers-get-ready-for-new.html

* Expand description on --cookie-secure flag

* Fix TriggerServiceFixture

* Fix middleware TestFixture

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-01-21 16:10:09 +00:00
Remy
53ab426119
LF: Release LF 1.11 (#8562)
CHANGELOG_BEGIN

- [Daml-LF] Release LF 1.11
  - add suport for Generic Map
  - add support for choice observer
  - add generic comparison
  - add convert of contract ID to string (available only in off-ledger mode)
  - reduce size of dar using type interning

CHANGELOG_END
2021-01-21 14:27:37 +01:00
Stephen Compall
00a5fe50ca
soft-code Postgres in json-api (#8517)
* SupportedJdbcDriver box for the required DB-specific implicits and magic values

* replace postgres references with the SupportedJdbcDriver box

* explaining the typeclass

* labels for debugging

* allow external initialization of SupportedJdbcDriver, but not usage

* thread SupportedJdbcDriver everywhere, hang it off of ContractDao

* remove unused dep from integration tests

* split Queries into an agnostic part and a DB-specific part

* document withOptPrefix

* reformat

* SQL syntax more amenable to refactoring

* different sets of DDL for different backends

* make everything use queries passed around everywhere (usually via ContractDao)

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-21 07:22:33 -05:00
azure-pipelines[bot]
f0d9dd8be2
rotate release duty after 1.9.0-snapshot.20210119.6103.0.cdcf090b (#8568)
@nickchapman-da is taking care of 1.9.0-snapshot.20210119.6103.0.cdcf090b (#8567), so they get pushed back to the end of the line.

Please do not merge this before #8567.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-01-21 12:16:10 +00:00
Sofia Faro
461273bb8f
Cleaning up the eval order tests. (#8580)
When I first wrote these tests I didn't realise you could have the `@ERROR` annotation anywhere in the file so I put them all near the top. This PR is just to move the `@ERROR` annotations closeer to where the error is generated, so it's easier to maintain. This is in preparation for updating the spec & tests for choice observers.

changelog_begin
changelog_end
2021-01-21 11:25:41 +00:00
Robert Autenrieth
cf42059102
Add buffer to speed up transaction streaming (#8579)
* Add buffer to speed up transaction streaming

CHANGELOG_BEGIN
- [Ledger API Server] Fixed an issue that was causing a slowdown of the
  transaction service.
CHANGELOG_END

* Move the buffer to TransactionReader
2021-01-21 11:44:11 +01:00
Simon Maxen
deb5041041
Allow TX updates to arrive in differing order (#8564)
* Allow TX to updates to arrive in differeing orders

CHANGELOG_BEGIN
CHANGELOG_END

* scalafmt

* whitespace to trigger rerun

* scalafmt

* Add waitForContract

* Update with review comments

* Unused import

Co-authored-by: Brian Healey <brian.healey@digitalasset.com>
2021-01-21 10:13:50 +00:00
Kamil Bożek
96a4306525
Fixed a flaky RecoveringIndexer test case (#8583)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-21 11:01:42 +01:00
Remy
aa3c6c62a8
LF: generalize usage of GlobalKey#build builder (#8570)
Hence we avoid usage of the standard Global key builder which require
an extra pass to ensure the contract key does not contain contract IDs.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-21 09:23:02 +01:00
Moritz Kiefer
a5bd99a368
Upgrade akka libraries (#8585)
changelog_begin
changelog_end
2021-01-20 19:49:10 +00:00
Remy
9b161bfd8e
java codegen: integration test for LF 1.11 (#8584)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-20 20:20:25 +01:00
Gary Verhaegen
532f996f12
ci: clean-up hard drive more often (#8582)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-20 17:22:53 +01:00
Remy
ff2beb6d4a
LF Encoder: fix encoding of LF 1.11 (#8575)
- fix encoding of generic comparisons
- fix encoding of choice observers

CHANGELOG_BEGIN
CHANGELOG_ENd
2021-01-20 17:10:02 +01:00