Commit Graph

4661 Commits

Author SHA1 Message Date
Remy
6497dfa507
Override the version of JOPT Simple from scala_rules (#6621)
CHANGELOG_BEGIN
CHANGELOG_END
2020-07-06 17:08:01 +02:00
Moritz Kiefer
907e4fe678
Fix project versions of DAML Script and DAML Triggers (#6622)
GHC has weird restriction on version numbers which damlc inserits so
we need to use `ghc_version` instead of `sdk_version`. That only makes
a difference for snapshot versions where the `-snapshot.` part is
replaced by `.`.

changelog_begin
changelog_end
2020-07-06 15:07:39 +00:00
Moritz Kiefer
1b533561b4
Only publish JSON API to GH releases (#6620)
daml-on-sql isn’t quite ready

changelog_begin
changelog_end
2020-07-06 14:43:09 +00:00
Gary Verhaegen
b3aab72cee
better let ANF transform (#6606)
Ask @nickchapman-da for details on what this transform does and why it's
better. I have no clue.

What I do understand is that current master has a stack-consuming
behaviour that just so happens to not reach the 1mb default stack size
on the tests we run, and that this presumably better version of a let
transform had been left out from the original ANF PR because it was
pushing the stack consumption over that 1mb limit.

Besides reintroducing the "better" let version, this PR applies an
almost full CPS transform to the set of mutually recursive functions
that grow the stack. Combined with the trampoline, this should mean the
ANF transform itself is done in (almost) constant stack space.

The one exception to that is the `flattenAlts` function, which has been
left as a plain imperative loop. This does mean that we consume stack
linearly with the nesting level of alts, so conceivably this could still
blow the stack. There is no fundamental reason that makes this hard, it
just seemed unnecessary for the stack consumption and potentially
damaging to performance (changing a native Java loop on an array to a
recursive list consumption).

To verify the stack-consuming behaviour on master, one can apply this
patch:

```patch
diff --git a/ledger/sandbox/BUILD.bazel b/ledger/sandbox/BUILD.bazel
index a717e66fb..4c953b3ea 100644
--- a/ledger/sandbox/BUILD.bazel
+++ b/ledger/sandbox/BUILD.bazel
@@ -124,6 +124,7 @@ da_scala_library(

 da_scala_binary(
     name = "sandbox-binary",
+    jvm_flags = ["-Xss256k"],
     main_class = "com.daml.platform.sandbox.SandboxMain",
     resources = ["src/main/resources/logback.xml"],
     visibility = ["//visibility:public"],
```

then run

```
bazel test -t- //ledger/sandbox:conformance-test-contract-id-seeding-memory
```

The same process can be repeated on this branch to verify that, at
least, this now runs under 256kb of stack for all our tests. I don't
know of a good way to get a stronger guarantee on stack allocations.

While my primary motivation here is correctness (and termination, I
guess), this does seem to yield a modest performance improvement. On a
test machine, I got the following results as confidence intervals:

* `master` (b4915a4bd7): 54.00, 54.56
* this branch: 52.54, 53.11

I've only ran the benchmark once on each and don't have enough
experience with it to know how reliable those numbers are. I'll try to
run some more.

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-06 15:11:05 +02:00
Moritz Kiefer
303d047516
Release a hotfix snapshot (#6616)
Note for reviewers: This is a hotfix for a snapshot. I’m not going to
into why we need this here. As for the version number we decided that
the least confusing option here is the following:

Use the sha and number of commits as usual but use the date of the
original snapshot that we are patching here.

changelog_begin
changelog_end
2020-07-06 13:06:48 +00:00
Samir Talwar
f1a00f40bf
kvutils/integrity-check: Rewrite without Await. (#6614)
* kvutils/integrity-check: When there's an exception, crash.

The integrity checker would previously hang around for a long time in
the event of an exception. This makes sure all threads are shut down
immediately.

* kvutils/integrity-check: Increase the timeout per submission.

Larger submissions time out on my machine.

CHANGELOG_BEGIN
CHANGELOG_END

* kvutils/integrity-check: Rewrite without `Await`.

* kvutils/integrity-check: Close the file after running.
2020-07-06 10:59:11 +00:00
Remy
dbd0215dd0
DAML-LF: cleanup TransactionBuilder (#6610)
small clean up in the testing library TransactionBuilder, bsaically add a Submitted and a Committed version for empty transaction constant and build method.

plus a bit of cleaning in tests using TransactionBuilder


CHANGELOG_BEGIN
CHANGELOG_END
2020-07-06 11:25:36 +02:00
Miklos
c789b65bd8
Do not expose log entry ID to committers (#6603)
* Removed archived_by_entry from CommitContext and DamlContractState.

* Removed references to getEntryId from test code.

* Do not pass log entry ID to committers.

* Log entry ID is no longer required for computing submission outputs.

* Log entry ID is no longer required for computing submission outputs.

* Code tidying.
CHANGELOG_BEGIN
CHANGELOG_END
2020-07-06 08:30:55 +00:00
Stefano Baghino
e1568e2b9d
Add test for divulgence with keys (#6607)
* Add test for divulgence with keys

changelog_begin
changelog_end

* Add unit test for redundant divulgence

changelog_begin
changelog_end

* Revert "Don't store archived divulged contracts (#6139)"

This reverts commit 28251ba296.

* Fix tests

* Address https://github.com/digital-asset/daml/pull/6607#discussion_r449799885

* Address https://github.com/digital-asset/daml/pull/6607#discussion_r449800030
2020-07-04 20:14:22 +00:00
Gary Verhaegen
b4915a4bd7
remove clean --expunge from Windows builds (#6605)
Following #6604, I have reset all of our Windows nodes, so hopefully
there is no broken local cache remaining.

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-03 19:24:54 +00:00
Moritz Kiefer
ade99dd2c1
Reset windows cache (#6604)
We are seeing caching errors again.

changelog_begin
changelog_end
2020-07-03 16:36:35 +00:00
Moritz Kiefer
06aa279133
Split up DA.Daml.Helper.Run (#6602)
This PR splits up the significantly too large `DA.Daml.Helper.Run`
module into modules grouped by the individual commands:

- `DA.Daml.Helper.Init` for `daml init`
- `DA.Daml.Helper.Ledger` for `daml ledger *`
- `DA.Daml.Helper.New` for `daml new`
- `DA.Daml.Helper.Start` for `daml start` and code for starting the
   components that are part of that individually.
- `DA.Daml.Helper.Studio` for `daml studio`
- `DA.Daml.Helper.Util` as a kitchen-sink utilty moduel for things
   that don’t really belong in one of the others.

This PR _only_ shuffles code around, there is no change in the
implementation.

changelog_begin
changelog_end
2020-07-03 18:32:51 +02:00
Miklos
52fc0635f1
Handle out-of-time-bounds log entry (#6568) 2020-07-03 15:27:27 +02:00
Robert Autenrieth
3e55fda66b
Privatize ledger-api-auth classes (#6599)
CHANGELOG_BEGIN
CHANGELOG_END
2020-07-03 15:06:18 +02:00
Sofia Faro
8969b3428f
Fix record update evaluation order. (#6590)
* Fix record update evaluation order.

This PR only fixes the evaluation order for single-constructor record
types. Fixing it for variant records, if we do, will be a major
challenge.

This PR also adds a regression test.

changelog_begin
changelog_end

* fix daml-lf-verify
2020-07-03 11:25:44 +01:00
Gary Verhaegen
2cbd4989f2
hide detailed disclosure information by default (#6587)
As requested by @shaul-da, this PR hides the information added by
@hurryabit in #6571 behind a checkbox, and reverts to plain "X"s by
default (checkbox unchecked).

CHANGELOG_BEGIN
- [DAML Studio] The new S/O/W/D information is hidden behind a top-level
  checkbox (next to Show archived). When that checkbox is not checked
  (which is the default), we display X's as before.
CHANGELOG_END
2020-07-03 12:16:34 +02:00
Moritz Kiefer
817b7ca82c
Fix unmangling of dotted identifiers in scenario service (#6597)
'.' is not a valid character in a mangled name which caused unmangling
to fail. Sadly the scenario service does not properly distinguish
between dotted an undotted names but for now everything we unmangle is
dotted anyway so I’ve taken the easy approach of simply changing our
unmangling to take that into account.

We might want to change the scenario service here but I’ll leave that
for a separate PR.

changelog_begin

- [DAML Studio] Fix a crash in scenarios that referenced records
  originating from definitions like `data T = T1 { f1 : Int } | T2 { f2
  : Int }`.

changelog_end
2020-07-03 11:17:27 +02:00
fabiotudone-da
43f99f45fc
Add support for fingerprints in CommitContext (#6567) 2020-07-03 10:57:49 +02:00
Martin Huschenbett
873e0163cd
Drop the global from globalImplicitDisclosure and globalDivulgence (#6588)
Since we have only absolute contract ids, there is no more distinction
between local and global disclosure/divulgence. Let's please remove the
`global` prefix since it causes confusion (at least for me it did).

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-03 08:43:31 +02:00
nickchapman-da
a624dd7242
Improve handling of over-application to allow much dead code to be eliminated. (#6586)
The dead code was hanging on by a slender thread. This change cuts that thread.

For over-apps, we now push a new continuation type KOverApp, instead of KArg.
KOverApp contains args of type SExprAtomic, instead of SExpr, and so its
execute() method may use enterApplication, instead of executeApplication.

This allowing lots of code to be removed:
- the continuation types: KArg, KFun, KBuiltin and KPap.
- defs: evaluateArguments and executeApplication.

changelog_begin
changelog_end
2020-07-02 19:38:54 +00:00
Andreas Herrmann
0c16823c1b
Upgrade rules_haskell and pin stack_snapshot (#6548)
* Update rules_haskell

* Pin stack_snapshot repositories

* Document stack_snapshot_json

CHANGELOG_BEGIN
CHANGELOG_END

* Don't pin stack_snapshot on Windows

The lock file is generated on Unix and includes unix specific
dependencies, e.g. `unix`. Most developers don't have easy access to a
Windows machine, so regenerating the lock file for Windows would be
inconvenient.

* upgrade stack 2.1.3 --> 2.3.1 on Windows

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-07-02 18:55:09 +02:00
Gary Verhaegen
166842e227
update versions bbased on git tags (#6580)
* update versions bbased on git tags

We currently run the update script as part of the release process. This
causes an issue (highlighted by @cocreature in #6560): the update script
currently relies on querying the docs website to get the list of
versions, but the docs website is updated on a cron, which means by the
time we run the update script it is not up-to-date yet.

This PR changes the update script to instead rely on the local git repo
and its list of tags, as that is updated synchronously.

CHANGELOG_BEGIN
CHANGELOG_END

* test

* revert test
2020-07-02 16:37:13 +00:00
Remy
1480168604
Speedy: make thing a bit more private (#6579)
CHANGELOG_BEGIN
CHANGELOG_END
2020-07-02 18:19:03 +02:00
Moritz Kiefer
4db71299ed
Fix ledger-api-test-tool exclusions (#6589)
We broke the tests with the exclusion of yesterday’s snapshot.

changelog_begin
changelog_end
2020-07-02 17:43:53 +02:00
Stephen Compall
9fb72202d8
use daml-lf scalacopts for ledger-service (#6569)
* add lf_scalacopts to ledger-service/ projects

* handle unused warnings in http-json main

* handle unused warnings in lf-value-json

* handle unused warnings in http-json tests

* handle unused warnings in jwt

* JwtGenerator.generate doesn't use its argument; remove it

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* format bazel files
2020-07-02 13:58:41 +00:00
Martin Huschenbett
6dc2c9c9b8
Only ship disclosure information once in scenario service (#6578)
Currently, the scenario service ships the disclosure information of a
transaction twice. One of the two copies is completely unused. This PR
simply deletes it. I hope this reduces confusion in the future.

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-02 13:16:21 +00:00
Martin Huschenbett
a2f2880eda
Remove the copyright header from the skeleton (#6581)
* Remove the copyright header from the skelton

It doesn't make sense to annoy our users with our copyright for on a
template. And the over abundance of empty lines has annoyed me so many
times.

* Add NO_AUTO_COPYRIGHT file

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-02 12:58:35 +00:00
Moritz Kiefer
3589c916ac
Avoid contention in create-daml-app tests (#6575)
The issue is described in a comment (since I want to preserve it) but
here’s the brief summary:

Calling `follow` twice can result in contention if we do not wait in
between. That is shown in the log of the JSON API. For some reason
that ends up propagating to a misleading Target closed error from
puppeteer.

This PR addresses the problem by waiting for the list of followers to
be updated which definitely implies that the ledger has seen the
command.

changelog_begin
changelog_end
2020-07-02 12:25:39 +00:00
nickchapman-da
b3b30ae71d
Speedy issue 6573 (#6576)
* address issue 6573

changelog_begin
changelog_end

* fmt

* push switch from SExpr to SValue to callers of the trigger service
2020-07-02 13:15:00 +01:00
azure-pipelines[bot]
3783275beb
update compat versions for \n\nCHANGELOG_BEGIN\nCHANGELOG_END\n (#6582)
Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-07-02 11:57:29 +00:00
Martin Huschenbett
4accae15cb
Split damlc integration tests per DAML-LF version (#6577)
* Split damlc integration tests per DAML-LF version

Currently, we have one test for all stable DAML-LF versions. This test
takes quite a while to run and times out occasionally. This PR splits
the big test into one test per stable DAML-LF version.

CHANGELOG_BEGIN
CHANGELOG_END

* Address some feedback
2020-07-02 11:13:33 +00:00
Martin Huschenbett
3296f56519
Distinguish witnesses and divulgences in scenario table view (#6571)
* Distinguish witnesses and divulgences in scenario table view

Currently, we display a "D" (for "Disclosure/Divulgence") in the table
view of the scenario view when a party can see a contract because they
have learnt about it via disclosure.

This change further refines this visibily indicators for disclosure:
We display a "W" for "Witness" (i.e. the party has witnessed the
creation of the contract) and "D" for "Divulgence".

Help for the reviewer: In the scenario service server, witnessing is
called explicit disclosure whereas divulgence is called implicit
disclosure.

CHANGELOG_BEGIN
* [DAML Studio]
  When displaying scenario results in table view in DAML Studio, we now
  indicate _why_ a party knows about the existence of a contract:
  - `S` means the party is a signatory.
  - `O` means the party is an observer.
  - `W` means the party has witnessed the creation of the contract.
  - `D` means the party has learned about the contract via divulgence.
CHANGELOG_END

* Address @cocreature's feedback
2020-07-02 07:58:21 +00:00
nickchapman-da
04c7b2af7f
Unit tests for ANF transform (#6562)
* Unit tests for ANF transform

changelog_begin
changelog_end

* add testcase for issue 6535
2020-07-02 07:45:05 +00:00
Moritz Kiefer
494c661a0a
Delete unused concatEnv from daml-lf-verify (#6572)
Was looking through the code and thought the TODO might hint at a bug
but it turns out this is just unused \o/

changelog_begin
changelog_end
2020-07-02 07:25:04 +00:00
Moritz Kiefer
ef470ee883
Simplify and fix package id handling in daml-lf-verify (#6564)
The whole instPrSelf thing is just repeating what DecodeAsDependency
does. Handling unqualified TypeConNames also sounds very questionable
so I changed that as well. Sadly this doesn’t fix the issue I was
hoping to fix.

changelog_begin
changelog_end
2020-07-02 07:03:43 +00:00
Moritz Kiefer
97aeda8db3
Replace substitutions in daml-lf-verify by DA.Daml.LF.Ast.Subst (#6565)
Implementing substitution once is scary enough, let’s not implement it
twice.

Sadly this is also does not fix the bug I was hoping to address.

I would not be surprised if it does fix some bugs but given that I
don’t know which there is no new testcase.

changelog_begin
changelog_end
2020-07-02 08:34:40 +02:00
Stephen Compall
86148c398b
make @silent annotations narrower (#6570)
* check that all @silent annotations are used

CHANGELOG_BEGIN
CHANGELOG_END

* make all @silent annotations very specific about what they're silencing
2020-07-01 20:53:22 +00:00
Miklos
5302c57593
Make record time optional for committers (#6538) 2020-07-01 19:20:07 +02:00
Moritz Kiefer
cf4fcb560b
Fix the package version of daml-trigger and daml-script (#6566)
It makes no sense to keep this at 0.0.1.

changelog_begin

- [DAML Script] The DAML Script library now has the version of the
  corresponding SDK.

- [DAML Trigger] The DAML Trigger library now has the version of the
  corresponding SDK.

changelog_end
2020-07-01 19:06:00 +02:00
fabiotudone-da
bf36f32fca
CommitContext records accessed input keys (#6561)
* `CommitContext` records accessed input keys

CHANGELOG_BEGIN
CHANGELOG_END

* Simplify state and tests for `accessedInputKeys`.

* Add note about stable VS deterministic iteration order

* Add test about not recording input keys that are not accessed.

* Use regular a regular set for accessed keys as nor iteration stability nor determinism are needed
2020-07-01 16:57:37 +00:00
Remy
817465defa
LF-Repl: log loading/compilation/validation time (#6549)
CHANGELOG_BEGIN
CHANGELOG_END
2020-07-01 18:28:43 +02:00
Andreas Herrmann
1cdea4ad27
Daml REPL - use data dependencies (#6563)
* Fix haddock typo

* Daml REPL - use data dependencies

Without this a DAR that has a transitive dependency on another DAR
cannot be loaded into the REPL since the interfaces are missing, with
data-dependencies they are reconstructed.

CHANGELOG_BEGIN
- [DAML REPL] The provided DAR is now loaded as a data-dependencies,
  meaning that the REPL supports loading DARs with transitive
  dependencies.
CHANGELOG_END

* REPL test - use indirect DAR dependency

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-07-01 16:11:30 +00:00
Stephen Compall
7622862312
upgrade to Wartremover 2.4.9 (#6551)
* upgrade to wartremover 2.4.9

* simplify wart list and list JavaConversions as disabled

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* delete long-obsolete, contradictory comment

* also upgrade wartremover in compatibility (leaving aside maven_install.json)

* update compatibility maven_install.json to match
2020-07-01 15:02:58 +00:00
Rohan Jacob-Rao
bdaf9aa216
Trigger service: restart triggers in database on server startup (#6556)
* Add optional trigger id to startTrigger

CHANGELOG_BEGIN
CHANGELOG_END

* Read running trigger table in DbTriggerDao

And get rid of traverse type application!
(since we have partial unification on)

* Restart triggers in database

* Test for trigger restart on recovery

* Add order by clause and remove accidental overloading
2020-07-01 13:22:23 +00:00
Sofia Faro
1908328383
Prepare snapshot release (#6559)
changelog_begin
changelog_end
2020-07-01 12:43:47 +02:00
Robin Krom
bdbefd11ff
update to newest version of the daml cheat sheet. (#6547)
CHANGELOG_BEGIN
CHANGELOG_END
2020-07-01 11:04:16 +02:00
Gary Verhaegen
72851d83e9
refactor speedy.Compiler.freeVars to be functional (#6542)
I was trying to track down what looks like a new source of flakiness in
the ANF work (#6440), which manifested in a stack overflow on the
recursion of the `go` function in speedy.Compiler. I spent a bit of time
refactoring this to be functional in order to then trampoline it, only
to realize afterwards that I had worked on `freeVars/go` whereas the one
blowing up the stack was `validate/go`.

Obviously, it did nothing to reduce the rate of flakiness on the stack
overflow issue I was trying to address, as it's a separate function.

So there isn't really a good reason for this change, except I had done
it and I do believe the code looks marginally nicer, so might as well
submit it.

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-01 07:26:10 +00:00
Rohan Jacob-Rao
546c75b74f
Trigger service: Remove data in messages from TriggerRunnerImpl to Server (#6554)
* Remove data from message sent from TriggerRunnerImpl to Server

* Remove unused trigger name from config

changelog_begin
changelog_end
2020-06-30 21:02:10 -04:00
Moritz Kiefer
bc3f485b9a
Update maven_install.json in compatibility tests (#6555)
We take our own libraries from latest_stable_version which changed but
we did not rerun pinning which meant that this did not get updated.

changelog_begin
changelog_end
2020-07-01 00:49:53 +00:00
Rohan Jacob-Rao
ea16ff350d
Trigger service: Change to restart strategy with backoff (#6552)
* Add min/maxRestartInterval to configs and use in trigger restart strategy

* Adapt tests with triggers failing due to lack of network

changelog_begin
changelog_end

* Adapt tests for triggers with errors

* Remove comment about number of restarts

* Use a small initial restart interval for testing

* Remove old restart params

* Move maxInboundMessageSize to LedgerConfig

* Rename TriggerRunnerConfig to TriggerRestartConfig
2020-06-30 20:46:23 -04:00