Commit Graph

3819 Commits

Author SHA1 Message Date
Nemanja
aee8a2485f
Added screenshots to the GSG (#5233)
* Added screenshots to the GSG

CHANGELOG_BEGIN
CHANGELOG_END

* Added copyright headers to theme/conf.py
2020-03-31 15:05:09 +02:00
associahedron
dd8a3a3518
Make new sandbox the default. (#5295)
* Make new sandbox the default.

changelog_begin

- [DAML SDK] The new sandbox is now the default that runs with ``daml sandbox`` and ``daml start``. The command ``daml sandbox-next`` has been removed. The old sandbox can be invoked via ``daml sandbox-classic`` and ``daml start --sandbox-classic=yes``.

changelog_end

* Update descriptions.

* Change it to a switch

* Change switch help

* Recapitalize
2020-03-31 12:50:21 +00:00
Remy
1d0c0df325
Scenario serice: use new contract ids (#5296)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-31 14:37:41 +02:00
associahedron
c0fe6997f4
Move PackageConfigFields and related function into a separate package. (#5275)
* Extract package config type to a separate package.

changelog_begin
changelog_end

* update copyright headers

* run buildifier-fix

* fix src_strip_prefix

* Heres the file I accidentally deleted

* buildifier-fix again
2020-03-31 12:26:13 +00:00
Moritz Kiefer
3ed21c26c7
Validate token parties on submit and query in DAML script (#5297)
This adds a validation step when running DAML script over the JSON API
to ensure that the party in the token matches the party that is passed
as an argument to `submit/query`.

changelog_begin
changelog_end
2020-03-31 14:16:16 +02:00
Stefano Baghino
aeefaa1d0c
Add queries to get flat transactions straight from the index (#5285)
* Add queries to get flat transactions straight from the index

changelog_begin
changelog_end

* Fix compilation errors

* Remove unused method, loosen transaction check

* Fix grammar in test case description

Thanks @SamirTalwar-DA

Co-Authored-By: Samir Talwar <samir.talwar@digitalasset.com>

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-03-31 14:13:14 +02:00
Martin Huschenbett
66653810ab
damlc: Drop support for reading DAML-LF 1.5 (#5294)
DAML-LF 1.6 is the baseline vesion we want to support with the next
SDK release.

CHANGELOG_BEGIN
- [DAML Compiler] Drop support for reading DARs using DAML-LF 1.5.
  Please recompile your DAML to a newer DAML-LF version in case you
  have such DARs.
CHANGELOG_END
2020-03-31 11:02:24 +00:00
Samir Talwar
a9ca9d3956
kvutils: Time transaction acquisition and release. (#5292)
* kvutils: Do less in the ledger transaction.

* kvutils: Make `SubmissionValidator#runValidation` tail-recursive.

Because otherwise IntelliJ is very unhappy.

* kvutils: Time transaction acquisition and release.

CHANGELOG_BEGIN
- [Ledger Integration Kit] Metrics for acquiring and releasing
  transactions.
CHANGELOG_END

* kvutils: Include the word "lock" in validator transaction lock metrics.

* kvutils: Record successful + failed transaction acquisitions separately.
2020-03-31 10:21:13 +00:00
Moritz Kiefer
99e56ebe22
Only catch specific grpc errors in DAML script (#5291)
It doesn’t really make sense to catch errors like PERMISSION_DENIED
and it only make the error message more confusing and debugging
harder.

changelog_begin
changelog_end
2020-03-31 11:55:52 +02:00
Moritz Kiefer
da5daf3239
Turn script over JSON API tests into a proper test suite (#5278)
This replaces the rather horrible previous setup of having a custom
test runner that spawns 3 separate JVM processes by a single scalatest
test suite that starts sandbox and the JSON API in process.

changelog_begin
changelog_end
2020-03-31 11:55:29 +02:00
Martin Huschenbett
bb1c5ed039
TypeScript libs: Enforce return type annotations (#5287)
For some reason the lint that catches missing return type annotations
was turned off. It's turned on now.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-31 09:28:23 +00:00
Remy
7185608f87
Engine: lf-repl uses to new contract ids (#5249)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-31 11:06:50 +02:00
Samir Talwar
499bb924cf
kvutils: Prefix metrics with "daml.". (#5289)
Just to get them consistent with the others.

CHANGELOG_BEGIN
- [Ledger Integration Kit] Prefixed all metrics with "daml." for
  consistency.
CHANGELOG_END
2020-03-31 08:18:29 +00:00
Andreas Herrmann
89a9f5c7d2
tarball reproducibility (#5258)
* integration-tests reproducibility

* package-app reproducibility

* Make remaining tar czf reproducible

* package-app

CHANGELOG_BEGIN
CHANGELOG_END

* Reproducibility of remaing tar invocation

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-03-31 10:09:52 +02:00
Leonid Shlyapnikov
703b588384
Error and disconnect when multiple requests coming over the same WebSocket connection (#5288)
* minor refactoring in preparation for the next test case

* allow only one input request + test, WIP

* allow only one input request + test, WIP

* Error when multiple requests coming over the same websocket connection

This never worked, we never returned anything when 2nd request received,
now we return an error and drop the connection.

changelog_begin
changelog_end

* update docs

* Fixing copyright header

* changing test description

* trying to clean wsMessageHandler up

* Reverting getTransactionSourceForParty changes
2020-03-30 18:08:54 -04:00
Samir Talwar
2e9d7adfa9
sandbox|kvutils: Use MetricRegistry.name to create metric names. (#5274)
* kvutils: Use `MetricRegistry.name` to create metric names.

String interpolation is 4TL.

* sandbox: Make the metric names of the services consistent with kvutils.

CHANGELOG_BEGIN
- [Sandbox] Move the service metrics from ``daml.sandbox.indexService``
  and ``daml.sandbox.writeService`` to ``daml.services.index`` and
  ``daml.services.write`` respectively. This brings Sandbox in line with
  the Ledger Integration Kit.
CHANGELOG_END

* sandbox: Use `MetricRegistry.name` to create metric names.

String interpolation is 4TL.
2020-03-30 20:14:06 +00:00
Shayne Fletcher
de03006470
Use sandbox '--port-file' (#5284)
* increase timeout to eternal

changelog_begin
changelog_end

* Switch to using --port-file for sandbox

changelog_begin
changelog_end
2020-03-30 15:24:42 -04:00
Shayne Fletcher
2722e7ce95
Move 'withEnv', call it from daml2ts tests (#5276)
* Move 'withEnv', call it from daml2ts tests

changelog_begin
changelog_end

* Fix withEnv call to ensure that TASTY_NUM_THREADs is set

withEnv replaces the whole environment so we need to set everything we
care about.

* withEnv replaces the whole environment so we need to set everything we
care about.

* Apparently applying the same fix has destabilized Windows

* Try even harder to get daml assistant tests passing on Windows again

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-03-30 17:20:47 +00:00
Martin Huschenbett
72e0cb6374
@daml/react: Remove unused dependencies (#5283)
The `package.json` lists some dependencies which used to be
dependencies in the past but aren't anymore.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-30 16:53:23 +00:00
Moritz Kiefer
a84311ac39
Change withEnv to not clear the whole env (#5281)
The way we use `withEnv` it is really intended to set a few
environment variables in an already existing environment instead of
clearing everything before. This PR changes it to do only that.

changelog_begin
changelog_end

closes #5280
2020-03-30 12:21:25 -04:00
Remy
3fc1175436
Engine: force recent version for serializing transactions and values. (#5232) 2020-03-30 16:29:18 +02:00
Ognjen Maric
5be5036f27
Engine: support reinterpreting LookupByKey nodes (#5271)
Fixes #5264

CHANGELOG_BEGIN

- [Engine] Support reinterpreting LookupByKey nodes

CHANGELOG_END
2020-03-30 15:13:43 +02:00
Samir Talwar
66a7fc6384
kvutils/app: Publish metrics someplace. (#5267)
* kvutils/app: Publish JVM metrics.

* kvutils/app: Sort the metrics prefixes.

* kvutils/app: Allow for specifying a metrics reporter as a CLI argument.

No changelog as this is hidden.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox: Remove an unnecessary string interpolation mark.

Co-Authored-By: Miklos <57664299+miklos-da@users.noreply.github.com>

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2020-03-30 13:00:42 +00:00
Stefano Baghino
746b774e82
Add canonical string representation for identifiers (#5270)
* Add canonical string representation for identifiers

An identifier is represented as a string as a package identifier and a qualified name separated by a colon.

changelog_begin
changelog_end

* Simplify explicit type signature for HexString

Thanks @remyhaemmerle-da

Co-Authored-By: Remy <remy.haemmerle@daml.com>

* Fix hashing test expected output

* Fix key hasher test expected output

Co-authored-by: Remy <remy.haemmerle@daml.com>
2020-03-30 12:55:11 +00:00
Samir Talwar
28b21d07c7
ledger-on-sql: Squash the migrations. (#5265)
Before this reaches production-ready status, it's time to squash the
migrations. This will improve startup performance a little.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-30 12:51:33 +00:00
Moritz Kiefer
19496482f6
Replace damlpatterns tarballs by a proper template (#5273)
There is no reason why patterns should be a tarball and the current
tarballs are broken anyway. Why do we even have 2 …

changelog_begin
changelog_end
2020-03-30 12:35:22 +00:00
Gary Verhaegen
38a5fea7a0
tweak periodic-killer (#5268)
1. Google says the instance is currently overutilized and suggests
   g1-small as a more appropriate size.
2. It occurred to me that the reason no error was logged might be that
   we lose them, so explicitly redirecting stderr too.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-30 14:12:14 +02:00
Martin Huschenbett
e11fced8c9
daml2ts: Update the TypeScript version (#5269)
Update the TypeScript version we're using in `daml2ts` and its support
libraries. Also update the versions of ESLint and its TypeScript
plugin we're using for linting the generated code. (And remove more
occurrences of `HashMap Text Text` at the same time.)

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-30 11:27:40 +00:00
Martin Huschenbett
dc617345c9
JSON API: Fix docs on WebSocket setup (#5253)
Using `on` to add event listeners is a Node.js idiom. In the brosers,
it's `addEventListener`, which works in Node.js too.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-30 13:19:25 +02:00
Moritz Kiefer
c0e28d83ee
Turn warnings for module name/record name mismatches into errors (#5266)
* Turn warnings for module name/record name mismatches into errors

The module name warning existed for ages. We started warning about the
record name mismatch in 0.13.55 so I’d like to turn it into an error
before 1.0

changelog_begin

- [DAML Compiler] File names must now match up with module names. This
  already produced a warning in previous releases.

- [DAML Compiler] It is now an error to define a record with a single
  constructor where the constructor does not match the type
  name. To fix the error you need to change ```data X = Y { … }``` to
  ```data X = X { … }```.  This restriction only applies to
  single-constructor records. Variants and enums are not affected.
  This already produced a warning in 0.13.55.

changelog_end

* Fix integration tests

* Fix docs

* Fix lsp tests
2020-03-30 10:21:53 +00:00
Moritz Kiefer
d70fa63a21
Add a proper scalatest test suite for triggers (#5250)
This PR adds a new test suite for DAML triggers based on scala test
rather than the client_server_test macro + a custom main. This seems
much nicer than the client_server_test (we get a lot of useful stuff
from scalatest, e.g., useful output of assertion failures, things
don’t blow up after the first test failure, …).

This PR only ports over a small fraction of the tests to make review
easier. The plan is then to port over everything and kill off the
existing test stuff once everything is ported over.

changelog_begin
changelog_end
2020-03-30 11:42:09 +02:00
Moritz Kiefer
a37d898e77
Remove dependency and data-dependency arguments from daml-helper (#5262)
Those were originally used for `damlc migrate`. However, that command
no longer exists and the only call site of `runNew` sets those
arguments to an empty list.

changelog_begin
changelog_end
2020-03-30 10:40:34 +02:00
Moritz Kiefer
1e296aa91f
Whitelist fetch-dar command in assistant telemetry (#5261)
changelog_begin
changelog_end
2020-03-30 10:39:55 +02:00
Remy
4cb3ea5c7c
Ledger: clean up contract id seeding (#5260)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-30 10:13:42 +02:00
Robert Autenrieth
f8cd628c2f
Remove old time model from ledger config (#5216)
* Remove old time model from ledger config

CHANGELOG_BEGIN
- [Ledger API] Fields related to the old ledger time
  model have been removed from the configuration
  management service and the ledger configuration service.
CHANGELOG_END

* Update ledger/ledger-api-test-tool/src/main/scala/com/daml/ledger/api/testtool/tests/LedgerConfigurationService.scala

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

Co-authored-by: Gerolf Seitz <gerolf.seitz@digitalasset.com>
2020-03-30 08:46:22 +02:00
mziolekda
0f3c0d66d8
docker image for ledger-on-memory (#5256)
* docker image for ledger-on-memory

CHANGELOG_BEGIN
CHANGELOG_END

* Apply suggestions from code review

Applying Samir's suggestions to the README file

Co-Authored-By: Samir Talwar <samir.talwar@digitalasset.com>

* Update ledger/ledger-on-memory/README.md

Co-Authored-By: Samir Talwar <samir.talwar@digitalasset.com>

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-03-29 10:54:12 +02:00
Robert Autenrieth
d57f78c9ef
Remove useless timeProvider in quickstart (#5247)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-28 13:25:29 +01:00
Robert Autenrieth
0a83309f1b
TTL cleanup (#5246)
* Remove documentation for a removed option

CHANGELOG_BEGIN
- [DAML Integration Kit] The CLI option command-submission-ttl-scale-factor was
  removed, as the LET/MRT/TTL fields have recently been removed
  from the command submission service.
CHANGELOG_END

* Minor renaming
2020-03-28 00:13:08 +01:00
Gary Verhaegen
7e960eb454
log periodic reboots (#5235)
It appears that most of our Windows machines have not been rebooted
since Tuesday 24. We detected this because one of them has run out of
disk space.

This is not good, but what's worse is I currently have no idea what
could be going wrong, and we are not logging anything at all in the
current setup, so even ssh'ing into the machine provides no insight.

This PR hopefully addresses that by:

1. Redirecting the outputs of the script to a file, and
2. `tail`iing that file from the startup script, so the logs will appear
   directly in the GCP web console. (This is what we currently do for
   the Azure agent logs on Linux.)

This PR also tells the script to not stop on the first failed machine
and keep trying.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 21:35:49 +01:00
Gary Verhaegen
525c4d605a
prepare playground for perf testing (#4520)
* prepare playground for perf testing

The goal of this commit is to provide me with a playground to test out
various GCP machine configurations and assess what impact they have on
build performance. I need separate pools for that as changing the
machine type requires a machine restart, which would be disruptive to
any running job if I did that in the existing pools.

The first commit in this PR does the following:

- Deactivate Bazel caching.
- Create two new machine groups (of size 1) for Linux and Windows pools.
- Disable all jobs that are not building the project on Linux or
  Windows.
- Change the Linux and Windows jobs to use the new pools.

The plan is for me to manually change the machine types in the new pool
and rerun the build repeatedly. Once I believe I have the information I
need, the expected end result for this PR is only a change to the
machine type (or no change at all if the current machine size is already
optimal). All other changes will be undone and the additional pools will
be destroyed.

Note: as of the opening of this PR, the two new pools have not been
created yet at the Azure level (this is a separate, manual step not
managed by Terraform) and the Terraform files have not been applied.

See corresponding PR (#4520) for full details. The gist of it is:
- We need at least 28GB of memory to build at all, 30 is better.
- Additional memory beyond 30GB does not seem to provide any benefit.
- CPU speed matters more than number of CPU cores, but both help.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 20:14:54 +01:00
Remy
1b37f6c482
DAML-LF: redesign absolute contract ids (#5207)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 19:07:42 +01:00
nickchapman-da
aa53c30de1
New command: daml ledger fetch-dar (#5225)
* New comamnd: daml ledger fetch-dar

`daml ledger fetch-dar [PID] [PATH]`

Download a `Package` and it's dependencies from a ledger, given a root `packageId`, and re-construct a valid `.dar` file. Addresses issue #5037.

The original package names are not reconstructed.

CHANGELOG_BEGIN
CHANGELOG_END

* address some comments

* fix spello

* attempt: recoverPackageName

* recover main package name & version

* Try to fix integration tests on Windows

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-03-27 18:04:14 +00:00
Moritz Kiefer
e42111b31f
Fix template name in multiparty agreement docs (#5255)
fixes #5239

changelog_begin
changelog_end
2020-03-27 16:34:57 +00:00
Samir Talwar
7ef0972856
sandbox: On reset, wait for the API server to start before replacing it. (#5251)
* sandbox: On reset, wait for the API server to start before replacing it.

Hopefully this addresses the flickering behavior we're seeing in CI.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox: Scale the retries in ResetServiceIT along with everything else.
2020-03-27 16:29:56 +00:00
Moritz Kiefer
53994c807a
Disable tuple-section and lambda-case hints (#5229)
Adding more syntax is just confusing for beginners so these are not
particularly helpful and I would argue that they aren’t that useful in
general even once you move past the beginner stage.

changelog_begin
changelog_end
2020-03-27 17:16:25 +01:00
Stefano Baghino
9522c6e4b2
Allow to have both verbose and succinct row parsers (#5248)
* Allow to have both verbose and succinct row parsers

This will be used when we need to stream transactions and not individual
events.

changelog_begin
changelog_end

* Succinct parser should have verbose = false
2020-03-27 17:00:36 +01:00
Martin Huschenbett
454bd127a0
daml2ts: Don't use HashMap Text Text anywhere (#5252)
As I said previously, all instances of the dreaded `HashMap Text Text`
can go away if write our code more direct. Here we go.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 15:51:42 +00:00
Martin Huschenbett
b1e6298ec6
JSON API: Slightly improve the docs for the streaming endpoints (#5234)
Semicolons at the end of every line seem to be good style. Logging to
the console does not help with the example. The `WebSocket` class is
built-in in the browser and you only need a package like `ws` on
Node.js.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 15:17:55 +00:00
Remy
20218e4175
DAML-LF: restrict length of parties (#5237)
CHANGELOG_BEGIN
* [DAML-LF]. *Breaking* Restrict length of parties
CHANGELOG_END
2020-03-27 14:52:43 +01:00
mziolekda
ce62bfb596
Support for large grpc messages in ledger-on-memory (#5230)
* Support for large grpc messages in ledger-on-memory

* adress review comments

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 14:00:24 +01:00