Commit Graph

6494 Commits

Author SHA1 Message Date
Stefano Baghino
72951b8416
Temorarily cut compatibility tests with incompatible versions of Daml-LF (#8957)
These cause spurious failures on CI.

As described in the code, the proper fix is to use the correct Daml-LF version for every pair.

changelog_begin
changelog_end
2021-02-26 09:55:43 +00:00
Moritz Kiefer
623f4e27b7
Commit compatibility/.bazelrc (#8955)
We initially did not commit this since keeping it in sync is
annoying. We cannot use a symlink because Windows. However, it changes
sufficiently rarely that checking it in + a check that the two are in
sync seems less fragile than the current state.

changelog_begin
changelog_end
2021-02-25 19:53:30 +01:00
Gary Verhaegen
76ef72b378
tweak release instructions (#8948)
1. Correct link for the releases page
2. Move Windows up because I thought I was done with Windows after the
   create-daml-app test and I killed my machine.

CHANGELOG_BEGIN
CHANGELOG_END
2021-02-25 18:49:07 +01:00
Gary Verhaegen
e94b7b0d03
hopefully release 2.12 (#8953)
See #8951.

CHANGELOG_BEGIN
CHANGELOG_END
2021-02-25 18:38:12 +01:00
Moritz Kiefer
0617fbde6f
Fix Scala release process again (#8951)
Turns out, attempt 1 at fixing the release process didn’t go as
planned. We only released Scala 2.13 artifacts but called some of them
2.12. Now you can argue that’s a feature but unfortunately some people
disagree so this PR fixes the issue:

While we took care to read the poms while the env var is still set we
had a single copying step at the end where the files were already
overwritten. This PR changes that by copying after each call to `bazel
build` to make sure that things are not overwritten.

This does slightly change the semantics, if you have an error (e.g.,
invalid group id, missing dep, …) we will now copy parts to the
release dir whereas before we copied all or nothing. I don’t see any
issues arising from it so I don’t think copying to a temp dir or
something like that to avoid this is worth the complexity.

changelog_begin
changelog_end
2021-02-25 15:18:09 +00:00
azure-pipelines[bot]
6f8eda2e01
rotate release duty after 1.11.0-snapshot.20210223.6368.0.09c46cf6 (#8925)
@garyverhaegen-da is taking care of 1.11.0-snapshot.20210224.6385.0.dba114a2 (#8945), so they get pushed back to the end of the line.

Please do not merge this before #8924.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-02-25 14:37:34 +01:00
Gary Verhaegen
1b56b31e80
document potentially-surprising Month <-> Enum (#8923)
Based on a [forum question] by Alxander Bernauer.

[forum question]: https://discuss.daml.com/t/enum-instance-for-month-is-misleading/2098?u=gary_verhaegen

CHANGELOG_BEGIN
CHANGELOG_END
2021-02-25 10:33:52 +01:00
Moritz Kiefer
e080b81f0b
Snapshot release attempt 2 (#8945)
This time including #8943 which hopefully fixes the issue.

changelog_begin
changelog_end
2021-02-25 10:33:25 +01:00
Stefano Baghino
fe5dd5cd72
Fix issue in retrieving signed payloads from PostgreSQL (#8941)
Closes #8935

Also adds tests for it and factors out functions shared across tests and benchmarks.

changelog_begin
changelog_end
2021-02-25 10:06:50 +01:00
Moritz Kiefer
dba114a283
Merge Maven uploads for different Scala versions (#8943)
* Merge Maven uploads for different Scala versions

It turns out Maven will abort an existing staging operation if you
create a new one. This means our jobs race against each other. We
could try to fix that by either sequencing the jobs in a clever
way (annoying and can break things like rerunning if only parts
failed), or by creating more profiles (unclear if you can even have
two profiles for the same group id, even if you do, it’s annoying to
merge).

So in this PR I (grudgingly) merged both uploads into the Haskell
script. This isn’t all bad:

1. It moves some logic from bash embedded in yaml string literals into
Haskell code.
2. It duplicates some versions but it removes duplication in other
places so overall not too much worse.
3. It does however, make things slower. We don’t run this stuff in
parallel. That said, the release step is relatively small (< 5min) and
it only runs on Linux.

We could add CLI arguments to make the Scala versions configurable for
local development. Given that this is blocking releases, I wanted to
get something in that works first and then see what we need in that regard.

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2021-02-24 20:33:53 +00:00
Moritz Kiefer
aca4b698fc
Upgrade react-scripts dependency (#8940)
Older versions emit security warnings. I went through the getting
started guide and CI should also test this so reasonable confident it
doesn’t break things™.

changelog_begin
changelog_end
2021-02-24 21:18:31 +01:00
Remy
a9b035e92e
LF: release LF 1.12 (#8856)
CHANGELOG_BEGIN

    - [LF] Release LF 1.12. This version reduce the size of transaction

    - [Compiler]: Change the default LF output from 1.8 to 1.11.

CHANGELOG_END
2021-02-24 21:17:33 +01:00
Gary Verhaegen
89cbd7d572
readme: send to discuss instead of so (#8939)
CHANGELOG_BEGIN
CHANGELOG_END
2021-02-24 17:59:54 +00:00
Robin Krom
7aa5522413
cheat-sheet: update to newest version (#8938)
CHANGELOG_BEGIN
CHANGELOG_END
2021-02-24 17:10:17 +00:00
Gary Verhaegen
f0f2e710c1
document HasField (#8922)
* document HasField

This is stolen directly from @sofiafaro-da's excellent [forum answer].

[forum answer]: https://discuss.daml.com/t/generating-record-update-functions-to-be-used-as-parameters/2091/3?u=gary_verhaegen

CHANGELOG_BEGIN
CHANGELOG_END

* remove currying & add warning to sue dot syntax instead

* add set -euo pipefail to preview script
2021-02-24 16:55:10 +00:00
Stefano Baghino
ab86d3fe06
Add benchmarks for non-repudiation (#8916)
* Add benchmarks for non-repudiation

Closes #8635

changelog_begin
changelog_end

* Fix issue for Scala 2.13

* Address https://github.com/digital-asset/daml/pull/8916#discussion_r581257540

* Address https://github.com/digital-asset/daml/pull/8916#discussion_r581756830

* Address https://github.com/digital-asset/daml/pull/8916#discussion_r581766829

* Address https://github.com/digital-asset/daml/pull/8916#discussion_r581772257
2021-02-24 17:04:34 +01:00
Moritz Kiefer
8ebc8d3fc8
Sort Daml REPL options to clean up --help (#8936)
Not perfect but probably much cleaner than what we had before. Some
of the orders can definitely be debated and I don’t have strong
feelings beyond the first 5 so if someone feels strongly, I’m open to
changing things.

New output:

Usage: damlc repl [DAR] [-i|--import PACKAGE]
                  [--ledger-host ARG --ledger-port ARG]
                  [--access-token-file TOKEN_PATH] [--application-id ARG]
                  [--tls] [--cacrt ARG] [--pem ARG --crt ARG]
                  [--max-inbound-message-size ARG]
                  [(-w|--wall-clock-time) | (-s|--static-time)]
                  [--project-root ARG] [--project-check]
                  [--include INCLUDE-PATH] [--package-db LOC-OF-PACKAGE-DB]
                  [--shake-profiling PROFILING-REPORT] [--jobs THREADS]
                  [--debug] [--ghc-option OPTION]
  Launch the Daml REPL.

Available options:
  -h,--help                Show this help text
  DAR                      DAR to load in the repl
  -i,--import PACKAGE      Import modules of these packages into the REPL
  --ledger-host ARG        Host of the ledger API
  --ledger-port ARG        Port of the ledger API
  --access-token-file TOKEN_PATH
                           Path to the token-file for ledger authorization
  --application-id ARG     Application ID used for command submissions
  --tls                    Enable TLS for the connection to the ledger. This is
                           implied if --cacrt, --pem or --crt are passed
  --cacrt ARG              The crt file to be used as the trusted root CA.
  --pem ARG                The pem file to be used as the private key in mutual
                           authentication.
  --crt ARG                The crt file to be used as the cert chain in mutual
                           authentication.
  --max-inbound-message-size ARG
                           Optional max inbound message size in bytes.
  -w,--wall-clock-time     Use wall clock time (UTC). (this is the default)
  -s,--static-time         Use static time.
  --project-root ARG       Path to the root of a project containing daml.yaml.
                           You should prefer the DAML_PROJECT environment
                           variable over this option.See
                           https://docs.daml.com/tools/assistant.html#running-commands-outside-of-the-project-directory
                           for more details.
  --project-check          Check if running in Daml project.
  --include INCLUDE-PATH   Path to an additional source directory to be included
  --package-db LOC-OF-PACKAGE-DB
                           use package database in the given location
  --shake-profiling PROFILING-REPORT
                           Directory for Shake profiling reports
  --jobs THREADS           The number of threads to run in parallel. When -j is
                           not passed, 1 thread is used. If -j is passed, the
                           number of threads defaults to the number of
                           processors. Use --jobs=N to explicitely set the
                           number of threads to N. Note that the output is not
                           deterministic for > 1 job.
  --debug                  Enable debug output
  --ghc-option OPTION      Options to pass to the underlying GHC

changelog_begin
changelog_end
2021-02-24 14:31:55 +00:00
Gary Verhaegen
634b38a92a
run PR builds on NOTICES updates (#8931)
CHANGELOG_BEGIN
CHANGELOG_END
2021-02-24 13:36:51 +00:00
azure-pipelines[bot]
6ab2858706
release 1.11.0-snapshot.20210223.6368.0.09c46cf6 (#8924)
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.

@garyverhaegen-da is in charge of this release.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-02-24 14:03:56 +01:00
Moritz Kiefer
abf061f694
Fix flakiness in JSON API integration tests (#8933)
The tests start the stream in parallel to submitting commands. This is
problematic since it means that those commands can either be included
in the ACS block or they can come after the ACS block. This PR polls
for the ACS block upfront which makes sure that the commands come afterwards.

changelog_begin
changelog_end
2021-02-24 14:00:19 +01:00
Gary Verhaegen
115d03fd7b
skip Oracle test on forks (#8930)
Fork builds do not have the required credentials.

CHANGELOG_BEGIN
CHANGELOG_END
2021-02-24 12:19:57 +00:00
tudor-da
b0b0b4ea09
Fetch only distinct parties in allocateMissingInformees (#8907)
CHANGELOG_BEGIN
CHANGELOG_END
2021-02-24 10:33:38 +00:00
Robin Krom
55b52f1249
daml start: less scary colors for rebuild message (#8929)
We change the color from red to yellow to inform about the possibility
to rebuild and also output the success message in green.

CHANGELOG_BEGIN
CHANGELOG_END
2021-02-24 11:32:59 +01:00
azure-pipelines[bot]
4e2f1b6886
update NOTICES file (#8926)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-02-24 11:15:46 +01:00
Moritz Kiefer
44bae76160
Support scala_deps in da_scala_benchmark_jmh (#8928)
changelog_begin
changelog_end
2021-02-24 10:46:24 +01:00
Moritz Kiefer
0bcabafd6e
Upgrade to gRPC 1.36.0 (#8927)
No particular strong reason for that one, I just prefer being on a
stable release as opposed to a random commit.

changelog_begin
changelog_end
2021-02-24 10:30:18 +01:00
Luc Bourlier
09c46cf666
Upgrades opentelemetry to 0.16.0 (#8862)
CHANGELOG_BEGIN

- [Dependencies] Upgrade io.opentelemetry:opentelemetry-api to 0.16.0

- [Dependencies] New dependency: io.opentelemetry:opentelemetry-context:0.16.0

CHANGELOG_END
2021-02-23 18:21:36 +01:00
Stefano Baghino
0191029d49
Factor out library to manage a transactor from CNR conformance tests (#8917)
changelog_begin
changelog_end
2021-02-23 16:25:26 +01:00
Miklos
911a628f6d
Relax checking of state updates [KVL-848] (#8910)
CHANGELOG_BEGIN
CHANGELOG_END
2021-02-23 11:10:13 +01:00
Remy
d17dd7e5f1
Ledger API test tool: test against legacy and preview version. (#8913)
* Ledger API test tool: test against legacy and preview version.

+ use dictionary instead of alias to map version keywords to LF version 

CHANGELOG_BEGIN
CHANGELOG_END
2021-02-23 09:19:17 +01:00
Moritz Kiefer
e82410bbae
Fix and simplify readActiveContracts in Java codegen tests (#8915)
changelog_begin
changelog_end
2021-02-22 18:17:08 +00:00
Andreas Herrmann
d0e8d696a0
Use ContractId and Party types instead of plain String (#8914)
* Use com.daml.ledger.api.refinements.ApiTypes.ContractId

https://github.com/digital-asset/daml/pull/8898#discussion_r579148842

changelog_begin
changelog_end

* Use com.daml.ledger.api.refinements.ApiTypes.Party

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-02-22 17:25:09 +00:00
Andreas Herrmann
240f7957a3
Factor out utilities from com.daml.script.dump.Main (#8912)
* Factor out getACS and getTransactionTrees

https://github.com/digital-asset/daml/pull/8898#discussion_r579146541

changelog_begin
changelog_end

* Factor out contracts and tx-trees pkg-references

changelog_begin
changelog_end

* Factor out writeDump

changelog_begin
changelog_end

* Move references helpers to TreeUtils

https://github.com/digital-asset/daml/pull/8912#discussion_r580396852

Also, use `scalaz.std.iterable._` in `TreeUtils`.

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-02-22 17:07:31 +00:00
Moritz Kiefer
8e8284c907
Retry on HttpException in release check (#8909)
ConnectionTimeout gets thrown as HttpException which seems very
sensible to retry.

changelog_begin
changelog_end
2021-02-22 17:37:08 +01:00
Moritz Kiefer
c309ef915c
Stream stdout of verify_signatures (#8911)
There is really no reason to first capture this to a String and then
putStrLn it. That only causes issues since if we crash with a non-zero
exitcode we won’t output anything.

changelog_begin
changelog_end
2021-02-22 16:03:25 +00:00
Stephen Compall
2e671e4e5d
non-empty newtypes (#8516)
* non-empty newtypes

* an operation

* add some map/set operations and make everything compile on 2.12 and 2.13

* +-: and :-+, with compatibility layer; docs

* move to nonempty package; add aliases for cons/snoc; fix SeqOps aliases

* ensure 2.12 aliases are inferrable

* groupBy1 and toList, use to prove uniqueSets's invariants

* prove immutability first

* matching variance in aliases

* prove the return property of uniqueSets, and use the proof

* tests for NonEmpty API

* rename sci alias to imm

* move RefinedOps to more obvious location

* more docs

CHANGELOG_BEGIN
CHANGELOG_END

* remove unused imports

* illustrate the scala.collection.Seq problem

* ideas for extension

* tests for toF

* tests for +-:

* explain difference with OneAnd
2021-02-22 08:54:26 -05:00
Remy
d92f2c7003
Ledger: refactor bazel packaging of tedger test tool (#8894)
improve previous generalization from #8695

- use lf version instead keyword (like 'stable', 'latest', 'dev') to
  tag actual target.  This will allow two keywords to map to the same
  versions without doing twice the compilation/test work.

- use alias to map keywords tag target to versioned tag target.

- move package manage dar to test_commong.

CHANGELOG_BEGIN
CHANGELOG_END
2021-02-22 11:41:19 +01:00
azure-pipelines[bot]
ee38cd4b02
update compat versions for 1.10.1 (#8905)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-02-22 09:05:11 +01:00
Brian Healey
ddc1af1cf3
Daml Driver for PostgreSQL additional startup options (#8823) (#8904)
* Enable migration only option for startup

CHANGELOG_BEGIN
[Daml Driver for PostgreSQL] Enable migrate only option at startup
CHANGELOG_END

* scalafmt

* Rationalize names of the sql start modes

* no op ledger

* scalafmt

* WIP: choose to run migrationOnly in Main

* revert changes to startup options for sandboxnext

* add sql-start-mode parameter to CLI, validate it

* scalafmt

* Update documentation

* delete some WIP experiments

* removed unused import

* Reorder migrate to properly initialize dao

* use lowercase delimitted options rather than initial caps for sql-start-mode options

* remove redundant parens

* exit after running migration scripts

* return future for flyway migration, only exit on complete, use cached threadpool execution context

* scalafmt

* correct options in docs to lowercase dash delimited
2021-02-19 21:35:08 +00:00
Brian Healey
99f757767d
1.10.1 release (#8902)
* 1.10.1 release

CHANGELOG_BEGIN
CHANGELOG_END

* correct SHA of 1.10.x branch

* Update LATEST

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-02-19 19:42:02 +00:00
Andreas Herrmann
68dfcc1d57
Support starting script dumps from a given offset (#8898)
* Start Daml Script Dump after an offset

changelog_begin
changelog_end

Before this offset we reproduce the ACS with simple `createCmd` command
submissions.

This current approach does not support contracts in the ACS that
reference other contracts outside the ACS, e.g. archived contracts.

* Unit test for encodeCreatedEvent

* Factor out operations from Daml Script IT test

* IT fresh tmpDir for each test case and sandbox around all

* Test Iou dump at different offsets

* Use "begin" for LEDGER_BEGIN

https://github.com/digital-asset/daml/pull/8898/files#r579144131

* unknownCidRefs

* Avoid unnecessary getTransactionTrees

* view.mapValues

* topoSortAcs fixes

* foldMap

* fmt

* warning: Unused import `import scala.collection.compat._`

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-02-19 18:10:54 +01:00
Andreas Lochbihler
b2124a6b82
Add hash function for hashing contract instances (#8900)
No need to include the agreement text because the agreement text is derived from the contract instance argument using a DAML function specified in the template

CHANGELOG_BEGIN
CHANGELOG_END
2021-02-19 16:31:01 +01:00
Andreas Lochbihler
00bffd2281
correct the causaility definition for non-stakeholder actors and choice observers (#8892)
CHANGELOG_BEGIN
aligned the formal causality guarantees for non-stakeholder actors and choice observers to the given examples
CHANGELOG_END
2021-02-19 10:16:07 +01:00
Sofia Faro
ff7f54b896
Rename tryCatchRaw to _tryCatch. (#8897)
This matches the name of other internal functions more closely, like
_toAnyTemplate and _fromAnyChoice.

changelog_begin
changelog_end
2021-02-18 18:26:08 +00:00
nickchapman-da
c93cadcc4d
Small cleanup of Speedy execution code, specifically w.r.t environment manipulation within continuations. (#8895)
changelog_begin
changelog_end
2021-02-18 17:00:05 +00:00
nickchapman-da
c31dd5c7b0
Refactor speedy code for begin/end exercise (#8878)
* Refactor speedy code so `endExercise` is performed by a new continuation `KCloseExercise`.

This is in preparation for support of unwinding the continuation stack (when an exception is thrown) through a `KCloseExercise` continuation. In this case we will need to call `abortExercise`.

changelog_begin
changelog_end

* remove unnecessary env-save/restore in KCloseExercise

* remove unnecessary SomeArrayEquals

* remove unnecessary templateId parameter to SEScopeExercise and KCloseExercise
2021-02-18 11:33:10 +00:00
Stefano Baghino
6a589cb905
Limit SDK/platform tests to the SDK HEAD (#8893)
* Limit SDK/platform tests to the SDK HEAD

```
# Instead of testing the full cartesian product of all SDK versions with
# all platform (~= Sandbox/JSON API) versions, we test the latest version of
# each with all versions of the other. This gives us a reasonable feedback
# with regards to maintaining backwards-compatibility without causing the
# test runs to grow quadratically.
```

changelog_begin
changelog_end

* Address https://github.com/digital-asset/daml/pull/8893#discussion_r578310492
2021-02-18 10:58:23 +00:00
Moritz Kiefer
b8af7196c3
Rotate release rotation (#8889)
Seems fair after having tested 2 releases today :)

changelog_begin
changelog_end
2021-02-18 11:02:25 +01:00
azure-pipelines[bot]
0b22af69da
update NOTICES file (#8891)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-02-18 09:08:24 +01:00
azure-pipelines[bot]
278205b51e
update compat versions for 1.10.0 (#8882)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-02-18 06:32:44 +01:00