Commit Graph

2553 Commits

Author SHA1 Message Date
associahedron
9a27ed092f Prepare release 0.13.39 (#3750) 2019-12-05 20:08:12 +00:00
Gerolf Seitz
0c00b28c83
Party management (#3744)
* Implement Async party allocation

* Address Jussi's review.

- Remove comments about implicit party entries
- Remove PollingUtils#pollSingleUntilPersisted
- Remove ill-placed comment in SqlLedger

Review: https://github.com/digital-asset/daml/pull/3744#pullrequestreview-327453144

* Address Samir's review

- Slight improvement in InMemoryKVParticipantStateIT
- Fix typo in scaladoc
- Fix SqlLedgerSpec: remove unused param and rephrase clues

Review: https://github.com/digital-asset/daml/pull/3744#pullrequestreview-327461368

* Address Stefano's review

Review: https://github.com/digital-asset/daml/pull/3744#pullrequestreview-327455206

* Only poll from the ledger end just before submitting the party allocation request.
2019-12-05 17:50:21 +01:00
Stephen Compall
1388ebd695 compile ValuePredicates to SQL and run json-api queries in Postgres (#3599)
* toSqlWhereClause WIP

* literal cases for SQL predicate generation

* fill in the remaining Literals' sql-equal data

* add other likely elements of the toSqlWhereClause fold

* SQL ListMatch case

* SQL VariantMatch case

* partial SQL RecordSubset case

* SQL Range case

* comments on JSON encoding for DB

* new relationship for the 3 paths in toSqlWhereClause Rec

- conversion to Fragment is further delayed to allow mixed-mode matching
  of records

* handle new Rec semantics in ListMatch (can't drop @> on the floor anymore)

* compile RecordSubset to SQL

* compile MapMatch to SQL

* note optimization for record & map

* optimize = when @> unavailable for record subsets

* optimize range when degenerately =

* don't discard the @> safety of empty test sets

* unnested SQL optional matching

* converting DB JSON to response body JSON

* compiling nested optionals to SQL

* add missing length check to ListMatch

* remove unneeded parens from generated predicates

* remove 1 = 1 leader from generated predicates

* test the generated SQL from toSqlWhereClause

* searchDb WIP

* searchDb integrated

* coerce party to text in selectContracts; log that query

* fixing query

* fixing scala formatting

* removing unused functions

* removing unused type alias

* checking a that search returned exactly what we searched for,

also checking that all contracts got stored in the DB

* factor commonalities of MapMatch and RecordSubset

* cleanup

* cleanup

* changelog

CHANGELOG_BEGIN

- [JSON API - Experimental] Queries will always run against Postgres if Postgres is
  configured.  See `issue #3388 <https://github.com/digital-asset/daml/issues/3388>`_.

CHANGELOG_END

* fix record =-unsafe detection
2019-12-05 11:15:01 -05:00
Moritz Kiefer
e9d7e783f2
Fix incremental builds (#3751)
Sadly, I haven’t managed to come up with an isolated test case for
this but I’ve tested this on a large internal codebase and it fixes an
issue with damlc build --incremental=yes.
2019-12-05 17:07:20 +01:00
Remy
96b3e33c27 daml-lf: specified generic equality (#3740)
* daml-lf: specified generic equality

* polishing

* address reviews

* more polishing

* address Samir's comments
2019-12-05 15:47:49 +00:00
associahedron
8127a415d9
Add unstable experimental text primitives in DA.Text and LF 1.dev (#3734)
* Add experimental text primitives

* Implement SBTextSlice

* Implemented SBTextSliceIndex

* Implement toUpper / toLower

* Implement SBTextContainsOnly

* Implement SBTextReplicate

* Implement SBTextReplicate

* Implement SBTextSplitOn

* Implement SBTextIntercalate

* Add unstable primitives in LFConversion

* Add unstable text primitives in DA.Text

* Remove all the ASCII infixes

* Fix typing mishap

* Change numbering for unstable primitives

* Deal with UTF8

* More careful slice

* Fix typo

* Missing decoder
2019-12-05 14:35:50 +00:00
Samir Talwar
cb378017d9 sandbox: If the Flyway migrations fail, crash the process. (#3731)
* sandbox: If the Flyway migrations fail, crash the process.

Otherwise running it in the background can make it look like
everything's OK.

* reference-v2: If the Flyway migrations fail, crash the process.

Otherwise running it in the background can make it look like
everything's OK.

* sandbox: Remove an errant debugging `println`.

* sandbox: Use `DirectExecutionContext.implicitEC`.
2019-12-05 13:44:13 +00:00
Moritz Kiefer
022c60ccb3 Publish the thin trigger library instead of the fat jar (#3739)
This still contains the main class so you can use it like you would
use the fat jar but publishing fat jars to maven central is apparently
bad practise and some peple have asked for the library.

This includes some slight tweaks to the scala_docs rule to make it
capable of coping with the generated source file and a hack in the
release script to avoid it complaining about the scenario proto
library not being published to Maven even though it is included in the
transitive deps.
2019-12-05 13:04:20 +00:00
Stefano Baghino
5254520b80 Spin off TokenHolder into a new library (#3741)
* Spin off TokenHolder into a new library

Avoids having weird dependencies between different packages, makes TokenHolder available on Maven

* Fix auth-utils path
2019-12-05 12:31:14 +00:00
Darko Pilav
d8eebc866d Change range of snippet to be displayed (#3746)
Fixes #3745
2019-12-05 13:25:13 +01:00
Robin Krom
3f666792b1 language: suffix all dalfs dependencies in a dar with the pkgid. (#3668)
* language: suffix all dalfs dependencies in a dar with the pkgid.

This makes sure that dalf dependencies are not accidentally overwritten
when two packages with equally named dalfs are imported.

* factor out parseUnitId
2019-12-05 11:47:45 +00:00
Stefano Baghino
da9306414b Add authentication support to DamlLedgerClient (#3743)
Add documentation

CHANGELOG_BEGIN
- [Java Bindings] Added authentication support. See `issue #3626 <https://github.com/digital-asset/daml/issues/3626>`__.
CHANGELOG_END
2019-12-05 10:57:51 +00:00
Stefano Baghino
94aafd8121 Add authentication support to Java transaction client (#3733)
* Add authentication support to Java transaction client

* Address https://github.com/digital-asset/daml/pull/3733#discussion_r354182366
2019-12-05 10:17:30 +00:00
Jussi Mäki
f998887ad7
Draft of config management service (#3656)
* Add draft of config management service

* Add submission id to SetTimeModelRequest
2019-12-05 10:25:58 +01:00
nickchapman-da
1684b2290a daml assistant: expect auth token in Bearer format (#3736)
* daml assistant expected auth token in Bearer format

* Daml assistant does no validation of the auth token before passing in on to the ledger.

* clarify code with newtype Token
2019-12-05 09:19:02 +00:00
Robin Krom
ed4397b2eb language: add registerTemplate for daml2ts (#3737) 2019-12-05 09:07:16 +01:00
mziolekda
68fc7de296
Refactor kv party allocation committer (#3701)
* convert party allocation to the new committer pattern

* scalafmt

* Use map with optional values for kvutils input state

We need to do this to detect when a submission has maliciously
omitted an input key.
2019-12-05 08:22:39 +01:00
Rohan Jacob-Rao
77c3819ea6 Fix logic for blog notifications (stop treating arrays as strings) (#3738) 2019-12-04 21:12:21 +00:00
Moritz Kiefer
ba30e86911
Split wired-in modules into separate LF packages (#3696)
This is a first step towards making sure that the package ids for
types defined in daml-prim and daml-stdlib don’t change. This PR
mostly adds all the necessary infrastructure for that and moves
GHC.Types and GHC.Prim to make sure it works.

Until data-dependencies are really solid and we have verified that we
no longer have performance issues with an increasing number of Haskell
packages, we still include the source files in daml-prim and then just
rewrite the references.

We will also need to add tests that these packages really have stable
ids but I’ll leave that for separate PRs since this doesn’t make that
much sense anyway until all of the types have moved to stable
packages.

CHANGELOG_BEGIN

- [DAML Compiler] The modules GHC.Prim and GHC.Types from daml-prim
have been moved to separate packages.

CHANGELOG_END
2019-12-04 16:42:48 +01:00
Moritz Kiefer
208cd23b01 Switch to upstream ghc-lib release (#3725) 2019-12-04 14:20:35 +00:00
Martin Huschenbett
5c02b1a1c3 Make the daml2ts tests fail on generated unused imports/definitions (#3714)
* Make the daml2ts tests fail on generated unused imports/definitions

* Shut up buildifier
2019-12-04 14:08:50 +00:00
Jussi Mäki
95ddb65483
DAML Engine: accurate package dependency annotations (#3726)
* Track used packages during whole of engine submit

- Introduce MutableCompiledPackages interface
- Add TrackingCompiledPackages that tracks fetched packages
- Make used packages in transaction optional to distinguish between
  missing dependencies and empty set of dependencies.

* Reimplement package dependency tracking

- Compute direct dependencies of a package during decoding
- Compute transitive dependencies of a package when adding a package
  to engine.
- Annotate the resulting transaction with package dependencies
  in Engine.submit.

* Create Ast.Package with proper direct deps in scenario service

While we don't have use for direct dependencies of a package in
scenario service (only Engine.submit needs it), it's better to be
accurate.

This of course overapproximates the direct dependencies.

* Compile a each new package once in ConcurrentCompiledPackages
2019-12-04 15:01:21 +01:00
Robert Autenrieth
a827040e4c
Add authentication docs (#3661)
* Add authentication docs

* Use anonymous references

* Update obsolete info on authentication

* Improve authentication intro
2019-12-04 14:51:19 +01:00
Stefano Baghino
9e2d0127f2 Fix comment explaining required claims for services (#3727)
Addresses https://github.com/digital-asset/daml/pull/3721#discussion_r353644232
2019-12-04 13:33:17 +00:00
Moritz Kiefer
24b6dfd319
Support authentication in DAML triggers (#3730)
* Support authentication in DAML triggers

fixes #3259

CHANGELOG_BEGIN

- [DAML Triggers - Experimental] DAML triggers can now be run against
an authenticated ledger.

CHANGELOG_END

* Remove debug printf

* Windows is bad
2019-12-04 13:57:44 +01:00
Moritz Kiefer
08b98602b1
Build SDK head tarball directly (#3723)
Previously, we constructed the tarball used by daml-sdk-head by first
building the regular SDK release tarball only to the extract it, patch
the version file and recompress it. This adds about 30-60s to every
invocation of daml-sdk-head.

This PR changes this by factoring out the logic from building the
release tarball into a macro that we instantiate twice, once with the
proper version file and once with a dummy HEAD version file set to
0.0.0.

This does change the format of the sdk-head-tarball slightly, in
particular the files are now located under sdk-0.0.0 instead of
sdk-head. However, this doesn’t matter anyway afaik and I think the
new format makes more sense anyway considering that the regular
release tarballs have something like sdk-0.13.38.
2019-12-04 13:04:15 +01:00
Stefano Baghino
50d689d011 Optimize imports in //language-support/java/bindings-rxjava (#3728) 2019-12-04 11:08:13 +00:00
Stefano Baghino
ba0c5e8b30
Add support for authentication to Java command submission client (#3716)
* Add support for authentication to Java command submission client

* Fix compilation error
2019-12-04 11:31:50 +01:00
Stefano Baghino
36da75e1d6
Add authentication support to Java command completion client (#3713)
* Add authentication support to Java command completion client

* Address https://github.com/digital-asset/daml/pull/3713#discussion_r353629606
2019-12-04 11:31:21 +01:00
Stefano Baghino
8d5b4af0f2
Add support for authentication to Java time client (#3721) 2019-12-04 11:00:30 +01:00
Stefano Baghino
8eb5956f31
Add support for authentication to Java package client (#3720) 2019-12-04 10:42:48 +01:00
Moritz Kiefer
808e44d48d
Avoid running navigator from a temporary directory in daml ledger navigator (#3718)
This makes sure that navigator picks up things such as
`frontend-config.js` which is needed for custom tabs.

To get there, this PR does two things:

1. Change navigator such that it prefers a config file specified
explicitly via -c over the SDK config file.
2. Change daml-helper to pass in the config file via -c instead of
changing the directory

CHANGELOG_BEGIN

- [DAML Assistant] ``daml ledger navigator`` now loads
``frontend-config.js`` properly.

- [Navigator] Explicit config files passed via ``-c`` are preferred
over ``daml.yaml``.

CHANGELOG_END
2019-12-04 10:36:31 +01:00
Oliver Seeliger
ca47e815f1
Upgrade Canton to 0.5.0 with flaky test fix (#3724)
This release contains a canton flakiness fix to prevent the
occurrence of `Disputed: Failed to select first domain: The
following parti(es) are not available on any connected domain`
during SemanticTest runs.
2019-12-04 10:17:14 +01:00
Stefano Baghino
de0c3db1a1
Restore optional endpoints but adds check (#3722)
* Revert "ledger-api-test-tool: The endpoints are mandatory. (#3611)"

This reverts commit 603ee9367b.

* Restore LedgerTestContext requirement

* Exit early if there are no participants to test
2019-12-04 10:14:59 +01:00
nickchapman-da
d15b0c7538
Add support for type-synonyms in DAML-LF .proto and Haskell AST (#3703)
* Add support for type-synonyms in DAML-LF .proto and Haskell AST

* address review comments
2019-12-03 14:51:02 +00:00
Martin Huschenbett
054fcd22f2 Remove component version from damlc output (#3709)
The component version is a relic from before we went to a mono repo.
It's completely useless now.
2019-12-03 14:06:49 +00:00
Moritz Kiefer
22dc87b7f0
Support CreateAndExercise in DAML script (#3712)
CHANGELOG_BEGIN

- [DAML Script - Experimental] Add createAndExerciseCmd matching the
Ledger API command of the same name.

CHANGELOG_END
2019-12-03 14:46:45 +01:00
Moritz Kiefer
e4cfc3f8f7 Fix RST in DAML script docs (#3711)
RST doesn’t like having a word character after an inline code block.
2019-12-03 10:27:32 +00:00
associahedron
b275a5f40a Use surface names for type variables, instead of uniques. (#3702)
* Use surface names instead of unique names

* Reviewer comments
2019-12-03 09:40:04 +00:00
Moritz Kiefer
5a3b5f498a Fix SDK versions in trigger and daml-script dars (#3706)
* Fix SDK versions in trigger and daml-script dars

* Fix SDK versions in tests
2019-12-03 07:28:49 +00:00
Leonid Shlyapnikov
8124569cc6 Error handling improvements (#3705)
* Error handling improvements,

partitioning the Soruce[Error \/ JsValue], folding all errors and
producing the final status and errors element based on the above fold

* Test case + fixes,

for some reason GeneratorDrivenPropertyChecks does not like AsyncFreeSpec

* changing the order of elements in the response,

would be better if we were checking the JSON objects not JSON strings.
2019-12-03 01:26:37 +00:00
Leonid Shlyapnikov
e6ff9a6766
Fixing the GET contracts/search endpoint, (#3700)
* Fixing the GET contracts/search endpoint,

Returning all active contracts for all known templates, skipping the
query store persistence.

* minor cleanup
2019-12-02 12:56:06 -05:00
Martin Huschenbett
7d1068b69d
daml2ts: Avoid 'unused definition' warning for modules without templates (#3698)
We only use the `templateId` function in a module only when the module
contains at least one template definition. Thus, we don't generate it if
there are no modules. That's the only functional change. The other changes
are due to the fact that we want better readability of the code.
2019-12-02 18:21:22 +01:00
Moritz Kiefer
5a46777855
Fix pattern matching example (#3697) 2019-12-02 17:20:25 +01:00
Oliver Seeliger
c1319451bf Fix submissionId typo in JdbcLedgerDao logging parameter (#3679) 2019-12-02 15:55:30 +00:00
associahedron
608a820c26
Remove generic template support from damldocs (#3693) 2019-12-02 15:08:06 +00:00
associahedron
e696c34fc0
Let damlc docs see build-options. (#3695)
CHANGELOG_BEGIN

- [DAML SDK] ``damlc docs`` now takes into account the project's ``build-options`` from ``daml.yaml``.

CHANGELOG_END
2019-12-02 15:07:15 +00:00
Martin Huschenbett
6e6614ae56 daml2ts: Use monoTraverse to collect modules refs in types (#3690)
This was suggested by @corcreature on a previous PR.
2019-12-02 14:56:22 +00:00
Moritz Kiefer
f5605247b3
Include type synonyms in LF abstract syntax (#3694)
* Include type synonyms in LF abstract syntax

* Use T instead of S for synonyms

Following a suggestion from @remyhaemmerle-da, we avoid having to
adapt all rules to synonyms by simply reusing the definition of type
constructors.
2019-12-02 15:20:38 +01:00
Martin Huschenbett
712231c963 daml2ts: Don't produce unused imports (#3689)
Instead of importing _all_ other modules referenced from a module, only
import those that are actually referenced from the generated code. First,
this produces less noise within each generated file. Second and probably
more important, this allows for not generating files without any actual
definition at all.

https://github.com/digital-asset/davl/pull/81 demonstrates the effect of
this change on DAVL.
2019-12-01 11:38:56 +00:00