Commit Graph

4369 Commits

Author SHA1 Message Date
Remy
bffc289868
DAML-LF: deprecate Transaction.TContractId (#6223)
CHANGELOG_BEGIN
CHANGELOG_END
2020-06-04 19:13:41 +02:00
Shayne Fletcher
322b93c7e7
Temporarily disable flaky test (#6228)
changelog_begin
changelog_end
2020-06-04 12:04:35 -04:00
Martin Huschenbett
6d71475745
DAML profiler: Make output user friendlier (#6226)
In order to make the flamegraphs easier to consume by humans, we change
the profiler output in the following ways:

1. Don't print package ids anymore. They are not particularly useful
   but cause a lot of noise.
2. Remove a few useless angle bracket and move the printed names of
   DAML-LF closer to their surface level names.
3. Unmangle identifiers on a best effort basis.
4. Give the profiles shorter names such that they don't occupy the
   whole screen and leave some space for the navigation buttons of the
   Speedscope UI.

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-04 16:03:49 +00:00
Martin Huschenbett
4a176c4f46
Sandbox: Fix build instructions in README (#6227)
CHANGELOG_BEGIN
CHANGELOG_END
2020-06-04 15:52:51 +00:00
Miklos
60b46bbe57
Expose configuration of interceptors via LedgerFactory (#6224) 2020-06-04 17:13:04 +02:00
Stephen Compall
8e3e296572
factor common structure in RawBatch.Event (#6216)
CHANGELOG_BEGIN
CHANGELOG_END
2020-06-04 09:55:28 -04:00
Shayne Fletcher
2c3efc6c4f
Refactor startTrigger (#6219)
changelog_begin
changelog_end
2020-06-04 09:30:47 -04:00
Rohan Jacob-Rao
09254a0fa8
Trigger service: streamline running tests with and without the database (#6205)
This adds a function withTriggerServiceAndDb which runs a test twice, once with and once without a database, and succeeds if both succeed. This will be useful for reusing test logic with both backends and making sure behaviour is consistent. I have used this function where possible, but it won't work for everything until stop is implemented on the DB side.

At the moment this new function squashes two tests into one making it hard to tell whether it failed with or without the database. In a future PR I will investigate using an abstract class to run the tests separately (hopefully with altered descriptions).

This feature required a few changes in the process, mainly:
- Use PostgresAroundAll to connect/disconnect to the database before and after all tests run
- Add a destroy method to the TriggerDao to reset the database between tests
- Use the TriggerDao in the withTriggerService functions to initialize / clean up the database at the start / end of each test
- Sort trigger instances from list using Scala's sort, not relying on Postgres' ordering of UUIDs. This also means we need to use UUIDs for trigger instances in the tests and sort nonempty vectors in expected results.
2020-06-04 09:30:26 -04:00
Moritz Kiefer
f1822f6daa
Fix variable in daily slack notifications (#6221)
Currently the report fails with variables[Build.SourceBranchName]:
command not found which is obviously not what we want (it’s mixing up
the syntax in Azure’s yaml config and Bash). Looking at the
code in the tell-slack-failed.yml, this one does seem to work but I
haven’t tested this so :crossed-fingers:.

changelog_begin
changelog_end
2020-06-04 12:41:36 +02:00
Gary Verhaegen
2fe320fe48
automated ghc-lib build (#6188)
automated ghc-lib build

This PR aims at automating the build of ghc-lib. The current process
still has a few manual steps; it needs to be updated because Bintray is
going away, so this seemed like a good opportunity to fully automate it.

This works like the "patch bazel on Windows" jobs: the filename will
contain a hash of the `ci/da-ghc-lib` folder, and the job will run only
if the corresponding filename does not yet exist on the GCS bucket. PRs
aiming at changing the ghc-lib version will need to run twice: once to
create the artifacts, and once to change the `stack-snapshot.yaml` file
to match.

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-04 12:05:03 +02:00
Stefano Baghino
003549ecbf
Introduce CLI option for input buffer size (#6211)
* Introduce CLI option for input buffer size

Also improves CLI help text for other back-pressure related options.

changelog_begin
[Sandbox] Allow to configure --input-buffer-size, which allows to tune the number of commands waiting to be submitted before the Sandbox applies back-pressure, run daml sandbox --help for more info.
changelog_end

* Update ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/cli/Cli.scala

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

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-06-04 06:50:50 +00:00
Moritz Kiefer
b993339844
Include rules_haskell revision in platform suffix (#6209)
* Include rules_haskell revision in platform suffix

Hopefully this makes CI a bit less of a dumpsterfire. I’ve also
followed the comment and made the suffix actually 3 characters long
instead of 2 since that makes me worry less about collisions and
should hopefully still be short enough to not hit MAX_PATH.

changelog_begin
changelog_end

* Update ci/configure-bazel.sh

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2020-06-03 21:33:37 +02:00
Shayne Fletcher
c2961b1957
Make the stop endpoint more robust and test (#6217)
* Make the stop endpoint more robust and test

changelog_begin
changelog_end

* Stopping an unknown trigger gives 404
2020-06-03 18:56:51 +00:00
Moritz Kiefer
8390dff7f9
Only force the result of GeneratePackageMap to whnf (#6213)
This rule is repeated for every file. While we cache the computation,
we still forced it to NF which is super slow. On my (realworld)
testcase, this is a speedup of > 1.7x, cuts allocations to 1/3 and max
residency also goes down to 1/3.

changelog_begin
changelog_end
2020-06-03 16:12:39 +00:00
Moritz Kiefer
a6d88d1a48
Clarify docs on type annotations for Decimal (#6214)
changelog_begin
changelog_end
2020-06-03 18:07:47 +02:00
Shayne Fletcher
6be68dc059
Renfinements to error test DAMLs (#6212)
changelog_begin
changelog_end
2020-06-03 15:02:53 +00:00
Moritz Kiefer
49a66515bd
Document requirement for type annotation on Decimal (#6210)
changelog_begin
changelog_end
2020-06-03 16:38:39 +02:00
Gary Verhaegen
58d5d31a49
improve release.sh (#6208)
This small PR makes a few QoL improvements to the release.sh script:

1. The snapshot command will now work for any commit. Previously, it
   would refuse to print the snapshot suffix for commits that were not
   ancestors of the `master` branch. The new version will print a
   warning if the commit does not seem to be part of a release branch,
   but will still print the result.

2. On checking the LATEST file, the script will now print a slightly
   more useful error message if the file format is not valid.

3. The snapshot command will now print the entire line to be added into
   the LATEST file, rather than just the version suffix.

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-03 16:36:49 +02:00
Gary Verhaegen
445f6467d9
daily run: warn on master only (#6177)
Currently the message to Slack is always triggered by running the daily
checks. This means that it gets very noisy to:

1. Run the check on PRs affecting the check (like this one),
2. Rerun the check multiple times to ascertain that a given failure is
   flaky.

With this PR, the message to Slack is replaced with a simple `echo` when
these checks are not run from the `master` branch, so whoever (manually)
triggered them can still get feedback on the result, but other people
don't get spurious `@here` mentions.

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-03 16:36:05 +02:00
Flash Sheridan
2dd034d9d4
“Few” in “None of the variables have annotations” (#6203)
Change “None” to “Few” in “None of the variables have annotations”, since daml/daml-intro-3/Native.daml#L16 has `my_dec = 0.001 : Decimal`
2020-06-03 16:05:36 +02:00
Miklos
b0c1b5a2b3
Improve batched submission validation related docs (#6186) 2020-06-03 15:20:09 +02:00
Stefano Baghino
c2a7c4966c
Release new snapshot (#6207)
changelog_begin
changelog_end
2020-06-03 13:31:34 +02:00
Martin Huschenbett
d637e4fa7f
@daml/react: Initialize loading indicators of hooks with true (#6196)
Having them set to `false` when they will immediately bet set to `true`
does not make too much sense. This allows for simplifying uses of
`useFetchByKey` where the key is know to always be present since you
can now operate under the assumption that the contract is never `null`
when the loading indicator is `false`.

This fixes #6171.

CHANGELOG_BEGIN
- @daml/react: Initialize the loading indicators of ``useQuery``,
  ``useFetchByKey`` and their streaming variants with ``true``. This
  removes a glitch where the loading indicator was ``false`` for a very
  brief moment when components using these hooks were mounted although
  no data had been loaded yet. Code using these hooks does not need to
  adapted in response to this change.
CHANGELOG_END
2020-06-03 10:52:36 +00:00
Moritz Kiefer
8fa28023e2
Fix --help output for sandbox time modes (#6206)
changelog_begin
changelog_end
2020-06-03 12:30:29 +02:00
Leonid Shlyapnikov
1386abc05a
move event witnesses directly into the participant_events table (#6172)
* events denormalization, WIP

* too soon to drop

* migration script

* add generated sha256 digest

* fixing the migration script naming

has to be double undescore after the version number

* flat event table queries

* write witnesses to events table during insert; disable inserts to witnesses tables

* use varchar[] for new witness columns instead of text[]

* ::varchar[] cast

* remove event witnesses table support code

* lookupFlatTransactionById works for postgres

* lookupTransactionTreeById works with postgres

* fixing the queries, replacing @> with &&

* cleanup

* multi-party postgres queries, WIP

* fixing multi-party queries, thanks @stefano.baghino

* fixing wildcardParties query

* minor cleanup

* h2 schema changes, h2 queries is WIP

* inlining some constants

* SqlFunctions introduced

* reformat

* Adding `SqlFunctions.arrayIntersectionValues`

* Adding `SqlFunctions.arrayIntersectionValues`

* Removing truncates for deleted tables

* Removing truncates for deleted tables

* filtering tree_event_witnesses

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2020-06-03 10:38:13 +02:00
Robin Krom
9835fafa9c
language: remove self-referencing links from docs (#6193)
This drops the `Documentation` section from the generated typescript
library docs on docs.daml.com, because it contains a link that points to
itself.

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-03 09:52:17 +02:00
Robert Autenrieth
dde5af0804
Add collectd metrics (#6189)
* Add collectd metrics

CHANGELOG_BEGIN
CHANGELOG_END

* Remove useless file

* Fix typo
2020-06-03 09:01:09 +02:00
Gary Verhaegen
81aff44497
1.2.0-snapshot.20200602.4310.0.1c18058f (#6201)
Includes the #6197 backport.

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-03 08:12:05 +02:00
Shayne Fletcher
5ff8ec69df
Trigger error cases (#6202)
changelog_begin
changelog_end
2020-06-02 19:29:43 -04:00
Brian Healey
d7eb458066
Update daml on fabric repo (#6197)
* Update daml on fabric repo

CHANGELOG_BEGIN
Update details for DAML-on-Fabric 2.0
CHANGELOG_END

Signed-off-by: Brian Healey <brian.healey@digitalasset.com>

* Fix digitalasset.com link

Co-authored-by: anthonylusardi-da <59614480+anthonylusardi-da@users.noreply.github.com>
2020-06-02 22:13:55 +02:00
Phoebe
29d39392ca
[create-daml-app] Change create daml app to run against several participants (#6089)
CHANGELOG_BEGIN
[create-daml-app] Change the create-daml-app template so that it can run against a HTTP JSON API port specified in the environment variable REACT_APP_LEDGER_ID
CHANGELOG_END
2020-06-02 21:13:41 +02:00
nickchapman-da
46cf3463bc
Optimize the execution of Saturated Builtin Applications in Speedy. (#6185)
* Optimize the execution of Saturated Builtin Applications in Speedy.

We special case applications where the expression in function-position is a builtin operator, and the number of arguments matches the arity of the builtin. The special-case detection is done at compile time, and allows for more efficient runtime execution, specifically:

- We don't need to construct an `SPAP` value, only to immediately deconstruct/enter it.
- We don't need to do arity checking at runtime, with special case handling for _partial-_ and _over-_ applications.

The change gives about 3% speedup.

changelog_begin
changelog_end

* improve doc comments & make class names more descriptive

* share code for evaluating arguments

* improve name: SEAppSaturatedBuiltinFun

* optimize over-applied builtin function applications

* fix bug in the refactoring which introduced evaluateArguments
2020-06-02 17:56:18 +00:00
Stephen Compall
39dc5aa88b
replace NodeExercises#controllers with controllersDifferFromActors boolean (#6073)
* replace NodeExercises#controllers with controllersDifferFromActors

* remove controllers from ActorMismatch and scenario service exercise

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* remove reserved ID #s in scenario-service grpc

As discussed, we don't need to worry about
version mismatches.

Co-authored-by: Remy <remy.haemmerle@daml.com>
2020-06-02 13:43:47 -04:00
Rohan Jacob-Rao
0b5762e437
Trigger service: use DB for start and list commands (#6153)
* Insert running trigger to DB when using one

If the DB write fails, the server sends itself a
TriggerInitializationFailure message so that the corresponding trigger
runner is stopped and the table is in sync with the actors.
We still need to retry writes here.

Includes basic test that runs the server with a JDBC config set and adds
a trigger, expecting a new entry to be added to the DB. However does not
check the running trigger table which we can do once reads are
implemented.

changelog_begin
changelog_end

* Await on future in test

* Update to new assertTriggerIds

* Apply scalafmt suggestions

* Create index on party token

* Read db in list command

* Update comment in test script

* Remove outdated comment

* Fix strings in insert and select

* Clean up test

* Add a second trigger in the db test

* Fix comment in test script

* Comment db tables

* Order trigger instances in list command

* Comment about TriggerDao execution context
2020-06-02 16:57:35 +00:00
Miklos
5be061c2ef
Enable caching of immutable state values only (#6187)
* Moved caching related classes to under validator.caching package.

* Introduced CacheUpdatePolicy for controlling what type of state keys should be updated in the cache and when.

* Consistently use 'cache update policy'.
CHANGELOG_BEGIN
CHANGELOG_END

* Made it explicit what policy we are testing against.
2020-06-02 16:50:39 +00:00
Leonid Rozenberg
0c63e06340
Remove older isLoading function calls. (#6181)
* Remove older isLoading function calls.

* Clarify omitting of query argument to use(Stream)Query

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
2020-06-02 16:46:54 +00:00
Stefano Baghino
de17510095
Document how to use compatibility sub-dir (#6194)
changelog_begin
changelog_end
2020-06-02 16:37:41 +00:00
Shayne Fletcher
256d48a431
Switch to timestamps not strings (#6191)
changelog_begin
changelog_end
2020-06-02 15:24:57 +00:00
Miklos
cb4917c812
Do not write output key whose value is identical to input (#6166)
CHANGELOG_BEGIN
* [kvutils] Do not commit output keys whose value is identical to input
CHANGELOG_END
2020-06-02 14:58:30 +02:00
Martin Huschenbett
a2d253fd45
DAML profiler: Use non-blocking IO for writing profiles (#6184)
* DAML profiler: Use non-blocking IO for writing profiles

As suggested by @SamirTalwar-DA.

CHANGELOG_BEGIN
CHANGELOG_END

* Follow Samir's advice even closer

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-02 12:55:09 +00:00
Shayne Fletcher
2de23d93c2
Trigger record status (#6180)
* Store trigger history

changelog_begin
changelog_end

* Harvest trigger histories

changelog_begin
changelog_end

* Switch to Vector over List (and other bits and bobs)

* Use a better verb for updating trigger status method

* Add a comment

* Fix mangled comments
2020-06-01 20:19:51 +00:00
Shayne Fletcher
41c967f1f1
Failure path testing (#6178)
changelog_begin
changelog_end
2020-06-01 12:50:51 -04:00
Gary Verhaegen
71d714510e
add find to dev-env (#6175)
The issues underlying #6173 prompted me to look into which `find`
version we had in dev-env, and I was surprised to notice we had none. We
already have `findutils` in our nix configuration, however, so this is
just adding the symlink.

Note that, on my machine at least, switching from the macOS-provided one
to the dev-env one does not change the result order for the hash
calculation in `ci/patch_bazel_windows`, so this would likely not have
helped for #6173. Still, we use `find` in many places in our scripts so
I think it's worth having there.

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-01 15:11:55 +02:00
nickchapman-da
c2c396467e
Special case atomic expressions in the functional-position of application (#6104)
* Special case atomic expressions in the functional-position of applications.

We regard builtins, values and variables as atomic. The special case detection is done at compile time; at run time, the atomic case avoids one push/pop on the continuation stack.

For the bench example, about 2/3 of the applications performed at run-time, fall into the special case, leading to an overall reduction in about 15% of the steps taken by the Speedy CEK machine.

This change gives a 3% to 4% performance improvement.

changelog_begin
changelog_end

* address review comments
2020-06-01 11:09:59 +00:00
Moritz Kiefer
405f3ad6ee
Sort files when calculating CACHE_KEY (#6173)
* Sort files when calculating CACHE_KEY

The order returned by `find` is unspecified and seems to have changed
for whatever reason in some cases. This changed the cache key which is
obviously not intended. It looks like the one we currently have in our
scoop manifest is the one that we get by sorting. Reversing the sort
produces the one CI currently calculates.

changelog_begin
changelog_end

* update manifest to match CI output

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2020-05-31 22:02:13 +02:00
Leonid Shlyapnikov
e097cf410b
Making PaginatingAsyncStream.streamFrom more generic (#6170)
* Making `PaginatingAsyncStream.streamFrom` more generic

so it does not specify what exactly `Offset` is.

changelog_begin
changelog_end

* Addressing code review comments + cleanup
2020-05-29 19:57:04 +00:00
Gerolf Seitz
e71e8e862d
Add LF value translation cache to Sandbox Classic (#6164)
* Add LF value translation cache to Sandbox Classic

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-29 19:00:58 +02:00
Moritz Kiefer
1c8691250d
Handle contract key failures due to visiblity in scenarios (#6165)
Previously, we just crashed the scenario service instead of throwing a
proper scenario error. This meant that you had to look at the
debugging output to figure out what is going wrong. This is both a
shitty UX and also inconsistent with how we handle this for fetch and
exercise on contract ids that are not visible. This PR adds a new
error type that matches the one for invisible contract ids.

changelog_begin

- [DAML Studio] Fetches and exercises of contract keys associated with
  contracts not visible to the submitter are now handled properly
  instead of showing a low-level error.

changelog_end

fixes #5903
2020-05-29 18:35:53 +02:00
Remy
5df8ac65ea
Engine: remove unnecessary pattern matching (#6167)
forgotten in #5991.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-29 18:22:17 +02:00
Gerolf Seitz
070bd18951
More detailed store transaction metrics (#6163)
* Add additional metrics when storing transactions

Since event witnesses will soon be denormalized into the participant_events
table, I did not include metrics right now.

CHANGELOG_BEGIN
[DAML Ledger Integration Kit] Add additional metrics for storing transactions. The overall time is measured by ``daml.index.db.store_ledger_entry``.
- Timer ``daml.index.db.store_ledger_entry.prepare_batches``: measures the time for preparing batch insert/delete statements
- Timer ``daml.index.db.store_ledger_entry.events_batch``: measures the time for inserting events
- Timer ``daml.index.db.store_ledger_entry.delete_contract_witnesses_batch``:  measures the time for deleting contract witnesses
- Timer ``daml.index.db.store_ledger_entry.delete_contracts_batch``: measures the time for deleting contracts
- Timer ``daml.index.db.store_ledger_entry.insert_contracts_batch``: measures the time for inserting contracts
- Timer ``daml.index.db.store_ledger_entry.insert_contract_witnesses_batch``: measures the time for inserting contract witnesses
- Timer ``daml.index.db.store_ledger_entry.insert_completion``: measures the time for inserting the completion
- Timer ``daml.index.db.store_ledger_entry.update_ledger_end``: measures the time for updating the ledger end
[Sandbox Classic] Added Timer ``daml.index.db.store_ledger_entry.commit_validation``: measure the time for commit validation in Sandbox Classic

CHANGELOG_END

* Refactoring: rename metrics *dao to *DbMetrics
2020-05-29 18:19:54 +02:00