Commit Graph

3599 Commits

Author SHA1 Message Date
Stefano Baghino
181df8f3ab
Act on Option2Iterable wart (#5154)
Some Option2Iterable ignore annotations are not needed, others were needed for unused methods.

In a few occasions we were ignoring the warning for the very purpose for which is was there,
i.e. avoiding an implicit conversion. I'm all for not verifying this rule if we agree we
don't need it.

For ProcessFailedException it was a bit gratuitous, I changed the way in which the exception
message is built.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-24 11:25:05 +00:00
Gary Verhaegen
4095538acf
match terraform with reality (#5143)
Our current Terraform setup attempts to create three static files on our
GCS buckets. The issue is that these buckets are configured to
automatically delete files that are older than X days, and there is no
way to exclude specific files from that. Therefore, the created files
disappear after some time, and running `terraform plan` suddenly looks
like the infrastructure has changed.

Moreover, the added value of these three files seems questionable: two
of them provide `index.html` type of functionality for our two caches,
whereas the third is automatically created by `nix` when pushing to the
cache anyway (if it doesn't exist already).

This PR also reduces the cache eviction time for the nix cache to 60
days, as a full year seemed a bit long.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-24 12:07:16 +01:00
Moritz Kiefer
2b47f6994d
Switch default DAML-LF target to 1.8 (#5127)
changelog_begin

- [DAML Compiler] The default output DAML-LF target version is now
  1.8. You can target 1.7 by specifying ``--target=1.7`` in the
  ``build-options`` field in your ``daml.yaml``.

changelog_end

Fix daml2ts tests
2020-03-24 11:02:13 +01:00
Moritz Kiefer
5cb7fc7c19
Disable bifunctor dlint rules (#5149)
changelog_begin
changelog_end
2020-03-24 10:43:05 +01:00
Stefano Baghino
37b7d855b8
Add test to ensure that the reset truncates all tables (#5142)
* Add test to ensure that the reset truncates all tables

The test can be adjusted over time to accomodate for exceptions (which are already there).

Unfortunataly we have to add a new couple of queries to support both Postgres and H2.

Fixes #5130

CHANGELOG_BEGIN
CHANGELOG_END

* Make loose check on configuration_entries
2020-03-24 09:18:14 +00:00
Remy
8fb86b7133
Engine: create type for immutable byte array (#5140)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-24 09:04:52 +01:00
Samir Talwar
22aa642a9f
sandbox: Add timers for all read, write, and index service methods. (#5147)
CHANGELOG_BEGIN
- [Sandbox] Added metrics under "daml.services" for various internal
  events.
CHANGELOG_END
2020-03-24 07:03:33 +00:00
Moritz Kiefer
ed67e5c188
Bump portfile retries (#5134)
We have seen a few test failures where the port file was not written
to in time. Apparently this can takes ages on CI for tests that are
not marked exclusive.

changelog_begin
changelog_end
2020-03-23 19:20:33 +01:00
Oliver Seeliger
3df5a6ec5b
Upgrade canton to 0.11.0 (#5144)
in turn based on 13.56-snapshot-20200318

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-23 18:06:38 +00:00
Shayne Fletcher
a5faa1cdbc
Use local paths in package dependencies (#5137)
changelog_begin
changelog_end
2020-03-23 13:54:56 -04:00
Remy
2dd9c50631
DAML-LF: contract id spec (#5106)
* DAML-LF: contract id spec

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-23 18:05:48 +01:00
Samir Talwar
e853012626
kvutils/app: Share the metrics registry between indexer and API server. (#5139)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-23 15:31:21 +00:00
Robert Autenrieth
c477b63a04
Store initial ledger configuration (#5126)
This is required by the "initialize before transaction acceptance"
invariant of the ReadService interface.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-23 15:39:13 +01:00
Stephen Compall
fb42845959
simplify websocket notes, remove an apparent contradiction (#5116)
- from a discussion with @meiersi-da and @hurryabit on #3878

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-23 09:59:49 -04:00
Moritz Kiefer
bef129605f
Fix fmt.sh (#5135)
grep returns with an exit code of 1 if there are no matches.

changelog_begin
changelog_end
2020-03-23 13:27:03 +00:00
Stefano Baghino
c26effb235
Expose both JDBC URL and database type in tests, centralize initialization (#5133)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-23 12:17:24 +00:00
Moritz Kiefer
aa48f3026e
Bump ghcide (#5128)
This PR bumps ghcide, haskell-lsp and haskell-lsp-types. There aren’t
really any important changes in ghcide itself but the haskell-lsp
update includes my fix for crashing completions.

One change in ghcide itself is that NormalizedFilePath got moved to
haskell-lsp. ghcide needs special treatment for empty file paths so we
use `toNormalizedFilePath'` from ghcide instead of
`toNormalizedFilePath` from `haskell-lsp`. I’ve added an hlint rule to
enforce this.

changelog_begin
changelog_end
2020-03-23 12:09:36 +00:00
Stefano Baghino
ceeb7c3487
Re-use AkkaBeforeAndAfterAll in AbstractSandboxFixture (#5132)
* Re-use AkkaBeforeAndAfterAll in AbstractSandboxFixture

CHANGELOG_BEGIN
CHANGELOG_END

* Do not expose the Akka execution context directly
2020-03-23 11:56:47 +00:00
Samir Talwar
3d6ecc13b6
Sandbox: Configurable metrics output. (#5113)
* sandbox: Clean up `MetricsReporting` a little.

Make sure it closes both reporters, and avoid starting things in a
constructor.

* sandbox: Add hidden options for enable metrics reporting.

* sandbox: Add a disambiguating name to the DB connection/thread pools.

CHANGELOG_BEGIN
- [Sandbox] DB connection pool metrics names have changed slightly, from
  ``daml.index.db.connection`` to ``daml.index.db.connection.sandbox``.
- [Ledger Integration Kit] DB connection pool metrics names have changed
  to disambiguate the StandaloneApiServer from the
  StandaloneIndexerServer. The former now has a ``.ledger-api-server``
  suffix, and the latter now has a ``.indexer`` suffix.
CHANGELOG_END

* sandbox-next: Use the same metrics registry for the API and indexer.

* sandbox: Give a useful error message on an invalid metrics reporter.

And simplify the error messages.

With the arguments `--client-auth=foo --metrics-reporter=foo`, we now
get the output:

```
Error: Option --client-auth failed when given 'foo'. Must be one of
  "none", "optional", or "require".
Error: Option --metrics-reporter failed when given 'foo'. Must be one of
  "console", or "csv:PATH".
Try --help for more information.
```

* sandbox: Pull out more helpers in `MetricsReporting`.

* sandbox: Rename MetricsReporter classes so they don't clash.

* sandbox: Wrap the `name` parameter in a `ServerName` tagged string.

For safety. Yours, not mine.

* sandbox: Push metrics to Graphite with `--metrics-reporter=graphite`.

* sandbox: Make `MetricsReporter.Graphite` singly-lazy, not doubly-.

Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* sandbox: Replace `ServerName` with `ServerRole`.

* sandbox: Fix usage of `ServerRole.Testing` in `LedgerResource`.

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2020-03-23 10:59:13 +00:00
Stefano Baghino
c00af40fe5
Cleanup: InfiniteRetries is used only in sandox-perf (#5131)
* Cleanup: InfiniteRetries is used only in sandox-perf

CHANGELOG_BEGIN
CHANGELOG_END

* Fix import
2020-03-23 10:49:11 +00:00
Stefano Baghino
97ec70e508
Add missing truncations from reset service and fix perf tests (#5129)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-23 10:36:32 +00:00
Gary Verhaegen
95d9cdb567
faster hlint with fmt.sh --diff (#5114)
This PR adds new behaviour to the existing --scalafmt-diff flag to also
use a diff-based approach for hlint. Consequently, the flag is renamed
to the simpler and more generic `--diff`, in a backwards-compatible way.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-23 11:22:02 +01:00
Gerolf Seitz
f9fb888cc4
Allow for predictable contractIDs and transactionIDs (#5112)
- New seeding type "Static" that uses a fixed seed for generating new seeds.
This is only used in Sandbox and Sandbox-next.

- Remove the fuzzing for submission time in Engine.scala

- DAML-on-SQL: Create new log entry IDs from a provided SeedService.
This allows for generating deterministic transaction IDs in
Sandbox-Next.

Fixes #5107

CHANGELOG_BEGIN
[Sandbox] Add contract-id-seeding=static to allow for predictable contract IDs. This is useful for documentation,
to be able to refer to a specific contract ID instead of having to write "note down the contract ID you see on the screen. we will use it later."
[DAML-on-SQL] Derive the next log entry ID using the provided SeedService. This allows us to also deterministically create transactionIds in static time mode together with `--contract-id-seeding=static`. This should only be used for demos or documentation.
CHANGELOG_END
2020-03-23 10:55:40 +01:00
Samir Talwar
3e95bb7bec
Sandbox: Simplify the ApiCommandService a little. (#5125)
* sandbox: Remove a few levels of indentation in `ApiCommandService`.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox: Get rid of the `LowLevelCommandServiceAccess` trait.

It only has one implementation. Just use it.

* sandbox: Remove unused type aliases from ApiCommandService.
2020-03-23 08:55:25 +00:00
Samir Talwar
28c78e5978
sandbox | kvutils/app: Re-use the Materializer in the JdbcIndexer. (#5124)
* kvutils/app|sandbox: Rename `system` to `actorSystem`.

* sandbox: Pass a materializer in to the StandaloneIndexerServer.

There's no need for it to construct one when the caller always has one
available.

CHANGELOG_BEGIN
CHANGELOG_END

* recovering-indexer: Use `SubmissionId` instead of `LedgerString`.

Where appropriate.

* sandbox: Use the materializer implicitly in JdbcIndexer.
2020-03-23 08:55:19 +00:00
Oliver Seeliger
45acfec218
Ledger api server indexer initializes proper ledger_end after restart (#5122)
by reading parameters.ledger_end column instead of parameters.external_ledger_end.

CHANGELOG_BEGIN
[Ledger API Server]: Upon restart, ledger api server continues consuming unconsumed events rather than
all events from beginning.
CHANGELOG_END

Closes #5121
2020-03-23 09:53:48 +01:00
Gerolf Seitz
e82b8d743b
Add missing truncate for participant_events (#5117)
The missing truncate caused "Duplicate Submissions" after a reset in
between the performance tests.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-23 09:06:02 +01:00
Shayne Fletcher
2525a4610a
Update hlint (#5123)
changelog_begin
changelog_end
2020-03-22 16:30:11 +00:00
Shayne Fletcher
bf22d8db59
Fix package name (#5120)
changelog_begin
changelog_end
2020-03-22 12:01:56 -04:00
Stephen Compall
f2b068f0b5
remove List and TextMap support from the JSON query language (#5099)
* remove List and TextMap support from the JSON query language

CHANGELOG_BEGIN
- [JSON API - Experimental] Removed support for maps and lists from the query language.
  See `issue #4855 <https://github.com/digital-asset/daml/issues/4855>`_.
CHANGELOG_END

* GenMap won't be supported in general, remove FIXME

- thanks @leo-da

* more documentation on unsupported query types

- as suggested by @hurryabit; thanks
2020-03-20 16:22:22 -04:00
Andreas Herrmann
4f7c52c981
DAML script runner takes CompiledPackages (#5110)
* daml-script runner from compiledPackages

* Factor out script parameter conversion

* Use ADT for DAML script (Action & Function)

* run --> runwithClients

* DAMl script Runner `run` convenience function

* REPL use pure script runner constructor

* DAML script runner holds script itself

* scalafmt

* comments

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-03-20 17:52:54 +00:00
Stefano Baghino
f67c32b002
Integrate transaction lookup on new schema in Ledger API (#5104)
* Integrate transaction lookup on new schema in Ledger API

Re-wires all transaction lookups to the new schema

CHANGELOG_BEGIN
CHANGELOG_END

* Always return the agreement text

CHANGELOG_BEGIN
[Ledger API Server] The metric 'daml.index.lookup_transaction' has been
replaced by 'daml.index.lookup_flat_transaction_by_id' and
'daml.index.lookup_transaction_tree_by_id', which record the same events
but with more granularity regarding the type of lookup.
CHANGELOG_END

* Ensure agreement text invariant in a single place

* Do not compare the order in which witness parties appear in an event

* Hide command identifier from non-submitters in transaction trees

* Fix time assigned to transaction to be the ledger effective time and not the record time

* Store transactions from initial state into the new schema
2020-03-20 17:22:42 +00:00
Leonid Shlyapnikov
ffabc2b3e5
Bumping up http-json tests size to large, adding some extra logging (#5109)
* Bumping up http-json tests size to large, adding some extra logging

* Removing the logging from prod code, adding some in tests.

changelog_begin
changelog_end
2020-03-20 16:48:11 +00:00
Moritz Kiefer
be7f0802c6
Bump ghcide (#5103)
This includes some completion improvements.

changelog_begin
changelog_end
2020-03-20 16:43:59 +00:00
Samir Talwar
1ffd23a6a2
Sandbox: Make JdbcLedgerDao create its own execution context. (#5091)
* sandbox: Don't let just anyone construct a DbDispatcher.

It's the job of the JdbcLedgerDao.

* sandbox: Clean up the DbDispatcher a little.

* sandbox: JdbcLedgerDao now creates its own execution context.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox: Make `defaultNumberOfShortLivedConnections` private.
2020-03-20 15:30:35 +00:00
Moritz Kiefer
18033271de
Remove bzip2 library (#5105)
This used to be a dependency of our zip library that you couldn’t
disable. However, in the meantime it has gotten a flag to disable
it and we don’t actually use it. Given that the upstream URL is dead
atm now seems like a good time to kill it.

changelog_begin
changelog_end
2020-03-20 15:05:33 +01:00
Gary Verhaegen
b45c7aed69
fix 0.13.55 release notes typo (#5074)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-20 13:25:23 +00:00
Stefano Baghino
febace7391
Add lookup for transaction tree by id (#5089)
* Add lookup for transaction tree by id

CHANGELOG_BEGIN
CHANGELOG_END

* Address https://github.com/digital-asset/daml/pull/5089#discussion_r395156203

* Address https://github.com/digital-asset/daml/pull/5089#discussion_r395163051

* Address https://github.com/digital-asset/daml/pull/5089#discussion_r395165561

* Address multiple comments

- https://github.com/digital-asset/daml/pull/5089#discussion_r395185084
- https://github.com/digital-asset/daml/pull/5089#discussion_r395185290
- https://github.com/digital-asset/daml/pull/5089#discussion_r395185461

* Address https://github.com/digital-asset/daml/pull/5089#discussion_r395157643

* Address https://github.com/digital-asset/daml/pull/5089#discussion_r395160343

* Address https://github.com/digital-asset/daml/pull/5089#discussion_r395482878

* Use refactored testing utilities

* Add test for partial transaction visibility
2020-03-20 13:28:11 +01:00
Stefano Baghino
a7c01e1b6f
Refactor transaction generation and add generation of more complex transaction (#5101)
Makes storing and generating test transaction more composable (store just takes a generated transaction)

- Add a nonTransient utility method to retrieve contracts that have been created but not consumed as part of a transaction
- Add an addChildren utility method to add children to a transaction to allow to create more complex test transactions
- Add a transaction generator that uses the aforementioned addChildren to create a more complex transaction

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-20 12:03:18 +01:00
Martin Huschenbett
7037f4b6a8
Getting started guide: Invoke daml start directly (#5102)
* Getting started guide: Invoke daml start directly

Since we no can configure arguments we wish to pass to DAML Sandbox
when running `daml start` in `daml.yaml`, we don't need the mysterious
`daml-start.sh` script anymore. That's why
https://github.com/digital-asset/create-daml-app/pull/78
removes the script from `create-daml-app`.

This PR adjust the getting started guide accordingly.

This fixes #4295.

CHANGELOG_BEGIN
CHANGELOG_END

* Fix expected message when daml start successful
2020-03-20 10:57:23 +00:00
Samir Talwar
6f9b516251
Sandbox: Remove duplication in JdbcIndexerFactory. (#5096)
* sandbox: Remove duplicate parameters in JdbcIndexerFactory.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox: `InitializedJdbcIndexerFactory` is just a ResourceOwner now.

* sandbox: Rename helper methods in `JdbcIndexerFactory`.

* sandbox: Make `JdbcIndexer#initialized` look like it does something.
2020-03-20 09:45:40 +00:00
Robin Krom
7a9648c714
language: react: tests for useReload. (#5095)
This adds tests to see that the `useReload` hook of @daml/react works.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-19 22:25:28 +01:00
Shayne Fletcher
78d34dd9ca
Experiment with 'eitherDecode' (#5098)
changelog_begin
changelog_end
2020-03-19 20:07:19 +00:00
Stefano Baghino
d966c17f0b
Refactor events (#5097)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-19 19:18:47 +01:00
Moritz Kiefer
be90649186
Support partial patterns in DAML repl (#5093)
* Support partial patterns in DAML repl

This PR improves the support for partial patterns in DAML repl by
making sure that they fail on the line itself rather than some
subsequent line and avoids the partial pattern match warnings on all
following lines.

changelog_begin
changelog_end

* Fix tests
2020-03-19 17:28:40 +00:00
Martin Huschenbett
8bd2172569
daml2ts: Remove "itself" from progress output (#5088)
I've received some feedback that the "itself" in
```
Generating <some hash> as itself
```
is confusing. Also, the first noun in each line said what is being
_processed_ not what is being _generated_. I've fixed that too.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-19 18:05:54 +01:00
Moritz Kiefer
c2c0557970
Support complex patterns in DAML REPL (#5087)
* Support complex patterns in DAML REPL

Previously, we only supported simple variable patterns in DAML
repl. This PR extends this to support pretty much all patterns. The
main complexity here is in handling shadowing correctly but I’m
reasonably confident the solution here is sensible.

What doesn’t work properly yet is partial patterns. I’ve added a
comment describing the issue and a potential solution. Given that this
isn’t a regression apart from maybe a slightly worse error message, I
think it makes sense to merge this PR and fix that separately.

changelog_begin

- [DAML REPL - Experimental] You can now use more complex patterns in
  statements, e.g., ``(x,y) <- pure (1,2)``.

changelog_end

* Update compiler/damlc/daml-compiler/src/DA/Daml/Compiler/Repl.hs

Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>

* Update compiler/damlc/daml-compiler/src/DA/Daml/Compiler/Repl.hs

Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>

* Improve error messages

* update documentation

Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
2020-03-19 16:17:50 +00:00
Robin Krom
b7f36d5e10
streamQuery tests (#5059)
* language:daml-react: tests for useStreamQuery/useStreamFetchByKey

This adds tests for `useStreamQuery` and `useStreamFetchByKey` of the
`@daml/react` library.

CHANGELOG_BEGIN
CHANGELOG_END

* renamed hooks.test.ts -> index.test.ts
2020-03-19 16:42:34 +01:00
Samir Talwar
82f2685e89
sandbox: Fix warnings by making test variables private. (#5086)
And move them to a companion object, just in case.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-19 14:12:06 +00:00
Remy
1216fd1a6f
Engine: fix missing usage of Enum Svalue rank (#5083)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-19 14:27:13 +01:00