Commit Graph

4359 Commits

Author SHA1 Message Date
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
Leonid Shlyapnikov
12c05c408a
Experiment: replacing row OFFSET with ledger offset (#6083)
* Experiment: replacing row OFFSET with ledger offset in the flat transactions query for one party.

if this improves the perf numbers, the rest of the queries can be updated.

* Flat transaction query optimization:

replacing row offset with ledger offset

* Flat transaction query optimization:

replacing row offset with ledger offset

* transaction tree query optimization

changelog_begin

[Sandbox-next/Postgres]
Flat Transaction Stream, Transaction Tree Stream SQL query optimizations.
Pagination based on Ledger Offset instead of SQL Row Offset.

changelog_end

* Addressing code review comments
2020-05-29 11:49:46 -04:00
Miklos
655c0a5425
Fix flaky tests for ledger-on-memory (#6160) 2020-05-29 15:33:10 +02:00
Martin Huschenbett
9d955d7039
Expose the DAML profiler in Sandbox Classic (#6151)
* Expose the DAML profiler in Sandbox Classic

This PR adds an option `--profile-dir` to Sandbox Classic which takes
a directory as its argument. When this option is used, all command
submissions to the Sandbox are run in profiling more and the resulting
profiling information is written to the directory specified via
`--profile-dir`. See `/ledger/sandbox/README.md#Profiling` for further
details on this.

CHANGELOG_BEGIN
CHANGELOG_END

* Adapt DAML-LF REPL

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-29 15:00:40 +02:00
Gerolf Seitz
c423f58f39
Collect active contract lookup time per execution (#6161)
CHANGELOG_BEGIN
[DAML Ledger Integration Kit]: Added 4 new metrics for more detailed execution time statistics:
- Timer ``daml.execution.lookup_active_contract_per_execution``: measures the accumulated time spent for looking up active contracts per execution
- Histogram ``daml.execution.lookup_active_contract_count_per_execution``: measures the number of active contract lookups per execution
- Timer ``daml.execution.lookup_contract_key_per_execution``: measures the accumulated time spent for looking up contract keys per execution
- Histogram ``daml.execution.lookup_contract_key_count_per_execution``: measures the number of contract key lookups per execution
CHANGELOG_END
2020-05-29 14:34:07 +02:00
Stephen Compall
3ad9f2b52f
declare http-json Streaming API as stable (#6152)
CHANGELOG_BEGIN
- [JSON API] The WebSocket endpoints ``/v1/stream/query`` and ``/v1/stream/fetch`` are now
  stable; these endpoints in SDK v1.0.0 are fully compatible with this first officially
  stable version.
  See `issue #6152 <https://github.com/digital-asset/daml/pull/6152>`_.
CHANGELOG_END
2020-05-29 08:33:11 -04:00
Miklos
404d043b22
Fix metrics for parallel validator (#6145) 2020-05-29 12:29:52 +02:00
Stefano Baghino
070e39d4df
Improve error message for unsuccessful key lookups (#6148)
changelog_begin
[Runtime] Improved error messages on unsuccessful key lookups
changelog_end
2020-05-29 09:57:13 +00:00
Moritz Kiefer
3cce4b7098
Include the transaction service in sandbox migration tests (#6158)
This PR extends the existing sandbox migration tests with a query to
the transaction service before and after running each step and
corresponding validations for that in the migration runner.

changelog_begin
changelog_end
2020-05-29 11:43:01 +02:00
Moritz Kiefer
94664db5ee
Release new snapshot (#6154)
New snapshot to include the `module-prefixes` feature. Hopefully this
is everything we need in 1.2.

changelog_begin
changelog_end
2020-05-29 10:58:24 +02:00
Moritz Kiefer
d2d3af165a
Mark build-and-lint codegen tests as flaky (#6156)
changelog_begin
changelog_end
2020-05-29 10:05:37 +02:00