Commit Graph

5797 Commits

Author SHA1 Message Date
Richard Kapolnai
f899a3e19c
Fixing minor documentation errors (#8144)
* fix minor typos
CHANGELOG_BEGIN
CHANGELOG_END

* Remove notes and comments on pragma

* minor fix: remove "again" again

* fix various typos

* remove unexplained "bank" references

* replace LET with LT

* fix typo

* remove "again"

* fix grammar

Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>

* adjust line numbers to include

Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>
2020-12-03 15:28:34 +00:00
nickchapman-da
0867605e1a
Don't loose signatures in template let binding (#8136)
* update ghc-lib patch

* update stack-snapshot.yaml

changelog_begin
changelog_end

* bazel run @stackage-unpinned//:pin (on linux) and update stackage_snapshot.json

* testcase to check type signatures in template-lets are not ignored

* update to ghc-lib commit hash following merge

* update snapshot

* update snapshot after pin on windows

* update stack pin on linux

Co-authored-by: Nick Chapman <nchapman@digitalasset.com>
2020-12-03 15:08:02 +00:00
Stefano Baghino
d3899368ff
Document offset inclusivity and exclusivity in Protobuf (#8145)
* Document offset inclusivity and exclusivity in Protobuf

As brought up in https://discuss.daml.com/t/using-offsets/1731, the
inclusivity and exclusivity of start and end offsets as exposed by
the Ledger API is not well documented.

This commit clearly states which offset is inclusive and which is
exclusive on all relevant endpoints (command completion and
transaction services).

changelog_begin
changelog_end

* Address https://github.com/digital-asset/daml/pull/8145#pullrequestreview-543758867
2020-12-03 16:00:50 +01:00
Moritz Kiefer
92e4c1f6d4
Bump more navigator frontend deps (#8141)
changelog_begin
changelog_end
2020-12-03 15:58:43 +01:00
Miklos
56c876ba46
kvutils: Simplified CommitContext [KVL-750] (#8146)
* Converted CommitContext into a class.
CHANGELOG_BEGIN
CHANGELOG_END

* newCommitContext => createCommitContext

* Made CommitContext a case class.

* Apply suggestions from code review

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>

* Made CommitContext a case class.

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-12-03 14:21:11 +00:00
Gary Verhaegen
3e4fec8951
release process: tweak automated messages (#8150)
I believe those will be a bit clearer.

CHANGELOG_BEGIN
CHANGELOG_END
2020-12-03 13:44:24 +00:00
Martin Huschenbett
00db6224f5
Improve IntelliJ + Bazel setup instructions (#8149)
CHANGELOG_BEGIN
CHANGELOG_END
2020-12-03 14:04:31 +01:00
Samir Talwar
331b9c8401
When publishing Protobuf source JARs, publish the dependencies. (#8148)
Previously, each Protobuf source JAR was considered independent, and did
not require dependencies. This meant that the kvutils Protobuf sources
were published without the associated DAML-LF sources, making them
useless.

This change adds the source JARs as runtime dependencies to ensure that
when publishing a Protobuf source JAR, the release process will fail if
the dependencies are not also published.

CHANGELOG_BEGIN
- [Ledger API] We now publish Protobuf sources in JARs for DAML-LF
  types to Maven Central, with the group "com.daml". The artifact names
  follow the format "<name>_proto_jar".
CHANGELOG_END
2020-12-03 11:52:18 +00:00
Stefano Baghino
56292dc191
Address leftover comments from 8019 (#8139)
changelog_begin
changelog_end

Address https://github.com/digital-asset/daml/pull/8019#discussion_r528755357

Address https://github.com/digital-asset/daml/pull/8019#discussion_r528763902

Address https://github.com/digital-asset/daml/pull/8019#discussion_r528767077

Address https://github.com/digital-asset/daml/pull/8019#discussion_r528773062
2020-12-03 09:23:16 +01:00
Gary Verhaegen
7c2ba6f996
infra: add prod label (#8140)
Requested by @nycnewman.

CHANGELOG_BEGIN
CHANGELOG_END
2020-12-03 01:55:43 +01:00
Gary Verhaegen
586e29adca
incident-118: investigate & fix (#8135)
incident-118: fruitless investigation; revert

This first commit just duplicates the existing configuration. Further
commits will make actual changes so they can be tracked by looking at
individual commits (rather than try to think up the diff by looking at
entirely new files).

CHANGELOG_BEGIN
CHANGELOG_END
2020-12-02 19:20:56 +01:00
Remy
45b04724ec
LF: Change ordering of builtin type to follow proto declaration (#8133)
CHANGELOG_BEGIN
CHANGELOG_END
2020-12-02 18:38:03 +01:00
Miklos
0de8f1b1b7
[kvutils] Record all key lookups by transaction committer [KVL-750] (#8082) 2020-12-02 18:04:05 +01:00
Andreas Herrmann
8bceeb13de
Handle token expiry in trigger service (#8037)
* Enable adjustable clock in trigger service tests

changelog_begin
changelog_end

* Test user side token expiry

* Test service side token refresh

* Use AccessToken wrapper in TriggerRunnerImpl

* Store refresh token in trigger DB

* add refresh token to trigger runner config

* TriggerTokenExpired message to server

* TriggerTokenRefresh message to server

* refresh trigger token and update db

* Restart trigger with fresh token

* Test second token expiry

* Refresh token on running trigger

changelog_begin
* [Triggers] UNAUTHENTICATED errors will now terminate the trigger.
  These errors are no longer available for handling in the trigger DAML
  code. Instead, they are forwarded to the trigger service for handling,
  e.g. access token refresh.
changelog_end

* todo note

* Move triggerRunnerName and getRunner into object

* Factor out token refresh

* Factor out getActiveContracts

* factor out create command

* Add logging to token refresh

* Handle token expiry in TriggerRunner

TriggerRunnerImpl throws a dedicated exception when it fails on an
expired access token (any unauthenticated error to be precise).
The TriggerRunner supervisor reacts to this child failure by
requesting a token refresh and restart on the trigger server and
stopping itself.
The trigger server requests a new access and refresh token on the auth
middleware and restarts the trigger.

This works around an issue with actor supervisors in akka-actor-typed.
A stop supervisor wrapped within a restart supervisor will not cause a
stop as expected. Instead, the restart supervisor will trigger as well
and restart the actor. The work around uses a custom behavior
interceptor to emulate the appropriate stop supervisors as closely as
possible. We cannot properly emulate ChildFailed signals this way, so
we use dedicated messages intead.

* throw --> Future.failedo

* getOrFail helper

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-12-02 16:17:45 +00:00
Sofia Faro
6b7f714c4d
Add exception type coherence check on Haskell side (#8137)
* Add exception type coherence check on Haskell side

changelog_begin
changelog_end

* update pretty instance

* follow martin suggestions
2020-12-02 14:36:22 +00:00
Moritz Kiefer
94578bd2fd
Fix docs for Java quickstart (#8129)
Noticed this while using it to test Navigator changes. Not sure for
how long this has been outdated but definitely for quite a while.

changelog_begin
changelog_end
2020-12-02 12:47:58 +01:00
Moritz Kiefer
9afce5b35a
Upgrade apollo libraries in Navigator (#8124)
changelog_begin
changelog_end
2020-12-02 12:47:30 +01:00
Moritz Kiefer
08dfb8a628
Only subscribe to local parties in Navigator (#8130)
* Only subscribe to local parties in Navigator

Subscribing to non-local parties isn’t going to work. Not quite sure
how to test this. Spinning up one of the multi-node ledgers just for
this seems a bit overkill.

changelog_begin
changelog_end

* Add log

changelog_begin
changelog_end
2020-12-02 12:10:53 +01:00
azure-pipelines[bot]
cb31b40308
rotate release duty after 1.8.0-snapshot.20201201.5776.0.4b91f2a6 (#8127)
@stefanobaghino-da is taking care of 1.8.0-snapshot.20201201.5776.0.4b91f2a6 (#8126), so they get pushed back to the end of the line.

Please do not merge this before #8126.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-12-02 12:08:46 +01:00
azure-pipelines[bot]
49d71f6213
release 1.8.0-snapshot.20201201.5776.0.4b91f2a6 (#8126)
This PR has been created by a script, which is not very smart and does not have all the context. Please do double-check that the version prefix is correct before merging.

@stefanobaghino-da is in charge of this release.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-12-02 11:56:22 +01:00
Gary Verhaegen
841116bf1e
incident-118: linux machines unable to start (#8128)
Early investigation points to cloud logging install failing. Temporarily
disabling.

CHANGELOG_BEGIN
CHANGELOG_END
2020-12-02 10:11:11 +00:00
fabiotudone-da
4b91f2a668
TransactionCommitter: remove Fetch and LookupByKey nodes [KVL-738] (#8106)
* Re-apply #7743 and adapt test

CHANGELOG_BEGIN
CHANGELOG_END

* Fix and test divulgence indexing

* Simplify TransactionIndexing.Builder init

* Clarify that this change makes blinding_info mandatory in DamlTransactionEntry

* Add comment about DamlTransactionEntry format backwards-compatibility

* Address review comments
2020-12-01 20:11:28 +01:00
Gary Verhaegen
485dd1b597
perf_json_http: compress results (#8123)
I wanted to suggest that on the PR but caught it after it was merged. So
I made a note of it, which promptly got lost. As the end of the year
approaches I've started trying to clean up a little.

CHANGELOG_BEGIN
CHANGELOG_END
2020-12-01 17:44:43 +01:00
Samir Talwar
93acf1e6cd
Bazel: Reduce visibility of Protobuf JARs and accoutrements. (#8121)
* Bazel: Reduce the visibility of some Protobuf targets.

* Bazel: Make Protobuf JAR visibility parameterizable.

Default to private, and explicitly make it public where it's needed.

CHANGELOG_BEGIN
CHANGELOG_END
2020-12-01 14:00:44 +00:00
Gary Verhaegen
5114fadd1d
ts/ledger: package management (#8115)
This PR adds coverage for the package management endpoints of the JSON
API.

CHANGELOG_BEGIN

- [JavaScript Client Libraries] The Ledger object (returned by
  `useLedger` through the React bindings) has three new methods covering
  the package management API: `listPackages` returns a list of all known
  packageIDs, `getPackage` returns the binary data of the corresponding
  DALF, and `uploadDarFile` takes binary data and uploads it to the
  ledger. Note that `uploadDarFile` requires admin access.

CHANGELOG_END
2020-12-01 12:58:29 +00:00
Sofia Faro
0df1a79ee3
Add DAML_EXCEPTIONS feature. (#8114)
* Add DAML_EXCEPTIONS feature.

Part of #8020. This extracts the DAML_EXCEPTIONS feature from #8023
since we need it for typechecking & LF conversion soon.

changelog_begin
changelog_end

* add full url

* add another url
2020-12-01 12:38:41 +00:00
Stefano Baghino
bc0f6ab35e
[DPP-84] Employ parallel unnesting instead of batching on PostgreSQL (#8042)
* [DPP-84] Employ parallel unnesting instead of batching on PostgreSQL

changelog_begin
[Integration Kit] When using a PostgreSQL-based index, leveraging native
parallel unnesting allows to more efficiently index new transactions.
changelog_end

* Address review https://github.com/digital-asset/daml/pull/8042#pullrequestreview-541759596
2020-12-01 12:06:36 +00:00
Moritz Kiefer
761b3da068
Delete unused withExercise from Navigator (#8116)
Not actually used anywhere

changelog_begin
changelog_end
2020-12-01 11:51:12 +01:00
Samir Talwar
4d1cf41adf
Bazel: Simplify the implementation of proto_gen. (#8120)
CHANGELOG_BEGIN
CHANGELOG_END
2020-12-01 10:36:10 +00:00
nickchapman-da
7d25cbba8b
test tail calls execute in constant env-stack (#8102)
* Tail-recursive function definitions execute with bounded environment and continuation stacks.

changelog_begin
changelog_end

* be more precise about the throw exception; use thrownBy

* add test for the KFoldr1Map/Reduce case
2020-12-01 10:35:58 +00:00
Moritz Kiefer
12b22ead1e
Mark NPM snapshots with --tag next (#8118)
NPM specialcases the latest tag which is used by default and defaults
to that in things like `npm add`. Given that we don’t want people to
rely on snapshots, tagging them as next (common convention on npm)
seems like a good idea.

I have no idea how to test this reasonably so the next snapshot will
have to tell if it works or not.

changelog_begin
changelog_end
2020-12-01 11:00:37 +01:00
Samir Talwar
e93439deb7
Bazel: Set the docstring on java_home_runtime. (#8119)
CHANGELOG_BEGIN
CHANGELOG_END
2020-12-01 08:54:30 +00:00
Samir Talwar
99de3b74cb
kvutils: Publish the Protobuf definition. (#8098)
CHANGELOG_BEGIN
- [Integration Kit] The kvutils Protobuf definition is now published to
  Maven Central in a JAR, under the group "com.daml", with the artifact
  name "participant-state-kvutils-proto".
CHANGELOG_END
2020-12-01 07:47:44 +00:00
Stephen Compall
8ec103ea0b
speed up sync fetch by contract ID/key with postgres and faster in-memory filtering (#7993)
* mark some of dbbackend private

* fetchBy* functions for Queries

* shift in-memory filtering into the transaction stream

- removes irrelevant contracts from memory as soon as possible for fetch by
  contract ID and key in-memory

* push the three synchronous search varieties into new signatures

* replace the core findByContract* functions with DB-delegating versions

* remove the GADT equality and most of the explicit traversals

- compiles again, finally

* factoring

* ContractDao wrappers for fetchById and fetchByKey

* DB version of findByContractId

* DB version of findByContractKey

* Search is the split of ContractsService

* fix SQL for keys

* trade the typeclass for a sum type

- sealed instead of final because of the path dependency on ContractsService
  instance

* number conversion is done already in ContractDao

* make fetch-by-key tests depend on proper number conversion for SQL

* add changelog

CHANGELOG_BEGIN
- [JSON API] ``/v1/fetch`` now uses the Postgres database, if configured, to
  look up contracts by ID or key, except when querying a contract by ID without
  its corresponding template ID.  The fallback in-memory version of
  ``/v1/fetch`` is also now significantly more efficient for large datasets,
  though still linear.

  You may optionally re-create JSON API's database to take full advantage.
  See `issue #7993 <https://github.com/digital-asset/daml/pull/7993>`__.
CHANGELOG_END

* use search.search for search

- suggested by @cocreature; thanks

* add an index for contract key lookups

- suggested by @cocreature; thanks
2020-11-30 13:51:29 -05:00
Bernhard Elsner
d40f2493ab
Docs style alignment (#8074)
* Docs restyle WIP

* Minor color changes

* Adjust fonts and shadows

* Remove redundant local contents

* Further fixes to "In this Section"

* Restyle previous and next buttons

* Make visited link color blue

* Top-level nav

* Change how anchors are underlined

* Fix header spacing

* Improve tables

* Improve search results

* Improve copy button

Match sphinx versions between dev-env and bazel

* Copy button and code block fixes

* Fix copy button z-index

* Making things reactive

* Make the title spacing work on mobile & tablet

* Pixel adjustment for S3 hosting

* Spacing and font-size fixes

* Fix content menu for tablet

* Tidy up menu indentation

* Reorder Mobile Menu

* Move unified nav up

CHANGELOG_BEGIN
[Docs] New styling
CHANGELOG_END

* Remove non-free fonts

* Fix button padding

* Fix spacing above first h2

* Fix pixel adjustment of h1 line

* Fix menu click effects and antialiasing

* Pixel adjust h1 line once more
2020-11-30 17:16:26 +00:00
Martin Huschenbett
fbabb5e0f4
DAML-LF spec: Incorporate Remy's feedback on exceptions (#8111)
CHANGELOG_BEGIN
CHANGELOG_END
2020-11-30 18:08:31 +01:00
Moritz Kiefer
8355124060
Remove password option from Navigator (#8113)
This was leftover from ancient times. You couldn’t actually use this
in any way since we always defaulted to the select method and provided
no way to change this. We still support it in the config but emit a
warning now if you use it.

changelog_begin

- [Navigator] The `password` option in the Navigator config file is
  now deprecated. Note that it was already unused before.

changelog_end
2020-11-30 17:38:22 +01:00
Sofia Faro
6499ee9716
Add exceptions in DAML-LF AST (Haskell side) (#8112)
* Add exceptions in DAML-LF AST (Haskell side)

Updates the Haskell DAML-LF AST for exceptions, including
encode/decode, and updates all the functions that deal with the
AST directly.

changelog_begin
changelog_end

* Missed some TODOs in DecodeV1
2020-11-30 16:18:29 +00:00
Moritz Kiefer
dee2460849
Support listKnownParties in DAML Script over JSON API (#8109)
fixes #6374

changelog_begin

- [DAML Script] listKnownParties is now also supported when running
  over the JSON API.

changelog_end
2020-11-30 15:02:54 +00:00
Bernhard Elsner
0f54a0cbdb
Remove the examples page from the docs in favour of one on daml.com (#8090)
* Remove the examples page from the docs in favour of one on daml.com

CHANGELOG_BEGIN
CHANGELOG_END

* Fix link from /samples to /examples

* Fix link in daml intro

* Fix link, second try
2020-11-30 15:37:15 +01:00
Andreas Herrmann
6ea3007e31
upgrade rules_nixpkgs (#8078)
changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-11-30 14:36:46 +00:00
Remy
17bed0fd3b
LF: clean spec from deprecated version (#8108)
* LF: clean the spec from deprecated versions

This advances the state of #7155.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-30 15:32:57 +01:00
Kamil Bożek
012ae55d65
Engine API - multi-party submissions [KVL-703] (#8081)
* Multiple submitters field for Command

* Multiple submitters field for Engine API

* Tests for multi-party submissions in Engine

* Make use of multi-party Engine capabilities in the engine benchmark

* Enable multi-party submission in Engine's API
CHANGELOG_BEGIN
CHANGELOG_END

* Separate unit tests for multi-party engine

* Unit tests for multi-party submission transaction replay
2020-11-30 15:04:30 +01:00
Gary Verhaegen
0a1feb75ef
ts/ledger: party management API (#8104)
This PR adds TS bindings coverage for the party management methods of
the JSON API.

CHANGELOG_BEGIN

- [JavaScript Client Libraries] The Ledger object (returned by
  `useLedger` through the React bindings) has three new methods covering
  the Party management API: `getParties` allows users to, based on a
  party id (or party ids, as the name suggests) fetch more information
  about the party or check for its existence; `listKnownParties` will
  return a list of all known parties, and `allocateParty` will allocate
  a new party.

CHANGELOG_END
2020-11-30 14:42:35 +01:00
Gary Verhaegen
fe191f21ae
ts/ledger: log JSON API warnings (#8107)
CHANGELOG_BEGIN

- [JavaScript Client Libraries] Ledger interactions will now log
  warnings received from the JSON API.

CHANGELOG_END
2020-11-30 13:53:41 +01:00
Moritz Kiefer
a3f8caae28
Cleanup DAML Script over JSON API (#8105)
* Cleanup DAML Script over JSON API

changelog_begin
changelog_end

* Update daml-script/runner/src/main/scala/com/digitalasset/daml/lf/engine/script/LedgerInteraction.scala

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

* Update daml-script/runner/src/main/scala/com/digitalasset/daml/lf/engine/script/LedgerInteraction.scala

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2020-11-30 13:36:50 +01:00
Moritz Kiefer
96f58a3db1
Discover parties in navigator automatically (#8079)
This turned out to be a bit more messy than I thought it would be
unfortunately but it doesn’t seem too bad. If anyone has a better
suggestion for how to approach this, I’m all ears.

I added an integration test that checks that newly allocated parties
are picked up.

changelog_begin

- [Navigator] If no parties are in the Navigator config or daml.yaml,
  Navigator will now pick up parties from the party management
  service. Those parties are periodically refreshed.

changelog_end

Update navigator/backend/src/main/scala/com/digitalasset/navigator/Session.scala

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2020-11-30 12:53:40 +01:00
Gerolf Seitz
74f5ecd082
kvutils: use a type ascription instead of asInstanceOf (#8103)
This doesn't override the compiler completely, but lets it tell us if
types become incompatible as part of a refactoring.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-30 12:25:47 +01:00
Sofia Faro
72e2f7d967
Update protobuf for exceptions. (#8087)
* Update proto file for exceptions

* s/CONS/MAKE

* typo

* DefException

* var is interned

* fix DefException numbers

* adjust decoding slightly

* lint

* Update scala decoder.

changelog_begin
changelog_end

* update simplifier tests

* move the MAKE up front

* suggestions

* fix pretty

* add placeholder builtin infos on scala side

* add exceptions feature on scala side

* fix typos

* forgot THROW
2020-11-30 10:42:17 +00:00
Moritz Kiefer
f4c530abc1
Exclude tests relying on 1.dev (#8100)
follow-up to #8099. If we don’t load the 1.dev dar in sandbox which is
totally sensible, we obviously also cannot run tests against it. In
newer test tool versions that’s not an issue but for older versions we
still need to exclude that one test.

changelog_begin
changelog_end
2020-11-30 09:53:59 +00:00