Commit Graph

8075 Commits

Author SHA1 Message Date
Moisés Ackerman
9e918c37a3
Update trigger-service docs to use --dar option in the corresponding example (#10877)
changelog_begin
changelog_end
2021-09-14 14:46:31 +02:00
Artúr Poór
49a9556e5c
[docs] Fix minor typo in doc of exerciseByKey in TS. (#10863)
changelog_begin
changelog_end
2021-09-14 12:30:50 +00:00
Robin Krom
f7c07eaa0c
interfaces: scala protobuf encoder (#10878)
This implements the protobuf encoder of the scala side for interfaces.

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-14 12:27:53 +00:00
fabiotudone-da
be4e06427f
Ledger API Test Tool: support --additional tests [KVL-1100] (#10829)
* Support adding tests as an hidden option

* Simplify existing suites

CHANGELOG_BEGIN
CHANGELOG_END

* Remove stale conformance suites from build.yml

* `--add` -> ``--additional`

* Re-add `--all-tests` as deprecated CLI option to be tested

* Move sandbox-classic pruning test to wall clock again

* Run KVCommandDeduplicationIT for sandbox append-only

* Tidy-up

* Also add participant pruning test to ledger-on-memory/single-participant

* Remove KVCommandDeduplicationIT on ledger-on-memory/append-only

* Run the full suite plus pruning (rather than just pruning) for ledger-on-memory with multiple participants and append-only

* Add KVCommandDeduplicationIT to ledger-on-memory append-only

* Exclude ConfigManagementServiceIT from ledger-on-memory append-only multi-participant

* Tidy-up

* Use KVCommandDeduplicationIT for sandbox-on-x too

* Fix merge

Add max dedup duration arg to all the test suites that include command dedup tests

* Make `--include` and `--additional` mutually exclusive

* Uniform formatting of multi-line strings

* Move exclusions after additions as they are applied last

* Re-disable deduplication test on sandbox with static time

* Re-disable deduplication test on sandbox-on-x
2021-09-14 14:00:30 +02:00
tudor-da
97e14de644
[Ledger API error codes] ErrorCode interfaces and generator [DPP-591] (#10836)
* [Ledger API error codes] ErrorCode interfaces and generator
* Implementation of annotation processor
* Implementation of DocItem generator
* Unit testing of the generator and error code logging

CHANGELOG_BEGIN
CHANGELOG_END

* Addressed review comments
2021-09-14 13:50:00 +02:00
pbatko-da
6dcdaa411c
[DPP-589] Add CLI flag to select minimum enabled TLS version (#10854)
- Add support for specifying either 1.2 or 1.3 as minimum TLS versions for ledger api server.
- Log enabled protocols (~TLS versions) and cipher suites at server and client startup.
- Add integration tests against Sandbox-classic and Sandbox

CHANGELOG_BEGIN
Sandbox: Add CLI flag to select minimum enabled TLS version for ledger API server.
CHANGELOG_END
2021-09-14 12:37:38 +02:00
matevarga-da
1fc58d93f1
Navigator customviews highlight and choices button, apply custom theme on the login screen (#10859)
* Custom views menu highlighting and choices button fixes.

* Consider theme on the login screen

* Consider theme on the login screen

Originally reported here: https://discuss.daml.com/t/how-to-highlight-selected-custom-filter-button-in-navigator-how-to-use-the-choice-field-in-a-custom-view

changelog_begin
- [Navigator] The currently selected custom view is now highlighted on the sidebar
changelog_end

* Use page.state.id and defined user object.
2021-09-14 11:32:04 +02:00
Miklos
6faddc90c8
Update Daml Documentation to reflect command deduplication related changes [KVL-1094] (#10852)
* Minor tweaks.

* Use deduplication period instead of deduplication time.

* Introduced change ID and consistent use of deduplication duration/period.

* Consistent use of deduplication duration/period.

* Added ALREADY_EXISTS to the described gRPC errors.

* Minor tweak.

CHANGELOG_BEGIN
CHANGELOG_END

* Emphasize that applications should not change the deduplication time upon a resubmission

* Fix definition of change ID and always refer to it

* Try to clarify "Application-specific IDs"

* Make command deduplication explanation unspecific w.r.t. direction

Co-authored-by: Fabio Tudone <fabio.tudone@digitalasset.com>
2021-09-14 11:28:27 +02:00
nickchapman-da
7c29eee130
Cleanup normalize from svalue (#10873)
* better variable name

CHANGELOG_BEGIN
CHANGELOG_END

* remove disallowGenMapAtVersion check
2021-09-14 09:23:48 +00:00
nickchapman-da
053f22a1af
Convert SValue to Value, and normalize, in a single code pass. (#10828)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-14 08:07:26 +01:00
nicu-da
37a1cb21b3
compatibility-tests - Exclude CommandDeduplicationIT from running for existing 1.17 snapshots (#10866)
Reason: in between snapshots there was a proto change (field number change) which broke compatibility

CHANGELOG_BEGIN

CHANGELOG_END
2021-09-14 06:58:42 +00:00
nicu-da
dfae9f600f
Command deduplication - better support for different deduplication modes in conformance tests [KVL-1099] (#10864)
* Extract deduplication "features" into a configuration to be used around the tests.
Better naming for assertions that support sync and async deduplication

CHANGELOG_BEGIN

CHANGELOG_END

* Fix broken test and use consistency for tests
2021-09-13 19:05:50 +00:00
Gary Verhaegen
6f151e287e
save kibana exports (#10861)
As explained in #10853, we recently lost our ES cluster. While I'm not
planning on trusting Google's "rolling restart" feature ever again, we
can't exclude the possibility of future similar outages (without a
significant investment in the cluster, which I don't think we want to
do).

Losing the cluster is not a huge issue as we can always reingest the
data. Worst case we lose visibility for a few days. At least, as far as
the bazel logs are concerned.

Losing the Kibana data is a lot more annoying, as that is not derived
data and thus cannot be reingested. This PR aims to add a backup
mechanism for our Kibana configuration.

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-13 18:28:11 +00:00
akshayshirahatti-da
99f0362aac
[JSON-API] drop package token doc changes (#10865)
* Update daml documentation to reflect the deprecation of the package/internal access token

CHANGELOG_BEGIN
CHANGELOG_END

* drop the whole internal access token section
2021-09-13 16:53:19 +00:00
Hubert Slojewski
b50bb8e437
Populate definite_answer in ApiException [KVL-1004] (#10832)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-13 16:28:39 +00:00
Remy
a471225fa3
LF: Add missing collision check for type synonyms (#10841)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-13 17:52:26 +02:00
Remy
1e1c452b36
LF: drop ad-hoc FrontStack builders (#10839)
Following #10763, we drop the ad-hoc builders for `FrontStack`.

* Building a `Fronstack` from individuals elements should be done with
  standard scala buidler.

* Building a `Fronstack` from a `TraversableOne` should be done with
  the scala 2.13 `.to(FrontStack)` methd

* Building a `Fronstack` from a `ImmArray` should be done with the
  `toImmArray` method.

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-13 17:49:09 +02:00
Robin Krom
8f5b4fa84c
interfaces: protobuf encoder haskell side (#10850)
* interfaces: protobuf encoder haskell side

This is the implementation of the protobuf encoder on the haskell side.

CHANGELOG_BEGIN
CHANGELOG_END

* missing decoder cases for added interface data constructor
2021-09-13 14:36:14 +00:00
Oliver Seeliger
63f6678d6f
ParticipantPruningIT divulgence test fixes to avoid flakiness on canton (#10860)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-13 14:02:21 +00:00
nicu-da
8a9d19a99b
Command deduplication - KV conformance test for usage of max deduplication duration [KVL-1098] (#10846)
* Add conformance test for KV committer usage of max deduplication duration as deduplication duration

CHANGELOG_BEGIN

CHANGELOG_END

* Run AppendOnlyKVCommandDeduplicationIT for KV ledgers that use the append-only schema
2021-09-13 06:48:31 -07:00
Remy
24fff88992
LF: Simplify TransactionBuilder (#10753)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-13 15:37:46 +02:00
Moritz Kiefer
9a4c9df06a
Implement LF desugaring of interface definitions (#10834)
This only handles the interface definition, not the implementation in
the template. There are also a few rough edges:

1. It maks all choices as consuming.
2. it ignores locations

But for a poc that doesn’t seem too bad.

The tests don’t do anything super useful since the typechecker falls
over but I checked tha tthe generated LF looks more or less reasonable.

changelog_begin
changelog_end
2021-09-13 15:15:31 +02:00
Robin Krom
2aaf601912
interfaces: protobuf decoder haskell side (#10849)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-13 14:58:48 +02:00
Robin Krom
6dc769b7ad
interfaces: lf typechecker implementation (#10843)
* interfaces: lf typechecker implementation

CHANGELOG_BEGIN
CHANGELOG_END

* review suggestions
2021-09-13 14:58:33 +02:00
Hubert Slojewski
d9178d2ac2
Clarify version usage in test tool exclusion docs (#10858)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-13 11:30:00 +00:00
Moritz Kiefer
c113954a35
Clarify docs for test tool exclusions (#10855)
* Clarify docs for test tool exclusions

changelog_begin
changelog_end

* clarify 0.0.0

changelog_begin
changelog_end
2021-09-13 10:12:20 +00:00
Gary Verhaegen
8c9edd8522
es cluster tweaks (#10853)
On Sept 8 our ES cluster became unresponsive. I tried connecting to the
machines.

One machine had an ES Docker container that claimed to have started 7
weeks ago and stopped 5 weeks ago, while the machine's own uptime was 5
weeks. I assume GCP had decided to restart it for some reason. The init
script had failed on missing a TTY, hence the addition of the
`DEBIAN_FRONTEND` env var.

Two machines had a Docker container that had stopped on that day, resp.
6h and 2h before I started investigating. It wasn't immediately clear
what had caused the containers to stop.

On all three of these machines, I was abble to manually restart the
containers and they were abble to reform a cluster, though the state of
the cluster was red (missing shards).

The last two machines simply did not respond to SSH connection attempts.
Assuming it might help, I decided to try to restart the machines. As GCP
does not allow restarting individual machines when they're part of a
managed instance roup, I tried clicking the "rolling restart" button
on the GCP console, which seemed like it would restart the machines. I
carefully selected "restart" (and not "replace"), started the process,
and watched GCP proceed to immediately replace all five machines, losing
all data in the process.

I then started a new cluster and used bigger (and more) machines to
reingest all of the data, and then fell back to the existing
configuration for the "steady" state. I'll try to keep a better eye on
the state of the cluster from now on. In particular, we should not have
a node down for 5 weeks without noticing.

I'll also try to find some time to look into backing up the Kibana
configuration, as that's the one thing we can't just reingest at the
moment.

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-13 11:12:02 +02:00
Moritz Kiefer
842c5b1605
Drop early access notice from profiler docs (#10856)
changelog_begin
changelog_end
2021-09-13 09:07:00 +00:00
Miklos
7c47aca968
Improvements to wording in ledger-api protobuf docs (#10851)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-13 07:44:55 +00:00
Miklos
cff0358db0
ledger-api: Remove unimplemented fields [KVL-1094] (#10822)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-10 19:26:51 +02:00
Hubert Slojewski
dcec6eafd7
kvutils: Populate definite_answer in rejections [KVL-1004] (#10801)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-10 19:21:01 +02:00
nicu-da
1c4f173f3a
Command deduplication - kvutils - Always use max deduplication duration as deduplication period [KVL-1098] (#10824)
* Always use max_deduplication_duration as deduplication period for committer side deduplication

Doing this we get the following guarantees:
- Deduplication period is constant for all the submissions therefore this guarantees consistency between "backward-looking" and "forward-looking" deduplication

CHANGELOG_BEGIN
kvutils - committer side deduplication always uses max_deduplication_duration + min_skew as a deduplication period for all the requests.
CHANGELOG_END

* Set max_deduplication_duration to 10 seconds for all the conformance tests

* Update KV command deduplication conformance tests to account for max deduplication duration used as deduplication period for all the requests

* Add max deduplication wait for multi-participant conformance test

* Overwrite the submitter info deduplication period in the transaction committer so that we always set the max deduplication duration

* Update ledger/participant-state/kvutils/src/test/suite/scala/com/daml/ledger/participant/state/kvutils/committer/transaction/TransactionCommitterSpec.scala

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

* Add separate step for overwriting the deduplication period

* Code review - reformatting and renames

* Add comment for setting the deduplication duration
2021-09-10 09:05:21 -07:00
Gary Verhaegen
567fe43cc6
tweak trigger-service docs (#10845)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-10 16:06:20 +02:00
akshayshirahatti-da
fb5ab5dca2
setvar doesn't like new lines in assignment, refactor (#10842)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-10 14:04:24 +00:00
Adriaan Moors
7225c0415c
[docs] Replace AdoptOpenJDK suggestion by Adoptium (#10837)
* [docs] Replace AdoptOpenJDK suggestion by Adoptium

In the installation instructions, suggest Adoptium as JDK source

[AdoptOpenJDK has moved to the Eclipse foundation](
https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/)

* Without changelog entry

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-10 13:45:03 +00:00
Stefano Baghino
6a9c8a64d3
release 1.17.0-snapshot.20210910.7786.0.976ca400 (#10838)
Manual release process. @stefanobaghino-da is in charge of this release.

Commit log (since 1.17.0-snapshot.20210907.7759.0.35a853fd):
```
976ca400eb Force JSON API to refresh packages for GET requests to /v1/query (#10835)
e42cd3a1c6 LF: add interface to scala AST and decoder (#10830)
07b72d0f3e Update Ledger API's proto documentation [KVL-1094] (#10815)
648acf52f8 Fix typo in app-arch.rst (#10798)
dc9fbb5aa9 Stringify errors in create-daml-app before calling alert (#10831)
90b008ef0d Stop using `controller … can` syntax in ledger tests (#10814)
e490b69471 Clarifications of code ownership in /ledger and /ledger-api (#10742)
8cdeb7539a make auth middleware aware that actAs => readAs (#10825)
e263d43aca Ledger API test tool: test that record time is monotonically increasing [KVL-1053] (#10552)
e5793a317b Account for multi participant conformance tests when updating the config [KVL-1092] (#10788)
2e39d7b647 Deprecate `Commands.deduplication_time` field [KVL-1096] (#10802)
7824201b8d Get rid of extra new line and prune precision for all gatling values (#10820)
a03f52a15e Add ledger API tests about command deduplication information in completions [KVL-1057] (#10748)
61a07b1986 Add command line option max-deduplication-duration for sandbox and KV [KVL-1098] (#10816)
0800504955 Fix DuplicateSubmissionID test exclusions (#10819)
1ff34ffbe8 Remove workaround for akka supervisor issue (#10818)
6d347d4e88 Add daml interfaces to the Haskell LF AST (#10811)
cecb27fe16 Stop using controller can syntax in skeleton template (#10799)
8830eaa2ec Drop controller can syntax from compiler tests (#10807)
9038a8051b Update code documentation for `participant-state` API [KVL-1094] (#10812)
60ffb79fb1 Command deduplication - Participant side/committer side command deduplication conformance tests split [KVL-1093] (#10784)
1e6540f8f2 Stop using `controller _ can` syntax in daml-lf tests (#10805)
0db15e6759 Ledger API test tool: ensure that test identifiers are unique (#10804)
f1e378a60b rotate release duty after 1.17.0-snapshot.20210907.7759.0.35a853fd (#10809)
1464177bf8 release 1.17.0-snapshot.20210907.7759.0.35a853fd (#10808)
deb8a8b740 [Divulgence pruning] Daml SDK docs update [DPP-536] (#10764)
8405ad58fd Enhance InMemoryLedger to use the ValueEnricher (#10757)
```

Changelog (since 1.17.0-snapshot.20210907.7759.0.35a853fd):
```
- [JSON API] Fixed a bug that prevented the JSON API to be aware of
  packages uploaded directly via the Ledger API.
- The auth middleware will now consider that actAs credentials are valid
  for readAs requests.
- [Ledger API Specification] Introduced a new conformance test about recort time in completions being monotonically increasing
ledger-api-test-tool - CommandDeduplicationIT tests only participant side deduplication, it should be disabled for KV ledgers. Added KVCommandDeduplicationIT which should be run for KV ledgers
- [Ledger API Specification] `Commands.deduplication_time` field has been deprecated, please use `Commands.deduplication_duration` instead.
ledger-api-test-tool - CommandDeduplicationIT tests only participant side deduplication, it should be disabled for KV ledgers. Added KVCommandDeduplicationIT which should be run for KV ledgers
[Ledger API Specification] Participant pruning of all divulged contracts is fully implemented: Participant operators can choose to prune all immediately and retroactively divulged contracts, by setting the newly-added prune_all_divulged_contracts flag in the ParticipantPruningService/Prune request.
```

changelog_begin
changelog_end
2021-09-10 11:47:29 +00:00
Remy
6ed21247a3
LF: clean up useless version tests. (#10833)
Since SDK 1.0.0 the min LF version is 1.6.
We drop some checks that are now redundant.

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-10 11:43:49 +00:00
mziolekda
85f6f36fd0
Modify the name of the secrets-url CLI flag to tls-secrets-url [DPP-604] (#10840)
CHANGELOG_BEGIN
Modify the name of the secrets-url CLI flag to tls-secrets-url.
CHANGELOG_END
2021-09-10 11:17:10 +00:00
akshayshirahatti-da
d809fd934a
[JSON-API] surrogate template id cache (#10806)
* Initial changes to add a surrogate_template_id cache to reduce db queries

CHANGELOG_BEGIN
CHANGELOG_END

* refactoring and addition of tests

* Code review based changes to use Contextual Logger and json-api metrics instance

* make max cache entries/size configurable

* Rename cache max entries default variable
2021-09-10 10:48:58 +00:00
Victor Peter Rouven Müller
976ca400eb
Force JSON API to refresh packages for GET requests to /v1/query (#10835)
* Add failing test that covers the bug we found in #10823

* Fix /v1/query endpoint bug

changelog_begin
- [JSON API] Fixed a bug that prevented the JSON API to be aware of
  packages uploaded directly via the Ledger API.
changelog_end
2021-09-10 10:45:58 +02:00
Remy
e42cd3a1c6
LF: add interface to scala AST and decoder (#10830)
this is part of #10810

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-10 08:46:19 +02:00
Miklos
07b72d0f3e
Update Ledger API's proto documentation [KVL-1094] (#10815)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-09 19:10:32 +02:00
Gerolf Seitz
648acf52f8
Fix typo in app-arch.rst (#10798)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-09 14:11:35 +00:00
Moisés Ackerman
dc9fbb5aa9
Stringify errors in create-daml-app before calling alert (#10831)
This is because otherwise we get the uninformative '[object Object]'

changelog_begin
changelog_end
2021-09-09 14:11:25 +00:00
Moritz Kiefer
90b008ef0d
Stop using controller … can syntax in ledger tests (#10814)
* Stop using `controller … can` syntax in ledger tests

We’re planning to deprecate that in SDK 2.0 to reduce the confusion
around the implicit observer behavior so in preparation for that, this
PR drops the syntax from all ledger tests.

changelog_begin
changelog_end

* shuffle let above usage

changelog_begin
changelog_end
2021-09-09 14:06:06 +00:00
Gerolf Seitz
e490b69471
Clarifications of code ownership in /ledger and /ledger-api (#10742)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-09 15:30:12 +02:00
Gary Verhaegen
8cdeb7539a
make auth middleware aware that actAs => readAs (#10825)
It seems a bit silly that the auth middleware would refuse a token that
has an `actAs` when it needs a `readAs`.

Reference: https://docs.daml.com/app-dev/authorization.html#access-tokens-and-claims

CHANGELOG_BEGIN
- The auth middleware will now consider that actAs credentials are valid
  for readAs requests.
CHANGELOG_END
2021-09-09 11:03:55 +00:00
fabiotudone-da
e263d43aca
Ledger API test tool: test that record time is monotonically increasing [KVL-1053] (#10552)
* Test that record time is monotonically increasing

CHANGELOG_BEGIN
- [Ledger API Specification] Introduced a new conformance test about recort time in completions being monotonically increasing
CHANGELOG_END

* Address early review comments

* Fix unused import

* Simplify main assertion

* Add assertion about expected number of record times

* Print less record times in main assert's error message

* Make wartremover:Option2Iterable happy

* Use a submitting party

* operations -> submissions

* Create contracts rather than allocating parties

* Shorten comment

* Explicitly sort checkpoints by offset

* Shorten short identified

* Don't assume the ledger is at the beginning

* Simplify the test

* Make the new test optional

* Apply review suggestions
2021-09-09 10:26:24 +00:00
nicu-da
e5793a317b
Account for multi participant conformance tests when updating the config [KVL-1092] (#10788)
* Split command deduplication conformance tests into non-kv and kv tests.

Because kv ledgers have both participant and committer side deduplication, the conformance tests have been duplicated into different suited which can target either both deduplications or just participant side deduplication.
CommandDeduplicationIT is a default suite and should be run for ledgers with participant side only deduplication.
KVCommandDeduplicationIT is optional and should be enabled for any KV ledgers.

CHANGELOG_BEGIN
ledger-api-test-tool - CommandDeduplicationIT tests only participant side deduplication, it should be disabled for KV ledgers. Added KVCommandDeduplicationIT which should be run for KV ledgers
CHANGELOG_END

* Run participant side/committer side deduplication tests based on the ledger implementation

* Try to update the time model on all the participants to account for multi participant setups.

When running with multi participants only one participant can update the configuration. Unfortunately to figure out which one exactly can do so it's not that easy so to make sure the configuration changes for our tests succeed we try to update it on all the participants.

CHANGELOG_BEGIN

CHANGELOG_END

* Fix on memory build file

* Daml-on-sql is not a kv ledger so revert the changes so that it runs the default command deduplication IT

* Rollback compat import

* Exclude command dedup from the reference test

* Exclude command deduplication from the reference export

* Format bazel

* Set the exclude to client args for the ledger-api-test-tool and not for the ledger-on-memory

* Exclude CommandDeduplicationIT from non repudiation conformance tests and include KVCommandDeduplicationIT because it runs using sandbox

* Exclude HealthServiceIT from the reference-ledger-export as it has no impact on the export

* Exclude CommandDeduplicationIT from the ledger-on-sql conformance-test as they are KV ledgers

* Format bazel file

* Exclude CommandDeduplicationIT from sandbox

* Apply suggestions from code review

Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>

* Add comments for command deduplication IT

* Rename to be consistent with scala namings

* Update formatting and comments

* Code review renames

* Add compat import

* Remove unused import

* Use a scala 2.12 compatible approach to receive all the configured participants in the conformance tests

Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>
2021-09-09 09:54:31 +00:00
Miklos
2e39d7b647
Deprecate Commands.deduplication_time field [KVL-1096] (#10802)
CHANGELOG_BEGIN
- [Ledger API Specification] `Commands.deduplication_time` field has been deprecated, please use `Commands.deduplication_duration` instead.
CHANGELOG_END
2021-09-09 11:30:17 +02:00