Commit Graph

2419 Commits

Author SHA1 Message Date
Remy
3f8bd0da5e DAML-LF: rename ValueMap to ValueTextMap. (#3584) 2019-11-22 11:35:32 +00:00
Robert Autenrieth
87c8f274e1
Split rw claims (#3548)
* Split read and write claims

Fixes #3398

CHANGELOG_BEGIN
- [Sandbox] Added support JWT tokens that only authorize to read data, but not to act on the ledger.
CHANGELOG_END
2019-11-22 11:24:50 +01:00
Remy
b506e27bde Java-codegen: add support for Generic Maps. (#3549)
* java-bindings: use LinkedHashMap asunderlying Map for DamlGenMap

* Address Samir's comments

* java-codegen: make DamlList, DamlMap and DamlGenMap immutable

* Address Samir's comments

* Adress Gerolf's comments

* more cleanup

* fix value generator

* Address Gerolf's comments:

CHANGELOG_BEGIN

[Java Bindings]
  * Rename ``DamlMap`` to ``DamlTextMap``
  * ``DamlCollectors`` class provides Collectors to build more easily ``DamlList`` and ``DamlTextMap``
  * Change the recommended method to convert ``DamlValue`` containers from/to Java Bindings containers.
    See `docs/source/app-dev/bindings-java/codegen.rst` for more details the new methodology.

CHANGELOG_END

* fix tests
2019-11-22 08:07:53 +00:00
Rohan Jacob-Rao
56820447d5 Fix link (#3579) 2019-11-21 18:54:50 +00:00
Stefano Baghino
9f9d2d0458 Move and improve LedgerIdentityService integration tests (#3581) 2019-11-21 17:08:10 +00:00
Moritz Kiefer
964bd3fd76 Support exerciseByKey in DAML script (#3580)
CHANGELOG_BEGIN
- [DAML Script - Experimental] Expose the Ledger API exerciseByKey command
CHANGELOG_END
2019-11-21 16:54:01 +00:00
Moritz Kiefer
c34f56ab2e
Add template id filtering to triggers (#3577)
* Add template id filtering to triggers

CHANGELOG_BEGIN
- [Daml Triggers - Experimental] DAML triggers now allow you to specify which templates you want to listen for which can improve performance.
CHANGELOG_END

* Address review comments

* Fix list-triggers test
2019-11-21 16:50:40 +01:00
Gerolf Seitz
c43f004e57
Replace MetricsManager with MetricRegistry (#3574)
Instead of passing around MetricsManager just for the timedFuture
method, we pass the underlying MetricRegistry directly and use
the timedFuture function as an actual function (passing in a timer metric).

The Sandbox still starts the JmxReporter, but the integrator of the Indexer
and the Ledger API Server needs to enable the reporting facilities themselves.

CHANGELOG_BEGIN

- [Ledger] Ledger API Server and Indexer now accept an instance of ``MetricRegistry`` as parameters. This gives implementors of ledger integrations the most flexibility to set up metrics reporting that works best for them.

CHANGELOG_END
2019-11-21 16:47:30 +01:00
nickchapman-da
9ab2923814
support authenticating ledgers in haskell ledger bindings (#3561)
* support authenticating ledgers in haskell ledger bindings

* address comments

CHANGELOG

- [Haskell Ledger Bindings] - support for passing `JWT` tokens to authenticating ledgers.
2019-11-21 15:11:33 +00:00
Jussi Mäki
01be23fa82
Implement GenericSetTemplate and ImmutableSetFactory for InsertOrdSet (#3557)
This ensures we retain InsertOrdSet when transforming it.
2019-11-21 16:08:08 +01:00
Stefano Baghino
f2f60d5e4c
Move LedgerConfigurationService out of Ledger API IT (#3576) 2019-11-21 16:02:17 +01:00
Gary Verhaegen
adceb3a6b2
checkout current sha after daily docs (#3559)
Currently if the docs script fails, the Slack message we get mentions the commit title of the docs version that failed to build, which is not super useful. This ensures we get back to the current commit regardless of what happens with the Haskell script.
2019-11-21 15:00:19 +01:00
Stefano Baghino
e0239a42a1
Remove test already covered (#3572)
This integration test is duplicate of
//ledger/sandbox/src/test/suite/scala/com/digitalasset/platform/sandbox/services/time/StaticTimeIT.scala
2019-11-21 14:30:23 +01:00
Moritz Kiefer
c3438a58af
Refactor trigger runner in preparation for template id filtering (#3570)
This is a prepatory PR before introducing template id filtering in
DAML triggers. It does not change or introduce any new functionality.
2019-11-21 14:08:11 +01:00
Stefano Baghino
e0b19a3c62 Fix unreleased.sh (#3567)
* Fix unreleased.sh

The usage of `git log` to avoid printing the diff of each commit turned
out to cause the commit to be interpreted as a revision range reachable
from said commit, which breaks unreleased.sh. This commit reverts to
using `git show` but with `--quiet` to avoid printing the diff, as
originally planned.

* Update unreleased.sh

Co-Authored-By: Samir Talwar <samir.talwar@digitalasset.com>
2019-11-21 12:43:11 +00:00
Stefano Baghino
147676d45c Remove runtime-based coloring from LATT reports (#3566)
CHANGELOG_BEGIN

- [DAML Ledger Integration Kit] The Ledger API Test Tool no longer shows
  individual test duration colored based on how they lasted.

CHANGELOG_END
2019-11-21 12:41:08 +00:00
Ben Price
96c15a7f42 add kleisli composition operators (#3563) 2019-11-21 13:00:11 +01:00
Moritz Kiefer
ec5d832c48
Generate API docs for DAML script and include them in the SDK docs (#3568)
* Generate API docs for DAML script and include them in the SDK docs

* Update daml-script/daml/Daml/Script.daml

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>
2019-11-21 12:59:09 +01:00
Oliver Seeliger
55dfe967da
Split out ledger api test tool transaction tests related to scale (#3569)
* Split out ledger api test tool transaction tests related to scale

This enables ledger providers to meet conformance targets first before
tackling the scale / large transactions tests.

* Update ledger/ledger-api-test-tool/src/main/scala/com/daml/ledger/api/testtool/tests/TransactionScale.scala

Co-Authored-By: Samir Talwar <samir.talwar@digitalasset.com>

* Update ledger/ledger-api-test-tool/src/main/scala/com/daml/ledger/api/testtool/tests/TransactionScale.scala

Co-Authored-By: Samir Talwar <samir.talwar@digitalasset.com>
2019-11-21 12:07:09 +01:00
Oliver Seeliger
15a7f72eae
Upgrade to canton 0.4.1 and reenable multi-ledger test (#3565) 2019-11-21 11:17:44 +01:00
Gerolf Seitz
74c2306100
Add @SamirTalwar as codeowner of /ledger and /ledger-api (#3558) 2019-11-21 09:19:47 +01:00
Stephen Compall
b3be6abd7e build a single graph to replace the two-ConnectionIO setup (#3537)
* build a single graph to replace the two-ConnectionIO setup

- readOffsetFromDbOrFetchFromLedger and contractsFromOffsetIo duplicate
  some CIO work; we can cat the ACS and txns into a single stream and
  treat them once

- also useful for in-memory query

* make contractsFromOffsetIo fetch ACS if at begin; stop using contractsToOffsetIo

* remove another unused function; comment transactionsFollowingBoundary

* factor out last flow
2019-11-20 20:53:04 +00:00
Gerolf Seitz
8c78c00c50
Add metrics to Ledger API Server (#3523)
Fixes #3513.

* Add metrics to track commands
- Meter: CommandSubmission.failedCommandInterpretations
- Timer: CommandSubmission.submittedTransactions

* Add metrics to JdbcIndexer
- Gauge: JdbcIndexer.lastReceivedRecordTime
- Gauge: JdbcIndexer.lastReceivedOffset
- Gauge: JdbcIndexer.currentRecordTimeLag
- Timer: JdbcIndexer.processedStateUpdates


* Allow setting a custom JMX domain.
We don't want to use com.digitalasset.platform.sandbox
for the ledger-api server and indexer.

* Add interceptor that automatically meters incoming grpc service calls.

CHANGELOG_BEGIN

- [Ledger] Add various metrics to track gRPC requests, command submissions, and state update processing. See `#3513 <https://github.com/digital-asset/daml/issues/3513>`__.

CHANGELOG_END
2019-11-20 18:26:25 +01:00
Moritz Kiefer
a4905d6b0f Release 0.13.37 (#3554) 2019-11-20 16:45:42 +00:00
Moritz Kiefer
61739bc49e Move non-upgrading code to a separate DataDependencies module (#3552) 2019-11-20 16:43:10 +00:00
Stefano Baghino
cff9640401 Show only logs in unreleased.sh (#3556) 2019-11-20 16:18:18 +00:00
Stefano Baghino
84e6064d51 Remove unreleased.rst (#3547)
* Start working on getting rid of unreleased.rst

Document new process in CONTRIBUTING.md,
.github/pull_request_template.md and unreleased.rst (for good measure)

Report the previous changelog additions here so that they're not lost in
the mist of times.

CHANGELOG_BEGIN

- [DAML Stdlib] Added the ``NumericScale`` typeclass, which improves the type inference for Numeric literals, and helps catch the creation of out-of-bound Numerics earlier in the compilation process.

- [DAML Triggers] ``emitCommands`` now accepts an additional argument
  that allows you to mark contracts as pending. Those contracts will
  be automatically filtered from the result of ``getContracts`` until
  we receive the corresponding completion/transaction.

- [Navigator] Fixed a bug where Navigator becomes unresponsive if the ledger does not contain any DAML packages.

- [Ledger-API] Add field ``gen_map`` in Protobuf definition for ledger
  api values. This field is used to support generic maps, an new
  feature currently in development.  See issue
  https://github.com/digital-asset/daml/pull/3356 for more details
  about generic maps.

  The Ledger API will send no messages where this field is set, when
  using a stable version of DAML-LF.  However the addition of this
  field may cause pattern-matching exhaustive warnings in the code of
  ledger API clients. Those warnings can be safely ignored until
  GenMap is made stable in an upcoming version of DAML-LF.

- [JSON API - Experimental] CLI configuration to enable serving static content as part of the JSON API daemon:
  ``--static-content "directory=/full/path,prefix=static"``
  This configuration is NOT recommended for production deployment. See issue #2782.

- [Extractor] The app can now work against a Ledger API server that requires client authentication. See `issue #3157 <https://github.com/digital-asset/daml/issues/3157>`__.
- [DAML Script] This release contains a first version of an experimental DAML script
   feature that provides a scenario-like API that is run against an actual ledger.
- [DAML Compiler] The default DAML-LF version is now 1.7. You can
  still produce DAML-LF 1.6 by passing ``--target=1.6`` to ``daml
  build``.

- [JSON API - Experimental] The database schema has changed; if using
  ``--query-store-jdbc-config``, you must rebuild the database by adding
  ``,createSchema=true``.
  See `issue #3461 <https://github.com/digital-asset/daml/pull/3461>`_.

- [JSON API - Experimental] Terminate process immediately after creating schema. See issue #3386.

- [DAML Stdlib] ``fromAnyChoice`` and ``fromAnyContractKey`` now take
  the template type into account.

CHANGELOG_END

* Document new release process to gather changelog additions

* Change the release script to ignore unreleased.rst

* Remove spurious unreleased.rst lines

* Transition to use tags

* Document new way to get changelog additions with tags

* Update release/RELEASE.md

Co-Authored-By: Gary Verhaegen <gary.verhaegen@digitalasset.com>

* Address https://github.com/digital-asset/daml/pull/3547#discussion_r348438786

* Document correction process

* Add copyright header to unreleased.sh

* Update CONTRIBUTING.md

Co-Authored-By: Gary Verhaegen <gary.verhaegen@digitalasset.com>

* Modify CONTRIBUTING.md after @garyverhaegen-da's proposal

* Make unreleased.sh run per commit and treat tags as case-insensitive

* Fix documentation for replacements
2019-11-20 15:16:57 +00:00
Moritz Kiefer
c501866608 Trim exports from Upgrade module (#3551)
None of those functions are actually used outside the module and I
prefer seeing the actual external API.
2019-11-20 14:54:27 +00:00
Andreas Herrmann
6c2f4ebe8f Fix pip and pipenv (#3366)
* Fix pip and pipenv

Since the latest nixpkgs update pip is no longer contained in the python
derivation but instead in its own `python37Packages.pip` derivation.

Additionally the pipenv version in nixpkgs is incompatible with the pip
version, as pipenv expects a module to be present which is only
available in later versions. This change overrides pip with a version
update to fix this issue.

Upstream nixpkgs has already updated pip accordingly

* Update nixpkgs

The versions of `pipenv` and `pip` contained in `nixpkgs` where
previously incompatible. They are compatible in the new `nixpkgs`
revision.

Just overriding the pip version caused too many uncached rebuilds and
timed out on CI.

* Update nixpkgs further

To incorporate
efce3c1367

* Try to build fewer GHCs

* nix: drop sass override

nixpkgs-unstable is on the same page.

* nix: use upstream chromedriver

* nix: remove pex override

* nix: drop pypi2nix override

* Fix bazel-watcher

* try upgrading rules go

* Remove overrides for ibazel

* Upgrade rules_go

* Remove references to sass overrides
2019-11-20 15:27:32 +01:00
Miklos
a7ae9c5fba
Improve DAML SDK documentation (#3509)
Improved DAML SDK documentation, focusing on quickstart guide:
- Corrected typos.
- Corrected some broken links.
- Made sample code formatting consistent (variable naming, comments).

Co-Authored-By: Samir Talwar <samir.talwar@digitalasset.com>
2019-11-20 14:57:57 +01:00
mziolekda
a217187b26
add error codes for overloaded and internal error to participant state (#3524)
* add error codes for overloaded and internal error

* change wording in error description strings

* scala formatting

* use string interpolation intead of concatenation

* address issues found in peer review
2019-11-20 14:37:00 +01:00
Moritz Kiefer
f94b832201 Include contract ids in DAML script’s query (#3546) 2019-11-20 11:07:52 +00:00
Moritz Kiefer
6d2ed90f29 Remove target flags in DAML triggers and DAML script (#3545)
1.7 is now the default so we no longer need those.
2019-11-20 10:54:16 +00:00
Moritz Kiefer
1bc4bb76a4 Make AnyChoice and AnyContractKey take template type into account (#3541)
* Make AnyChoice and AnyContractKey take template type into account

fixes #3540

* Update template desugaring

* Switch to proper ghc-lib release
2019-11-20 10:40:14 +00:00
Oliver Seeliger
917c43a048
Ledger api tool transaction test fixes: (#3542)
- moved comparableTransaction[tree]s helpers to companion object
  as suggested in https://github.com/digital-asset/daml/pull/3475#pullrequestreview-317474464
- applied helpers to two additional tests
- strip offset in addition to command-ids as offsets drift apart over time
  depending on differing heartbeats and different sets of hosted party and thus different
  party-relevant events
- modified two tests to be single-node as look-up by transaction/eventid assumes the events
  are available locally
2019-11-20 10:42:47 +01:00
nickchapman-da
e2a8cc29e5
Choice instances for cross sdk (#3477)
* generate choice instances for cross sdk dependencies

* add line to test cross-sdk exercise of choice

* revert to naming choice in GenerateSimpleDalf as "NotChoice"

* remove filter/special-handlimg for "Archive" choice

* dont assume a tycon with the same name as a choice; instead use type from chcArgBinder

* error if cant find the template datatype def

* naming

* avoid intercalate followed by re-split on "." in module name

* GenerateSimpleDalf: have two choices: one of record type, one of variant type

* Update Upgrade.hs

* added some linebreaks, spaces for readability

* address cosmetic comments

* use Sdk. prefix as necessary so tests work

* mollify hlint

* fix: daml-assistant/integration-tests
2019-11-20 07:29:56 +00:00
Rohan Jacob-Rao
fa8be840a8 Change title of release notes tab (#3535)
* Change title of release notes tab

This suggests that a new release is available, but not necessarily
installed. We do this for the case that the extension is updated
(which triggers the tab to open) but the actual SDK is not.

* Keep 'New'

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>
2019-11-19 22:00:53 +00:00
Leonid Shlyapnikov
a849bb86e4 JSON API: quit immediately after creating schema (#3534)
* quitting after create schema

* better error codes

* quitting after create schema

* better error codes

* explicitly creating schema during integration testing

* Updating release notes and CLI help

* Updating release notes

* minor update

* Fixing formatting

* update
2019-11-19 21:39:18 +00:00
Stephen Compall
1b6e4523ed replace JSON witnessParties column with a text[] column (#3461)
* replace JSON witnessParties column with a PG text[] column

* notes about the concurrent behavior of updateOffset

* include witness party in selectContracts query

* fmt

* fix witness_parties fetching in http-json tests

* release note

* typo in prior release note

* move new release note to bottom
2019-11-19 19:53:43 +00:00
Moritz Kiefer
8615266230 Switch the default DAML-LF version to 1.7 (#3530) 2019-11-19 19:18:07 +00:00
Samir Talwar
fbd6d77e62 ledger-api-test-tool-on-canton: Download Canton from canton.io. (#3533)
So we don't interfere with Canton download metrics.
2019-11-19 17:40:08 +00:00
Moritz Kiefer
7deca903bb Add documentation for DAML script and bundle it in the SDK (#3527) 2019-11-19 17:19:57 +00:00
Jussi Mäki
ff03ed5f3f
Add party to participant mappings as submission inputs (#3456)
* Add InsertOrdSet

A set with deterministic ordering.

* Add party to participant mappings as inputs to kvutils submissions

* Add InsertOrdSetTest, remove fromSet. Sort packages and parties.

* Apply suggestions from code review

Co-Authored-By: Remy <remy.haemmerle@daml.com>

* Add AbstractSet and SetLike traits to InsertOrdSet. Remove (Non)EmptyInsertOrdSet.
2019-11-19 18:03:58 +01:00
Brian Healey
fc70ec6412 indentation to show continuation (#3517) 2019-11-19 16:43:12 +00:00
Martin Huschenbett
e82630d864
Move the docs for the visualization to the experimental section (#3531) 2019-11-19 17:40:50 +01:00
Stefano Baghino
c51ecd3c58
Extractor with authentication (#3514)
* Make Extractor work against Ledger API servers protected by authentication

* Update changelog

* Address https://github.com/digital-asset/daml/pull/3514#pullrequestreview-318811500

- https://github.com/digital-asset/daml/pull/3514#discussion_r347753205
- https://github.com/digital-asset/daml/pull/3514#discussion_r347753629
- https://github.com/digital-asset/daml/pull/3514#discussion_r347754462

* Address https://github.com/digital-asset/daml/pull/3514#discussion_r347755484

* Address https://github.com/digital-asset/daml/pull/3514#discussion_r347752424

* Address https://github.com/digital-asset/daml/pull/3514#discussion_r347756328

* Fix docs

* Fix artifacts.yaml
2019-11-19 17:12:25 +01:00
Martin Huschenbett
c33517cf9f MVP for a daml2ts codegen (#3441)
* MVP for a daml2ts codegen

This PR adds an MVP for a codegen for TypeScript.

Given a DAR, daml2ts replicates the structure of the serializable type
definitions in it as TypeScript type definitions following our JSON
representation of DAML-LF types. It also adds decoders for all these types,
which can be used to check where an arbitray JSON value has the given type.
Finally, daml2ts also produces one JavaScript object for each template, which
reflects the type information of that template.

All produces objects implement some interfaces defined in a TypeScript
library currently called `@digitalasset/daml-json-types`. This libary is not
yet uploaded to NPM but rather included in the `tests/ts/daml-json-types`
directory. This libary also contains the JSON decoders for all of DAML-LF's
builtin types.

There are quite a few limitations right now. Most notably, variant and enum
types are not properly typed right now but rather gradually "typed" as
`unknown`. We also don't support nested `Optional`s, the `Numeric` type or
sum-of-product types in DAML. These issues are tracked in #3518.

There is currently one test. It takes a very simple DAML model, generates
the TypeScript for it and checks that it compiles and contains no linter
warnings/errors. Proper integration tests against the JSON API will follow.

* Address @cocreature's comments

* Make test work on Windows
2019-11-19 15:51:17 +00:00
Moritz Kiefer
e4632f5fb2 Include "daml trigger" in "daml --help" (#3528) 2019-11-19 16:19:17 +01:00
Martin Huschenbett
24d22012a8 Upgrade to nodejs-10.16.3 on Windows (#3529)
This matches the version we use on Linux.
2019-11-19 15:08:39 +00:00
Oliver Seeliger
f50901347f
Release lf scalacheck test jars to maven central (#3519)
as they are dependencies used downstream
2019-11-19 13:10:28 +01:00