Commit Graph

6161 Commits

Author SHA1 Message Date
Moritz Kiefer
4ca890fab9
Fix queryContractKey for complex keys over gRPC (#8368)
* Fix queryContractKey for complex keys over gRPC

Unfortunately the Equal instance of Value only performs structural
equality which includes optional field names and constructor
names. While we could try to ensure that they are always present or
always absent, the more reliable solution seems to be to not rely on
this at all and instead use the equality on SValues which is
explicitly designed for this.

changelog_begin

- [DAML Script] Fix a bug where queryContractKey incorrectly returned
  None despite their being an active contract with the given key. This
  only affected DAML Script over gRPC.

changelog_end

* Update daml-script/runner/src/main/scala/com/digitalasset/daml/lf/engine/script/LedgerInteraction.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

Co-authored-by: Remy <remy.haemmerle@daml.com>
2021-01-04 15:38:43 +00:00
Remy
57aa4993e9
LF: test LF 1.11 in DamlLfEncoderTest (#8365)
This is part of #7139.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-04 15:15:06 +00:00
Sofia Faro
2c248a411c
Add LF version 1.11 in damlc (#8371)
* Add LF version 1.11 in damlc

This maintains the default as 1.8 for now.

CHANGELOG_BEGIN
CHANGELOG_END

* Fix version1_11 doc
2021-01-04 14:53:00 +00:00
Remy
425fca6541
LF: Scala serializability checker handle exceptions (#8363)
This is part of #8020.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-04 15:25:25 +01:00
Gary Verhaegen
2083f74cf2
add docs.daml.com/latest (#8372)
This commit changes the docs cron to create a new file
`docs.daml.com/latest`, a simple text file containing the version number
of the latest released version. This is done in response to #8354, to
avoid having to replicate the logic for which version is the latest
across this, the assistant and the get-daml.sh script.

This commit also cleans up a small transitional FIXME in the docs cron
regarding the transition from `snapshots.json` to `hidden.json`.

For the solution to #8354 to be complete, we'll also need to update
get-daml.sh and the assistant to use the new latest file. Note that this
file would only be published on the next stable release, so this commit
also includes a temporary hack to re-generate it (and `versions.json`
and `hidden.json`) unconditionally on every run; this can be removed as
soon as this has run once.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-04 15:14:42 +01:00
Remy
8b5940842f
LF: fix specification of exceptions (#8366)
This is part of #8020.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-04 14:30:36 +01:00
Remy
693e5fac70
LF: prevent collision betweem templates and excetpions (#8367)
@sofiafaro-da noticed this was missing when reviewing #8364.

This is part of #8020.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-04 13:05:36 +00:00
Remy
ae915b8dee
LF: Scala type checker handle exceptions (#8364)
* LF: Scala type checker handle exceptions

This includes some fixes of the DAML-LF specifications.

This is part of #8020.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-04 13:47:15 +01:00
Remy
92b3bfd825
Java coden: itegration test for Generic Map (#8362)
This part of #2256.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-04 11:01:05 +01:00
Moritz Kiefer
b324fc4551
Port //daml-lf/(transaction|language) to Scala 2.13 (#8343)
changelog_begin
changelog_end
2021-01-04 10:54:38 +01:00
Gary Verhaegen
b45e37991f
update test sha for copyright update (#8361)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-01 22:16:37 +00:00
Gary Verhaegen
a925f0174c
update copyright notices for 2021 (#8257)
* update copyright notices for 2021

To be merged on 2021-01-01.

CHANGELOG_BEGIN
CHANGELOG_END

* patch-bazel-windows & da-ghc-lib
2021-01-01 19:49:51 +01:00
azure-pipelines[bot]
578df70a27
update NOTICES file (#8357)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-01-01 16:56:02 +01:00
Gary Verhaegen
93f449d245
rename master to main (#8245)
As we strive for more inclusiveness, we are becoming less comfortable
with historically-charged terms being used in our everyday work.

This is targeted for merge on Dec 26, _after_ the necessary
corresponding changes at both the GitHub and Azure Pipelines levels.

CHANGELOG_BEGIN

- DAML Connect development is now conducted from the `main` branch,
  rather than the `master` one. If you had any dependency on the
  digital-asset/daml repository, you will need to update this parameter.

CHANGELOG_END
2020-12-27 14:19:07 +01:00
azure-pipelines[bot]
c33140cf88
update compat versions for 1.6.1 (#8349)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-12-26 12:15:19 +01:00
Robin Krom
de9771810d
navigator: ignore project parties flag (#8348)
* navigator: ignore project parties flag

This adds a flag '--ignoreProjectParties' to navigator such that
parties specified in the daml.yaml file are ignored and the
`PartyManagementService` is queried for parties instead.

This is part of #6099.

CHANGELOG_BEGIN
CHANGELOG_END

* add flag to

* add flag to daml ledger navigator

* Update navigator/backend/src/main/scala/com/digitalasset/navigator/config/Arguments.scala

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>

* remove config file from daml ledger navigator command

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2020-12-21 16:57:29 +01:00
Gerolf Seitz
5a0a683e89
Release 1.6.1 (#8345)
CHANGELOG_BEGIN
CHANGELOG_END
2020-12-21 15:17:34 +01:00
Moritz Kiefer
f3e481525c
Fix compare.sh again (#8346)
Turns out bash is hard and I’m stupid :sadpanda:

We need to write thoutput to stderr, otherwise this ends up in the
JSON output which obviously is not valid JSON.

changelog_begin
changelog_end
2020-12-18 20:59:38 +00:00
Moritz Kiefer
0391b867ee
Fix compare.sh in perf test (#8344)
We changed the patch to target more than one file which made the
checkout insufficient for restoring the state and then the following
git checkout of current fails with:

```
error: Your local changes to the following files would be overwritten by checkout:
        stack-snapshot.yaml
```

A git reset --hard should make sure everything gets reset.

changelog_begin
changelog_end
2020-12-18 20:59:22 +01:00
Samir Talwar
4447685755
ledger-on-memory: Don't bother with fingerprints. [KVL-747] (#8340)
* ledger-on-memory: Don't bother with fingerprints.

Instead, just compare values during post-execution.

This has no semantic change, as the "fingerprints" were simply the
serialized bytestrings of the DAML state values. We now just compare the
DAML state values instead.

This change also removes fingerprints entirely from the kvutils code.
Ledgers that use fingerprinting can (and already do) can transform the
state values to include those fingerprints, if necessary.

CHANGELOG_BEGIN
- [Integration Kit] kvutils no longer supports fingerprints directly.
  Instead, if the ledger fingerprints the code, you can use the newer,
  more generic APIs to transform the state values to include those
  fingerprints, if necessary.
CHANGELOG_END

* kvutils: Make `PreExecutingSubmissionValidator` non-final.

It doesn't have a corresponding interface/trait, and it's useful to be
able to mock it.
2020-12-18 17:07:28 +00:00
Remy
9ba146a3e4
LF: Preview of LF 1.11 (#8280)
First step of LF 1.11 release #7139

Preview version is not stable and cannot be used in the ledger only in dev mode.

CHANGELOG_BEGIN
CHANGELOG_END
2020-12-18 17:08:22 +01:00
Robin Krom
ca83649468
hotreload: archive active contracts (#8192)
* hotreload: archive active contracts

Fixes #8162. This archives all active contracts on the ledger when a
hotreload is performed. A hidden command `reset` is added to `daml
ledger` to perform the reset against a running sandbox.

CHANGELOG_BEGIN
CHANGELOG_END

* don't reset when no parties are allocated

* hlint

* reuse tokenFor

* remove unused imports

* add applicationId to token

* remove readAs field from command

* use uuid as cmdId

* remove token from reset command

* batch cmds in size of 100

* remove comment about todo, remove readAs from token
2020-12-18 17:00:09 +01:00
Andreas Herrmann
20cf6fcbd0
Make auth callback URIs configurable (#8342)
* Make middleware callback URI configurable

changelog_begin
changelog_end

* Make trigger service callback URI configurable

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-12-18 14:39:27 +00:00
nickchapman-da
a7891a32b5
Avoid duplicating template let bindings (#8259)
* update ghc-lib patch hash

* update stack-snapshot.yaml

* update ghc-lib patch again

changelog_begin
changelog_end

* update stack-snapshot.yaml

* bazel run @stackage-unpinned//:pin (on linux)

* update ghc patch -- no singleton tuples!

* update stack-snapshot.yaml

* update stackage_snapshot.json

* expect error just once, not repeated 5 times

* remove 4x: --ghc-option -Werror

* ghc-lib patch

* stackage_snapshot.json

* stackage_snapshot.json (really, last commit was the yaml)

* Revert "remove 4x: --ghc-option -Werror"

This reverts commit 34b65fc7b1.

* ci/da-ghc-lib/compile.yml

* stack-snapshot.yaml

* stackage_snapshot.json

* stack pin on windows
2020-12-18 14:33:28 +00:00
Sofia Faro
b70770ebe7
Disable daml assistant's update-check by default. (#8341)
Also disables auto-install on Windows, since installation-related
errors range from "simple error message" to "program hangs forever",
and users can bypass "daml install" by downloading the new installer.

changelog_begin

- [DAML Assistant] The update-check is disabled by default for
  newer installations. In addition, auto-install is disabled by
  default on Windows. See here for instructions on how to
  configure these settings manually: https://docs.daml.com/tools/assistant.html#global-config-file-daml-config-yaml

changelog_end
2020-12-18 13:10:29 +00:00
Matthias Schmalz
6bdfadd06c
Shutdown the GrpcServer and LedgerClient, even if there are active subscriptions (#8279)
* Shutdown the GrpcServer and LedgerClient, even if there are active subscriptions.
* Shutdown ledger client in navigator integration test.
* When shutting down GrpcServer, await termination for 1 second to give the reset service time to gracefully complete an ongoing reset request.

changelog_begin
changelog_end
2020-12-18 14:02:38 +01:00
Gary Verhaegen
e51838efff
fail on failed perf check (#8334)
Today the [perf check failed], but we got no notification of it. I'm not
sure what's happening as I can't reproduce any of it locally: not only
does the `bazel run` command work for me (despite the ghc-lib URL
returning a 404 when I try it manually), I also can't reproduce the fact
that Bash, on CI, doesn't seem to fail on either the `bazel run` error
or the fact that on the next line `cat` tries to access a file that
doesn't exist (for which CI does print the error message).

This PR does two things:

- Add an explicit check that _should_ get Bash to actually fail should
  this happen again in the future. It is not a great fix but at least
  we'll know if it happens again (to the best of my knowledge today was
  the first time we hit this).
- Amend the existing patch we apply on the baseline commit to use the
  GCS-hosted ghc-lib packages.

CHANGELOG_BEGIN
CHANGELOG_END

[perf check failed]: https://dev.azure.com/digitalasset/daml/_build/results?buildId=64395&view=results
2020-12-18 13:42:54 +01:00
Moritz Kiefer
cb57ad374c
Port //daml-lf/data to Scala 2.13 (#8321)
* Port //daml-lf/data to Scala 2.13

changelog_begin
changelog_end

* factor common ImmArraySeq code to version-agnostic file

- ImmArraySeq itself is agnostic; the 2.12 and 2.13 versions contain
  implementation mixins/superclasses for parts that must be specific.  The 2.13
  version will collapse into the agnostic version when 2.12 support is no longer
  desired

* factor common InsertOrdMap code to version-agnostic file

- InsertOrdMap itself is agnostic; the 2.12 and 2.13 versions contain
  implementation mixins/superclasses for parts that must be specific.  The 2.13
  version will collapse into the agnostic version when 2.12 support is no longer
  desired

* factor common InsertOrdSet code to version-agnostic file

- InsertOrdSet itself is agnostic; the 2.12 and 2.13 versions contain
  implementation mixins/superclasses for parts that must be specific.  The 2.13
  version will collapse into the agnostic version when 2.12 support is no longer
  desired

* factor Map removal

* Move ImmArraySeq back into ImmArray

changelog_begin
changelog_end

* Type assertion instead of symbol

changelog_begin
changelog_end

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2020-12-18 13:20:15 +01:00
Remy
063ce6dc0f
LF: update LF parser with exceptions (#8332)
CHANGELOG_BEGIN
CHANGELOG_END
2020-12-18 13:06:24 +01:00
Moritz Kiefer
df98ee0107
Support multi-party submissions in DAML Script over JSON API (#8339)
* Support multi-party submissions in DAML Script over JSON API

changelog_begin

- [DAML Script] Multi-party submissions are now also supported over
  the JSON API.

changelog_end

* Fix outdated comment

changelog_begin
changelog_end
2020-12-18 12:45:34 +01:00
Moritz Kiefer
433a4e0e29
Test multi-party submissions in DAML Script over gRPC (#8331)
changelog_begin

- [DAML Script] Multi-party submissions are also supported over gRPC.

changelog_end
2020-12-18 09:57:25 +01:00
Samir Talwar
cb0f681932
kvutils: Remove fingerprints from the PreExecutingValidatingCommitter. [KVL-747] (#8337)
* ledger-on-memory: Create type aliases for caches.

* kvutils: Move caching out of the committer and into the constructor.

* kvutils: Move `reader.map` into the conflict detector.

* kvutils: Remove `LogResult` from the `PreExecutingValidatingCommitter`.

By making it covariant, we can just use `Any`, as we don't care about
the actual type.

* kvutils: Pull the state type out of `PreExecutingValidatingCommitter`.

It is now generic over state types.

CHANGELOG_BEGIN
CHANGELOG_END
2020-12-18 08:13:14 +00:00
Samir Talwar
72b00a05f2
kvutils: Avoid serializing keys and values except when necessary. [KVL-747] (#8319)
* kvutils: Let users pass an `Iterable`, not just a `Seq`, to StateReader.

* kvutils: Avoid serializing keys and values except when necessary.

This simplifies the state-reading operations considerably.

CHANGELOG_BEGIN
CHANGELOG_END

* kvutils: Remove knowledge on fingerprints from conflict detection.

Generics forever.

* kvutils: Move FingerprintedReadSet.

* kvutils: Remove the `fingerprint` test helper.

* kvutils: Make equality-based post execution even more generic.

* kvutils: Be less variant in the PostExecutionConflictDetector types.
2020-12-18 06:54:40 +00:00
Moritz Kiefer
494077cb3d
Support multi-party submissions in the JSON API (#8328)
* Support multi-party submissions in the JSON API

changelog_begin

- [JSON API] Add support for multi-party submissions by allowing for
multiple actAs parties in the token and passing on readAs to the
ledger.

changelog_end

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

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

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2020-12-17 21:10:09 +00:00
Remy
a8c4f1661b
LF: Add exceptions to Scala DAML-LF AST (#8312)
This advances states of #8020.

CHANGELOG_BEGIN
CHANGELOG_END
2020-12-17 17:45:32 +01:00
Remy
649f740efd
LF: retire ValueVersion (#8303)
use TransactionVersion instead.

This is part of #7788

CHANGELOG_BEGIN
CHANGELOG_END
2020-12-17 17:35:43 +01:00
Gary Verhaegen
403990dfd7
reenable Windows cache (#8329)
See #8326.

CHANGELOG_BEGIN
CHANGELOG_END
2020-12-17 15:58:01 +01:00
Sofia Faro
33df124d84
Throw exceptions directly. (#8320)
* Update protobuf to throw exceptions directly.

Part of #8020. This PR changes the exception protobuf and AST (Haskell
side) to make exceptions be thrown directly via a primitive expression
(EThrow), instead of wrapping them up via AnyException.

changelog_begin
changelog_end

* Rename MakeAnyException to ToAnyException

* update EToAnyException field names

* Missing stuff

* missing scala case

* Make AnyException unserializable

* reindex protobuf builtins

* meaningless change

* refrobulate

* change pretty
2020-12-17 14:14:46 +00:00
Gary Verhaegen
604787eb07
fix Slack notifications (#8327)
CHANGELOG_BEGIN
CHANGELOG_END
2020-12-17 14:32:49 +01:00
Robert Autenrieth
f3d8f05070
Enable multi-party submissions [KVL-708] (#8266)
* Remove single-party check

CHANGELOG_BEGIN
- [Ledger API] The ledger API now supports multi-party submissions.
  In order to use multi-party submissions, use the new act_as and
  read_as fields in submission requests.
CHANGELOG_END

* Remove usage of temporary SubmitterInfo methods

* Fix validator tests

* Fix auth test

* Add multi-party tests to the ledger API

* Fix compile errors

* Improve tests

* Remove temporary single-party method from SubmitterInfo

* Remove temporary single-party method from SubmitterInfo companion object

* Remove temporary single-party method from TxEntry

* Run multi-party submission ITs for ledger-on-memory and ledger-on-sql

* Minor improvement

Co-authored-by: Kamil Bozek <kamil.bozek@digitalasset.com>
2020-12-17 13:42:39 +01:00
Moritz Kiefer
b32789025e
Reset Windows cache (#8326)
changelog_begin
changelog_end
2020-12-17 12:24:07 +00:00
Moritz Kiefer
a8776b0ba1
Fix documentation for InclusiveFilters (#8322)
As discussed in
https://discuss.daml.com/t/registeredtemplates-behaves-as-allindar/1789/5?u=cocreature
the current behavior doesn’t match the docs. There doesn’t seem a good
usecase to change the existing behavior so adapting the docs seems
more sensible.

changelog_begin
changelog_end
2020-12-17 08:33:35 +01:00
Jost Berthold
04a6d4c86c
HOTFIX bump versions for Haskell LF libraries (#8287)
* HOTFIX update LF lib extraction to 0.1.8.0 + add new things

* HOTFIX add a dummy project file for testing

CHANGELOG_BEGIN
CHANGELOG_END
2020-12-17 17:41:09 +11:00
Robin Krom
fa9b470249
install script: check available disk space (#8317)
* install script: check available disk space

This fixes #6993. We check that /tmp offers enough space to extract the
sdk tarball and fail otherwise. An alternative extraction directory can
be set by setting the TEMPDIR environment variable.

CHANGELOG_BEGIN
CHANGELOG_END

* don't remove user specified directory

CHANGELOG_BEGIN
CHANGELOG_END

* Update daml-assistant/get-daml.sh

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2020-12-16 18:15:01 +01:00
Samir Talwar
021697fff7
kvutils: Remove fingerprints from the pre-executing validator. [KVL-747] (#8296)
* kvutils: Remove fingerprints from the pre-executing validator.

The submission validator doesn't care about fingerprints, it only needs
to know about them in order to discard them from the state value. This
introduces a new typeclass, `HasDamlStateValue`, which can be customized
for various state value types to make submission validation generic.

A little more code for now, but we're setting things up so it can be
deleted later.

CHANGELOG_BEGIN
CHANGELOG_END

* kvutils: Add more comments for `PreExecutingSubmissionValidator`.
2020-12-16 15:15:08 +00:00
nickchapman-da
2d511b449d
Make choice observers mandatory when available. (#8316)
* Make choice observers mandatory when available.

This is an invariant of the DAML-LF proto.

The haskell AST allows missing choice observers for any version, because the AST represents what was written in the syntax. However, if we are targeting a new DAML-LF version (>= `featureChoiceObservers`) then `Nothing` is converted to `Just (ENil TParty)` by the haskell encoder (`EncodeV1.hs`) to satisfy the proto invariant.

On the scala side, the decoder (`DecodeV1.scala`) now insists that choice observers are present when_ the version is new. (>= `LV.Features.choiceObservers`).

changelog_begin
changelog_end

* LF: LF encoder generate always choice observer if lf >= 1.dev (#8318)

This is a follow up of #8316.
This advances the state of #7709

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Remy <remy.haemmerle@daml.com>
2020-12-16 14:38:25 +00:00
Gary Verhaegen
7a5940d076
ts: generated code includes Template.QueryResult (#8315)
See [discourse].

[discourse]: https://discuss.daml.com/t/best-practice-for-getting-ledger-state-in-multiple-nested-react-components/1814/3

CHANGELOG_BEGIN

* [JavaScript Client Libraries] When using our React wrapper from
  TypeScript, users could end up having to manually reconstruct a
  `QueryResult` type for a specific template, leading to code looking
  like (assuming a `User` template):
  ```
  const allUser: QueryResult<User.User, User.User.Key, typeof User.User.templateId> = useStreamQueries(User.User);
  ```
  Our codegen will now generate an additional type definition per
  template such that the above can be rewritten as
  ```
  const allUser: User.User.QueryResult = useStreamQueries(User.User);
  ```
  Developers using our JavaScript bindings directly (i.e. without taking
  advantage of the TS type definitions) are not affected. Existing
  (long-form) type declaractions will also keep working.

  Note: In order to make this change, we had to move the definition of
  the `QueryResult` type from the `@daml/react` package to the
  `@daml/ledger` package. However, the `@daml/react` package is still
  exporting it as before, so this is a backwards-compatible change.

CHANGELOG_END
2020-12-16 14:31:36 +01:00
azure-pipelines[bot]
5073f56595
rotate release duty after 1.8.0-snapshot.20201215.5907.0.a6ed34c5 (#8307)
@sofiafaro-da is taking care of 1.8.0-snapshot.20201215.5907.0.a6ed34c5 (#8306), so they get pushed back to the end of the line.

Please do not merge this before #8306.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-12-16 13:12:06 +00:00
curiousleo-da
edae9ddb33
Add spans for index DB reads [LPF-270] (#8239)
CHANGELOG_BEGIN
- [Integration Kit] Emit OpenTelemetry spans and events for index DB
  reads
CHANGELOG_END
2020-12-16 12:39:24 +01:00
Moritz Kiefer
fbf1820f94
Fix slack escaping (#8311)
The previous escaping syntax doesn’t seem to work (after the first
layer you no longer have a variable) and has broken our build
reporting completely.

changelog_begin
changelog_end
2020-12-16 11:18:41 +00:00