Commit Graph

2649 Commits

Author SHA1 Message Date
Martin Huschenbett
00f23ef7d5
Rename Contract type to CreateEvent and move it to daml-ledger-fetch (#3869)
What was called `Contract` until now is actually a create event. Hence the
renaming. We'll most likely get a `Contract` type in DAML as well and this
renaming will avoid a name conflict. Also, create events are not part of
DAML-LF values and hence not generated by `daml2ts`. Thus, there's not need
to have them in `daml-json-types`. Instead, they should be in a future
`daml-json-api-types` package which captures the types used by the JSON API.
2019-12-17 15:05:32 +01:00
Andreas Herrmann
06cd1f14a2
Expose timestamp in DAML triggers (#3858)
* Add time to Trigger update function

CHANGELOG_BEGIN

- [DAML Triggers - Experimental] Expose timestamp in triggers.
  See `#3612 <https://github.com/digital-asset/daml/issues/3612>`__.

CHANGELOG_END

* Add triggers time test

* Update trigger docs
2019-12-17 11:12:05 +01:00
Moritz Kiefer
52e594a2e9
Move optWriteIface to compile-specific options (#3861)
Originally, this made sense as a flag in Options since we read it
during typechecking to write out interfaces on the fly. But now, we
write this is only used in execCompile so having this be a global
option that is ignored anywhere but in `compile` is rather confusing.
2019-12-17 11:05:28 +01:00
Moritz Kiefer
c65f918145
Bump ghcide (#3865)
* Bump ghcide

* Fix goto definition tests

* Fix hie-bios config

* Try to fix windows
2019-12-17 10:21:52 +01:00
Martin Huschenbett
6d83a7bf47
Move daml-json-types to TypeScript 3.7.3 (#3856)
This should have happened in a previous PR, but I missed it.
2019-12-17 08:47:41 +01:00
Stefano Baghino
db711d40f3
Remove dead ledger-api-integration-tests code (#3866) 2019-12-16 18:01:42 +01:00
Robin Krom
bbb6e27d04
language: daml2ds: Removal of accidentally slipped in dependencies (#3862)
These seem to have slipped in when running yarn locally.
2019-12-16 15:40:49 +01:00
Moritz Kiefer
ddef6c7bce Document packaging code (#3860)
This documents some of the edge cases in the packaging code that I’ve
had trouble understanding so that the next person hopefully has an
easier time with this.

There is also some minor cleanup in this PR.
2019-12-16 13:44:19 +00:00
Robin Krom
881d36eab4
language: daml2ts: support for enum types (#3852)
* language: daml2ts: support for enum types

This adds support for enum types to daml2ts. daml-lf enums are converted
to typescript enums and a decoder defined in the same namespace.

* static serializable check for enums and better tests
2019-12-16 13:57:25 +01:00
nickchapman-da
1369351f70
separate type-synonyms from type-constructors (#3829)
* separate type-synonyms from type-constructors in DAML-LF .proto and Haskell AST

* comments
2019-12-16 11:52:28 +00:00
Gary Verhaegen
83fdc6d164
remove unused python3.6-da dev-env bin (#3845) 2019-12-16 11:51:43 +01:00
Moritz Kiefer
54f0fa0f50 Improve documentation on precision and scale of Numeric (#3846)
* Improve documentation on precision and scale of Numeric

fixes #3778

* s/precision/scale/
2019-12-16 10:06:47 +00:00
Samir Talwar
71e8c20127 Sandbox: Fix warnings in SandboxServer. (#3853)
* sandbox: Move SandboxServer's helper classes to the companion object.

And make them `private`, `final`, and non-`case`.

* sandbox: Drop SandboxServer.apply and just call the constructor.

* sandbox: Move the SandboxServer#SandboxState class into the object.

Leave the `resetAndRestartServer` method behind, though.
2019-12-14 20:52:03 +00:00
Martin Huschenbett
44005348a3
daml2ts: Upgrade to TypeScript 3.7 (#3854)
Also upgrade ESLint to the newest version and its plugins to the newest
version.
2019-12-13 23:01:05 +01:00
Stefano Baghino
3ca7ed49dd Remove warts: ExplicitImplicitTypes (#3851)
* Remove warts: ExplicitImplicitTypes

* Fix compilation errors
2019-12-13 18:33:49 +00:00
Stefano Baghino
d2c7067314 Rename weirdly named directories (#3850) 2019-12-13 18:32:11 +00:00
Jussi Mäki
33c7a1aace Implementation for the configuration management service (#3756)
* Implementation for the configuration management service

- Add configuration generation to the response of SetTimeModel
- Implement the ConfigManagementService
- Implement integration test into test tool

This is still a draft as it has unsolved FIXMEs and
it conflicts with #3744 which should go first.

The main conflict is with changes to PartyAllocationResponse which cannot
no longer reference "domain.PartyDetail" as we would have a cyclic dependency
(participant-state contains Configuration which we point to from domain.ConfigurationEntry).

The still open issues are:
- Revisit PartyDetail
- Naming: LedgerConfigurationService and ConfigManagementService are not talking
  about the same configuration and it feels confusing.
- Remove duplication of ConfigurationEntry? Do we need both domain.ConfigurationEntry
  and ledger.store.ConfigurationEntry? Only difference is in the types of participantId
  and submissionId.

* Address review part 1

* Fix up tests after rebase and address PR review

* Post-merge fixes

* Add missing config MRT checks and fixes to tests

- Check config MRT in InMemoryLedger and SqlLedger
- Use proper source of time in ConfigManagement
- Separate out ConfigManagementServiceIT in sandbox conformance tsets

* Reformat
2019-12-13 17:58:44 +00:00
Stefano Baghino
d7e734b744 Move ResetServiceIT to Sandbox integration tests (#3844)
Closes #2857

- Also deals with the long ignored todo about not using the context
- Attempts at restoring this as a non-flaky test
- Attempts at running the same test across runtime environments
2019-12-13 16:18:02 +00:00
Stefano Baghino
651384ad79
Perf tests no longer depend on integration tests (#3842)
* Perf tests no longer depend on integration tests

The infrastructure necessary to run performance tests on both the
in-memory and the persistent sandbox is duplicated to the
//ledger/sandbox-perf package in order to be able to get rid of all
contents of //ledger/ledger-api-integration-tests once the test porting
is over (which will happen soon).

The scope and functionality of ported classes has been reduced to the
minimum set needed by the performance test suite.

* Address https://github.com/digital-asset/daml/pull/3842#discussion_r357652888

* Address https://github.com/digital-asset/daml/pull/3842#discussion_r357653331

* Address https://github.com/digital-asset/daml/pull/3842#discussion_r357654770
2019-12-13 17:04:26 +01:00
Oliver Seeliger
b967a7d8c6 Test tool flakiness take2 (#3843)
* Ledger api test tool flakiness fix part 2: Add "eventually"

to synchronize use of waitForParties

* Upgrade to Canton 0.5.2
2019-12-13 13:37:02 +00:00
Samir Talwar
014b5608c2 Sandbox / Reference v2: Close the Ledger API Server on failure. (#3837)
* sandbox: No point creating a class just for the `close` method.

The LedgerApiServer class doesn't actually have much behavior apart from
closing. The `startServer` method is called during construction, which
definitely counts as spooky action at a distance. This change moves that
behavior to `LedgerApiServer.start` (renamed from `LedgerApiServer
.create` to make it more explicit).

There's not much point creating a class for the rest, so all behavior is
now in that `start` method.

* sandbox: Build up a list of "closeables" as the LedgerApiServer starts.

* sandbox: If the LedgerApiServer fails to come up, stop the parts.

* sandbox: Apply @stefanobaghino-da's refactoring suggestions.

* sandbox: Don't log while building the gRPC server; log at the end.

* sandbox: Turns out we should not stop the server when it works.

Facepalm.
2019-12-13 12:36:00 +00:00
Oliver Seeliger
2afd8bc55f Test tool party flakiness fix (#3841)
* Ledger api test tool party flakiness for multi-participant runs

Caused by synchronize not waiting for parties to fully exist on
all participants.

* Reenable canton test run

* Update canton to 0.5.2

* Revert "Update canton to 0.5.2"

This reverts commit d0e530c652.
2019-12-13 11:25:18 +00:00
Martin Huschenbett
05860d1df4
daml2ts: Tie the knot between templates and their choices without hacks (#3839)
In the code generated by `daml2ts`, every template companion object lists
all its choices and every choice has a pointer back to the companion object
of its template. Thus, there's a knot to tie.

So far, we initialized the choices as `undefined` and later mutated them to
point to the template companion object. This feels kind of hacky,
particularly since we end up with cyclic values.

This PR pushes the pointer from the choice back to the template companion
object behind a lambda. This makes the hack unnecessary and removes the
cyclic values.
2019-12-13 12:03:51 +01:00
Stefano Baghino
8965c1bf3b
Move TimeServiceDisabledIT to the sandbox integration tests (#3840)
Closes #2859
2019-12-13 11:53:27 +01:00
Gary Verhaegen
0f3d9a3e5e
ci: improve failed job detection (#3828) 2019-12-13 11:44:39 +01:00
Gary Verhaegen
42d66c97cf
remove unused nix file (#3831) 2019-12-13 11:43:50 +01:00
Jussi Mäki
ce70ad4a2f
Async package management (#3806)
* Add package_entries table

* Change PublicPackageUpload event to cover list of packages.

Add PublicPackageUploadRejected.

* Produce new package update events in KeyValueConsumption

* Update signature of uploadPackages

* Cleanup InMemoryKVParticipantState. Add submissionId to uploadPackages.

* Fix up InMemoryKVParticipantStateIT

* Initial ledger dao changes for package entries

Drop the participant_id as we never expect to see
entries of other participants. This should be done
for party_entries as well.

* Drop UploadPackagesResult

* Implement getPackageEntries and refactor callers

* Add maxRecordTime to uploadPackages

* First cut at updating ApiPackageManagementService

* Update tests, wire through the packageEntries

* Don't extend IndexPackagesService in InMemoryPackageStore

It does not implement the full interface and it isn't used
directly as one anyway.

* Drop maximum_record_time from package_management_service

Adding maximum record times touches the whole stack. Leaving
this change to another PR.

* Wire through the removal of maximum_record_time.

And remove dead code from InMemoryKVParticipantState

* Remove checking for duplicate package uploads

This aligns with the behaviour of WriteService.

* Reformat

* Fix PackageManagementService after adding of submission_id to the service
2019-12-13 09:56:47 +01:00
Leonid Shlyapnikov
0c741a64cb Fix contract lookup endpoint (#3809)
* Lookup by Contract ID and Contract Key is WIP

* factor out "contract ID or key" JSON decoding

- adapted from fc132253 (#2695)

* Resolving conflicts

* Resolving conflicts

* Lookup by contract ID works

* Testing new contract created by IOU_Transfer can be looked up

* error if key and contractId specified for lookup at the same time

* Lookup by contract key test

* Lookup docs

* re-format with `./fmt.sh`

* minor cleanup

CHANGELOG_BEGIN

- [JSON API - Experimental] Fix and document ``/contracts/lookup`` endpoint. See #3755.

CHANGELOG_END
2019-12-12 22:16:12 +00:00
Moritz Kiefer
787e5557de Fix authorization docs for contract keys (#3835)
* Fix authorization docs for contract keys

This should hopefully match what we have actually implemented.

* Update wording
2019-12-12 20:33:03 +00:00
Martin Huschenbett
3722f32429
daml2ts: Add more tests (#3832) 2019-12-12 18:42:27 +01:00
Remy
9dadfc05bc daml-lf: second version of type synonym spec (#3782)
* daml-lf: second version of type synonym spec

* cosmetic changes

* more fixes

* make special application for type synonymes

* Update daml-lf/spec/daml-lf-1.rst

Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>

* make type synonym different from type constructor

* typos
2019-12-12 17:28:18 +00:00
Moritz Kiefer
d675156e2c
Bump ghcide to fix flakiness in LSP tests (#3813)
fixes #3821

see https://github.com/digital-asset/ghcide/pull/235 for the actual
fix, I’ll change the commit before merging.
2019-12-12 17:11:35 +01:00
associahedron
4fe8cbff6e Run a package-wide name collision check when building a DAR. (#3827)
* Perform full package name collision check

* Comment on the ascendants thing

* Fix comment
2019-12-12 13:27:22 +00:00
Gary Verhaegen
2b3693bf4d
restore 0.13.38 logging defaults for daml jars (#3819)
CHANGELOG_BEGIN
- [Sandbox] Restore 0.13.38 logging behaviour.
- [Navigator] Restore 0.13.38 logging behaviour.
- [Extractor] Restore 0.13.38 logging behaviour.
- [Internals] As of 0.13.39, we merged a number of internal JAR files in
  the SDK tarball to reduce its size. These jars used to be standalone
  JARs you could invoke as e.g. ``java -jar sandbox.jar <args>``. As a
  result of merging the jars, they lost their individual ``logback.xml``
  configuration file. Although running the jars directly was (and is
  still) not supported, note that you can now achieve the same behaviour
  with e.g. ``java -Dlogback.configurationFile=sandbox-logback.xml -jar
  daml-sdk.jar sandbox <args>``.
CHANGELOG_END
2019-12-12 14:02:23 +01:00
Samir Talwar
d7a7a78083 sandbox/reference-v2: Split Config into three. (#3823)
* sandbox/reference-v2: Split `Config` into three.

- Reference v2 CLI configuration
- Standalone API server configuration
- Standalone indexer configuration

* reference-v2: Simplify CLI parsing of TLS config and extra participants.

Turns out we _always_ want to support extra participants. They're
optional, after all.
2019-12-12 11:48:17 +00:00
Moritz Kiefer
1767b2e6bf
Remove mysterious hFlush stdout (#3825)
This has been there since before we open sourced DAML and afaict if it
has ever served any purpose, that purpose is long gone.
2019-12-12 09:36:47 +01:00
lima-da
a56849ce73
Json simple websocket (#3796)
* first checkpoint for adding websocket

* unify shared method across websocketEndpoints and Endpoints using EndpointsCompanion objc

* add config for ws backpressure and logging

* add copy right header

* merge and change TODO comments

* resolve conflicts

* disable ws service for now to save merge conflicts while working on improvements
2019-12-11 17:02:35 -05:00
Leonid Shlyapnikov
0b172da49a Add ExceptionOps to extract exception details safely (#3822)
* Add ExceptionOps to extract exception details safely

`Throwable.getMessage` can return `null` which caused unexpected NPE
in JSON API error handling

* Fix formatting

* Remove show instance

* Addressing code review comments,

thanks Stefano!
2019-12-11 18:38:44 +00:00
Moritz Kiefer
2bd8b36571
Remove ghc-lib jenkins config (#3824)
We’ve switched off jenkins for ghc-lib ages ago so there is no point
in keeping the old config around.
2019-12-11 19:27:44 +01:00
Samir Talwar
90416744e4 sandbox: Re-add the Docker images with a public base image. (#3814)
* Revert "Remove docker bazel target for sandbox (#3802)"

This reverts commit 48a381ca49.

* sandbox: Use the public `openjdk` Docker image rather than GCR's.

Turns out you need to authenticate with Google Container Registry
regardless of whether the image is public or not. We don't want people
to have to bother logging in to GCR just to get Bazel working.
2019-12-11 16:58:08 +00:00
Samir Talwar
9ffa9b7aef sandbox: Delete unused test helpers. (#3820) 2019-12-11 16:11:07 +00:00
Moritz Kiefer
013d668159 Add Eq instances for AnyTemplate, AnyChoice and AnyContractKey (#3816)
* Add Eq instances for AnyTemplate, AnyChoice and AnyContractKey

CHANGELOG_BEGIN

- [DAML Standard Library] Add ``Eq`` instances for ``AnyTemplate``, ``AnyChoice`` and ``AnyContractKey``.

CHANGELOG_END

* Add DAML_ANY_TYPE to the CPP guard
2019-12-11 14:59:50 +00:00
mziolekda
ac47a84085
clean up logs and metrics in the kvutils transaction processing (#3811)
* clean up logs and metrics in the kvutils transaction processing

* fix failing test
2019-12-11 15:36:12 +01:00
Moritz Kiefer
d6bf6f6c04 Mark lsp tests flaky (#3818) 2019-12-11 14:10:48 +00:00
Samir Talwar
1184ee6f0a Sandbox: Split the Ledger API server and Indexer into separate packages. (#3783)
* sandbox: Split the StandaloneApiServer from the StandaloneIndexerServer.

* sandbox: Move StandaloneApiServer's nested classes to its companion.

And make them private.

* reference-v2: Rename `IndexServer` to `ApiServer`.

* sandbox: Move the services into the `apiserver.services` package.

* sandbox: Move SandboxEventIdFormatter's vals to the top.

* sandbox: StandaloneApiServer helper classes don't need to be Products.

* docs: Fix links for LedgerApiServer and Standalone{Api,Indexer}Server.

* sandbox: Delete a misleading comment from `StandaloneApiServer`.

* sandbox: Rename SandboxEventIdFormatter to EventIdFormatter.
2019-12-11 13:23:39 +00:00
Remy
a893202c32 DAML-LF: decommission equality function for atomic values (#3817) 2019-12-11 13:08:47 +00:00
associahedron
76531c93bf Expose generic equality in compiler (#3815) 2019-12-11 12:15:52 +00:00
associahedron
08ee42fb30 Implement missing genmap fns (#3807) 2019-12-11 11:16:25 +00:00
Remy
21630a8841 DAML-LF: fix generic equality (#3812)
* DAML-LF: generic equality is available in dev only

* more doc fixes

* please restart CI
2019-12-11 11:02:24 +00:00
Moritz Kiefer
e3830106ad
Fix package names in depends field in pkg configs (#3810)
* Fix package names in depends field in pkg configs

Previously, we derived this based on the DAR name which breaks if you
use -o with rather confusing error messages. Now, we read it from the
`Name` field in the manifest that we added in
https://github.com/digital-asset/daml/pull/3805.

CHANGELOG_BEGIN

- [DAML Compiler] Fix an issue where transitive package dependencies
  resulted in packages not being found, if the DAR name was changed with
  `-o`.

CHANGELOG_END

* Fix package dependencies
2019-12-11 11:49:50 +01:00