Commit Graph

139 Commits

Author SHA1 Message Date
tudor-da
ae037ab5fd
Fail Akka sources with distinct throwables [DPP-1241] (#15084)
* On Dispatcher cancel, fail sources with distinct throwables

changelog_begin
Fixes an issue where failing multiple sources with the same StatusRuntimException
leads to an unhandled error in the gRPC serialization layer. This issue was
caused by serialization actually mutating the non-thread-safe io.grpc.Metadata
contained in the StatusRuntimeException.
changelog_end

* Fix ApiVersionService internalError

* Log error on ServerCall.close() errors

* Address Sergey's review comments

* Addressed more review comments

* Accessor method for call.close to bypass IllegalAccessErrors

* Use unique kill switches per stream in generated Akka Grpc streaming services

This change has two benefits:
- The error is logged only on an actual stream termination
- The throwable is not shared between streams, avoiding concurrent Metadata access errors

* Addressed Marton's review comments
2022-10-04 11:39:38 +00:00
Sergey Kisel
9ce2830cd4
Contract Argument Blob API change for the Explicit Disclosure [DPP-1162] (#15012)
* Contract argument blob [DPP-1161].

CHANGELOG_BEGIN

[Ledger API]: Introduce an ability to expose contract arguments as blob if matched by the interface filter using `include_create_arguments_blob` flag in the ``InterfaceFilter``.
Introduce an ability to provide `DisclosedContract.arguments` as a blob instead of a typed `Record`.

CHANGELOG_END

Breaks-protobuf: true


Co-authored-by: Simon Meier <meiersi-da@users.noreply.github.com>
Co-authored-by: atriantafyllos-da <andreas.triantafyllos@digitalasset.com>
2022-09-27 14:30:47 +02:00
tudor-da
d4646d7f9d
[ED] Explicit disclosure conformance tests [DPP-1095] (#14352)
* Disclosed contracts conformance tests

changelog_begin
changelog_end

* Addressed review comments

* Addressed Moritz' review comments

* Add conformance test asserting disabled feature

* More exhaustive testing:
* Aserting metadata contents
* Test duplicate keys/contract ids
* Test local key lookup visibility

* Addressed Carrie's review comments

* Added two more tests:
* Archival race test
* Superfluous inconsistent contracts race test

* Update ledger/ledger-api-tests/suites/src/main/scala/com/daml/ledger/api/testtool/suites/v1_dev/ExplicitDisclosureIT.scala

Co-authored-by: mziolekda <marcin.ziolek@digitalasset.com>

Co-authored-by: mziolekda <marcin.ziolek@digitalasset.com>
2022-09-05 08:49:21 +00:00
Rafael Guglielmetti
7a69759dce
Fix typo in Interface2.daml (#14927)
changelog_begin
changelog_end
2022-09-05 08:54:31 +02:00
Sergey Kisel
0b5a333dc2
Support interfaces for benchtool [DPP-1163] (#14864)
* Support interfaces for benchtool [DPP-1163]

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-02 12:23:20 +02:00
Remy
4622de48bd
API-test-tool: add InterfaceSubscriptionsIT to LF 1.15 tests (#14800)
CHANGELOG_BEGIN
CHANGELOG_END
2022-08-30 09:20:22 +02:00
Sergey Kisel
fe703c6c67
Conformance test for Interface subscriptions with retroactive interfaces [DPP-1175] (#14807)
Conformance test for Interface subscriptions with retroactive interfaces [DPP-1175]

CHANGELOG_BEGIN
CHANGELOG_END
2022-08-25 12:32:10 +00:00
dylant-da
a74c020ddd
Add version 1.15 - move interfaces into them (#14770)
* Add version 1.15 - move interfaces into them

* Update Ast/Version & docs for 1.15, split interface into simple/extended

* Stage 1.15 protobuf

* Remove references to dev from 1.15 protobufs

* Add Tests file for 1.15 in ledger API testtool

* Update Version 1.15 changelog with Call/implements

* Make 1.14 default again

* Add 1.15 as preview version

* Add 1.15 test suite to testtool

* Reinclude 1.15 in COMPILER_LF_VERSIONS to build model-tests-1.15

* Move v1_15 ledger-api-tests into own suite

* Fix InterfaceNotSupported message to 1.15 or higher

* satisfy changelog check

CHANGELOG_BEGIN
CHANGELOG_END

* Update tests with extended interface features to only run on 1.dev

* Allow unsafe_from_interface and interface_template_type_rep in 1.15

* Fix StableVersions back to 1.14, make EarlyAccessVersions 1.15

* Run retroactive implements tests only in extended interfaces

* lint

* Temporarily disable 1.15 conformance tests - handle in another PR

* Also disable conformance-test-tls1.2-or-newer-1.15

* Disable PureConfigReaderWriter tests that assume early-access == stable

* lint
2022-08-23 13:39:16 +00:00
Sergey Kisel
2cecaf9726
Package Upload within interface subscription conformance test [DPP-1159] (#14768)
Package Upload within interface subscription conformance test [DPP-1159]

CHANGELOG_BEGIN
CHANGELOG_END
2022-08-22 18:59:03 +02:00
Sergey Kisel
6382d5b619
Cleanup unused classes. (#14781)
* Cleanup unused classes.

CHANGELOG_BEGIN
CHANGELOG_END
2022-08-22 18:16:55 +02:00
Moisés Ackerman
95d00c4e8a
Add conformance test for retroactive interface instances (#14753)
changelog_begin
changelog_end

Co-authored-by: Remy <remy.haemmerle@daml.com>
2022-08-22 13:58:24 +02:00
Sergey Kisel
1f7dd3c018
Conformance Tests for Interface Subscriptions [DPP-1159] (#14750)
* Conformance Tests for Interface Subscriptions [DPP-1159]

CHANGELOG_BEGIN
CHANGELOG_END
2022-08-22 08:01:47 +02:00
Moisés Ackerman
009c3c306b
Add interface instance syntax, including retroactive interface instances (#14715)
* Extract qualifyLocally in LFConversion

* Update ghc rev

* Add parent type argument to interface instance desugaring types

* Check interface instance parent in LFConversion

* Convert interface instances in interface declarations

* Update daml-test-files to use 'interface instance' syntax

* Update other tests to use 'interface instance' syntax

* Update interface reference docs to use 'interface instance' syntax

* Update other files to use 'interface instance' syntax

* Add todo in DA.Daml.LF.Ast.Pretty

* Add daml-test-files for retroactive interface instances

changelog_begin
changelog_end
2022-08-17 12:06:59 +00:00
dylant-da
0d37134bc2
Change placeholder unit viewtypes to empty records (#14656)
* Update views in integration-v1dev to be EmptyInterfaceView instead of ()

* Update expected desugared daml for `EmptyInterfaceView`

* Update compiler Shake / DataDependencies viewtypes to EmptyInterfaceView

* Add record viewtypes to docs, update docs

* Add empty records to daml-lf, language-support, ledger, trigger tests

* Qualify EmptyInterfaceView in ledger semantic Interface tests

* Fix imports for EmptyInterfaceView in IIou / CIou / Transferrable

* empty changelog commit

CHANGELOG_BEGIN
CHANGELOG_END

* Qualify EmptyInterfaceView import

* Fix imports of EmptyInterfaceView in TypeScript codegen tests

* Accept Interface doc changes

* Add EmptyInterfaceView to DataDependencies tests

* Remove missing interface viewtype test - all interfaces must have views

* Replace all EmptyInterfaceView with EmptyInterfaceView {}
2022-08-10 16:45:23 +00:00
dylant-da
8e8e0dabdf
Convert viewtype and view methods to LF (#14456)
* Add DA_Internal_Interface to convertTypeDef exclusion check

* Move desugared types/values for interface views into DA.Internal.Desugar

* Convert viewtype and view method declarations

* Typecheck view types and view declarations

* Add unit viewtypes to InterfaceChoiceCollision tests

* Add unit viewtypes to more compiler/damlc tests

* Modify empty interfaces/implements to have viewtypes/views

* Add unit viewtypes to remaining Interface tests

* Test for error thrown when viewtype not specified

* Fix daml-lf/ interface tests to use new syntax / unit views

* Add placeholder view of type Unit to TestInterfaces

CHANGELOG_BEGIN
CHANGELOG_END

* Fix typescript interface tests with unit viewtype

* Add unit viewtype to Java & Scala codegen

* Add unit viewtype to triggers tests interface

* Add unit viewtypes to ledger/test-common

* Add unit viewtypes to ledger-service/http-json

* Fix some damlc tests

* Use viewtype syntax in InterfaceViewNonSerializable test

* Remove HasInferfaceView instances in convertBind

* Add unit view to QualifiedInterface.daml test

* Generate HasInterfaceView instances in DataDependencies

* Add unit viewtypes and views to compiler/damlc/tests

* Document reconstruction of HasInterfaceView

* Move desugared types/values for interface views into DA.Internal.Desugar

* Add desugarable function view w/ EViewInterface desugaring

* Remove templateName and viewtype from generated EViewInterface

* Update desugared-daml

* Proof of concept: use _view -> EViewInterface prim via HasInterfaceView

* Move view, HasInterfaceView to DA.Internal.Interface

* Update desugared-daml tests

* Stop removing and re-generating HasInterfaceView instances

* Do not generate docs for generated "_view_" methods

* Report errors with interface TypeConNames prettily

* Fix InterfaceViewNotSpecified @ERROR to reflect new error text

* Don't import magic `view` method from Prelude to avoid name clash

* Update shake interface goto definition test locations

* Temp disable view spec tests, will re-implement views in speedy

* Add unit viewtype to Java code snippet docs

* Update Interface syntax docs for views

* Add unit viewtype to Transferrable.daml

* Add back "empty" interface implementation to interfaces.rst

* Re-enable view tests by having _view methods on InterfaceViews.daml file

* Remove deprecated commented-out view desugaring code
2022-08-03 16:23:38 +01:00
pbatko-da
aa8ad32304
[Benchtool] Package Benchtool related Daml modules separately from other modules [DPP-1089] (#14231)
Recent changes in //ledger/test-common in Daml modules changed the fully qualified names of templates used by Benchtool, even though they hadn't been changed directly.

This made it impossible to filter by template name in a recently created LR IndexDB snapshot.

To avoid spurious changes in fully qualified template names (from Benchtool perspective) we are now packaging Benchtool related Daml modules separately from other modules

changelog_begin
changelog_end
2022-06-21 10:38:15 +02:00
Remy
5b139bea60
add regression test for #14171 in conformance test (#14212)
CHANGELOG_BEGIN
CHANGELOG_END
2022-06-20 07:41:50 +00:00
Remy
2ddd744a91
[Engine] fix and test #14175 (#14206)
follow up of #14175

this is part of #14171

CHANGELOG_BEGIN
CHANEGELOG_END
2022-06-16 22:45:50 +02:00
nickchapman-da
44a14d06c9
Regression test for rollback create bug (#14197)
* Regression test for issue 14148

changelog_begin
changelog_end

* update compatability
2022-06-16 14:58:19 +00:00
Moritz Kiefer
d233bfa4b4
Add missing activeness check when reading from globalKeyInputs (#14080)
* Add missing activeness check when reading from globalKeyInputs

changelog_begin

- Engine. Fix lookup by key. See issue Lookup archived contracts may succeed when combined with rollback exceptions #14107 for more details.

changelog_end
2022-06-13 19:27:08 +00:00
pbatko-da
c52b3bad79
Benchtool: Generate consuming events with non-stakeholder informees [DPP-1049] (#13988)
Non-stakeholder informees for consuming events are obtained by exercising a consuming choice on Foo1, Foo2 or Foo3 contract as a sub-action of divulgers newly introducedDivulgeConsumingExercise choice.

changelog_begin
changelog_end
2022-05-30 12:30:49 +01:00
pbatko-da
ef43df4849
Benchtool: Make non-consuming events visible to observer parties [DPP-1056] (#13987)
By making contract observers choice observer on the non-consuming choice (on Foo1, Foo2 and Foo3 contracts)


changelog_begin
changelog_end
2022-05-26 19:45:16 +02:00
Remy
d3264236ba
Interface: drop collision check between inherited choice name (#13939)
CHANGELOG_BEGIN
CHANGELOG_END
2022-05-24 17:53:18 +02:00
mziolekda
385504fd7d
Add ledger api test tool cases for expensive daml maps and lists [DPP-955] (#13821)
* add tests for large maps and lists

* add many iterations on exercise

* format

* clean up

CHANGELOG_BEGIN
CHANGELOG_END

* fix broken build

* Incorporate review comments
2022-05-19 17:13:28 +00:00
Remy
0c07e426c1
Interface: conformance test of Interface (#13884)
part of #13653

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-18 12:58:45 +00:00
pbatko-da
724a0c1b1a
Benchtool: Non-stakeholder informees generation [DPP-978] (#13808)
We obtain non-empty non-stakeholder informees by performing an immediate divulgence of instances of Foo1, Foo2 or Foo3 templates through instances of a helper Divulger template.
The divulgence is controlled by 1) configuring the number of all divulgees to generated and 2) probabilistically picking a non-empty subset from all divulgees for each contract (similar to how observers are picked for each contract with certain probabilities). If the divulgees for a contract are non-empty a Foo1, Foo2 or Foo3 contract is created via a helper choice on a Divulger contract. Otherwise a standard create Foo1, Foo2 or Foo3 command is issued.

Each Divulger contract can divulge any number of Foo1, Foo2 or Foo3 contracts but it's limited to divulging to a fixed set of divulgees. In other words, there is a separate Divulger contract for each non-empty subset of all divulgees.
We expect the set of all divulgees to be very small in practice similar to how only a small number observers (currently at most 3) is currently configured for existing benchmarks. Thus, the set of all subsets is also small.
To be conservative, we allow the number of divulgees to be at most 5.

changelog_begin
changelog_end
2022-05-16 15:27:03 +02:00
pbatko-da
751e0f78a6
Benchtool: Separate command generation and submission. Also other clean-ups [DPP-978] (#13833)
This is setting ground for generating contracts with non-empty non-stakeholder informees in #13808

changelog_begin
changelog_end
2022-05-12 11:40:59 +02:00
Simon Maxen
da0c458b8a
Add support for fibonacci contracts. (#13738)
changelog_begin
changelog_end
2022-05-03 16:16:56 +01:00
pbatko-da
d66045a169
[ETQ] Extend Benchtool to submit consuming and nonconsuming exercises [DPP-972] (#13492)
changelog_begin
changelog_end
2022-04-25 09:45:02 +02:00
pbatko-da
ee6a5f9e0e
Handle misc error codes todos. [DPP-606] (#13248)
changelog_begin
changelog_end
2022-03-14 17:16:31 +01:00
pbatko-da
92e3e9e2df
Add unit tests for ErrorCode [DPP-799] (#13236)
changelog_begin
changelog_end
2022-03-14 12:38:23 +01:00
Samir Talwar
83ed13d799
Split the ledger-api-test-tool into libraries, under /ledger/ledger-api-tests. [KVL-1076] (#12771)
* Move //ledger/ledger-api-test-tool to //ledger/ledger-api-tests/tool.

And conformance.bzl to //ledger/ledger-api-tests.

* Move test tool infra to //ledger/ledger-api-tests/infrastructure.

* Split the ledger API test tool into smaller libraries.

There is no change to behavior.

CHANGELOG_BEGIN
CHANGELOG_END

* ledger-api-tests: Encapsulate performance tests.

* ledger-api-tests: Extract a "runner" library.

* ledger-api-tests: Publish libraries to Maven Central.

* ledger-api-tests: Fix Scaladoc so it compiles correctly.

Unfortunately I had to remove some Scaladoc in ActiveContractsServiceIT
which is incorrectly interpreted as not being attached to anything.
Fortunately, it's not actually that helpful.

* compatibility: Fix paths to the Ledger API Test Tool.

* Fix release types for ledger API test libraries.

* test-common: Publish generated Scala.

These libraries are dependencies of the ledger API tests components.

* ledger-api-tests: Use "com.daml" as the group ID everywhere.

* ledger-api-tests: Check that tests in `--additional` are valid.

* compatibility: Fix a reference to ledger-api-test-tool I missed.
2022-02-10 13:25:23 +00:00
Stefano Baghino
aec3390904
Replace silencer plugin with built-in warning configuration (#12543)
Since Scala 2.13.2, Scala introduced built-in support to
manage warnings in a more granular fashion, thus making
the silencer plugin we are currently using no longer
strictly useful. Removing compiler plugins also removes
friction from migrating to Scala 3 in the future. As a
cherry on top, the built-in warning configuration also
allows to check whether a `@nowarn` actually does
anything, allowing us to proactively remove unused
warnings should the need arise.

[Here][1] is s a blog post by the Scala team about it.

Warnings have been either solved or preserved if useful,
trying to minimize the scope (keeping it at the single
expression scope if possible). In particular, all
remaining usages of the Scala Collection API compatibility
module have been removed.

Using the silencer plugin also apparently hid a few
remaining usages of compatibility libraries that were used
as part of the transition from Scala 2.12 to Scala 2.13
that are no longer needed. Removing those warnings
highlighted those.

changelog_begin
changelog_end

[1]: https://www.scala-lang.org/2021/01/12/configuring-and-suppressing-warnings.html
2022-01-24 15:01:35 +00:00
pbatko-da
4fe6e53b9d
[User management] Persistence with caching (#12344)
Adding
 - `PersistentUserManagementStore` and `CachedUserManagementStore`,
 - `UserManagementStorageBackendTemplate` and sql migrations,
 - CLI flags: `--user-management-max-cache-size` and `--user-management-cache-expiry`;
 And wiring `PersistentUserManagementStore` where before we had `InMemoryUserManagementStore`.
2022-01-18 15:59:22 +01:00
Moritz Kiefer
ce624915d5
Fix damlc warnings & compile flags (#12404)
`--ghc-option=-Werror` turns warnings into errors, `--ghc-option=-Wwarn`
undoes exactly that so this clearly was not doing anything sensible.

changelog_begin
changelog_end
2022-01-13 18:32:31 +00:00
mziolekda
fafb86b389
Add static time feature flag and test tool coverage [DPP-849] (#12336)
* Add static time feature flag and test tool coverage

CHANGELOG_BEGIN
CHANGELOG_END

* incorporate the review feedback
2022-01-11 12:21:05 +00:00
Gary Verhaegen
ea55ea2d14
Further copyright updates (#12249)
Somewhat error-prone, so please review carefully.

Reasons we need this:

- Some file types are not properly handled by the script.
- The only exclusion mechanism we currently have (`NO_AUTO_COPYRIGHT`)
  is overly coarse.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-04 16:32:17 +01:00
Gary Verhaegen
d2e2c21684
update copyright headers (#12240)
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.

I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 16:36:51 +00:00
Moisés Ackerman
ba0c6c9841
Set --enable-scenarios to False by default (#12156)
* Set --enable-scenarios to False by default

changelog_begin
changelog_end

* Enable scenarios for shake test

* Add --enable-scenarios=yes for //compiler/lsp-tests

* Add enable_scenarios arg to rules_daml/daml.bzl helpers

* daml_compile
* daml_build_test
* daml_test

* Add enable_scenarios to ledger/test-common helper da_scala_dar_resources_library

* Add --enable-scenarios=yes for //ledger/test-common

* Remove unused scenario in //ledger/test-common PingPong test

* Add --enable-scenarios=yes for //daml-lf/tests

* Add --enable-scenarios=yes for //language-support/java tests

* Add --enable-scenarios=yes for group-chat example

* Add --enable-scenarios for //ledger/sandbox-perf LargeTransaction test

* Add --enable-scenarios=yes for //docs tests

* Add --enable-scenarios=yes for //daml-lf/scenario-interpreter tests

* format bazel

* Add --enable-scenario=yes for 'daml_doc_test's

* Add --enable-scenarios=yes for DamlDocTestIntegration

* Add --enable-scenarios=yes for DamlcTest

* Add --enable-scenarios=yes for Test/DataDependencies

* Add --enable-scenarios=yes for daml-ghc-deterministic.sh

* Add --enable-scenarios=yes for Test.IncrementalBuilds

* Add --enable-scenarios=yes for tests:memory-bond-trading and tests:memory-examples

* Add --enable-scenarios=yes for daml-assistant/integratio-tests
2021-12-20 19:31:06 +01:00
pbatko-da
0613a712c9
[DPP-767] Add assertion for logged messages in ErrorFactoriesSpec (#11973)
CHANGELOG_BEGIN
CHANGELOG_END
2021-12-08 09:54:49 +01:00
Moritz Kiefer
85e2fa551c
Avoid CPP in ledger API test tool daml code (#11993)
Apparently this works very poorly with damlc_legacy which fails to
find hpp after the latest nixpkgs upgrade. Somewhat confusingly it
only fails to find that on release builds and I don’t understand how
it ever worked but this seems more sensible anyway.

changelog_begin
changelog_end
2021-12-07 07:06:12 +01:00
Moritz Kiefer
31cc540cf9
Turn package name & version warnings into an error (#11859)
* Turn package name & version warnings into an error

fixes #11321

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2021-11-26 18:46:33 +00:00
Remy
58e69ade1a
LF: replace "dev" LF version by "1.dev" in bazel files (#11894)
the more consistent, as asked by Moritz in review of #11820

CHANGELOG_BEGIN
CHANGELOG_END
2021-11-26 12:23:17 +00:00
mziolekda
f2aa09c114
Allow encoded server key files to be in base64 [DPP-761] (#11796)
* Allow encoded server key files to be in base64

CHANGELOG_BEGIN
CHANGELOG_END

* format

* dry tests
2021-11-23 09:49:52 +00:00
Kamil Bozek
d9c7031fc3
ACS testing - payload support [DPP-661] (#11308)
* Generating random payload of configurable size in ledger-api-bench-tool command submission

CHANGELOG_BEGIN
- [Integration Kit] - ledger-api-bench-tool can generate test contracts with configurable payload size.
CHANGELOG_END

* Fix for Scala 2.12

* Multi-template support for command submission in the ledger-api-bench-tool [DPP-659] (#11365)

* Added multi-template support for command submission in the ledger-api-bench-tool

CHANGELOG_BEGIN
- [Integration Kit] - Added multi-template support for command submission in the ledger-api-bench-tool
CHANGELOG_END

* Simplified distribution calculation

* Improved throttling - set max 100 in-flight commands
2021-10-26 17:19:03 +02:00
Kamil Bozek
0ee59f57c9
Command submission in the ledger-api-bench-tool. (#11296)
CHANGELOG_BEGIN
- [Integration Kit] - The ledger-api-bench-tool is now capable of generating test contracts for testing purposes.
CHANGELOG_END
2021-10-25 09:57:53 +02:00
nicu-da
b8e21d8f48
Fix takeFilter for the test StreamConsumer (#10918)
* Reorder the observers for StreamConsumer to first filter and then take just one element, not the other way around

CHANGELOG_BEGIN
CHANGELOG_END

* Refactor the test to get better stacktraces during failures

* Remove unused import
2021-09-17 16:16:04 +02:00
tudor-da
38227a8ed7
[Ledger API error codes] ErrorCode enrichments [DPP-591] (#10874)
* [Daml error codes API] Further implementations
* Implements ErrorCode.asGrpcError (and test)
* Error code logging now accepts correlation id and an extra context map
* Full error context is included into enriched logging context

CHANGELOG_BEGIN
CHANGELOG_END

* Fixed Scala 2.12 compilation issues
2021-09-15 07:43:32 +02: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
pbatko-da
1ded42f185
[DPP-418] Protect TLS keys - follow-up cleanup (#10696)
CHANGELOG_BEGIN
CHANGELOG_END
2021-08-31 10:42:47 +02:00