Commit Graph

6187 Commits

Author SHA1 Message Date
Moritz Kiefer
c74fe9ea20
Delete unusued bzip2 BUILD file (#8678)
changelog_begin
changelog_end
2021-01-29 10:37:25 +01:00
Moritz Kiefer
a07ab83fef
Remove grpc nix override (#8679)
We get grpc from Bazel everywhere now so no need to try to keep a nix
definition in sync.

changelog_begin
changelog_end
2021-01-29 10:37:18 +01:00
Andreas Herrmann
a226324afa
Use cliopts.Http for OAuth 2.0 middleware (#8671)
* Use cliopts.Http for OAuth 2.0 middleware

changelog_begin
- [OAuth 2.0 Middleware] You can now configure the address that the
  middleware listens to using the ``--address`` flag.
  The port that the middleware listens to is now configured using the
  ``--http-port`` flag, use 0 to dynamically choose a free port.
  You can now configure a port file where the chosen port will be
  written to using the ``--port-file`` flag.
changelog_end

* Add test-case for OAuth 2.0 middleware port file

* Don't forget to close source

* Fix integration test

* Update triggers/service/auth/src/main/scala/com/daml/auth/middleware/oauth2/Config.scala

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

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-01-29 09:32:07 +00:00
Stefano Baghino
df692f42db
Non-repudiation: use binary headers for signature and fingerprint (#8672)
* Non-repudiation: use binary headers for signature and fingerprint

This should reduce the times we encode and decode to and from base64 strings.

changelog_begin
changelog_end

* Address https://github.com/digital-asset/daml/pull/8672#discussion_r566264693
2021-01-29 08:56:33 +00:00
Bernhard Elsner
24116e4fa2
Minor docs fixes (#8662)
* Fix copyright messages.

The (C) Copyright gets inserted automatically.

CHANGELOG_BEGIN
CHANGELOG_END

* Update favicons

* Reduce z-indices

* Improve inline search hover effect

* Avoid putting "null" in the search bar

* Address Gary's feedback

* Remove pycache

* Improve gitignore

* Change © to (c)
2021-01-29 08:42:36 +00:00
Moritz Kiefer
81dc6b9473
Relax party validation in DAML Script over JSON API (#8674)
* Relax party validation in DAML Script over JSON API

Since the JSON API infers parties from the token instead of accepting
them explicitly, we have to ensure that the parties in the token match
the parties passed to `submit`/`submitMulti` exactly. However, we were
a bit too strict and required a party to be in `readAs` even if it is
already in `actAs`. This caused issues on DamlHub because they issue
tokens with the party in both `actAs` and `readAs` so regular `submit`
doesn’t work.

changelog_begin

- [DAML Script] When running DAML Script over the JSON API, the check
  that the parties in the DAML Script match the parties in the token
  has been relaxed and now allows for duplicate parties as well as
  parties that are only in actAs in the DAML Script but in both actAs
  and readAs in the token.

changelog_end

* fmt

changelog_begin
changelog_end
2021-01-28 20:22:07 +01:00
Kamil Bożek
505b05c0c1
Removed logging JDBC url to prevent leaking passwords to log files. [DPP-140] (#8601)
* Removed logging JDBC url to prevent leaking passwords to log files.

CHANGELOG_BEGIN
- not logging JDBC url
CHANGELOG_END

* Minor change to fix the build
2021-01-28 19:33:16 +01:00
Moritz Kiefer
c89e00342d
Clean broken entries from the Bazel cache (#8668)
* Clean broken entries from the Bazel cache

This is hopefully a somewhat reasonable workaround for the "output not
created" errors that keep annoying us.

For now, this is just part of the hourly cronjob but we could move it
somewhere else if desired.

changelog_begin
changelog_end

* Fix GCS credentials

changelog_begin
changelog_end
2021-01-28 17:57:09 +00:00
Remy
83496abf62
LF: cleanup value.rst and transaction.rst (#8644)
Clean up as of version 11.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-28 18:03:48 +01:00
Remy
4bde0dcc29
LF: preview of LF 1.12 (#8652)
CHANGELOG_BEGIN

* LF: preview of LF 1.11. Preview versions can be changed only to
include bug fixes. Changes of LF 1.12 include:
 - reduce transaction size by erasing type information in user-defined
   type.

CHANGELOG_END
2021-01-28 17:28:41 +01:00
Sofia Faro
98fe621066
Add DA.Set to match DA.Map (#8651)
* Add DA.Set to match DA.Map

Fixes #8448

changelog_begin
changelog_end

* Make it a stable package

* Add test.

* add map field

* fix stable-packages test

* update Examples.daml
2021-01-28 16:12:16 +00:00
Moritz Kiefer
b242f1f796
Catch permission errors in readPortFile (#8669)
changelog_begin
changelog_end
2021-01-28 15:49:54 +00:00
Robin Krom
ce4fff5133
ghcide: update to newest commit (#8665)
* ghcide: update to newest commit

CHANGELOG_BEGIN
CHANGELOG_END

* update golden tests
2021-01-28 15:03:52 +01:00
azure-pipelines[bot]
a9793651b3
update compat versions for 1.10.0-snapshot.20210125.6143.0.550aa48f (#8628)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-01-28 13:36:35 +01:00
Kamil Bożek
d2a9e1e5b3
--client-auth param for kvutils app [DPP-212] (#8589)
* --client-auth param for kvutils app

CHANGELOG_BEGIN
-- enabled --client-auth for kvutils config
CHANGELOG_END

* TLS integration tests for StandaloneApiServer client authorization parameter

* Refactored TlsFixture to reduce duplication

* Improved description of the client-auth parameter

* Added test cases with invalid certificates

* Improved readability of the test cases

* Formatted changes
2021-01-28 13:21:43 +01:00
Gary Verhaegen
29197a96d7
add Stefano to appr (#8663)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-28 11:11:08 +00:00
Stefano Baghino
c541df2c38
Restrict extensibility of ServerResourceOwner (#8660)
* Restrict extensibility of ServerResourceOwner

Following https://github.com/digital-asset/daml/pull/8649 this commit
fixes the last open comment from https://github.com/digital-asset/daml/pull/8604
as explained in the comment https://github.com/digital-asset/daml/pull/8604#issuecomment-766620042

changelog_begin
changelog_end

* Address https://github.com/digital-asset/daml/pull/8660#discussion_r565946621
2021-01-28 10:47:28 +00:00
fabiotudone-da
0a379bc078
KV TransactionCommitter: report correct rejection reason in case of contract keys contention, second attempt [KVL-760] (#8594)
* TransactionCommitter: allow transaction traversal to perform several key validations

* Re-implement the key consistency check in the committer

[CHANGELOG_BEGIN]
KV: always reject as "Inconsistent" when contract keys referenced in a transaction have changed between submission and commit (previously other, less appropriate rejection reasons would be produced, such as "Disputed")
[CHANGELOG_END]

* Fix implementation and KVUtilsTransactionSpec

* Fix TransactionCommitterSpec

* Remove TODO

* Extract TransactionCommitter's contract keys validation logic

* Revert unneeded access modified change for Committer.logger

* Make StepResult monadic and use for comprehension for TransactionContractKeysValidation validation steps

* Leverage Either's monadicity

* Tidy up and perform cheaper monotonicity validation first

* Tidy up and perform cheaper monotonicity validation first

* Tidy up and perform cheaper monotonicity validation first

* Tidy up and perform cheaper monotonicity validation first

* Extract KeyValidation data structures

* Monoidize KeyValidationState

* Remove unused zero of KeyValidationState and tidy up

* Refactor into several files

* Tidy up

* Reduce diff size

* Address review comment
2021-01-28 10:24:18 +01:00
azure-pipelines[bot]
e325361495
update NOTICES file (#8654)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-01-28 08:23:23 +01:00
Gary Verhaegen
ec5e419e3a
clean-up infra after Ubuntu 20.04 upgrade (#8653)
See #8617.

This has to be a separate PR so we could drain all the jobs still
expecting the linux-pool pool to exist.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-27 22:19:34 +01:00
Stefano Baghino
793fd8fdfc
Correctly document and report malformed party names when allocating (#8642)
* Correctly document and report malformed party names when allocating

changelog_begin
[Ledger API] Documented the hard-coded limit of 255 characters for Daml-LF party names.
[Ledger API] Malformed party names are now correctly reported back with an INVALID_ARGUMENT error
changelog_end

* Make sure that what is given is a suggestion

Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>

* Use Future.successful where possible

Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>

* Address https://github.com/digital-asset/daml/pull/8642#discussion_r565116571

* Address https://github.com/digital-asset/daml/pull/8642#discussion_r565122362

* Keep fields private where possible

* Whitelist new tests on compatibility suite

* Don't run the new tests on Canton

Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2021-01-27 18:50:19 +00:00
Samir Talwar
48daf33586
resources: Add Resource#transform, and mirror Resource#transform{,With} in ResourceOwner. (#8649)
* resources: Add `Resource#transform`.

CHANGELOG_BEGIN
CHANGELOG_END

* resources: Fix some Scaladoc warnings.

* resources: Add `transform` and `transformWith` to ResourceOwners.
2021-01-27 17:58:13 +00:00
Samir Talwar
ecab863d68
resources: Sometimes, Future#andThen is simpler. (#8650)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-27 17:58:06 +00:00
Gary Verhaegen
fef712bf60
Upgrade linux nodes to 20.04 (#8617)
CHANGELOG_BEGIN

- Our Linux binaries are now built on Ubuntu 20.04 instead of 16.04. We
  do not expect any user-level impact, but please reach out if you
  do notice any issue that might be caused by this.

CHANGELOG_END
2021-01-27 17:38:34 +01:00
Kamil Bożek
340fd00942
Tracker retention duration parameter [DPP-191] (#8554)
* Tracker retention duration parameter

CHANGELOG_BEGIN
- New --tracker-retention-period parameter for kvutils CLI to be able to customize for how long the command service will keep an active command tracker for a given party.
CHANGELOG_END

* Changed default tracker retention period to 5 minutes

CHANGELOG_BEGIN
- changed the default tracker retention period from 24 hours to 5 minutes
CHANGELOG_END

* Applied review suggestions

* Update parameter description.

Co-authored-by: mziolekda <marcin.ziolek@digitalasset.com>

* Formatted changes

Co-authored-by: mziolekda <marcin.ziolek@digitalasset.com>
2021-01-27 17:30:48 +01:00
Gary Verhaegen
fc83f7088d
limit blackduck scans to main (#8647)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-27 17:29:27 +01:00
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