Commit Graph

6702 Commits

Author SHA1 Message Date
Moritz Kiefer
767e47fb94
Make occurence occur less often (#9258)
changelog_begin
changelog_end
2021-03-26 21:17:09 +01:00
Gary Verhaegen
205763e11a
correct notifs for new linux jobs (#9255)
Without this we sometimes get success notifications on Slack for failed
jobs.

CHANGELOG_BEGIN
CHANGELOG_END
2021-03-26 15:26:24 +00:00
Remy
d3dcfa932e
LF-Repl: run only scenarios marked as test (#9251)
CHANGELOG_BEGIN
CHANGELOG_END
2021-03-26 16:18:01 +01:00
Hubert Slojewski
cb422e2f67
KVL-810 Report the correct gRPC error code on failures due to concurrent transactions (#9218)
* Fix gRPC status codes for inconsistency rejections and DamlLf errors
Also, add unit tests and exclude failing compatibility and conformance tests

CHANGELOG_BEGIN

- [Integration Kit] Fix gRPC status codes for inconsistency rejections and DamlLf errors (ContractNotFound, ReplayMismatch) by changing them from INVALID_ARGUMENT to ABORTED

CHANGELOG_END
2021-03-26 15:26:33 +01:00
Gary Verhaegen
3a91cbccba
get oracle image from Docker Hub (#9252)
CHANGELOG_BEGIN
CHANGELOG_END
2021-03-26 14:43:04 +01:00
Moritz Kiefer
8790bd7d75
Upgrade ssri to address security warning (#9249)
I tried fixing it properly without a resolution but that requires an
upgrade to webpack 5 which runs into issues since the modernizr loader
we use does not support webpack 5 and at that point I gave up. I did
test navigator manually with this change.

changelog_begin
changelog_end
2021-03-26 13:01:23 +01:00
Remy
181afe4607
Daml: Add basic support for BigNumeric in 1.dev (#9243)
CHANGELOG_BEGIN
CHANGELOG_END
2021-03-26 09:00:05 +01:00
azure-pipelines[bot]
f9df848e61
update NOTICES file (#9247)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-03-26 08:24:23 +01:00
Kamil Bożek
c91d9ec3ff
Race condition test suite for the ledger-api-test-tool [DPP-274] (#9138)
* Early draft of the race condition ITs

* Archival vs Successful lookup by key test

* More descriptive failure messages

* Unsuccessful lookup vs non-transient creation test

* Double-archival test

* Fixed a test case name

* Archival vs Creation order test

* Reduced number of test templates

* Improved race test template naming

* Helper object with transaction and template utils

* Simplified transaction util

* Fixed wrong choice name

* Removed redundant println

* Formatted code changes

* Minor change

* CHANGELOG_BEGIN
- Integration Kit - added a test suite for race condition to the ledger-api-test-tool
CHANGELOG_END

* Removed unnecessary sorting of transactions

* Added explanatory comments to test cases

* Mechanism for running ledger-api-test-tool test cases multiple times

* Running each race condition test case 5 times

* Fixed WWArchiveVsNonTransientCreate test case

* Fixed flakiness of RWArchiveVsNonConsumingChoice

* Disabled RaceConditionIT in Canton tests

* Formatted code changes

* Moved RaceConditionIT to conformance tests with unique contract keys mode on for Canton

* Nicer delay mechanism

* Improved WWArchiveVsNonTransientCreate to take contention into account

* Fixed RWTransientCreateVsNonTransientCreate conditions for Canton

* Increased the delay before reading the transaction trees stream to 1 second

* Fixed incorrect conformance tests definition for RaceConditionIT

* Running race condition tests sequentially to avoid timeouts

* Simplified race condition test case definition

* Return sum of durations for repeating test cases in the ledger-api-test-tool

* Reverted previous change with computing sum of durations

* Exclude RaceConditionIT from sandbox-on-x conformance tests

* Print the number of a test run only for cases when the number of repetitions is > 1

* Fixed RWArchiveVsFetch scenario
2021-03-25 23:07:01 +01:00
Remy
6d90985667
Speedy: cleanup dynamic casting in builtins
CHANGELOG_BEGIN
CHANGELOG_END
2021-03-25 18:32:11 +01:00
Gary Verhaegen
839c97cff9
fix dev-env in clean-up (#9244)
CHANGELOG_BEGIN
CHANGELOG_END
2021-03-25 15:48:58 +00:00
Moritz Kiefer
00805aac0a
Add a profiler for engine replays (#9240)
* Add a profiler for engine replays

This is the sibling of the benchmark infrastructure for ledger
replays.

changelog_begin
changelog_end

* Add a basic test for the profiler

changelog_begin
changelog_end

* gnahhhhhhhhhh I’m tired

changelog_begin
changelog_end
2021-03-25 16:46:04 +01:00
Sofia Faro
f670daec6f
Add try-catch syntax. (#9203)
* Add try-catch syntax.

changelog_begin
changelog_end

* ++

* +++

* ++[>++<-]>

* ++[>++<-]>+

* ++[>+++<-]>

* ++[>+++<-]>+

* ++[>++++<-]>

* Use try-catch in ExceptionSyntax test

* add a syntax test for try catch

* +++[>+++<-]>

* +++[>+++<-]>+

* enable test4

* typo

* add a test with multiple patterns and guards

* final patch sha

* update stack snapshot (unix)

* update stack snapshot (win)
2021-03-25 13:36:09 +00:00
azure-pipelines[bot]
b8958c7b37
rotate release duty after 1.12.0-snapshot.20210323.6567.0.90c5ce70 (#9222)
@robin-da is taking care of 1.12.0-snapshot.20210323.6567.0.90c5ce70 (#9221), so they get pushed back to the end of the line.

Please do not merge this before #9221.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-03-25 13:27:40 +01:00
Moritz Kiefer
39377e88d6
Add unique(on)? to DA.List.BuiltinOrder (#9233)
changelog_begin

- [Daml Stdlib] Add unique(on)? as more efficient versions of unique,
  uniqueOn using the builtin daml-lf ordering.

changelog_end
2021-03-25 13:14:15 +01:00
azure-pipelines[bot]
44d1de5685
update NOTICES file (#9235)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-03-25 13:01:05 +01:00
Remy
6f84b35fc0
LF: Engine support for BigNumeric (#9220)
This is part of #8719

CHANGELOG_BEGIN
CHANGELOG_END
2021-03-25 11:52:30 +01:00
Stefano Baghino
b6f7b78990
Publish non-repudiation app fat JARs to Artifactory (#9238)
* Publish non-repudiation app fat JARs to Artifactory

changelog_begin
changelog_end

Contributes to #9097

* Address https://github.com/digital-asset/daml/pull/9238#discussion_r601264444
2021-03-25 10:48:49 +00:00
Stefano Baghino
1b7491b8c9
Remove code duplication of driver names in HTTP JSON API (#9239)
changelog_begin
changelog_end

Closes #9229
2021-03-25 10:44:54 +00:00
Remy
cd7955aae2
LF: make LF-Repl test for GenMap stable (#9237)
CHANGELOG_BEGIN
CHANGELOG_END
2021-03-25 10:10:36 +00:00
Moritz Kiefer
ca61218060
Factor out replay code into a library (#9236)
I want to add a version of the benchmark which produces a Daml profile
and don’t want to duplicate all the code.

changelog_begin
changelog_end
2021-03-25 10:56:41 +01:00
nickchapman-da
288a6cad9f
Implement structural cases for NodeRollback (#9212)
* Implement match-handling for `NodeRollback` in _structural cases_

where what the code has to do is in some sense _obvious_.

changelog_begin
changelog_end

* do cases in daml-lf/interpreter

* do cases in daml-lf/engine

* fix spello in comment

* drop Rollback nodes when normalizing for KV

* reinstate one 8020 todo

* more 8020 TODOs
2021-03-25 09:37:54 +00:00
Marton Nagy
6388396bc4
Adding first draw of sandbox-on-x concept (#9074)
Content:
-adds ReadWriteServiceBridge
-adds BridgeLedgerFactory with extra configuration
-conformance test suits

Limitations:
-no conflict checking, just replaying all submissions
-no bootstrapping from indexer persistence
-no multiple/subsequent subscription support
-conformance tests, which rely on correctness features were excluded
 -ClosedWorldIT: test should fail referencing unallocated party
 -CommandDeduplicationIT:CDStopOnCompletionFailure: creates error conditions based on racing key updates (rest is green)
 -ContractKeysIT:CKFetchOrLookup, CKNoFetchUndisclosed: these are failing due to lack of validation/conflict checking in the bridge
 -SemanticConcurrentDoubleSpend:SemanticConcurrentDoubleSpend: this is failing due to lack of validation/conflict checking in the bridge

CHANGELOG_BEGIN
[Sandbox] Proof-of-concept implementation of Sandbox-on-X
CHANGELOG_END
2021-03-25 08:35:43 +01:00
Stefano Baghino
3fa05804bf
Make non-repudiation integration exclusive to enterprise edition (#9219)
* Make non-repudiation integration exclusive to enterprise edition

Closes #9182

changelog_begin
changelog_end

* Address https://github.com/digital-asset/daml/pull/9219#discussion_r599578614

* Address https://github.com/digital-asset/daml/pull/9219#pullrequestreview-618605511

* Add aliases for CE test targets, thanks to @S11001001 for the feedback

* Uh, turns out you need a main...

* Address https://github.com/digital-asset/daml/pull/9219#discussion_r599717526

* Add missing dependency for Oracle
2021-03-24 20:25:47 +01:00
Gary Verhaegen
8f1fb6d0a1
fix slack notifs (#9234)
Revert change from #9166.

CHANGELOG_BEGIN
CHANGELOG_END
2021-03-24 18:38:41 +00:00
azure-pipelines[bot]
6eb7ee233f
update compat versions for 1.12.0-snapshot.20210323.6567.0.90c5ce70 (#9232)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-03-24 18:59:56 +01:00
Moritz Kiefer
2e335b1ef1
Fix alias for test suite (#9231)
* Fix alias for test suite

Unfortunately aliases don’t work directly for tests but test_suite
with a single test does.

changelog_begin
changelog_end

* Include tags in alias

changelog_begin
changelog_end
2021-03-24 17:13:12 +00:00
Moritz Kiefer
a8cb170ed1
Add Ord instances for Any(Template|Choice|ContractKey) (#9224)
* Add Ord instances for Any(Template|Choice|ContractKey)

This is useful to use them as map keys. We have a large application
that currently does a linear search over a potentially very large set
of contracts which can be replaced with a map lookup with this.

changelog_begin
changelog_end

* Match builtin equality for Any(Template|Choice|ContractKey)

changelog_begin
changelog_end

* Use primitives directly

changelog_begin
changelog_end
2021-03-24 16:33:14 +01:00
Moritz Kiefer
81c710f8fc
Add DA.List.BuiltinOrder module (#9226)
This provides variants of `dedup*` and `sort*` which rely on Daml-LF’s
builtin ordering (using Map internally). I don’t have microbenchmarks
but even in macrobenchmarks this is a measurable improvement which
isn’t particularly surprising.

changelog_begin

- [Daml Stdlib] Add `DA.List.Builtinorder` module. This module provides
  variants of `sort*` and `dedup*` which rely on Daml-LF’s builtin
  ordering and are significantly more efficient in some cases.

changelog_end
2021-03-24 16:33:05 +01:00
azure-pipelines[bot]
7c86c0a8c4
release 1.12.0-snapshot.20210323.6567.0.90c5ce70 (#9221)
This PR has been created by a script, which is not very smart
and does not have all the context. Please do double-check that
the version prefix is correct before merging.

@robin-da is in charge of this release.

Commit log:
```
90c5ce703a Optimize mapOptional and add more efficient findOptional (#9214)
1e0c67c306 LF: Add RoundingMode and BigNumeric in Haskell Ast (#9215)
e492603808 More manual list fusion in stdlib (#9217)
90aa84193f tuesday notif: newlines (#9213)
51c5eac66e LF: Add BigNumeric to archive proto (#9210)
615f4e4bae Support passing sandbox port via --sandbox-option --port (#9208)
349e0a0bef LF: fix package name in LF 1.12 proto snapshot (#9211)
b7aedb477b Remove contract arguments from localContracts (#9207)
c1cf2756a8 add rollback node to transactions (#9178)
2551b2d615 LF: Add BigNumeric and Rounding to Scala AST (#9205)
be4dbd971d update compat versions for 1.11.1 (#9172)
0f9ab428ee kvutils: Remove ledger dump functionality  (#9204)
f89aa294e5 damlc pkg: use cache for already present packages (#9193)
7a41ee6ce0 Cache contract fetches in speedy (#9192)
644561fe23 Bump jinja2 from 2.11.2 to 2.11.3 in /docs/scripts (#9198)
bf76e3c84a update NOTICES file (#9201)
4d90d02740 LF: drop useless field arity in Ast Builtin (#9194)
a93f89b6f8 Factor out an Oracle test fixture (#9191)
51f495e758 KVL-203 Share participant state integration test harness (#9143)
440eead6c4 Make LedgerDao a pure interface (#9186)
617e6f58e8 update NOTICES file (#9190)
587a9c95d0 Recognize (some) exerciseByKey commands in Daml script dumps (#9185)
ad94c47605 ci/docker: sync with hub (#9184)
081623b493 fix: bad package id validation (#9183)
f0c8b1240d Integrate non-repudiation into HTTP JSON API (#9180)
dbd8806848 Distinguish all four types of submits (#9179)
8c64f120da pkgid data deps (#9153)
d5ca22815d Recognize simple createAndExercise commands (#9154)
6c9679f511 Add documentation for the Daml Profiler (#9174)
a6da995ecb use representational variance for generated Scala classes (#8879)
47e0a223e7 rotate release duty after 1.12.0-snapshot.20210316.6523.0.b382fc45 (#9161)
1ea00976f0 skip compat tests on release (#9169)
c26c349c8b Generate exception instances from syntax. (#9140)
9d175ce547 Document profiling internals (#9168)
5e97c573e0 Add a test for create and exercise events in the profiler (#9151)
75f7688cae Expose unhandled exception values and types (#9158)
e4d5799907 weekly release (#9167)
370f290d3d Handle createAndExecuteCmd (#9150)
af0cb30828 Release SDK 1.11.1 (#9162)
```
Changelog:
```

- [Daml Assistant] The sandbox port can now also be configured via
  `--sandbox-option=--port=12345` instead of `--sandbox-port`. Other
  tools like Navigator, the JSON API and Daml Script will pick up the
  modified port automatically.

- [JSON API] The JAR for the HTTP JSON API is no longer published on
Maven, use the fat JAR as indicated in the documentation.

- [Daml Profiler] Daml Connect EE now includes a profiler which can be
used to profile Daml execution time.

- [Scala Codegen] Type parameters used in GenMap keys are now supported.
  See `issue #8879 <https://github.com/digital-asset/daml/pull/8879>`__.
```

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-03-24 14:16:28 +01:00
Gary Verhaegen
7c4b32aee9
use coreutils date on macos (#9228)
macOS uses BSD date by default which has slightly different options.

CHANGELOG_BEGIN
CHANGELOG_END
2021-03-24 13:35:02 +01:00
Andreas Herrmann
eb80e7b32e
Improve syntax for selecting contract ids from a transaction tree (#9216)
* Daml.Script fromTree, created(N), exercised(N)

Implements more readable transaction tree accessors. E.g.

```
let contract_1_0 = fromTree tree $
      exercised @Module.Template "Choice" $
      created @Module.Template
```

instead of

```
let contract_1_0 = createdCid @Module.Template [0, 0]
```

changelog_begin
changelog_end

* Use fromTree in daml script dump

changelog_begin
changelog_end

* Update tests

* Remove now unused createdCid

* Avoid zip of layer selectors and events

Addresses https://github.com/digital-asset/daml/pull/9216#discussion_r600243370

The zip approach would be misaligned if an event has `Kind.Empty`. This
circumvents the issue by only iterating over non-empty events.

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-03-24 12:30:27 +00:00
Moritz Kiefer
4fd1cf7c28
Fix doctests (#9225)
Haven’t tracked down when they broke. They used to work at some point
but atm they are very broken and don’t test anything.

This PR fixes the bash mess to parse the files correctly and fixes two
minor issues that creeped in by virtue of the doctests being broken.

changelog_begin
changelog_end
2021-03-24 12:56:37 +01:00
Gary Verhaegen
b0c0306696
fix release: skipping compat should not fail (#9227)
In #9169, I changed the compat jobs to not run on releases.
Unfortunately I forgot to update the `collect_build_data` job to know
about that. Hopefully after this has been merged we'll be able to rerun
\#9221.

CHANGELOG_BEGIN
CHANGELOG_END
2021-03-24 11:18:58 +00:00
azure-pipelines[bot]
46cce2a637
update NOTICES file (#9223)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-03-24 08:23:35 +01:00
Moritz Kiefer
90c5ce703a
Optimize mapOptional and add more efficient findOptional (#9214)
* Optimize mapOptional and add more efficient findOptional

Given that we don’t have list fusion catOptionals . map f is clearly
less efficient than this version.

I also added findOptional which can be pretty handy in certain cases.

changelog_begin
changelog_end

* more foldr

changelog_begin
changelog_end

* fix tests

changelog_begin
changelog_end
2021-03-23 17:07:45 +00:00
Remy
1e0c67c306
LF: Add RoundingMode and BigNumeric in Haskell Ast (#9215)
This is part of #8719.

CHANGELOG_BEGIN
CHANGELOG_END
2021-03-23 16:50:17 +00:00
Moritz Kiefer
e492603808
More manual list fusion in stdlib (#9217)
Both of these seem sufficiently common that it seems worth optimizing
them.

I realize I’m switching somewhat randomly between foldr and
hand-written recursion. Either should be better than traversing the
list twice but I think it’s a clear sign that we need some benchmarks
to establish the benefits or downsides of one over the other properly.

changelog_begin
changelog_end
2021-03-23 17:08:43 +01:00
Gary Verhaegen
90aa84193f
tuesday notif: newlines (#9213)
CHANGELOG_BEGIN
CHANGELOG_END
2021-03-23 17:03:22 +01:00
Remy
51c5eac66e
LF: Add BigNumeric to archive proto (#9210)
CHANGELOG_BEGIN
CHANGELOG_END
2021-03-23 13:58:22 +00:00
Moritz Kiefer
615f4e4bae
Support passing sandbox port via --sandbox-option --port (#9208)
--sandbox-port has caused confusion several times and cannot be
specified in daml.yaml which is a bit annoying. There isn’t really any
good reason not to support --sandbox-option --port since we can pick
up the port via the port file either way.

This change is fully backwards compatible.

changelog_begin

- [Daml Assistant] The sandbox port can now also be configured via
  `--sandbox-option=--port=12345` instead of `--sandbox-port`. Other
  tools like Navigator, the JSON API and Daml Script will pick up the
  modified port automatically.

changelog_end
2021-03-23 13:31:07 +01:00
Remy
349e0a0bef
LF: fix package name in LF 1.12 proto snapshot (#9211)
thanks to @tristan-da for catching the issue.

CHANGELOG_BEGIN
CHANGELOG_END
2021-03-23 10:42:02 +00:00
Moritz Kiefer
b7aedb477b
Remove contract arguments from localContracts (#9207)
We already store them in cachedContracts, no reason to store them
twice. This should also be slightly more efficient since we only do
one lookup in cachedContracts in the common case and only look at
localContracts if there’s a wrongly typed contract. I doubt it’s
measurable but at least it’s not worse.

changelog_begin
changelog_end
2021-03-23 09:49:53 +00:00
nickchapman-da
c1cf2756a8
add rollback node to transactions (#9178)
* New transaction node: NodeRollback. Fixup every match with a crash + TODO.

changelog_begin
changelog_end

* remove 3 methods from NodeRollback which are not needed to fulfill its interface

* add override to remaining 4 methods implemented in body of NodeRollback

* remove unrequired 2nd type parameter (Cid) from NodeRollback

* add missing 8020 marker
2021-03-23 08:49:25 +00:00
Remy
2551b2d615
LF: Add BigNumeric and Rounding to Scala AST (#9205)
This advance the state of #8719

CHANGELOG_BEGIN
CHANGELOG_END
2021-03-23 09:16:27 +01:00
azure-pipelines[bot]
be4dbd971d
update compat versions for 1.11.1 (#9172)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-03-22 18:25:07 +01:00
Miklos
0f9ab428ee
kvutils: Remove ledger dump functionality (#9204)
* Removed Debug feature directly embedded into kvutils. Removed messages for v1 export format.

* 'kvutils' => 'KV'
CHANGELOG_BEGIN
CHANGELOG_END
2021-03-22 16:07:10 +00:00
Robin Krom
f89aa294e5
damlc pkg: use cache for already present packages (#9193)
* damlc pkg: use cache for already present packages

This only downloads packages from a remote ledger, if the package is not
already present in the dependency db as a normal dependency.

CHANGELOG_BEGIN
CHANGELOG_END
2021-03-22 13:57:38 +01:00
Moritz Kiefer
7a41ee6ce0
Cache contract fetches in speedy (#9192)
* Cache contract fetches in speedy

This PR adds a cache to speedy to cache contract fetches and
information only derived from the contract argument, namely,
signatories, observers and keys.

The cache is engine-internal so on the first fetch of a global
contract in a transaction, we recompute that information.

This does not change observable semantics:

Ledgers must be consistent within a transaction so caching is safe. We
still recompute signatories, observers & keys the first time so if
they fail, we still blow u.

We also never compute more than before. While `SBUFetch` itself did
not compute that information, it was immediately folowed by either
`SBUBeginExercise` or `SBUInsertFetchNode` which compute that
information.

We also keep the optimization that we do not have to compute key and
maintainers on by-key operations

On the collect authority benchmark, this is around a ~1.48x
improvement which is pretty decent.

changelog_begin
changelog_end

* Remove dead code

changelog_begin
changelog_end

* Less stupid error handling

changelog_begin
changelog_end

* Add a test for wrongly typed contract ids

changelog_begin
changelog_end

* Check type of cached contracts

changelog_begin
changelog_end

* Update daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SBuiltin.scala

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

* Add tests for wrongly-typed contract ids to EngineTest

changelog_begin
changelog_end

Co-authored-by: Remy <remy.haemmerle@daml.com>
2021-03-22 13:39:02 +01:00
dependabot[bot]
644561fe23
Bump jinja2 from 2.11.2 to 2.11.3 in /docs/scripts (#9198)
* Bump jinja2 from 2.11.2 to 2.11.3 in /docs/scripts

Bumps [jinja2](https://github.com/pallets/jinja) from 2.11.2 to 2.11.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/master/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/2.11.2...2.11.3)

Signed-off-by: dependabot[bot] <support@github.com>

* bump lower bound

changelog_begin
changelog_end

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-03-22 09:19:17 +01:00