Commit Graph

8450 Commits

Author SHA1 Message Date
Sofia Faro
48afb7b5ea
interface: Add inherited choice names in scala AST (#11503)
Also checks that they're right. There's no collision checking yet.

Part of #11137.

changelog_begin
changelog_end
2021-11-02 14:35:37 +00:00
akshayshirahatti-da
9f8b039be3
[Trigger-Service] Migrate tests to sandbox (#11501)
* Migrate trigger service tests to sandbox from sandbox-classic

CHANGELOG_BEGIN
CHANGELOG_END

* remove config override for EngineMode.Dev based on code review
2021-11-02 14:35:30 +00:00
Robert Autenrieth
6bafeb03e8
DPP-662 Support archivals in bench tool (#11474)
* Support archivals in bench tool

changelog_begin
changelog_end

* Rename archive_chance
2021-11-02 15:09:09 +01:00
Moritz Kiefer
63d855f202
Pass damlc build logs through daml logger (#11485)
* Pass `damlc build` logs through daml logger

This gives us some timings which can be useful in some
circumstances (I want timings around data-dependencies next).

I also changed the default log level to INFO. The `damlc build` output
doesn’t get any noisier from that.

Example output:

```
2021-11-01 15:25:17.16 [INFO]  [build]  []
Compiling foobar to a DAR.

2021-11-01 15:25:17.80 [INFO]  [build]  []
Created .daml/dist/foobar-0.0.1.dar
```

changelog_begin
changelog_end

* Adjust scenario service log level

changelog_begin
changelog_end

* Adjust tests

changelog_begin
changelog_end

* delete comment

changelog_begin
changelog_end
2021-11-02 12:10:09 +00:00
Moritz Kiefer
565dfac2e5
Bump rules_nodejs to 4.4.2 (#11495)
Ran into an issue on M1 and there has been some recent work around
that area. Not sure this actually fixes it but why not upgrade anyway.

changelog_begin
changelog_end
2021-11-02 12:02:30 +01:00
Moritz Kiefer
9214956218
Enable experimental nix command (#11498)
* Enable experimental nix command

Nix 2.4 got released which confusingly marked the nix command as
experimental despite it being actively worked on and being more stable
than before.

changelog_begin
changelog_end

* switch to CLI flag

changelog_begin
changelog_end

* Revert "switch to CLI flag"

This reverts commit 58d6a25d83.
2021-11-02 10:16:38 +00:00
Remy
f81d880bcc
LF: drop com.daml.lf.transaction.Transaction.Transaction type alias. (#11470)
After dropping type parameter from GenTransaction we do not
com.daml.lf.transaction.Transaction.Transaction type alias.  We use
instead directly com.daml.lf.transaction.VersionedTransaction, wich is
anyway more informative.

CHANGELOG_BEGIN
CHANGELOG_END
2021-11-02 10:23:17 +01:00
Moritz Kiefer
505a7f59f3
Extend debug logging around dependencies/data-dependencies (#11488)
* Extend debug logging around dependencies/data-dependencies

changelog_begin
changelog_end

* stop stealing by $s hlint

changelog_begin
changelog_end
2021-11-02 09:34:45 +01:00
Moritz Kiefer
55d35e5521
Drop TLA+ from dev-env (#11492)
Our build definitely does not depend on it. If people need it for
something else they can get it from somewhere else.

changelog_begin
changelog_end
2021-11-01 20:45:38 +00:00
tudor-da
3a5cb18e7f
[Self-service error codes] Adapt all grpc assertions to additionally take self-service error codes [DPP-680] (#11437)
* Adapt self-service error codes in conformance tests
* Assertions.assertGrpcError and assertGrpcErrorRegex assert self-service error codes based on feature descriptor
* Adapted all GRPC error assertions to expect self-service error codes as well
* Added TODO and exclusions list to conformance-test-self-service-error-codes in anticipation of some missing
self-service error codes implementation.

CHANGELOG_BEGIN
CHANGELOG_END

* Correct errorCode id assertion

* Fixed incorrect error assertion in CommandService

* Exclude entire KVCommandDeduplicationIT due to flakiness
* To be fixed in the subsequent PR
2021-11-01 20:43:47 +00:00
Remy
98e7461fc5
LF: ContractInstance should be a CidContainer (#11487)
In #11419 we drop the implicit call that convert ContractInstance in
CidContainer. Thie is used by Canton and should be restore.

Note that now ContractInstance is not polymorphic anymore, hence we
can inherite CidContainer instead of defining an implicit.

CHANGELOG_BEGIN
CHANGELOG_END
2021-11-01 18:58:47 +00:00
Marton Nagy
9afb3b36bd
Add and wire ledger-end-cache [DPP-703] (#11480)
* Add a simple cache implementation
* Add support for ReadOnlySqlLedgerWithMutableCache
* Add support for ReadOnlySqlLedgerWithTranslationCache
* Add support for sandbox-classic

changelog_begin
changelog_end
2021-11-01 17:28:36 +00:00
Andreas Herrmann
cdd2accc26
Explicitly import Java runtime from Nix/dadew (#11411)
* Fix rules_scala Windows launcher

* Define nixpkgs_java_configure

To generate a java_runtime based on a Nix provided JDK similar to how it
is done with the Python and CC toolchain.

changelog_begin
changelog_end

* Enable Nix provided Java runtime on Linux and MacOS

* Define dadew_java_configure

To import a JDK and JAVA_HOME from dadew similar to
nixpkgs_java_configure.

* Enable dadew Java runtime on Windows

* Remove now unused java_home_runtime

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-11-01 18:18:45 +01:00
nickchapman-da
b5540a9c3b
Evidence for contract-key testing (#11479)
* Split contract-key tests from engine tests, and mark for evidence.

CHANGELOG_BEGIN
CHANGELOG_END

* remove contract key tests from their original location

* evidence for unique/non-unique contract keys
2021-11-01 16:38:26 +00:00
tudor-da
78735a8d27
Less logging on //docs:generate-error-codes-json (#11486)
CHANGELOG_BEGIN
CHANGELOG_END
2021-11-01 16:33:27 +00:00
Sofia Faro
d8898b8c80
Check fixed choices in name collision checker (#11481)
* Check fixed choices in name collision checker

This is a follow up to #11364. This PR checks that the list of inherited
choice names is correct in the type checker, and moves the "fixed choice name
collision" check into the name collision checker using this data.

Haskell side only for now. Part of #11137.

changelog_begin
changelog_end

* Update compiler/daml-lf-tools/src/DA/Daml/LF/TypeChecker/Check.hs

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

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-11-01 14:52:44 +00:00
Gary Verhaegen
7a0198ba52
daml-react: allow for React 17 (#11463)
See #11358.

CHANGELOG_BEGIN

- [@daml/react] Our React bindings now request the `react` library as a
  peer dependency, and will accept React 17 in addition to the current
  React 16. For new projects, the `create-daml-app` template now uses
  React 17.

CHANGELOG_END
2021-11-01 15:29:42 +01:00
Moritz Kiefer
c415d9d1ee
Migrate trigger tests from sandbox-classic to sandbox (#11478)
Deliberately does not include the tests for the trigger service.

changelog_begin
changelog_end
2021-11-01 14:22:51 +00:00
Moritz Kiefer
f9ec12be12
Add cocreature as a codeowner of the docs (#11450)
* Add cocreature as a codeowner of the docs

Currently we have no active codeowner of the docs which is an
unfortunate situation since PRs just end up sitting until someone
happens to find it or someone else asks for a ping.

Not necessarily saying I’m the right one to review all docs but I can
at least make sure PRs advance.

changelog_begin
changelog_end

* Update CODEOWNERS

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* Update CODEOWNERS

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2021-11-01 13:41:04 +00:00
tudor-da
a79cc08687
DbDispatcher handles SQL exceptions with self-service error codes [DPP-690] (#11435)
* DbDispatcher handles transient and non-transient SQL exceptions with specific error codes

CHANGELOG_BEGIN
CHANGELOG_END

* Handle retries when verifying ledger id

* Addressed Pawel's comments

* Logging clean-up and small refactoring

* Exhaustive match against Oracle and PSQL exceptions
2021-11-01 13:35:33 +01:00
azure-pipelines[bot]
164cdbbd7d
update compat versions for 1.18.0-snapshot.20211026.8179.0.e474b2d1 (#11426)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-11-01 12:59:45 +01:00
Sofia Faro
741a6e75a7
interfaces: Add list of fixed choices in TemplateImplements structure. (#11364)
* interfaces: Add fixed choices in TemplateImplements

To make template choice collision checks local.

changelog_begin
changelog_end

* LF completer

* lint

* scary non-shadowing

* improve comment

* change field name
2021-11-01 11:51:51 +00:00
Gary Verhaegen
79505b5474
oracle debug (#11386)
Collect Oracle logs for further debugging.

CHANGELOG_BEGIN
CHANGELOG_END
2021-11-01 12:19:01 +01:00
Moritz Kiefer
257d5365c2
Switch from sandbox to sandbox-classic in daml test-script (#11476)
* Switch from sandbox to sandbox-classic in daml test-script

changelog_begin
changelog_end

* apparently sadbonx next also has ce and ee

changelog_begin
changelog_end
2021-11-01 10:42:46 +00:00
fabiotudone-da
e91ced54f3
KV: generate self-service error docs [KVL-1148] (#11431)
* Differentiate committer deduplication error code

* Let error docs generator tolerate `deprecated`

* Generate error documentation for KV

CHANGELOG_BEGIN
- [Integration Kit] Document KV-specific self-service errors
CHANGELOG_END

* Cleanup ErrorCodeDocumentationGenerator

* Add test case for deprecated errors

* Improve ErrorCodeDocumentationGenerator.getAnnotations

* Fix test

* Factor annotationTypeName

* Fix formatting

* Use case class for annotations and deal with missing ones in convertToDocItem

* Improve cause wording for KV duplicate command self-service error

* Simplify error message

Co-authored-by: tudor-da <tudor.voicu@digitalasset.com>

Co-authored-by: tudor-da <tudor.voicu@digitalasset.com>
2021-11-01 10:13:06 +00:00
Moritz Kiefer
8ffd835f24
Migrate daml script tests to Sandbox next (#11472)
* Migrate daml script tests to Sandbox next

This does not yet drop all dependencies from daml script. In
particular `daml test-script` still depends on Sandbox classic. Will
tackle that in a separate PR.

changelog_begin
changelog_end

* Speedup maxInboundMessageSize tests

changelog_begin
changelog_end
2021-11-01 09:08:32 +00:00
nicu-da
df65d02c4e
Exclude dedup tests affected by current changes (#11471)
CHANGELOG_BEGIN

CHANGELOG_END
2021-10-29 21:28:56 +02:00
Robin Krom
45beaf7aac
interfaces: typecheck for precond, haskell side. (#11468)
This adds the typecheck for the interface precondition on the Haskell
side.

CHANGELOG_BEGIN
CHANGELOG_END
2021-10-29 14:36:32 +00:00
Remy
e445fe1aee
LfEngineToApi conversions do not have to deal with version. (#11414)
CHANGELOG_BEGIN
CHANGELOG_END
2021-10-29 15:57:09 +02:00
Remy
d3712745e2
Sandbox-classic: contracts sent to the engine do not need enrichment (#11416)
CHANGELOG_BEGIN
CHANGELOG_END
2021-10-29 15:56:36 +02:00
Moisés Ackerman
05312f1ca0
Lift out constraint tuples to synonyms in dfun contexts (#11467)
This is because otherwise GHC expands them out as regular constraints.

Closes #11455
Similar to #9663

changelog_begin
changelog_end
2021-10-29 15:52:46 +02:00
pbatko-da
a492a6cad0
[DPP-636] Update docs on MacOS firewall issue when running tests (#11460)
CHANGELOG_BEGIN
CHANGELOG_END
2021-10-29 14:24:52 +02:00
azure-pipelines[bot]
5a85881cfa
rotate release duty after 1.18.0-snapshot.20211026.8179.0.e474b2d1 (#11422)
@akshayshirahatti-da is taking care of 1.18.0-snapshot.20211026.8179.0.e474b2d1 (#11421), so they get pushed back to the end of the line.

Please do not merge this before #11421.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2021-10-29 14:02:50 +02:00
Marton Nagy
1096f9144b
Adds default keepalive support for postgreSQL [DPP-697] (#11453)
Problem: default keep alive is inherited for the OS for postgres which takes 2h
until the server releases held locks in corner cases. This can cause the indexer
being unable to start up due to HA exclusion.

Solution: setting reasonably small settings for connections, which hold locks.

changelog_begin
changelog_end
2021-10-29 13:57:52 +02:00
Marton Nagy
379996348f
Fix akka-streams shutdown at LedgerConfigurationSubscriptionFromIndex (#11462)
changelog_begin
changelog_end
2021-10-29 13:57:13 +02:00
Stefano Baghino
e89da7c1ed
Move non-repudiation proxy conformance tests to their own package (#11464)
... and tag them as manual since they are not under active development.

changelog_begin
changelog_end
2021-10-29 13:24:03 +02:00
Robin Krom
b98a3ade29
interfaces: precondition, scala ast, decoder/encoder (#11452)
* interfaces: precondition, scala ast, decoder/encoder

This adds the interface precondition to the scala Daml LF AST, plus
decoder/encoder and the typechecker.

CHANGELOG_BEGIN
CHANGELOG_END

* Update daml-lf/archive/src/main/scala/com/digitalasset/daml/lf/archive/DecodeV1.scala

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

* format

Co-authored-by: Remy <remy.haemmerle@daml.com>
2021-10-29 10:10:55 +00:00
Moritz Kiefer
fd973e6b86
Drop assistant integration tests for relative/absolute DAML_PROJECT (#11461)
Let me provide some justification:

1. We used to have a bug around this in the assistant. This got fixed
in https://github.com/digital-asset/daml/pull/7142 together with unit
tests. https://github.com/digital-asset/daml/pull/7150 then added an
integration test. Finally
https://github.com/digital-asset/daml/pull/8032 as part of refactoring
also added a test for absolute paths.
2. As shown in https://github.com/digital-asset/daml/issues/11218
those tests together currently take more than 50s (locally without
load).
3. On the other hand, they don’t really seem to add any meaningful
coverage over the unit tests.

So overall, those tests don’t seem to test anything particularly
useful that isn’t tested elsewhere while they are very slow so
deleting them seems like the best strategy.

changelog_begin
changelog_end
2021-10-29 09:04:11 +00:00
Stefano Baghino
05505e3d03
Multiplex multiple virtual query streams through a single web socket (#10221)
* Initial work-in-progress

changelog_begin
[TS bindings] When using daml-react and daml-ledger, all streaming request to the query endpoint will be multiplexed through a single web socket.
changelog_end

* Minor touches, renaming

* Handle offsets received from the JSON API

* Create state array once per downstream consumer

* Handle reconnections as streamSubmit does

* Don't share mutable state between events

* Fix compilation errors

* Remove language-support/ts/package-lock.json

* Remove --downlevelIteration option, materialize iterators, fix one test

* I will refrain from commenting on the meaning of `this` in JavaScript

* WebSocket does not have a removeAllListeners method

* Remove unnecessary docstring from `handleQueriesChange`

* Address https://github.com/digital-asset/daml/pull/10221#discussion_r670441680

* Address https://github.com/digital-asset/daml/pull/10221#discussion_r670427941

* Address https://github.com/digital-asset/daml/pull/10221#discussion_r670448474

* Address https://github.com/digital-asset/daml/pull/10221#discussion_r670473307

* Fix some failing tests and linting fixes

* fix reconnect on server close test

* fix failing tests in test.ts and create-daml-app tests

* Update language-support/ts/daml-ledger/index.ts

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* Update language-support/ts/daml-ledger/index.ts

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* Update language-support/ts/daml-ledger/index.test.ts

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* Update language-support/ts/daml-ledger/index.test.ts

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* changes based on code review comments

Co-authored-by: Akshay <akshay.shirahatti@digitalasset.com>
Co-authored-by: akshayshirahatti-da <86774832+akshayshirahatti-da@users.noreply.github.com>
2021-10-29 09:20:33 +01:00
Remy
3098b70624
pretty print contract IDs properly (#11359)
CHANGELOG_BEGIN
CHANGELOG_END
2021-10-29 09:02:33 +02:00
Robert Autenrieth
bb4f4c5a40
DPP-665 Make in-flight commands configurable (#11456)
changelog_begin
changelog_end
2021-10-28 21:50:09 +02:00
Stephen Compall
bf00956143
replace OneAnd party Sets with NonEmpty Set (#11420)
* add PartySet alias for db-backend

* add PartySet alias for fetch-contracts

* add PartySet alias for http-json

* deprecate old apply

* quick builder for NonEmpty collections

* replace PartySet in db-backend

* replace PartySet in fetch-contracts

* lar.Party is also domain.Party

* add incl1 operator

* replace PartySet in http-json

* port tests

* into with Scala 2.12 needs collection-compat

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* simplify a couple functions that don't need so much data transformation now

* clean up some OneAnds and HKTs

* deal with Scala 2.12 without having warning suppression

* better, more obscure choice for Scala 2.12
2021-10-28 15:23:12 +00:00
nicu-da
570160b718
Add LoggingValue instance for Time.Timestamp (#11444)
CHANGELOG_BEGIN
[daml LF] - Add LoggingValue instance for Time.Timestamp
CHANGELOG_END
2021-10-28 07:01:04 -07:00
Moisés Ackerman
bad50a51e9
Type reexports explicitly use 'type' namespace (#11451)
This ensures that type operators are reexported correctly.

Closes #11447

changelog_begin
changelog_end
2021-10-28 15:50:58 +02:00
Robin Krom
d3b9c84908
ifaces: preconditions, proto changes (#11448)
This adds a precondition expression to the protobuf and the
encoders/decoders on the haskell side.

CHANGELOG_BEGIN
CHANGELOG_END
2021-10-28 13:15:22 +00:00
Moritz Kiefer
73718a22fa
Mark script export tests as flaky (#11449)
Not much we can do here until the underlying bug in the indexer is
fixed so marking flaky for now.

changelog_begin
changelog_end
2021-10-28 15:03:45 +02:00
Kamil Bozek
22e9e6b56e
Multi-observer command submission in the ledger-api-bench-tool [DPP-660] (#11413)
* Multi-observer command submission in the ledger-api-bench-tool

CHANGELOG_BEGIN
- [Integration Kit] - ledger-api-bench-tool can generate synthetic contracts with multiple observers
CHANGELOG_END
2021-10-28 13:54:28 +02:00
Andreas Herrmann
3eacbf9d67
Bazel cache retry on connection reset by peer (#11445)
changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-10-28 11:29:17 +00:00
Moritz Kiefer
fcc7e581cf
Make stable packages dependent on supported LF versions (#11382)
* Make stable packages dependent on supported LF versions

Note that this just introduces an API dependency, we are not yet
filtering the list of packages. For that, I’d really like to
autogenerate StablePackages.scala since I don’t want to make that
manually maintained list even more complex. But review seems easier if
we first change the usage sites and then switch to autogenerating than
trying to do both in one go.

changelog_begin
changelog_end

* Fix script export tests

changelog_begin
changelog_end
2021-10-28 11:20:42 +00:00
Stefano Baghino
6c45f099bb
Remove TODO (#11446)
Fixes #11425

changelog_begin
changelog_end
2021-10-28 11:11:07 +00:00