Commit Graph

4286 Commits

Author SHA1 Message Date
Gary Verhaegen
ef0c06a47e
add sed to dev-env (#6129)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-27 17:11:09 +00:00
Gary Verhaegen
e2d416e335
fix docs cron not ignoring release-notes (#6127)
The docs cron is supposed to ignore the release-notes.html page when
checking whether a docs folder is corrupted, because we manually
override it. However, that currently doesn't work, either because the
`sed` version we are using does not support changing the delimiters, or
because no version of `sed` does and I just imagined it.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-27 18:47:40 +02:00
Shayne Fletcher
576e47f587
Toxify Windows (#6122)
changelog_begin
changelog_end
2020-05-27 12:07:54 -04:00
Remy
3f29ac84f0
DAML-LF: cleanup last refs to Absolute Contract IDs (#6126)
follow up of #5991

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-27 18:05:48 +02:00
Gary Verhaegen
ccb496ee0d
update perf test sha (#6125)
Changed by #6123, relevant part of the diff is:

```
           ledger.lookupGlobalContract(ParticipantView(committers.head),
effectiveAt, acoid) match {
-            case LookupOk(_, result) =>
+            case LookupOk(_, result, _) =>
               cachedContract = cachedContract + (step -> result)
```

which seems benign enough.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-27 15:10:11 +00:00
Remy
2a05bb877e
Scenario service: fix visibility of contract keys. (#6123)
fixes #5924

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-27 16:27:50 +02:00
Gary Verhaegen
1731a47101
remove javadoc_dev_env (#6124)
The comment on it says it should be replaced by `local_jdk//:javadoc`
once [a patch](https://github.com/bazelbuild/bazel/pull/7898) is merged
into Bazel. Not only has that patch been merged, but I could not find
any reference to `javadoc_dev_env` to replace.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-27 16:27:09 +02:00
Remy
46bb942964
DAML-LF: restrict value versions (#6109)
advances #5164

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-27 15:51:56 +02:00
Andreas Herrmann
61d181d22c
Setup compatibility tests for DAML Trigger (#6112)
* Build CopyTrigger example in compatibility

* Test DAML trigger with test DAML script

Defines a custom client script that runs the trigger runner in the
background and uses a DAML script in the foreground to test that the
trigger runs and its effects are observable.

CHANGELOG_BEGIN
CHANGELOG_END

* Apply suggestions from code review

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

* Use bazel_tools:versions.bzl%versions.is_at_least

Also align versions.is_at_least|most with skylib

The arguments to the Skylib function are in the opposite order. I've
included a docstring to explain

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-05-27 12:32:37 +00:00
nickchapman-da
06eadd2c47
Disentangle the execution of closures and builtin functions. (#6068)
* Disentangle the execution of closures and builtin functions.

Both closures and builtins take arguments, but only closures have free variables.
Consequently, we split the machine component `frame` into `frame` and `actuals`.
Allowing them to be managed independently, and simplifying lookup for `SELocF` and `SELocA`.

The `KFun` continuation is split into 3 variants: `KFun`, `KBuiltin` and `KPap`.
These handle the execution of three different cases of function application:
- execution of a user function (a closure)
- execution of a builtin
- execution of a partial application (builtin or closure, it doesn't matter)

The choice of which continuation to push is made in the `KArg` continuation when the
function-expression has been evaluated and we have discovered what it is - builtin or
closure - and we know it's arity.

The prior code made some related decisions (for example, is this an over-application) but
left other choices to `KFun` (code was: `enterFullyAppliedFunction`). This required that
the `KFun` continuation had to stash the entire `Prim` (closure/builtin) and `arity`, only
to then re-examine it when the continuation was entered.

Now, all decisions are made within `KArg`, making the structure and execution of the three
new continuations much simpler. In particular, the `machine.frame` is only set when we
enter `KFun`.

All continuations which need to preserve their environment, now save both frame & actuals,
along with the env-stack-size. And `restoreEnv` is adapted accordingly.

changelog_begin
changelog_end

* improve variable name

* with SomeArrayEquals
2020-05-27 12:18:41 +00:00
Gary Verhaegen
b28b543fc6
add toxiproxy to Windows (for #6114) (#6119)
I have never used Scoop before and I'm not sure how to actually test
this, but I thought this might at least get a conversation going.

Plus, if my reading of the documentation of both toxiproxy and Scoop is
correct, this may even work as is.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-27 13:37:55 +02:00
Gary Verhaegen
9a02ef6ef4
remove unused scoop tests (#6118)
This PR removes a few scoop-related files that seem to have been there
primarily to help us discover how Scoop worked when we first started
using it. They have not been touched in a long time and as far as I can
tell have not been run in a long time either.

I'm a firm believer in the idea that dead code belongs to the git
history, and has no place in the current worktree.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-27 13:37:04 +02:00
Gary Verhaegen
6e48abc793
update perf benchmark following #6080 (#6120)
This should be merged after #6080. This PR adds a patch (and
consequently updates the `ci/cron/perf/compare.sh` script) to apply the
same logical change as #6080 on top of the baseline commit, so our
performance comparison remains "apples to apples".

I am well aware that managing patches is not going to be a great way
forward. The rate of changes on the benchmark seems to be slow enough
that this is good enough for now, but should we change the benchmark
more often and/or want to add new benchmarks, a better approach would be
to handle the changes at the Scala level. That is:

- Create a "rest of the world" (world = Speedy, its compiler, and all of
  the associated types) interface that benchmarks would depend on,
  rather than depend directly on the rest of the codebase.
- Create two implementations of that interface, one that compiles
  against the current state of the world, and one that compiles against
  the baseline.
- Change the script to load the relevant implementation, and then run
  all the benchmarks as-is, with no match necessary.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-27 13:34:08 +02:00
nickchapman-da
974ff45a08
Improve CollectAuthority perf benchmark (#6080)
The aim of the `CollectAuthority` benchmark is to track performance improvements made to the
DAML compiler & the speedy interpreter. Unfortunately the benchmark was spending at least
20% of the time being benchmarked outside of the speedy machine execution code, and
instead interacting with the ledger. We would like to minimize this as much as possible.

The solution is to cache the responses from the ledger made during the setup() run, and
replay them during the benchmark `run()`s.  To perform the caching, we no longer make use
of the scenario-interpreter, but instead have our own simplified runner, specialized for
this benchmark, and managing the cache.

using the cache speeds up the benchmark by a factor of about x1.25 (Which is the origin of
the claim above about 20% outside of speedy execution).

    Result "com.daml.lf.speedy.perf.CollectAuthority.bench":
      95.188 ±(99.9%) 0.410 ms/op [Average]
      (min, avg, max) = (94.177, 95.188, 95.890), stdev = 0.472
      CI (99.9%): [94.779, 95.598] (assumes normal distribution)

    Result "com.daml.lf.speedy.perf.CollectAuthority.bench":
      75.881 ±(99.9%) 0.288 ms/op [Average]
      (min, avg, max) = (75.077, 75.881, 76.491), stdev = 0.332
      CI (99.9%): [75.593, 76.169] (assumes normal distribution)

Because of how we run perf benchmark on CI -- by running the benchmark for now vs. some
fixed time in the past -- it ought to be fine to change the benchmark like this, although
we might need some help from Gary!

As well as improving the focus of this benchmark going forwards, we should also gain a
retrospective improvement on the speedup work already committed, since they will no longer
we dragged down by time which is outside of our control.

changelog_begin
changelog_end
2020-05-27 11:15:59 +00:00
Shayne Fletcher
79563ee74b
ToxiProxy config (#6114)
changelog_begin
changelog_end
2020-05-27 07:08:45 -04:00
Miklos
895a709498
Standardize command-line parameter for max inbound message size (#6093) 2020-05-27 11:55:49 +02:00
Moritz Kiefer
2d20948992 Release snapshot (#6117)
changelog_begin
changelog_end
2020-05-27 11:47:56 +02:00
Moritz Kiefer
139bc0f058
Bump timeouts in create-daml-app compat tests (#6106)
We have seen a couple of timeouts on CI. I haven’t reproduced any
locally and even on CI there haven’t been too many (remember that we
run those tests very often in different configurations) so going for a
fairly conversative bump in timeouts but I’m just guessing here.

changelog_begin
changelog_end
2020-05-27 11:38:25 +02:00
Stefano Baghino
acc5a21c59
Fix issues cause by migration V25 and V26 (#6107)
* Fix issues cause by migration V25 and V26

Fixes #6017

Please note that migrating sandbox-classic from version 1.0.0 to 1.1.1 will cause
undefined behavior if the result is used to back a running ledger setup.

No migration should end at 1.1.1 and they should move past that until the version
that applies this fix to make sure the index database is in a consistent state.

Full write-up on the issue here: https://github.com/digital-asset/daml/issues/6017#issuecomment-634040972

changelog_begin
[Sandbox Classic] Fix issue in migrating to version 1.1.1. If you did migrate to
version 1.1.1, do not use the resulting setup but make sure to migrate until this
version, which fixes the issue
See https://github.com/digital-asset/daml/issues/6017
changelog_end

* Add trailing newline

* Fix wrong hash for migration

* Address https://github.com/digital-asset/daml/pull/6107#discussion_r430469918
2020-05-27 08:37:58 +02:00
Gerolf Seitz
d55ebf08ec
Use Sandbox Classic as DAML on SQL (#6095)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-27 08:31:27 +02:00
Leonid Shlyapnikov
937aa88ce7
transaction stream dashboard (#6059)
changelog_begin
changelog_end
2020-05-26 21:07:49 -04:00
Shayne Fletcher
b95dd39a6e
Don't update running triggers until we know the trigger is running (#6079)
* Don't update running triggers until we know the trigger is running

changelog_begin
changelog_end

* Don't update running triggers until we know the trigger is running
2020-05-26 16:15:29 -04:00
Simon Maxen
cfec886e71
Ensure that on first call to ReadService.stateUpdates beginOffset is … (#6103)
* Ensure that on first call to ReadService.stateUpdates beginOffset is None

Fixes #6023

CHANGELOG_BEGIN
CHANGELOG_END

Also restores correct advice in CONTRIBUTING.md

* Update with review comments
2020-05-26 17:36:02 +01:00
Shayne Fletcher
887815c019
Get toxify from nix (#6110)
changelog_begin
changelog_end

Co-authored-by: Shayne Fletcher <shayne@shaynefletcher.org>
2020-05-26 16:32:33 +00:00
Robin Krom
d2eadf95dc
language: add an empty template for the daml assistant. (#6102)
This adds an empty template for the daml assistant. This is very helpful
for writing katacoda's, because otherwise you have to delete contained
source files in the `skeleton` project everytime as a first step. The
README in the `daml` directory is mainly there to get the daml directory
in the template.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-26 15:27:10 +02:00
anthonylusardi-da
0ee217cdae
ADD: Change most Slack references to forum references where appropriate (#6071)
* ADD: Change most Slack references to forum references where appropriate

CHANGELOG_BEGIN
Replace references to Slack with references to discuss.daml.com
CHANGELOG_END

* ADD: Change issue template support link from SO to forum

* ADD: Add back Slack links
2020-05-26 09:26:53 -04:00
Gary Verhaegen
081bc60e2f
remove envsubst from dev-env (#6098)
It should not be an issue, but I know of at least 4 people for whom
having envsubst in dev-env causes their local git to get confused and
spit out many lines of warning on each invocation. This also seems to
make git much slower.

Given that we're only using envsubst in this one place, I think it may
be worth replacing.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-26 12:25:54 +02:00
Gary Verhaegen
26bfab48d7
remove da -> daml upgrade docs (#6100)
The `da` tool has not existed for a while now and it's unlikely any new
user will need to know about the upgrade path. I think starting from
1.2.0 it makes sense not to have that documenation around anymore.

Note that we do have references to the upgrade page in the release
notes, so leaving them as is would break building the documentation. My
preference would have been to turn those references into "external"
links to the relevant version, but unfortunately, these are versions
(`0.12.15` and `0.12.18`) that, for various reasons, we cannot build
anymore and do not have in pre-built form. I have therefore decided to
change the links in the release notes to link to the latest existing
version of that page (which is pretty much what it already did), i.e.
specifically link to `1.1.1`.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-26 12:25:32 +02:00
Moritz Kiefer
e86fbedfd0
Support version ranges in test tool exclusions (#6094)
* Support version ranges in test tool exclusions

This cleans up the map of exclusions for the ledger-api-test-tool part
of the compat tests. For now, you can only use ranges for the inner
map. In principle we could also add it to the outer map but I’ll leave
that for a separate PR.

I’ve also run the script to update versions so this includes the
latest two snapshots.

fixes #5851

changelog_begin
changelog_end

* Address review comments

changelog_begin
changelog_end

* buildifier

changelog_begin
changelog_end
2020-05-26 11:42:53 +02:00
Stefano Baghino
9af85e56e9
Introduce DAML-LF value caching for transaction service (#6052)
* Introduce DAML-LF value caching for transaction service

Allows to keep the DAML-LF values in the most recently indexed events in memory,
so that they don't have to be deserialized on the client from their Protobuf encoding.

Closes #6044

CHANGELOG_BEGIN
[Sandbox] The --max-lf-value-translation-cache-entries option allows to set a
number of events for which DAML-LF values are cached. Could reduce latency in
serving transactions for consumers that are reasonably fast.
CHANGELOG_END

* Add missing dependency

* Address https://github.com/digital-asset/daml/pull/6052#discussion_r428076003

* Update ledger/sandbox/src/main/scala/com/digitalasset/platform/sandboxnext/Runner.scala

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>

* Address https://github.com/digital-asset/daml/pull/6052#discussion_r428071324

* Address https://github.com/digital-asset/daml/pull/6052#discussion_r428076905

* Address https://github.com/digital-asset/daml/pull/6052#discussion_r428081294

* Fix fatal warnings

* //ledger/caching has to be used whenever sandbox is run

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-05-26 08:33:53 +00:00
Remy
9e456a1016
DAML-LF: Kill RelativeContractId (#5991)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-25 22:30:45 +02:00
Miklos
9a0cce155e
Introduce batched submission validator (#6004) 2020-05-25 18:25:10 +02:00
Moritz Kiefer
34ae06414e
Speed-up create-daml-app compat tests (#6087)
Previously we ran `daml codegen js` and `daml build` in the tests and
we also ran it twice. While this makes sense for the SDK integration
tests, it doesn’t really make sense for the compatibility tests. These
are SDK-only features so they don’t actually test compatibility. These
steps are super slow and running them in the tests also means that we
run them a quadratic number of times.

This PR moves the `daml build` and the `daml codegen js` step to
separate genrules. In the actual test, the only expensive steps are to
run `yarn install` and the actual jest tests. In principle, we could
probably try to factor out the `yarn install` step as well but I’m a
bit scared of coyping around node_modules so I’ll not attempt to do
that for now.

changelog_begin
changelog_end
2020-05-25 16:25:10 +02:00
Gary Verhaegen
9c7c8918a3
fix fatjar versions (#6091)
Version is taken from the env var (or defaulted to 0.0.0) at build-time.
Since those two packages are not build by default by Bazel, we need to
add the env var to the Bash step where they do get explicitly built.

Fixes #6090.

CHANGELOG_BEGIN
- sandbox and http-api fatjars will now display correct version number.
CHANGELOG_END
2020-05-25 15:59:23 +02:00
Sofia Faro
f18db87333
Add the stdlib anchor table as a bazel target. (#6088)
Part of #6039

changelog_begin
changelog_end
2020-05-25 10:37:27 +00:00
Moritz Kiefer
5b19aafc18
Fix json API options in compat tests (#6084)
--allow-insecure-tokens only exists in recent SDKs.

changelog_begin
changelog_end
2020-05-23 16:48:27 -04:00
Moritz Kiefer
2b1468e0e7
Add JSON output to damlc inspect-dar (#6076)
* Add JSON output to `damlc inspect-dar`

fixes #3117, fixes #5563

This PR adds a `--json` flag to `damlc inspect-dar` that does pretty
much what you expect. So far it mainly exposes the same information
that you already got from `inspect-dar` but it’s easy to add more as
needed.

I’ve also finally added some documentation for `inspect-dar`.

changelog_begin

- [DAML Compiler] ``damlc inspect-dar`` now has a `--json`` flag to
  produce machine-readable output. See
  https://docs.daml.com/daml/reference/packages.html#inspecting-dars
  for more information.

changelog_end

* Sort packages in human-readable output

changelog_begin
changelog_end

* Update docs/source/daml/reference/packages.rst

Co-authored-by: Rohan Jacob-Rao <rohanjr@gmail.com>

Co-authored-by: Rohan Jacob-Rao <rohanjr@gmail.com>
2020-05-22 19:09:22 +00:00
Moritz Kiefer
b72f4eec83
Add documentation for error (#6077)
fixes #6072

changelog_begin
changelog_end
2020-05-22 20:17:46 +02:00
nickchapman-da
fb6cafa311
Bump the sha for CI perf (#6078)
changelog_begin
changelog_end
2020-05-22 16:24:18 +00:00
nickchapman-da
44d0128f29
Add control to speedy compiler to choose if stack-trace support occurs at runtime. (#6070)
Choices for `stacktracing` are `NoStackTrace` / `FullStackTrace`.

Adapt code so the selection is made by the original caller:
- `engine`
- `scenario-service`
- `repl-service`
- `daml-script` runner
etc

Currently, all callers pass `FullStackTrace` (the existing behaviour), except for the
exploration dev-code: `daml-lf/interpreter/perf/src/main/scala/com/daml/lf/explore`.

The idea is that once this control is in place, we can discuss if we can change how we
might expose it to the user, and/or perhaps change the default behaviour to have
`stacktracing` disabled.

changelog_begin
changelog_end
2020-05-22 16:36:03 +01:00
Rohan Jacob-Rao
f845bca12f
Trigger service: initialize database command (#6062)
Minimal database initialization with schemas for running_triggers and dalfs tables. The user passes in the database URL, username and password in a config string argument (approach and code adapted from the JSON API).

In future the idea is to also create a "service" role with permissions to read and write to the new tables. Then the user can pass in the service role to connect to the database when running the service for real.
2020-05-22 10:54:08 -04:00
Moritz Kiefer
629ec732dd
Include puppeteer tests in compat tests (#6018)
* Include puppeteer tests in compat tests

This PR adds the puppeteer based tests to the compatibility
tests. This also means that they are now actually compatibility
tests. Before, we only tested the SDK side.

Apart from process management being a nightmare on Windows as usually,
there are two things that might stick out here:

1. I’ve replaced the `sh_binary` wrapper by a `cc_binary`. There is a
   lengthy comment explaining why. I think at the moment, we could
   actually get rid of the wraper completely and add JAVA to path in
   the tests that need it but at least for now, I’d like to keep it
   until we are sure that we don’t need to add more to it (and then
   it’s also in the git history if we do need to resurrect it).
2. These tests are duplicated now similar to the `daml ledger *`
   tests. The reasoning here is different. They depend on the SDK
   tarball either way so performance wise there is no reason to keep
   them. However, we reference the other file in the docs which means
   we cannot change it freely. What we could do is to make this
   sufficiently flexible to handle both the `daml start` case and
   separate `daml sandbox`/`daml json-api` processes and then we can
   reference it in the docs. There is still added complexity for
   Windows but that’s necessary for users as well that want to run
   this on Windows so that seems unavoidable. (I should probably also
   remove my snarky comments 😇) I’d like to kee it duplicated
   for this PR and then we can clean it up afterwards.

changelog_begin
changelog_end

* Bump timeouts

changelog_begin
changelog_end
2020-05-22 14:02:59 +02:00
nickchapman-da
70201afc55
Make the Lightweight Pretty Printing more helpful. (#6069)
- reduce verbosity of PAP
- see inside applications & lambdas.
- see rhss/body of lets
- see scrut of case (maybe later we add alts!)
- see the name of the definition ref
- see bools
- see LOC(and-nested-expression) -- interesting where the LOCs are places
- see head of kont stack

changelog_begin
changelog_end
2020-05-21 15:41:22 +00:00
nickchapman-da
9e5ae15e6d
Bazel rule to inspect dar file when compiling daml (#6067)
This change extends the bazel rule for `compile_daml` to add a stage which will pretty-print the generated .dar file, suitable for human inspection. The generated file is named with a `.dar.pp` suffix, and will only be generated if explicitly requested as a build target or listed as a dependency.

Make use of the new rule by demanding CollectAuthority.dar.pp when the perf benchmark is built.

changelog_begin
changelog_end
2020-05-21 11:06:51 +00:00
nickchapman-da
3e4c67613a
Speedy explore dar (#6066)
Explore the execution of the speedy machine on small examples taken from a dar file
In particular interested in how the execution proceeds for standard patterns of recursion.

changelog_begin
changelog_end
2020-05-21 11:06:44 +00:00
Bernhard Elsner
b7947767c9
Delete two poor docs pages (#6058)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-21 10:13:13 +02:00
Shayne Fletcher
90c0194dd9
Change trigger maps to store tokens not parties (#6061)
changelog_begin
changelog_end
2020-05-20 16:54:13 -04:00
Shayne Fletcher
639bec5a83
New module TokenManagement.scala (#6060)
changelog_begin
changelog_end
2020-05-20 16:51:40 -04:00
Shayne Fletcher
03d8425e16
Rework start/stop & list to require bearer header with JWT token (#6055)
changelog_begin
changelog_end
2020-05-20 15:40:22 -04:00
Shayne Fletcher
17f6c29958
Remove --pure-lockfile to yarn (#6056)
changelog_begin
changelog_end
2020-05-20 13:41:46 -04:00