Commit Graph

147 Commits

Author SHA1 Message Date
Rohan Jacob-Rao
4d641dbb66 Fix a bug in template resugaring (#2942)
Under very specific circumstances, as presented in `TemplateSuperClassD`, the
template resugaring would fail and the compiler crash. This PR fixes the
problem.

It also adds test case `TemplateSuperClassF` for similar very specific
circumstances under which template resugaring would fail.
2019-09-24 21:38:13 +00:00
Moritz Kiefer
8ad74da20b
Support passing additional options to sandbox/navigator/json-api in daml start (#3002)
This should make `daml start` a bit more useful since you don’t have
to switch to starting all processes separately once you start
deviating from the defaults, e.g., I found myself wanting to specify a
custom ledger id during the hackathon. This is part 1 of ##2993.
2019-09-24 18:39:16 +02:00
Gary Verhaegen
cc66d054a8
release 0.13.26 (#2996) 2019-09-24 14:01:18 +01:00
Gary Verhaegen
4576aed986
sign releases (#2968) 2019-09-24 12:02:29 +01:00
Stephen Compall
22a5b17ea0 json-api: "table scan"-style query, literal equality and record subsets (#2826)
* ADT for json-api's LF value query predicates

* expand predicates into primitive cases

* expand more cases for the predicate reader

* instantiating type references

* record case

* get super-reductionist with ValuePredicate so we can tease out the proper model by operations

* just put the literal predicates in the ADT

* more primitive predicates

* properly build RecordSubset predicates

* tests for ValuePredicate LF value predicate functions

- false cases fail because outer layer still stubbed

* outer RecordSubset always used

* tests for comparing literal predicate and ApiCodecCompressed parsing

* map querying

* Adding ListMatch

* removing List test cases covered by LF-JSON encoding tests

* Optional support; precompile ListMatch elements

* use go instead of toFunPredicate

- deals with potential subst introduction as we make VP more abstract

* test cases for optional queries

* Adding VariantMatch

* Fixing comments

* some precompiling and fusion

* Adding value predicate to contracts/search endpoint, WIP

* Adding value predicate to contracts/search endpoint, WIP

* add filtering to ContractsService#filterSearch

* Adding contracts/search result filtering based on the constructed predicates

* cleanup

* make error throwing in ValuePredicate a little nicer

* scalafmt

* cleanup

* follow JSON format rules for numeric queries

* test that apiValueToLfValue . lfValueToApiValue = arr id

* API value -> LF value discards scale; account for that in ValuePredicate

- fixes queries that match numerics

* document query

* release note

* test for contracts/search with query

* more tests for contracts/search with query

* More tests and cleanup

* more cleanup

* better test

* Adding disclaimer

* records, not documents

* better error message in the fromCon case
2019-09-23 16:08:24 -04:00
Moritz Kiefer
bf3f0063d2
Get rid of ./build.sh scripts for damlc migrate (#2984)
Now that we have the build-options fields that makes for a much nicer
interface.
2019-09-23 19:08:30 +02:00
Moritz Kiefer
2ab06da199 Use a consistant include dir for cwd (#2978)
* Use a consistant include dir for cwd

See https://github.com/digital-asset/ghcide/pull/114 for the actual
fix.
This PR just bumps ghcide and adds a regression test. I’ll change the
revision before merging, I just want to test CI for now.

fixes #2929

* Switch to proper ghcide revision

* writeIfacesAndHie no longer exists

* Add changelog entry

* Maybe I should try to compile code before committing but I don’t want to

* Fix ghcide exe
2019-09-23 14:33:06 +00:00
Stefano Baghino
aad98b4c9e
More transaction service tests ported to the new test tool (#2961)
* Remove dead code

* Port around 30 more tests, delete dead code

* Remove template comment

* Update unreleased.rst

* Address https://github.com/digital-asset/daml/pull/2961#discussion_r327000163

* Address https://github.com/digital-asset/daml/pull/2961#discussion_r326999412

* Address https://github.com/digital-asset/daml/pull/2961#discussion_r326998734

* Address https://github.com/digital-asset/daml/pull/2961#discussion_r326998278

* Address https://github.com/digital-asset/daml/pull/2961#discussion_r326998888

* Address https://github.com/digital-asset/daml/pull/2961#discussion_r326997789
2019-09-23 15:33:32 +02:00
Moritz Kiefer
2de32b7419
Include all daml files in dar if source points to a file (#2970)
Previously, we only included the source file itself but not its
dependencies which didn’t make much sense.

This fixes #2960
2019-09-23 11:14:35 +02:00
Jussi Mäki
26c5a64589
release 0.13.25 (#2952) 2019-09-18 14:34:05 +02:00
Gerolf Seitz
b70e289303 ActiveContractsService stream ow always returns at least 1 element (#2799)
This removes the need for clients to handle the special case where the
stream might be empty.
Now the clients can always assume that they receive at least one
response element in the stream.
2019-09-18 11:16:56 +00:00
Jussi Mäki
11f1735613 Fix contract key uniqueness check in kvutils (#2933)
* Fix contract key uniqueness check in kvutils

Archival of a contract with a key and recreation within the
same transaction is now allowed in kvutils.

* Add assertions to check that new contract has been created with same key
2019-09-17 18:21:41 +02:00
Remy
220a03c9e8 Daml-LF: make MUL_NUMERIC and DIV_NUMERIC multi-scale (#2921)
* daml-lf: Make MUL_NUMERIC and DIV_NUMERIC multi-scale

* update release notes

* compiler: fix with type change
2019-09-17 14:32:49 +00:00
Gerolf Seitz
f32f1b975e
Filter the contracts for the ACS already in the database. (#2931)
This avoids unnecessarily loading contracts from the database
that would anyway get discarded later on.
2019-09-17 15:30:45 +02:00
Jost Berthold
277bfcbb70 HOTFIX damldoc: suppress instance docs when --data-only (#2927) 2019-09-17 11:55:51 +00:00
Remy
dc9429be1d Daml-LF: Add CAST_NUMERIC and SHIFT_NUMERIC (#2919)
* daml-lf: add CAST_NUMERIC and SHIFT_NUMERIC internally

* daml-lf: add CAST_NUMERIC and SHIFT_NUMERIC to archive proto

* daml-lf: update spec with CAST_NUMERIC and SHIFT_NUMERIC

* update release notes

* fix spec

* Address comments from Fran and Gerolf

* fix unrel
2019-09-17 08:52:54 +00:00
Leonid Shlyapnikov
b2b711c67b release-0-13-24 (#2922) 2019-09-16 15:19:10 -04:00
Rohan Jacob-Rao
c7eb05be6a Hlint update + release note (#2923)
* Update hlint version corresponding to ghc-lib update

* Add missing release note for corresponding compiler fix
2019-09-16 17:31:44 +00:00
Stefano Baghino
e37e3ec314
SemanticTests synchronize/wait across participants, specify error codes (#2911) 2019-09-16 15:18:42 +02:00
Stefano Baghino
c1d3c54f65
Port transaction service tests (#2900)
* Delete dead code

* Add test case for contract identifier retrieval when filtering by template

* Factor out retry strategies, make transaction tests multi-node-aware, add one test case

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324541271

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324543869

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324543999

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324544107

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324544193

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324545838

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324545682

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324545947

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324546075

* Wrap eventual success around exercise exclusively
2019-09-16 14:26:58 +02:00
Oliver Seeliger
16f58a8583
Upgrade H2 Database to 1.4.199 (#2889)
For statbility of merge statement
2019-09-13 12:54:37 +02:00
Leonid Shlyapnikov
4a9fb1ccff
DAML assistant codegen command (#2800)
* DAML assistant codegen command, codegen config reader and docs
2019-09-12 14:23:49 -04:00
Stefano Baghino
47d8432670
Panic on interface reader error (#2890) 2019-09-12 15:15:21 +02:00
Moritz Kiefer
a58cf857d4 Release 0.13.23 (#2875)
Given how many people want the HTTP JSON API, let’s make a release
that contains the integration with the assistant.
2019-09-11 08:55:25 +00:00
Gary Verhaegen
5234236639
add build-options to daml.yaml (#2772) 2019-09-10 18:16:33 +02:00
Martin Huschenbett
0fdf85442f
Improve UX of generic templates over Ledger API (#2779)
* Improve UX of generic templates over Ledger API

Currently, if you write
```
template Template t => Proposal t with
    receiver: Party
    asset: t
  where ...
template Iou with ...
template instance ProposalIou = Proposal Iou
```
you'll get the following DAML-LF types:
```
record Proposal t = { receiver : Party, asset : t }
record Iou = ...
record ProposalIou = { unpack : Proposal Iou }
```
The definition of `ProposalIou` is not particularly user friendly when used
over the Ledger API.

This PR changes the definition of `ProposalIou` to
```
record ProposalIou = { receiver : Party, asset : Iou }
```
Basically, the definition of `Proposal` is copied and `t` is instantiated
with `Iou`. This should make a much nicer UX.

* Update documentation

* Add test

* Fix docs examples

* Fix release notes
2019-09-10 14:38:25 +02:00
Stephen Compall
603e0a169f
json-api: in search input, rename templateIds to %templates (#2825)
* use %template instead of templateIds for /contracts/search

* release note

* doc %template

* s/$/s$/
2019-09-09 13:45:02 -04:00
Leonid Shlyapnikov
d237040822 DAML Assistant json-api logback configuration (#2797)
* filter out exception stack traces logged at debug

* Adding logback.xml for DAML Assistant release

* Fixing readme

* Fixing readme

* Use the config file in the assistant
2019-09-09 11:13:50 +02:00
Moritz Kiefer
2e29d3c0d9
Integrate the HTTP JSON API with the assistant (#2792) 2019-09-06 15:48:15 +02:00
associahedron
3c78e6110f Move (/) to a Divisible class and drop the Fractional Int instance. (#2728)
* Move (/) into a separate typeclass.

* Update release notes.

* Wording change

* rst syntax!!!

* tweak release notes.

* Remove recip on Int test.

* deduplication of release notes.

* Fix release notes?
2019-09-06 11:51:51 +00:00
Stefano Baghino
dc1eb2b151
Make semantic tests multi-node aware (#2770) 2019-09-05 15:38:51 +02:00
Stefano Baghino
4bfabe80fd
First multi-node test (#2737)
* WIP

* Ensure identifier uniqueness across endpoints

* Use Greek alphabet letters for node naming to better tell them apart

* Allow reference server to specify extra participants

* Restore all semantic tests

* Update changelog

* Have exponential backoff retries when creating the endpoint test context
2019-09-05 09:37:51 +02:00
Rohan Jacob-Rao
e364375ce6
Initiate release (#2745) 2019-09-04 15:39:46 -04:00
Stefano Baghino
785e41eb2c
Enable multi-node conformance testing (#2735) 2019-09-03 15:57:23 +02:00
Gerolf Seitz
4dbbdaaf52
Use (submitter, command_id, application_id) for command deduplication (#2724) 2019-09-03 10:09:01 +02:00
Gerolf Seitz
ecb506e803
SQL diagnostics (#2662)
* Use proper names for the DB connection pools.

* Add some trace logging for DB operations.

This does not capture timing of individual statements but
rather the time for "units of work".
For example "lookup contract" doesn't mean only loading
a single row from the contracts table, but also 2 additional
queries for looking up witnesses and divulgences.

This is not a problem, because this is trace level logging
that helps us debug problems and shouldn't be made sense of by
users at this stage.

* Make description a by-name parameter.

This avoids building up the string if trace logging
is not enabled (i.e. most of the time).
2019-08-30 13:41:44 +02:00
Gerolf Seitz
0e80f75ff4
Make sure ActiveContractService sends out a consistent snapshot (#2708)
* Make sure ActiveContractService sends out a consistent snapshot

instead of looking up the latest ledger end, we can only take the latest known ledgerEnd in the scope of SqlLedger.
If we don't do that, we can miss contracts from a partially inserted batch insert of ledger entries
scenario:
1. batch insert transactions A and B at offsets 5 and 6 respectively; A is a huge transaction, B is a small transaction
2. B is inserted earlier than A and the ledger_end column in the parameters table is updated
3. A GetActiveContractsRequest comes in and we look at the latest ledger_end offset in the database. We will see 6 (from transaction B).
4. If we finish streaming the active contracts up to offset 6 before transaction A is properly inserted into the DB, the client will not see the contracts from transaction A
The fix to that is to use the latest known head to the dispatcher, which is updated AFTER a batch has been inserted completely.

This PR also factors out the basic readonly functionality that is
duplicated between SqlLedger and ReadOnlySqlLedger into a class
BaseLedger.

* copyright header
2019-08-30 10:56:30 +02:00
Remy
20649cf78e ledger-api: rename decimal field to numeric in value Proto (#2688)
* add Numeric.java

* ledger-api: rename `decimal` field to `numeric` in value protobuf

* Address Gerolf's comment

* ledger-api: add missing renammings

* ledger-api: relax syntax of numbers that can be sent as numerics

* extractor:  fix

* leger-api: change format of number though ledger api

* daml-lf: fix numeric regexp

* ledger: fix tests
2019-08-29 22:51:33 +00:00
Robin Krom
d4919ad319 fixed messed up release notes (#2700) 2019-08-29 12:37:34 +00:00
Robin Krom
7fca591df0
replace main file with a pointer to the source root (#2687)
* language: compile everything in the source directory

This removes the need to specify a 'main'. Instead we 'source' in
daml.yaml should point to the source root directory.
2019-08-29 13:42:33 +02:00
Martin Huschenbett
c3f394e94f
Release DAML SDK 0.13.21 (#2693) 2019-08-29 10:56:44 +02:00
Oliver Seeliger
834a06a397
Ledger API Server H2 Database support (#2425)
* Ledger API Server H2 Database support (#2528)

* Disable parallel batch ledger append due to lack of H2DB isolation
2019-08-28 14:14:21 +02:00
Martin Huschenbett
016b73b3de Enable MonoLocalBinds and FlexibleContexts by default in DAML (#2678)
Both language extension are needed to improve the UX of generic templates.
Without them templates a la
```
template Template (A t) => B t with
```
would produce an error that we need `FlexibleContexts` for the
`Template (A t)` context and a warning suggesting to simplify it to
`AInstance t`. The latter would expose an implementation detail we prefer
to hide.
2019-08-28 10:21:54 +00:00
Gary Verhaegen
126ac64bbf
daml-sdk-head also installs HEAD jars (#2652) 2019-08-27 18:08:52 +02:00
Stefano Baghino
d79e03d42c
Ensure uniqueness of decoding and encoding methods (#2651)
Fixes #2367
2019-08-23 17:31:37 +02:00
Gerolf Seitz
139afa4e59
Properly set connection pool properties (#2637) 2019-08-23 10:24:56 +02:00
Moritz Kiefer
dda583c659 Release 0.13.20 (#2633) 2019-08-22 14:07:33 +00:00
Moritz Kiefer
88c2a1fd15 Add stripInfix to daml stdlib (#2629)
fixes #2617
2019-08-22 13:21:03 +00:00
Gerolf Seitz
32a61b275f Java Codegen now supports parametrized ContractIds. (#2621)
Fixes #2258
2019-08-22 12:01:22 +00:00
Stefano Baghino
424bd0cbf4
Restore resource closing ordering in Ledger API server (#2623)
Fixes #2549
2019-08-22 11:44:58 +02:00