Commit Graph

5697 Commits

Author SHA1 Message Date
Brian Healey
08e1dc34ef
Replace com.digitalasset.platform with com.daml.platform (#7912)
* com.digitalasset.platform --> com.daml.platform in logbacks

* correct some broken running scala test examples

* correct com.digitalasset.platform broken links

CHANGELOG_BEGIN
Correct some remaining package name references to
com.digitalasset.platform in logback and readme file
CHANGELOG_END

Signed-off-by: Brian Healey <brian.healey@digitalasset.com>
2020-11-05 19:27:24 -05:00
Martin Huschenbett
b01d327211
Haskell: Add hlint rule to suggest foldl' over foldl (#7897)
* Haskell: Add hlint rule to suggest foldl' over foldl

`foldl` is lazy in a way that almost never is what you want since it
can cause space leaks without any benefit. `foldl'` does not have this
problem. See https://www.well-typed.com/blog/2014/04/fixing-foldl/ for
more details.

CHANGELOG_BEGIN
CHANGELOG_END

* Fix all existing occurrences of foldl

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-05 18:32:44 +00:00
Remy
6fd12862c2
LF: redesign transaction validation to return mismatching nodes. (#7826)
- Exercises' results are checked after the children have been checked.
- output the mismatching nodes in case of comparison failure.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-05 18:25:10 +01:00
Gary Verhaegen
3884a42a85
try to fix ws close test (#7911)
Hopefully with no `sleep` it should also not be racy anymore.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-05 18:20:56 +01:00
Martin Huschenbett
814e62caf5
damlc: Don't warn on TypeOperators and UndecidableInstances (#7909)
Currently, we're warning that both extensions might not work with
`data-dependencies`. However, we have tests that demonstrate that both
extensions actually do work with `data-dependencies`. Since there's
been customer demand to remove these warnings, we'll do so.

CHANGELOG_BEGIN
[damlc] Don't warn anymore that the language extensions TypeOperators
and UndecidableInstances might not work with `data-dependencies`.
CHANGELOG_END
2020-11-05 16:43:31 +00:00
Kamil Bożek
efa263a717
Documented gRPC error codes returned by the API server (#7844)
CHANGELOG_BEGIN
- gRPC error codes documentation in .proto definitions
CHANGELOG_END
2020-11-05 16:12:43 +01:00
Andreas Herrmann
c61abf0ab0
newtype wrapper for access token in trigger service (#7906)
changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-11-05 14:07:04 +00:00
Moritz Kiefer
31a3f25800
Add a --port-file option to the trigger service (#7907)
fixes #7097

changelog_begin

- [Triggers] The trigger service now has a `--port-file` option
  matching the corresponding option in the JSON API.

changelog_end
2020-11-05 15:03:34 +01:00
Moritz Kiefer
edc243963c
Expose Event from the high-level trigger API (#7899)
This allows you to write somewhat useful update functions since you
can inspect the transactions. Created and Archived are kept abstract
but we expose fromCreated/fromArchived to interact with them.

fixes #6968

changelog_begin

- [DAML Triggers] The `Daml.Trigger` module now reexports `Event`
  which avoids having to import `Daml.Trigger.LowLevel` for implementing
  a non-trivial `updateState` function.

changelog_end
2020-11-05 15:02:17 +01:00
Moritz Kiefer
693e55609c
Bump timeouts in build-and-lint’s (#7904)
* Bump timeouts in build-and-lint’s

We’ve seen some timeouts on CI so let’s bump everything to 100ms and
see if that fixes it. If it doesn’t, we can increase those 100ms as well.

changelog_begin
changelog_end

* Fix race on registering open event

changelog_begin
changelog_end
2020-11-05 13:37:05 +00:00
Moritz Kiefer
2a3e8095b8
Support multiple --dar options in the trigger service (#7903)
Limiting this to a single one makes little sense and while you can
work around it by uploading more packages, that can be annoying during
development.

fixes #6332

changelog_begin

- [Triggers] The trigger service now accepts multiple `--dar`` options.

changelog_end
2020-11-05 14:01:06 +01:00
Martin Huschenbett
123811cef9
damlc: Split data-deps test out of packaging tests (#7894)
The packaging test suite has become just so big that it regularly
exceeds its 15 min timeout. There are some deeper issues here, for
instance that we set up tons of tiny DAML projects and call
`daml build` on each of them. Each of those builds initializes a
package database, which is one of the things that seem to take
noticable time. Unfortunately, fixing these issues is a bigger effort.

This PR is more of a band aid rather than a proper solution: split the
packaging tests into two parts: the packaging tests and the tests for
data-depenendencies. Effectively, this amounts to giving the old
packaging test suite a 30 min time budges, but at least the two parts
can now be run in parallel.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-05 11:04:46 +01:00
Andreas Herrmann
4f92ed13ed
Store access token in trigger dao (#7890)
* Test all four trigger service configurations

- non-authenticated with in-memory backend
- non-authenticated with database backend
- authenticated with in-memory backend
- authenticated with database backend

changelog_begin
changelog_end

* add access token to trigger dao

* Simplify readRunningTriggers

* fmt

* Rename V2__Add_access_token.sha25 to V2__Add_access_token.sha256

* Apply suggestions from code review

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>
2020-11-05 09:45:40 +00:00
Moritz Kiefer
4fe9196ceb
Improve error on query failures in toACS (#7898)
Getting a pattern match failure here if you accidentally pass in an
archived contract is a bit cruel and now that this is DAML Script
where we can handle the failure, we can do better.

changelog_begin
changelog_end
2020-11-05 10:38:54 +01:00
Martin Huschenbett
feb3510a7c
DALF Reader: Refactor decoder environment (#7891)
* DALF Reader: Refactor decoder environment

Currently, the module to be decoded is part of the decoder environment.
This turned out to be unpleasant during my attempts to implement
interning for types since decoding the type interning table does not
happen in the context of a module.

This PR moves the module out of the decoder environment and passes it
to the decoder function for modules directly. Unfornatunately, we still
need to keep the module name in the environment since that is used as a
default when decoding location information. We solve this problem by
making the module name in the environment optional and always filling
it in when decoding in actual module.

CHANGELOG_BEGIN
CHANGELOG_END

* Adapt tests

CHANGELOG_BEGIN
CHANGELOG_END

* Follow Remy's suggestion

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-04 21:18:34 +00:00
Moritz Kiefer
bdf1c48947
Make HealthService public (#7887)
* Make HealthService public

DABL patches the rest adapter so making this public helps them plug it
together with other things.

Also removes some garbage debug print which I forgot to remove
🤦

changelog_begin
changelog_end

* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/HealthService.scala

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

* No logging

changelog_begin
changelog_end

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2020-11-04 19:13:54 +01:00
Gary Verhaegen
ba2ce20bb2
Docker Hub description for digitalasset/daml-sdk (#7886)
This commit just copies the existing description of the image from
DockerHub so we have a starting point to change it.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-04 18:25:08 +01:00
Gary Verhaegen
ad541bebce
release instructions: firefox (#7889)
`ad-hoc` machines now come with Firefox installed.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-04 17:16:58 +00:00
azure-pipelines[bot]
5f4ac97b77
update compat versions for 1.7.0-snapshot.20201103.5565.0.e75d42dd (#7872)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-11-04 16:38:01 +01:00
Andreas Herrmann
dc7ec9ef45
Refactor trigger service test fixture (#7880)
* Separate trigger service test fixture

Define a dedicated fixture per resource instead of generating all
resources in a single fixture function. This allows to control the
lifetime of resources individually.

Reuse the same sandbox and toxiproxy and auth middleware for the test
suite instead of restarting new resources for each test case. This is to
reduce overall test runtime.

changelog_begin
changelog_end

* fix exec context

changelog_begin
changelog_end

* Use owned resources where appropriate

Avoid Await result and use owned resources instead.

* Reduce test timeout

* Be more patient for Windows

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-11-04 15:00:28 +00:00
Robin Krom
ab3cce3e55
assistant tests: Testing hot-reload (#7871)
* assistant tests: Testing hot-reload

This adds a test to the assistant integration tests for testing the
hot-reload feature.

CHANGELOG_BEGIN
CHANGELOG_END

* hlint
2020-11-04 15:57:12 +01:00
Remy
37eb1d4c4c
LF: Kill deprecated Transaction version. (#7785)
This PR drops support for Transaction version 1 to 9. This is a
breaking change that may affect only ledger created with a pre SDK
1.0.0. No Sandbox-based ledger is affected by this change.

This advances the state of #7788

This breaking change was approved by the architecture committed.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-04 15:45:42 +01:00
Remy
5c36f07832
LF: Rotate type checking of case expressions by 90 degrees (#7883)
* LF: Rotate type checking of case expressions by 90 degrees

This reproduces changes made to the Haskell type checker (in #7873) 
into the Scala type checker.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-04 14:50:52 +01:00
Martin Huschenbett
075cab697b
damlc: Rotate type checking of case expressions by 90 degrees (#7873)
Currently, the Haskell implementation of the DAML-LF type checker
first branches on the pattern and then on the type of the scrutinee.
This PR changes it to first branch on the type of the scrutinee and
then on the pattern. This allows for destructing the type of the
scrutinee only once intead of repeating it for each pattern. This
should be good for performance, which is a nice side effect of this
change.

The main reason why I'm changing this is because we want to implement
an exhaustiveness check. This seems rather complicated to achieve with
the current implementation and will be significantly easier after this
change.

This PR is purely a refactoring and does not change the semantics of
amnything. In particular, it does not touch the decision that default
patterns match on anything, even no other pattern would match on the
value.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-04 13:06:00 +01:00
Gary Verhaegen
736d53c311
testing Docker signing (#7878)
There is no other way to test this code than to make a release. This is
expected to be identical to 1.7.0-snapshot.20201103.5565.0.e75d42dd,
with the version number being the only difference.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-04 12:44:56 +01:00
Gary Verhaegen
b9c1746abf
add env vars back to azure-cron (#7882)
Looks like I was wrong and [secret variables] do indeed require
explicit mapping:

[secret variables]: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#secret-variables

> Unlike a normal variable, they are not automatically decrypted into
> environment variables for scripts. You need to explicitly map secret
> variables.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-04 12:42:23 +01:00
Gary Verhaegen
ffd9da60ee
remove finished job (#7881)
It looks like Azure is correctly reporting the overall job completion
again. See #7790 for details.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-04 12:38:47 +01:00
Martin Huschenbett
f974efec57
Update release rotation (#7879)
Although I _really like_ making releases, particularly the testing on Windows, I think it's only fair if I don't have all of them for myself but share them with the team.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-04 11:22:10 +00:00
Gary Verhaegen
d5060fa94c
sign SDK Docker image (#7868)
Nobody should be using it anyway, but at least now they can trust it's
from us. If they bother to check.

CHANGELOG_BEGIN

- The SDK Docker image is now signed. Reminder: this is a dev-only
  image, with absolutely no support for any kind of production use-case.
  To verify the signature, use the `docker trust inspect` command.
  You can also set the `DOCKER_CONTENT_TRUST` environment variable to 1
  to instruct Docker commands to only pull and run signed images. Keep
  in mind, however, that this only checks that there is a signature, not
  that the signer is who you expect it to be. For optimal security, you
  should manually check the signature once with `docker trust inspect
  --pretty` and then pin the image hash rather than relying on tags.

  The expected output of the `docker sign inspect` command should
  mention a signer named `automation` with a public key ID matching
  533a6e09faa512f974f217668580da1ceb6aa5b00aad34ea1240afc7d249703f
  (note that the `--pretty` output only shows the first 12 chars) and a
  repository key matching
  f5dc2aee6aed2d05d7eda75db7aa2b3fac7fc67afbb880d03535d5a5295a0d3b.

CHANGELOG_END
2020-11-04 10:33:04 +01:00
Moritz Kiefer
6fdc6af6a7
Fix exclusions for nongranular test tool (#7876)
Older versions of the test tool don’t allow granular exclusion so we
have to exclude the whole suite.

changelog_begin
changelog_end
2020-11-04 09:53:08 +01:00
Martin Huschenbett
af3198ddee
Release 1.7.0-snapshot.2020.11.03 (#7869)
CHANGELOG_BEGIN
CHANGELOG_END
2020-11-03 17:56:46 +00:00
Moritz Kiefer
05b4f95967
Avoid verbose mode in DAML Script and DAML triggers (#7870)
We only expose the DAML values to users which don’t depend on this, so
we might as well avoid the unnecessary costs associated with verbose
mode especially since those are expected to increase in the
foreseeable future.

changelog_begin
changelog_end
2020-11-03 18:37:13 +01:00
Sofia Faro
e75d42ddc3
Represent overlap modes at the type level. (#7864)
On request by @hurryabit, this PR changes the representation of
overlap modes by moving it to the type-level. Since the value-level
encoding never made it into a stable release, this isn't a breaking
change. Also, the data-dependency and roundtrip tests are unchanged,
only the daml-test-files overlap mode test had to be updated.

changelog_begin
changelog_end
2020-11-03 12:40:36 +00:00
Gary Verhaegen
a131da4607
daml-ledger: document stream close behaviour (#7867)
This question has come up a couple times so I thought I'd write down the
answer in a more permanent fashion.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-03 13:21:38 +01:00
Gary Verhaegen
6b0b7cbe6f
daml-react: only log WS close as error on failure (#7866)
Fixes #7846.

CHANGELOG_BEGIN

- JavaScript Client Libraries: The family of React hooks `useStream*`
  was logging every `close` event as an error. However, there are
  legitimate cases for the connection to be closed (e.g. the component has
  been unmounted). The default behaviour will now be to log only
  unexpected disconnects and be silent on deliberate connection closes. The
  behaviour can be customized by passing a `onClose` callback; we
  strongly recommend passing such a callback to handle connection errors
  gracefully.

CHANGELOG_END
2020-11-03 13:20:57 +01:00
Bernhard Elsner
5629032dbe
Improve Ledger API versioning docs (#7865)
* Improve Ledger API versioning docs

CHANGELOG_BEGIN
CHANGELOG_END

* Update docs/source/support/compatibility.rst

Co-authored-by: Kamil Bożek <72492440+kamil-da@users.noreply.github.com>

Co-authored-by: Kamil Bożek <72492440+kamil-da@users.noreply.github.com>
2020-11-03 10:42:09 +00:00
Remy
8677bd92f3
LF: remove allowed transaction versions from EngineConfig. (#7861)
This is a followup of #7858.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-03 10:43:06 +01:00
Martin Huschenbett
5853d24a80
damlc: Make record projection sections faster (#7853)
Currently, `damlc` compiles a record projection section `(.foo.bar)`
into
```
getField @"bar" . getField @"foo"
```
Since we don't inline the `.`
operator, this is slower than it could be.

This PR changes the compilation scheme to produce
```
\record -> getField @"bar" (getField @"foo" record)
```
This is significantly faster since it avoids a couple of function
applications.

My micro benchmarks show a speedup of 1.8x for a single application of
`(.foo.bar)`. For a chain of length 3, as in `(.foo.bar.baz)`, the
speedup is even 2.3x.

This PR does add any new tests since the existing tests, particularly
the ones in `Records.daml`, already cover that area.

CHANGELOG_BEGIN
[daml] Performance improvements for record selector sections such as
`(.foo.bar)`.
CHANGELOG_END
2020-11-03 09:13:48 +01:00
Andreas Lochbihler
0c38c83b11
sandbox-classic reports contract key lookup mismatches as Inconsistent instead of Disputed (#7829)
CHANGELOG_BEGIN
sandbox-classic reports contract key lookup mismatches as Inconsistent instead of Disputed
CHANGELOG_END

excludes affected contract key tests from compability tests
2020-11-03 08:44:52 +01:00
Remy
cb5b439e39
Bump test_sha (#7512) (#7860)
This changed in #7858 but it’s a harmless change.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-02 20:18:32 +00:00
Remy
21c1c951f1
LF: remove control of input/output value/transaction versions. (#7858)
This is made obsolete by #7788.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-02 20:02:53 +01:00
Remy
23ba79ca6b
LF: drop legacy logic to infer transaction versions. (#7856)
This advances the state of #7788

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-02 19:15:55 +01:00
Remy
7325499ff9
LF: fix CidContainer2 (#7857)
Drop useless type variables in the definition of CidContainer2.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-02 19:15:36 +01:00
Moritz Kiefer
a74a1c15f4
Add healthcheck endpoints to JSON API (#7852)
* Add healthcheck endpoints to JSON API

This PR adds /livez and /readyz (following k8s naming scheme) that can
be used as liveness and readyness check. There isn’t much we can do
for liveness apart from showing that we can still respond to http
requests but readyness can be a bit more clever and check the ledger
connection as well as the database connection.

changelog_begin

- [JSON API] Add `/livez` and `/readyz` health check endpoints for
  easier integration with k8s and other schedulers.

changelog_end

* I hate windows

changelog_begin
changelog_end
2020-11-02 18:41:49 +01:00
Robin Krom
25edd9fd10
daml start: rerun the initialization script on rebuild (#7841)
We rerun the initialization script for every rebuild. In addition we fix
a potential bug that would lead to a wrong sandbox port when trying to
re-upload the package.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-02 10:41:05 +01:00
Martin Huschenbett
8519e52f03
Speedy: Add more tests for multi record updates (#7848)
Add two more tests for the following cases:
1. The Expressions the values should be updated with are non-atomoic.
   This tests that our internal ANF transformation doesn't destroy the
   omptimization. (In fact, it can't really do that because it is run
   after the phase which does the optimization. But better safe than
   sorry.)
2. A single record field is updated multiple times. This tests that
   the last update wins. Unfortunately, we cannot drop the earlier
   updates, or at least computing their values, since these values
   might be bottom. (We could add an optimization _after_ we've
   transformed into ANF but I don't expect any benefits from this in
   practice and would hence not do it.)

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-02 08:43:57 +00:00
Robin Krom
2e22b5f5f2
daml ledger: Infrastructure for tests (#7794)
* daml ledger: Infrastructure for tests

This adds infrastructure for testing `daml ledger` and moves one test
from the assistant integration tests to the newly created tests.

CHANGELOG_BEGIN
CHANGELOG_END

* Update libs-haskell/test-utils/DA/Test/HttpJson.hs

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update libs-haskell/test-utils/DA/Test/HttpJson.hs

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>

* small fixes

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
2020-10-30 21:35:29 +01:00
Brian Healey
83c50d287f
Add maven coordinates to publish ledger-resources-test-lib (#7851)
CHANGELOG_BEGIN
CHANGELOG_END

Signed-off-by: Brian Healey <brian.healey@digitalasset.com>
2020-10-30 14:49:23 -04:00
Andreas Herrmann
ebd1a7b70b
Add libstdc++ and ws2_32 to base on Windows (#7849)
These libraries have to appear on the linker command line after grpc and
gpr when linking against these. rules_haskell does currently not offer a
way to add extra libraries to the package configration file that are not
themselves Bazel targets. In case of libstdc++ and libws2_32 these are
system libraries that are not explicitly tracked by Bazel. As a
workaround we add these libraries to base's package configuration file.

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-10-30 15:37:20 +01:00
Andreas Herrmann
5e78ebded1
Update vcredist (#7843)
changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-10-29 17:14:22 +00:00