Commit Graph

5715 Commits

Author SHA1 Message Date
Moritz Kiefer
2d3820ac14
Upgrade akka-http to 10.2 (#8058)
* Upgrade akka-http to 10.2

Follow up to #8048, I left out this upgrade to reduce noise and since
I wasn’t quite sure how involved it was going to be.

changelog_begin
changelog_end

* Reenable transparent HEAD requests

Apparently no longer on by default but we depend on this in waitForHttpServer

changelog_begin
changelog_end
2020-11-25 13:39:25 +01:00
Andreas Lochbihler
2156f946d1
kvutils reports lookupByKey inconsistencies as Inconsistent (#7914)
CHANGELOG_BEGIN
kvutils reports LookupByKey node mismatches during validation as Inconsistent
instead of Disputed if they can be due to contention on the contract key
CHANGELOG_END
2020-11-25 13:36:26 +01:00
Moritz Kiefer
037ff64e96
Bump timeout in integration tests (#8059)
changelog_begin
changelog_end
2020-11-25 10:47:01 +00:00
azure-pipelines[bot]
d8a5a0e516
release 1.8.0-snapshot.20201124.5709.0.dabd55d0 (#8055)
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.

@cocreature is in charge of this release.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-11-25 10:24:35 +01:00
Moritz Kiefer
d83cbdb475
Upgrade akka and akka-http (#8048)
* Upgrade akka and akka-http

Was chasing an issue somewhere and thought this might affect it in
some way. It didn’t but I might as well turn the upgrade into a PR.

changelog_begin
changelog_end

* Fix trigger service tests

changelog_begin
changelog_end

* Downgrade akka-http again

changelog_begin
changelog_end

* Upgrade akka-http again and fix tests

changelog_begin
changelog_end

* Cleanup trigger service

changelog_begin
changelog_end
2020-11-25 10:13:51 +01:00
Miklos
6664794600
[kvutils] Add config key to read set [KVL-746] (#8052) 2020-11-25 10:07:21 +01:00
Robin Krom
dabd55d0b0
assistant integratin tests: speed and cleanup. (#8032)
CHANGELOG_BEGIN
CHANGELOG_END
2020-11-24 19:05:02 +01:00
Gary Verhaegen
1aadbb1d6f
ts: support GenMaps (#8040)
ts: support GenMaps

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-24 17:11:53 +01:00
Richard Kapolnai
f3caa5919d
rename "gRPC API" to "gRPC Ledger API" (#8046)
* rename "gRPC API" to "gRPC Ledger API"
an incremental step towards #8029
changelog_begin
changelog_end

* fix section underline
2020-11-24 16:34:07 +01:00
Martin Huschenbett
38a9c70a79
DAML-LF spec: Some minor fixes (#8050)
We correct some spelling mistakes and make the formatting of some rules a bit more consistent.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-24 15:07:54 +00:00
Remy
0e4adfc47b
LF: clean LF encoder from deprecated LF versions (#8049)
This advances the state of #7788.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-24 15:56:13 +01:00
Remy
68c92b479c
LF: version transaction node independently in proto (#7925)
This advances the state of #7788.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-24 14:07:33 +01:00
Stefano Baghino
d5ff0dd8ea
Refactor indexing to minimize transaction traversals (#8019)
* Refactor indexing to minimize transaction traversals

changelog_begin
[Integration Kit] Bugfix: daml.index.db.store_transaction metrics were keeping track of empty insertions, skewing down the numbers
[Integration Kit] Performance: minimizing the number of traversals of a transaction to index it, more efficient indexing
changelog_end

* Add empty stakeholders for non-consuming exercises

* Fix test to check usage of pre-computed blinding info

* Remove unnecessary string interpolators

* Shorten creation of net visibility

* Delete obsolete comment

* Add visibility of divulged contracts

* Address review https://github.com/digital-asset/daml/pull/8019#discussion_r527666572

* Address review https://github.com/digital-asset/daml/pull/8019#pullrequestreview-535399441

* Address review https://github.com/digital-asset/daml/pull/8019#discussion_r527681774

* Fix ordering of batches, use explicitly named types to avoid confusion

* Default to an empty set if a divulged contract is not visible in the current transaction

* Shorten references to store transaction metrics when writing

* Address review https://github.com/digital-asset/daml/pull/8019#discussion_r527745640

* Add divulgences from past transactions

* More fine-grained types and signatures
2020-11-24 13:08:35 +01:00
Samir Talwar
09d7400e22
kvutils/tools: Verify that write sets are readable. [KVL-493] (#8038)
* kvutils/tools: Factor out builds from IntegrityCheckerSpec.

* kvutils/tools: Verify that write sets are readable.

CHANGELOG_BEGIN
- [Integration Kit] The integrity checker now validates the contents of
  each write set, regardless of whether it is used subsequently.
CHANGELOG_END

* kvutils/tools: Move the write set exception outwards.

* kvutils/tools: Make the integrity checker `main` method easier to read.

* kvutils/tools: Move `WriteSetEntries` logic into CommitStrategySupport.

This makes it more flexible with regards to extended write sets.

* kvutils/tools: Use the support state key serialization strategy.
2020-11-24 10:43:22 +00:00
Richard Kapolnai
57e0b065ad
Fix typo in json-api docs (#8045)
CHANGELOG_BEGIN
CHANGELOG_END
2020-11-24 10:46:02 +01:00
Moritz Kiefer
92cb4e7a32
Bump curl on Windows (#8044)
The old url 404s now and upgrading seems nice anyway.

changelog_begin
changelog_end
2020-11-24 09:27:05 +00:00
fabiotudone-da
1bd98c068d
Address review comments in #8009 and #8012 [KVL-736] (#8024)
* Address review comments in #8009 and #8012

CHANGELOG_BEGIN
CHANGELOG_END

* Tidy up

* Make test more meaningful and precise
2020-11-24 09:17:01 +01:00
Robert Autenrieth
07adbc8d80
Improve logging related to ledger config (#8025)
* Improve logging related to ledger config

CHANGELOG_BEGIN
CHANGELOG_END

* Update ledger/participant-integration-api/src/main/scala/platform/apiserver/services/LedgerConfigProvider.scala

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

* Improve wording

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-11-23 21:47:03 +01:00
Oliver Seeliger
7a2a2700cf
Introduce optional ledger-api-test-tool tests with ParticipantPruningIT (#8041)
CHANGELOG_BEGIN
CHANGELOG_END
2020-11-23 19:09:39 +01:00
Oliver Seeliger
83f11aa784
Participant pruning ledger api server support ported from Canton (#7988)
* Participant pruning ledger api server support ported from Canton

CHANGELOG_BEGIN
- [Ledger API]: The preview of `ParticipantPruningService` enables ledger participants to prune the "front" of ledger state at the participant including the ledger api server index.
CHANGELOG_END

* Review feedback from Stefano

* Add pruning tests plus missed command completions change

* Review feedback from Robert

* Improved test readability by having populate helper return offsets

* Review feedback

* Ledger api changes to pruning api and disable canton pruning test

- Change return result to PruneResponse
- Change type of PruneRequest.prune_up_to to string

* Review feedback: Use ApiOffsetSConverter for logged offsets
2020-11-23 15:28:04 +01:00
Robin Krom
936a0862fb
daml codegen: Add deprecation warning for scala. (#8033)
This fixes #8022. This adds a deprecation warning for the scala codegen.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-23 13:27:49 +01:00
tudor-da
f7c2ca808a
Allow async commits only within JdbcIndexer (#8004)
* Allow async commits within JdbcIndexer (#8004)

CHANGELOG_BEGIN
CHANGELOG_END

* Test in SqlLedgerSpec asserting no async commits in JdbcLedgerDao
2020-11-23 11:13:23 +01:00
Miklos
d5de65a234
Support serializing a single state update [KVL-669] (#8031) 2020-11-20 18:04:25 +01:00
Samir Talwar
bd037475eb
kvutils/tools: Fix the integrity checker so it compares state updates. (#8030)
* kvutils/tools: Fix the integrity checker so it compares state updates.

Previously, it would always take the list of updates _before_ processing
the import, leading to this useless check:

    Comparing expected and actual state updates.
    Successfully compared 0 state updates.

This makes the snapshotting lazy (by using a function instead of a
value), ensuring we actually perform the assertion.

CHANGELOG_BEGIN
CHANGELOG_END

* kvutils/tools: Add a test for the state updates regression.
2020-11-20 15:46:42 +00:00
Moritz Kiefer
65f355f327
Wait for live event in build-and-lint JS tests (#8001)
The stream from the JSON API is split into two sections:

1. The unordered section of ACS events.
2. The ordered transaction stream after the live event.

Our assertions assume that we only get 2 but currently we don’t wait
before sending commands so depending on timing, some of the events can
be delivered as part of the ACS section in a different order causing
very confusing assertion failures.

This test fixes this by waiting for the live event indicating the end
of section 1 and thereby forcing everything to come via the ordered
transaction stream.

Verified that this fixes the flakiness with --runs_per_test=50 which
reproduced it fairly reliable before (on CI, never managed to hit it
locally).

changelog_begin
changelog_end
2020-11-20 14:38:49 +01:00
Martin Huschenbett
da551ea142
DAML-LF spec: Explain how to use LaTeX input (#8018)
Add a description of how to enable LaTeX input mode when editing the
DAML-LF spec in VS Code. Also add some additional symbols.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-20 13:41:10 +01:00
fabiotudone-da
13851ca5e9
[KV] Read and prefer pre-computed blinding info when decoding KV transaction log entries [KVL-736] (#8012)
* Test and fix Conversions#encodeBlindingInfo

* Fix rebase

* Read and prefer pre-computed blinding info when decoding KV transaction log entries

CHANGELOG_BEGIN
CHANGELOG_END

* Fix rebase

* Tidy up

* Tidy up
2020-11-20 10:41:58 +01:00
Richard Kapolnai
34d7429147
fix section link in docs (#7850)
changelog_begin
changelog_end
2020-11-20 08:42:24 +00:00
fabiotudone-da
4f21453c5a
[KV] Fill DamlTransactionEntry#bindingInfo during TransactionCommitter#blind [KVL-736] (#8009)
* Fill DamlTransactionEntry#bindingInfo during TransactionCommitter#blind

CHANGELOG_BEGIN
CHANGELOG_END

* Test and fix Conversions#encodeBlindingInfo

* Fix rebase

* Fix non-determinism

* Reduce visibility

* Tidy up
2020-11-20 08:43:08 +01:00
Matthias Schmalz
82eaef5402
Updated documentation of CommandClient.trackCommands(Unbounded) (#7998)
* Do not backpressure from the command tracker output to the submission flow.
This is required to meet the contract of CommandClient.trackCommandsUnbounded, which allows for submitting an unbounded number of commands.
This is in turn required to use CommandClient.trackCommandsUnbounded as part of a flow that retries (some of the) failed command submissions.

CHANGELOG_BEGIN
CHANGELOG_END

* Revert "Do not backpressure from the command tracker output to the submission flow. This is required to meet the contract of CommandClient.trackCommandsUnbounded, which allows for submitting an unbounded number of commands. This is in turn required to use CommandClient.trackCommandsUnbounded as part of a flow that retries (some of the) failed command submissions."

This reverts commit 20c0b8e3

* Adding a disclaimer to the CommandClient so that users are not totally surprised about unexpected backpressure.
2020-11-19 16:55:10 +00:00
fabiotudone-da
2ff4d923a9
[KV] proto: add optional DamlTransactionBlindingInfo to DamlTransactionEntry [KVL-736] (#8005)
* KV proto: add optional DamlTransactionBlindingInfo to DamlTransactionEntry

CHANGELOG_BEGIN
CHANGELOG_END

* Wording

* Wording

* Rename party -> <action>_to for consistency

* Treat contract IDs as opaque strings (and for consistency)

* Address review comments
2020-11-19 15:09:23 +01:00
Richard Kapolnai
db08959811
Topology documentation: refine "serving the API" (#7971)
* concretize item on "serving the API"
CHANGELOG_BEGIN
CHANGELOG_END

* Revert "concretize item on "serving the API""

This reverts commit 83e35114c4.

* change authentication to authorization

* remove "etc." to make item clearer
2020-11-19 14:49:02 +01:00
Sofia Faro
4ac8d7cdf1
Make featureCppFlag field optional. (#8014)
Some features, in particular daml-lf encoding features, don't make any sense to have an associated CPP flag. I made the CPP flag optional and removed these unnecessary feature flags (based mostly on whether the flags were used in the standard library).

changelog_begin
changelog_end
2020-11-19 12:40:41 +00:00
Sofia Faro
ddf1378273
Use a NonEmpty list in makeLocalValBinds. (#8013)
Rewrite makeLocalValBinds to make the non-emptiness of the `binds`
argument explicit.

changelog_begin
changelog_end
2020-11-19 11:29:19 +00:00
Moritz Kiefer
9a6c33a7e3
Pass application_id through auth middleware (#8011)
fixes #7978

There is no new test in the trigger service since the existing test
for the custom application id already hits this. The difference is
that now the test authorization server will produce a token with the
application id set to what we request rather than the wildcard token
we used before.

changelog_begin
changelog_end
2020-11-19 12:00:54 +01:00
Shaul Kfir
2b9bc2b8bf
Minor improvements to getting started doc (#7854)
* Minor improvements to getting started doc

* add empty changelog

changelog_begin
changelog_end

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-11-19 09:42:22 +00:00
azure-pipelines[bot]
6a7cdc1831
update compat versions for 1.8.0-snapshot.20201117.5661.0.76fae40c (#8000)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-11-19 10:18:40 +01:00
Martin Huschenbett
cfb8681b1c
DAML-LF spec: Fix some bad markup for links (#8010)
CHANGELOG_BEGIN
CHANGELOG_END
2020-11-19 09:06:34 +00:00
Moritz Kiefer
21aaf8b173
Use futures for database interaction in trigger service (#7999)
akka-http gets a bit unhappy if you block within requests and we also
use the unsafeToFuture in the JSON API so it seems sensible to do the
same in both.

I’ve moved out the initDb option out of the Server actor both because
it seemed cleaner than calling sys.exit in the actor and because it
was annoying to fit it in.

changelog_begin
changelog_end
2020-11-19 09:13:05 +01:00
nickchapman-da
6a745ed1fa
Support choice observers in 1.dev (#7922)
* Adapt to new desugaring for choice observers.

update hash of ghc patch.

changelog_begin
changelog_end

update ghc patch to final version

update stack-snapshot hashes for ghc-lib(-parser)

update stackage_snapshot.json, following `bazel run @stackage-unpinned//:pin`

expose Optional constructors for desugared code to use

adapt LFConversion to expect a 4-tuple for a desugared choice def/sig

update LFConversion for choice-observers

first example using new choice observer syntax.

fix scala type checker to have correct scoping rules for choice-observers

remove comment from example which says it is broken

improve variable names

improve tests for choice-observer clause

only test choice-observers SINCE 1.dev

add jq queries for choice observeres

make positive statement in jq test which checks choice obserers are present

test behaviour of choice observers

squash me

typo

* test more choice-observer divulgence

* Update documention for choice observers.

changelog_begin
Support choice observers in 1.dev
changelog_end

* fix docs build

* fix daml docs choice-observers example

* address comments: rewording text

* annotate choices observers as early-access in documention

* split out documentation code-snippets which require --target=1.dev

* final tweaks to documentation text
2020-11-18 19:51:15 +00:00
Sofia Faro
6c7e37a330
Rewrite multiple binding lets sequentially. (#8006)
* Rewrite multiple binding lets sequentially.

This PR enforces a sequential evaluation and dependency on
multiple-binding lets, by rewriting,

  let x1 = e1
      x2 = e2
      ...
      xn = en
  in b

Into a chain of single-binding let expressions,

  let x1 = e1 in
    let x2 = e2 in
      ...
        let xn = en in
          b

And likewise, rewriting multi-binding let statements in a "do" block,

  do
      ...
      let x1 = e1
          x2 = e2
          ...
          xn = en
      ...

Into single-binding let statements,

  do
      ...
      let x1 = e1
      let x2 = e2
      ...
      let xn = en
      ...

This PR fixes #6788 and adds a bunch of tests.

This is a bugfix, but it may break existing code that relies on
out-of-order let bindings. The suggested fix is to simply reorder
the let bindings, placing them in order of their dependency.

CHANGELOG_BEGIN

- [DAML Compiler] The DAML compiler now enforces sequential
  ordering for ``let`` expressions with multiple bindings.
  This fixes a bug where ``let`` expressions would be evaluated
  in the wrong order.

CHANGELOG_END

* Update compiler/damlc/daml-preprocessor/src/DA/Daml/Preprocessor.hs

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* adjust last binding behavior

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-11-18 19:32:08 +00:00
Gary Verhaegen
e69cb45c51
ts/daml-ledger: createAndExercise (#7990)
ts/daml-ledger: createAndExercise

Fixes #7966.

CHANGELOG_BEGIN

JavaScript Client Libraries: The Ledger object (defined in daml-ledger,
returned by useLedger in daml-react) now sports an additional method
`createAndExercise`, which lets JS users create a contract and exercise
a choice on it in the same transaction.

CHANGELOG_END
2020-11-18 18:06:42 +01:00
Gary Verhaegen
6b31b2d4fd
release instructions: minor tweaks (#8008)
CHANGELOG_BEGIN
CHANGELOG_END
2020-11-18 17:37:19 +01:00
Samir Talwar
4ca87206ed
sandbox-common: Use a single sandbox for all the reset service tests. (#8007)
This makes the test a lot faster, not just because we don't restart the
Sandbox, but because we don't restart PostgreSQL either.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-18 16:02:48 +00:00
azure-pipelines[bot]
dc236dc600
rotate release duty after 1.8.0-snapshot.20201117.5661.0.76fae40c (#7995)
@garyverhaegen-da is taking care of 1.8.0-snapshot.20201117.5661.0.76fae40c (#7994), so they get pushed back to the end of the line.

Please do not merge this before #7994.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-11-18 16:53:20 +01:00
Samir Talwar
7bea34955e
extractor: Use pattern matching to get better error messages. (#8002)
* extractor: Use pattern matching to get better error messages.

If the gRPC exception status is not the one we expect, this will ensure
that we log the entire exception and not just the status.

CHANGELOG_BEGIN
CHANGELOG_END

* extractor: Make VeryLargeArchiveSpec an async spec.
2020-11-18 12:31:58 +00:00
Andreas Herrmann
59f40cb54e
Hide docs of Daml.Trigger.Internal (#7992)
changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-11-18 12:26:06 +00:00
Martin Huschenbett
f0e5bed36f
DAML-LF: Add interning for type to DAML-LF 1.dev (#7893)
* DAML-LF: Add interning for type to DAML-LF 1.dev

We add two new features to DAML-LF 1.dev:

* a per package list (or table) of `Type` messages, and
* a new case in the `Type` message which is an index into this table.

In combination, these two features can be used to allow DAML-LF
encoders to perform hash-consing of `Type` messages. We also change the
Haskell implementation of our DAML-LF encoder to do exactly that when
targetting DAML-LF 1.dev.

Doing this has a few benefits:

1. The DALFs produced by `damlc` get smaller: I've seen a case where
   the size dropped from 69MB to 45MB.
2. DAML-LF decoders need to decode less data.
3. Decoded packages use less memory because identical structures are
   now shared. This is particularly helpful in situations where we need
   to keep the interface (or signature) of a package in memory for a
   long time.

This PR mostly takes care of the Haskell implementation. However, we
need to make the Scala implementation of the decoder aware of the new
features as well since we have tests that load DAML-LF 1.dev into the
engine. A decoder and _targeted_ tests on the Scala side will follow
in a separate PR.

CHANGELOG_BEGIN
CHANGELOG_END

* Make jq tests aware of type interning

CHANGELOG_BEGIN
CHANGELOG_END

* Improve jq test

CHANGELOG_BEGIN
CHANGELOG_END

* Apply Remy's suggestions

Co-authored-by: Remy <remy.haemmerle@daml.com>

* Improve the imperative bits

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Remy <remy.haemmerle@daml.com>
2020-11-18 11:14:30 +00:00
Samir Talwar
1ac3160a46
test-common: Make FiniteStreamObserver more lenient. (#7996)
* test-common: Make FiniteStreamObserver more lenient.

We can't protect against all possible race conditions; we just have to
accept that sometimes `onNext` will be called after `onCompleted`, or
`onCompleted` will be called twice, or…

CHANGELOG_BEGIN
CHANGELOG_END

* test-common: Avoid calling `onCompleted` twice in `TimeBoundObserver`.
2020-11-18 10:45:40 +00:00
fabiotudone-da
43b1f9c96f
Let indexer updates support and prefer (optional) pre-computed blinding info [KVL-724] (#7989)
* Add to indexer updates and prefer optional blinding info

CHANGELOG_BEGIN
CHANGELOG_END

* Formatting

* Relax adherence to Scala naming convention for better readability
2020-11-18 11:42:12 +01:00