Commit Graph

6405 Commits

Author SHA1 Message Date
Moritz Kiefer
576d0cb758
Bump Ledger API version for LF 1.12 (#8972)
changelog_begin
changelog_end
2021-03-01 12:42:33 +00:00
Moritz Kiefer
71116b053c
Add a Ledger API changelog (#8974)
* Add a Ledger API changelog

changelog_begin
changelog_end

* Update docs/source/support/compatibility.rst

Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>

Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>
2021-03-01 12:42:27 +00:00
azure-pipelines[bot]
1da3e64f0c
update NOTICES file (#8968)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-03-01 10:49:13 +01:00
Moritz Kiefer
514bf2597e
Include table view for failed scripts (#8967)
fixes #8966

changelog_begin

- [Daml Studio] Failed scripts (and scenarios) now also offer the
  option to view the table view at the state before the failing
  transaction to ease debugging.

changelog_end
2021-03-01 09:58:01 +01:00
Moritz Kiefer
3f4cebd808
Fix daml-sdk-head Maven install (#8962)
* Fix daml-sdk-head Maven install

There were two issues:

1. The generated pom.xml used to install everything in one step
referenced the source files in the bazel directory rather than the
released artifacts. This luckily worked so far but falls apart now
since the 2.13 build overwrites the 2.12 build. Same issues that also
blew up the actual release on Thursday.

2. Two artifacts are published as shaded jars. We treated those like
Scala artifacts while they should be treated more like fat
jars. They’re not quite like those since the file paths are different
so I gave them a new release type.

changelog_begin
changelog_end

* shut up hlint

changelog_begin
changelog_end

* Fix broken comment for jarjar

changelog_begin
changelog_end
2021-02-26 21:20:04 +01:00
Robin Krom
012b04368d
damlc test: feature: add --all flag. (#8919)
* damlc test: feature: add --all flag.

This adds a flag `--all` that will test all present scenarios/scripts in
the code and also report code coverage with respect to all present
templates/choices, whereas without the flag, code coverage is reported
relative to a single package.

CHANGELOG_BEGIN
[damlc test] Added a `--all` flag to test all present scripts/scenarios.
CHANGELOG_END
2021-02-26 18:44:40 +01:00
Oliver Seeliger
e5d12e2875
Upgrade canton to 0.21.0 which supports lf-version 1.11 (#8963)
Updated crypto config and removing two sets of tests that had been
disabled against canton 0.19.0

CHANGELOG_BEGIN
CHANGELOG_END
2021-02-26 16:52:03 +00:00
Andreas Herrmann
ddf8e13705
Helpers to create test ACS and TransactionTree (#8961)
* Helpers to create test ACS and TransactionTree

changelog_begin
changelog_end

* use mutable count

c62fff7921 (r583743837)

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-02-26 16:41:36 +00:00
Moritz Kiefer
275eaedd2a
Fix closure references in Daml Repl (#8950)
* Fix closure references in Daml Repl

Turns out the comment "we probably need to extend this to merge the
modules from each line" was exactly correct: If the result evaluates
to a closure (or a value including a closure), it can reference
definitions from the current module. This happens if the simplifier
lifted something out of the current definition (otherwise we have only
one and it cannot be recursive so no chance of leaking a reference).

This PR fixes this by checking whether the result references the
current module and if it does, we keep it around.

changelog_begin
changelog_end

* Address review comments

changelog_begin
changelog_end

* fmt

changelog_begin
changelog_end
2021-02-26 13:29:42 +00:00
Stefano Baghino
929e0c12d4
Temporarily cut compatibility tests with incompatible versions of Daml-LF (#8959)
* Temporarily cut compatibility tests with incompatible versions of Daml-LF

This adds more tests to the exclusions added as part of #8957

All SDK/platform compatibility tests are not filtered to use compatible
Daml-LF versions, not just those involving the Ledger API Test Tool.

changelog_begin
changelog_end

* Fix Bazel code
2021-02-26 13:47:59 +01:00
Andreas Herrmann
4fcd2b833f
Avoid submitTree for a sequence of creates (#8952)
* use scalaz.std.iterable

* Use submitMulti for sequence of creates

Instead of submitMultiTree, which is not necessary in such cases.
Avoids redundant binds, i.e. when we only bind one result and it is from
the last action.

changelog_begin
changelog_end

* Extend EncodeTreeSpec

* Factor out encoding created events

* Factor out encodeSubmitCreatedEvents

* Remove redundant encodeSubmitCreatedEvent

* Test encoding multiple creates

* Drop redundant case

* Fix duplicate created event

* Avoid .last

* Use traverse

* Avoid silently discarded return values

* mkCreate helper in EncodeTreeSpec

* mkExercised helper in EncodeTreeSpec

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-02-26 11:29:45 +00:00
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