CHANGELOG_BEGIN
Ledger API Specification: When using user management based authorization streams will now get aborted on authenticated user's rights change.
CHANGELOG_END
We add a `useUser` hook to daml-react returning the user currently
logged in the ledger participant. create-daml-app is changed
accordingly.
CHANGELOG_BEGIN
[daml-react] A `useUser` react hook is added to the daml-react
TypeScript library. It allows for easy access to the currently logged in
user of a ledger participant node for ledgers supporting user
management.
CHANGELOG_END
* Add ts bindings for the uncovered new user management endpoints
changelog_begin
- [Typescript Bindings] All methods for user management have been added to the bindings (createUser, deleteUser, getUser, listUsers, listUserRights, grantUserRight, revokeUserRight)
changelog_end
* Fix list user rights method & add tests
* Reduce diff
* Add missing delete method
* Update language-support/ts/daml-ledger/index.ts
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
Continues the work started in https://github.com/digital-asset/daml/pull/12543
These libraries were only needed to transition from Scala 2.12 to 2.13
and are no longer useful as all the necessary items are now available
in Scala 2.13.
changelog_begin
changelog_end
* Add experimental Daml assistant support for ledger metering
CHANGELOG_BEGIN
Add experimental Daml assistant support for ledger metering
CHANGELOG_END
* Update with review comments
* Update with review comments
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
changelog_begin
[Java bindings] `DamlLedgerClient.forLedgerIdAndHost` and `DamlLedgerClient.forHostWithLedgerIdDiscovery` static methods
and the constructor taking a `ManagedChannel`, which were all deprecated since 0.13.38, have been removed.
changelog_end
* Tell users to use --install-assistant=yes
`daml install --activate` is deprecated since forever, we tell
users to use `daml install --install-assistant=yes` instead.
changelog_begin
changelog_end
* modernise error message somewhat
* add 'current'
* Drop support for no seeding in sandbox-classic
Sandbox classic is going away in SDK 2.0 and so is support for v0
contract ids which is the only thing no seeding was used for.
This has been cleared by product.
I’ll drop v0 contract ids completely in #12464 as a follow-up. Just
wanted to factor this out for ease of review.
changelog_begin
changelog_end
* .
* .
* Remove reset service from grpc and documentation [DPP-804]
CHANGELOG_BEGIN
Remove reset service from the ledger api protocol and the documentation
CHANGELOG_END
* remove reset service from two left-over places
* remove reset service from the protobuf structure test
* user management: require `daml_ledger_api` scope in user access tokens
The accesss token's scope must include `daml_ledger_api` to ensure
that access token was issued for accessing the Daml ledger api.
CHANGELOG_BEGIN
CHANGELOG_END
* Split channel configuration from LedgerClientConfiguration
Fixes#12391
The channel configuration now has to be provided separately from the
configuration specific to the ledger client. In this way we avoid
situations where the builder is provided with some configuration
that gets overridden.
changelog_begin
[Scala bindings] The channel configuration has been split from the
LedgerClientConfiguration class. Provide the gRPC channel specific
configuration separately or use a builder. The channel configuration
no longer overrides the builder.
changelog_end
* Fix compilation issues in //ledger-service/...
changelog_begin
changelog_end
Bump resolved markdown-it version to 12.3.2 for modernizr
Bump webpack-dev-server to 4.3.7 to fix transitive issue reported on selfsigned 1.x
Bump marked to 4.0.10 to address reported vulnerability
Fixes#12913
The resulting `Flowable`/`Single` is going to be blocking.
Since the `Future` is ultimately a `ListenableFuture`, we take advantage of the
possibility of adding a callback to it and we dispacth it to the execution
sequencer that is used to process response streams.
changelog_begin
[Java bindings] The Single resulting from calling several of the services
exposed by the bindings are no longer blocking. For further details, see
https://github.com/digital-asset/daml/issues/12193.
changelog_end
`--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
* Support UserManagementService on the Java bindings
changelog_begin
[Java bindings] User management service client added
changelog_end
Fixes#12401
* Apply suggestions from code review
Thanks @S11001001
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* Add support for get user which recently has been added to the json api
changelog_begin
- [TS-Bindings] You can now call getUser to gain information about
the user that is associated with the currently used JWT.
changelog_end
* Apply review comments
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
* 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
* Get rid of deprecated components
Removes:
- mentions of the Node.js bindings
- mentions of the Scala bindings
- usage of the Scala codegen as an SDK tool
- Java bindings "reactive components"
changelog_begin
The Node.js bindings are no longer supported as part of the Daml SDK
The Scala bindings are no longer supported as part of the Daml SDK
The Java bindings reactive components are no longer supported as part of the Daml SDK
The `daml codegen` command has dropped support for Scala
changelog_end
* Fix typo noticed by @cocreature
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* Address https://github.com/digital-asset/daml/pull/12167#issuecomment-995714093
* Remove quickstart-scala from the SDK tarballs
* Fix failing codegen test
* Address https://github.com/digital-asset/daml/pull/12167#pullrequestreview-833991243
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
CHANGELOG_BEGIN
- [User Management]: add support for managing participant node users and authenticating
requests as these users using standard JWT tokens.
CHANGELOG_END
Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com>
Co-authored-by: Adriaan Moors <90182053+adriaanm-da@users.noreply.github.com>
* Update TODOs to outdated issues.
In particular update a lot of defunct interface TODOs to the LF 1.15
issue (or add the LF 1.15 issue if it's also relevant).
changelog_begin
changelog_end
* typo
* remove numeric/bignumeric todo
* scalafmt!!
* drop choice observer TODO
* Move toInterfaceContractId and fromInterfaceContractId out of Implements class
* Split Implements class into single-method classes
* Define toInterface outside its class to swap type arguments
This allows users to call 'toInterface @Interface', since the type of the template can usually be inferred
* Move interface classes and functions to DA.Internal.Interface
changelog_begin
changelog_end
Closes#11317
* Add warning for uses of 'controller ... can' syntax
* Remove uses of 'controller ... can' syntax
* Add test cases for -W{,no-}controller-can
* Update docs to reflect 'controller ... can' syntax deprecation
changelog_begin
* Deprecate 'controller ... can' syntax.
* It will be removed in a future version of Daml.
* Instead, use 'choice ... with ... controller' syntax. Note that this does not implictly add the controller as an observer, so it must be added explictly as one (or as a signatory).
changelog_end
* Limit supported input versions in damlc to >= LF 1.8
1.8 was the version that introduced type synonyms, we really don’t
gain much by dropping more since data-dependencies mainly depends on
that. and this provides for a very natural upgrade path for users
where pretty much everyone should be able to upgrade directly to SDK
2.0 without having to go through intermediate versions.
changelog_begin
- [Daml Compiler] The supported input LF versions for
data-dependencies are now limited to LF 1.8 and newer.
changelog_end
* fix some tests
changelog_begin
changelog_end
* Drop export 1.6 tests
changelog_begin
changelog_end
* Drop daml2js support for LF < 1.8
changelog_begin
- [Daml2js] DARs with LF version < 1.8 are no longer supported.
changelog_end
* .
changelog_begin
changelog_end
* bash is bad, stop using it
changelog_begin
changelog_end
* .
changelog_begin
changelog_end
This adds support for fixed choices to the TS codegen. However,
currently this fails because the JSON API does not accept interface
template ID's when exercising a choice.
CHANGELOG_BEGIN
CHANGELOG_END
* Drop LF < 1.14 from supported damlc output versions
fixes#11319
We keep test coverage by depending on the most recent snapshot which
still has 1.14 support.
changelog_begin
- [Daml Compiler] Damlc can only produce Daml-LF 1.14 or
newer. Passing aynthing older to `--target` is an error. If you
need to produce older versions, use an older SDK.
changelog_end
* Switch around legacy_compiler_lf_versions
changelog_begin
changelog_end
* drop since-lf
changelog_begin
changelog_end
* [Self-service error codes] Enabled by default
* Flag changed to `use-pre-1.18-error-codes` (disabled by default)
CHANGELOG_BEGIN
[Ledger API Specification] The Ledger API returns enriched error codes (see https://docs.daml.com/error-codes/self-service/index.html)
For backwards-compatibility, a new API flag `--use-pre-1.18-error-codes` is introduced for preserving the legacy behavior for
clients that want to migrate incrementally to the changed gRPC status code responses and error details format.
CHANGELOG_END
* Adapted HttpServiceIntegrationTest
* Renamed `Feature Flag` to `Configuration` in docs
* Fix Daml Script tests
changelog_begin
changelog_end
* Fix Repl functests
changelog_begin
changelog_end
* Fix haskell binding tests
changelog_begin
changelog_end
* Fix CommandClientIT test
* Fixed Sandbox and CommandServiceBackpressureIT tests
Please enter the commit message for your changes. Lines starting
* Adapt //compiler/damlc/tests:repl-functests again
* Fix more tests and address Miklos' comments
* Flag name changed to `grpc-status-codes-compatibility-mode`
* Remove useless flags sandbox-classic
* Sandbox-classic tests fix for ContractKeysIT and ExceptionsIT
* Created 2 deprecated test suites that have the more generic assertions as returned
by the deprecated in-memory backend
* More fixes for CommandServiceIT
* Fixes compilation issue with the deprecated exceptionsIT class for Sandbox-classic in-memory
* Compatibility mode for old test tools
* Change flag name to `use-pre-1.18-error-codes`
* Apply suggestions from code review
Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
* Update ghc patch
* Replace Implements proxy datatype with a class
* Expose 'Implements' class in Prelude
* Add DA.Internal.Desugar.HasMethod class
This allows us to get the type of a method of an interface through the functional dependency
* Convert interfaces from new desugaring
* Update Interface daml-test-file to use Interface class functions
* Update InterfaceDesugared daml-test-file
* Replace remaining uses of Is<Interface> methods with Implements
* Document HasMethod, Method and mkMethod
* Ignore _method_ bindings in convertBind
* Ignore interface desugaring types/classes/instances/functions in LF conversion
* update snapshot after pin on windows
changelog_begin
changelog_end
* Update to Java 11
changelog_begin
changelog_end
* Fix RoundingMode deprecation warnings
* Fix dep-ann warning
* Integer constructor
* JavaX annotation dependency
* javax.xml.bind was removed in Java 11
Using Guava as a replacement, since it is already a project dependency.
* JDK 11 no longer has a separate JRE tree
* Remove unused jdk_nix import
* remove now redundant jdk11_nix
* Java 8 --> 9 increased Instant.now() precision
See https://bugs.openjdk.java.net/browse/JDK-8068730
The precision of `Instant.now()` increased between Java 8 and Java 9.
On Linux and MacOS this doesn't seem to be a problem, as the precision
still seems to be at micro seconds. However, on Windows this now causes
errors of the following form:
```
java.lang.IllegalArgumentException: Conversion of Instant
2021-11-05T13:58:56.726875100Z to microsecond granularity would result
in loss of precision.
```
Suggesting that it now offers sub-microsecond precision.
`TimestampConversion.instantToMicros` had a check to fail if the
conversion lead to a loss of precision. In the specific failing test
case this is not a concern, so this adds a `roundInstantToMicros`
variant that avoids this kind of error.
* TMP round timestamps
* Revert "TMP round timestamps"
This reverts commit af8e261278.
* Skip versions before 1.6.0 in migration tests
changelog_begin
changelog_end
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
The encoder just took the keys & values as is which clearly falls
apart once those actually contain anything else that requires encoding
changelog_begin
- [Typescript Bindings] Fix an issue where nested maps did not get
encoded properly before sent to the JSON API which caused requests
to fail with a decoding error on the JSON API.
changelog_end
I’ve kept the infrastructure for versioned_scala_deps around because
I’m optimistic and hope that eventually we’ll do another Scala upgrade.
changelog_begin
changelog_end
* Changes to renable ws multiplexing
CHANGELOG_BEGIN
[TS-BINDINGS] Re-enable ws multiplexing for stream queries after resolving the reconnect connection close bug associated with ws state and liveness.
CHANGELOG_END
* websocket is passed as an argument to the onMessage handler
* consistently use 'manager' reference instead of 'this' in the handleQueries change method
CHANGELOG_BEGIN
[TS-Bindings] Ws multiplexing for stream queries is disabled by default as we investigate issues
of intermittent websocket closures.
CHANGELOG_END
* Use error validators in ApiPackageManagementService
CHANGELOG_BEGIN
CHANGELOG_END
* Exclude PackageManagementServiceIT from compatibility tests after 1.17
CHANGELOG_BEGIN
CHANGELOG_END
* Remove virtual choices
* Remove choices without a body in 'interface' definition
* Remove choices in 'template ... implements' section
part of #11372
changelog_begin
changelog_end
* Remove virtual choices cont.
Switch uses of virtual choices to fixed choice with method implementation
* update snapshot after pin on windows
* Disable failing interface tests with TODO #10810
See #11358.
CHANGELOG_BEGIN
- [@daml/react] Our React bindings now request the `react` library as a
peer dependency, and will accept React 17 in addition to the current
React 16. For new projects, the `create-daml-app` template now uses
React 17.
CHANGELOG_END
* Initial work-in-progress
changelog_begin
[TS bindings] When using daml-react and daml-ledger, all streaming request to the query endpoint will be multiplexed through a single web socket.
changelog_end
* Minor touches, renaming
* Handle offsets received from the JSON API
* Create state array once per downstream consumer
* Handle reconnections as streamSubmit does
* Don't share mutable state between events
* Fix compilation errors
* Remove language-support/ts/package-lock.json
* Remove --downlevelIteration option, materialize iterators, fix one test
* I will refrain from commenting on the meaning of `this` in JavaScript
* WebSocket does not have a removeAllListeners method
* Remove unnecessary docstring from `handleQueriesChange`
* Address https://github.com/digital-asset/daml/pull/10221#discussion_r670441680
* Address https://github.com/digital-asset/daml/pull/10221#discussion_r670427941
* Address https://github.com/digital-asset/daml/pull/10221#discussion_r670448474
* Address https://github.com/digital-asset/daml/pull/10221#discussion_r670473307
* Fix some failing tests and linting fixes
* fix reconnect on server close test
* fix failing tests in test.ts and create-daml-app tests
* Update language-support/ts/daml-ledger/index.ts
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Update language-support/ts/daml-ledger/index.ts
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Update language-support/ts/daml-ledger/index.test.ts
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Update language-support/ts/daml-ledger/index.test.ts
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* changes based on code review comments
Co-authored-by: Akshay <akshay.shirahatti@digitalasset.com>
Co-authored-by: akshayshirahatti-da <86774832+akshayshirahatti-da@users.noreply.github.com>
* Add DA.Internal.NatSyn as a stable package
This module exposes a type NatSyn, to be used for encoding
type synonyms of Nat-kinded types
* Add generalized roundtrip test helpers in LFConversion tests
roundtripTestsBy and roundtripTestsPartialBy are like their
non-By versions, except they take an explicit equality predicate
instead of relying on the Eq instance. This allows the source
and target types to differ.
* Define encoder/decoder for type synonyms
This works by saturating the RHS of the declaration with artificial
variable names and adding the corresponding parameters on the LHS
In the case of Nat type synonyms, the Proxy-like
DA.Internal.NatSyn.NatSyn type is used to wrap the value into
something of kind star.
* Use type synonym encoder/decoder when generating/consuming DALF
This closes#11226
changelog_begin
changelog_end
* Extend type synonyms over data-dependencies test
* Add test cases for multi-param type class synonyms
* interface: adding interfaces to the TS codegen
We add TS interfaces corresponding to Daml interfaces to the generated
TS code.
CHANGELOG_BEGIN
CHANGELOG_END
* Update language-support/ts/codegen/README.md
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Update language-support/ts/codegen/src/TsCodeGenMain.hs
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* comment on pure interface methods
* added comment on substitutions
* extend example/tests to two implementations
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* [Self-service error codes] Implement V2 in Authorizer
CHANGELOG_BEGIN
CHANGELOG_END
* Added unit test for authorize (non-streamed)
* Fix after rebase
* Do not expose the error codes switching mechanism to the Java bindings
* Adjust InternalAuthorizationError to be SystemInternalAssumptionViolated
* Parameter names in test
* Testing AuthorizationInterceptor with regard to returned error codes
* Do not use default error code version switchers at instance creation
* Addressed Pawel's review comments
* Using ErrorFactories for error dispatching
* Pass loggingContext to Authorizer where available
* Generic internal authorization error
* a model for trapping client errors in Scala bindings shim and reporting correctly
* clean up some nesting with an alias
* filter out client-side command service errors
* fix flattening error propagation of CommandService errors in endpoints
* remove todo
* Daml evaluation triggers INVALID_ARGUMENT; handle this for creates/exercises
* clean up lookupResult
* remove stripLeft utility; it is unused
* proper error propagation for /parties endpoint
* map grpc status codes to HTTP error codes
* add a case to pass-through gRPC errors in Endpoints errors
* handle gRPC status in all explicit top-level catches
* pass through gRPC errors in CommandService as well
* treat a gRPC status anywhere in the causal chain as indicating participant-server error
* propagate ContractsService errors without assuming they will always be ServerErrors
* filter ServerErrors' contents when rendering errorful streams
* log errors from websocket output instead of rendering full messages
* hide message in ServerError case
* remove Aborted
* transfer with bad contract ID now returns 409
* mention new error codes
* add changelog
CHANGELOG_BEGIN
- [JSON API] Several kinds of gRPC server errors are now reported with
associated HTTP statuses; for example, a Daml-LF interpreter error now
returns a 400 instead of a 500, and an exercise on an archived contract
returns a 409 Conflict instead of a 500. Errors internal to JSON API
(e.g. internal assertion failures) are no longer detailed in the HTTP
response; their details are only logged.
See `issue #11184 <https://github.com/digital-asset/daml/pull/11184>`__.
CHANGELOG_END
* remove unused Show and liftErr utility
* adapt daml-script to new error codes
* adapt typescript tests to new error codes
* adapt json-api failure tests to new error codes
* For the client binding propagate the full original completion.
Because more fields are added to the completion it gets more difficult to deconstruct it into our own models while keeping the same external API. Because of this, we are propagating the full completion as well
CHANGELOG_BEGIN
java-client-bindings - the original full completion is included in the `CompletionResponse` when available
CHANGELOG_END
changelog_begin
changelog_end
Visualizes the top-most exception as part of the test failure when the expected
gRPC error code is not found in the stack trace. This should hopefully improve
our chances to identify the cause of flakes such as the one reported as part of
https://github.com/digital-asset/daml/issues/10974.
Example output in case of a failing match:
```
- should deny access without sufficient authorization *** FAILED *** (39 milliseconds)
listPackages java.lang.RuntimeException: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: UNAUTHENTICATED: did not equal DEADLINE_EXCEEDED (AuthMatchers.scala:38)
```
Before this commit, the output for a similar failure would be the something like:
```
- should deny access without sufficient authorization *** FAILED *** (208 milliseconds)
getPackageStatus <iterator> was empty (AuthMatchers.scala:16)
```
* Add daml interfaces to the Haskell LF AST
Just copied from Sofia’s PR with no changes and stubbed all usages of
it that aren’t trivial.
changelog_begin
changelog_end
Fixes#10383
CHANGELOG_BEGIN
- [Java Bindings] DamlLedgerClient.Builder allows to set a timeout for command using `withTimeout`.
CHANGELOG_END
Co-authored-by: Stefano Baghino <stefano.baghino@digitalasset.com>
* Add the LedgerClientWithoutLedgerId class
* Minimize diff
changelog_begin
changelog_end
* Minimize diff further
* Add missing license header & reformat
* Update language-support/scala/bindings-akka/src/main/scala/com/digitalasset/ledger/client/binding/LedgerClientBinding.scala
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Update ledger/ledger-api-client/src/main/scala/com/digitalasset/ledger/client/LedgerClient.scala
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Add changelog
changelog_begin
- [Ledger Client Scala Bindings] A new variant of the LedgerClient class
was added called `LedgerClientWithoutLedgerId`. This class does not
need a ledger id at initialization. It was added to allow skipping
any checks at initialization for use cases where either the
ledger id is not known at initalization or no valid token can be fed
at initialization for checking the ledger id. Furthermore for each
classes `ActiveContractSetClient`, `CommandClient`, `PackageClient`,
`TransactionClient`, `VersionClient` now exists a variant which
doesn't depend on a ledger id at initialization and instead requires
one for every function as parameter. Moreover the existing classes
are extending these classes with overriding the methods and setting
the default of the parameter with the given ledger id from
initialization. The class `LedgerClientWithoutLedgerId` already
makes usage of these variants e.g. `PackageClientWithoutLedgerId`.
changelog_end
* More changelog
changelog_begin
- [Ledger Client Scala Bindings] The function `transactionSource` of the
class `LedgerClientBinding` now optionally accepts a token which is
passed on to the unterlying call.
changelog_end
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* participant-integration-api: On submit and wait, capture a deadline.
We need this deadline to make sure we terminate the stream.
* ledger-api-client: Use the specified expiry time for tracking.
Not the command deduplication time.
CHANGELOG_BEGIN
- [Ledger API Server] The command deduplication time is no longer used
for determining the period of time to track the command before giving
up. Instead, the gRPC deadline is used. If no deadline is provided
(or if the deadline exceeds the command tracker retention period), the
tracker retention period is used instead.
CHANGELOG_END
* ledger-api-client: Keep supporting the `deduplication_time` timeout.
* ledger-api-client: Improve comments in CommandTrackerFlow and its tests.
Co-Authored-By: Miklos <57664299+miklos-da@users.noreply.github.com>
* bindings-akka: Parameterize RetryInfo with its value type.
* ledger-api-client: Wrap command submissions in a new class.
This will allow me to pass a deadline alongside the commands in the
future.
CHANGELOG_BEGIN
CHANGELOG_END
* ledger-api-client: Inline `CommandRetryFlow.Value`.
* bindings-akka: Inline `CommandRetryFlow`'s `createRetry`.
It's always the same: `retryInfo.value`.
CHANGELOG_BEGIN
ledger-api - Command deduplication period can now be specified by setting `deduplication_offset` instead of `deduplication_time` (only valid for v2 WriteService). This change is backwards compatible.
CHANGELOG_END
* Propagate the enriched deduplicationPeriod instead of deduplication duration
* Update the Haskell bindings for the new deduplication period
* Calculate the deduplicateUntil using the new deduplication period for backward compat
* Use consistent naming for deduplication_period
* Cleanup command timeout extraction from deduplication period
* Add the required deduplication_offset to deduplication instead of deduplication_start
* Update haskell bindings to support deduplication_offset
* Add support for deduplication_offset in the ledger-api
* Remove the timestamp-based deduplication from our models to simplify upgrade for users
* Add optional conformance test for offset based deduplication
* Remove buf rule for FIELD_SAME_ONEOF as our change is backwards compatible
* Disable FIELD_SAME_ONEOF buf check for commands file
* Apply suggestions from code review
Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
* Update comment for deduplication period
Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
* Upgrade Scalatest to v3.2.9.
Because of some coupling we also have to upgrade Scalaz to the latest
v7.2 point release, v7.2.33.
The Scalatest changes are quite involved because the JAR has been broken
up into several smaller JARs. Because Bazel expects us to specify all
dependencies and doesn't allow transitive dependencies to be used
directly, this means that we need to specify the explicit Scalatest
components that we use.
As you can imagine, this results in quite a big set of changes. They
are, however, constrained to dependency management; all the code remains
the same.
CHANGELOG_BEGIN
CHANGELOG_END
* http-json-oracle: Fix a Scalatest dependency.
* ledger-api-client: Fix a Scalatest dependency.
* Track command response using an Either instead of passing the completion with the grpc code.
This makes it clearer as to the result of command tracking. We no longer count on the grpc status to determine if there was an error or not, and instead use types for that.
CHANGELOG_BEGIN
akka-bindings: `LedgerClientBinding.commands` now returns a flow of `Either[CompletionFailure, CompletionSuccess]` instead of `Completion` for clearer error handling. For backwards compatiblity the new return type can be turned back into a `Completion` using `CompletionResponse.toCompletion`
CHANGELOG_END
* Fix formatting
* Code review changes
- remove usages of Symbol in tests
- clean curly braces
* Remove change added from another PR
* Fix import
* Fix import
* Fix retry flow and extract one more match case
* Un-nest matches to a single level for simplicity
* fix typo
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
* Be consistent in assertions and prefer `inside` for pattern matching
* Inline CompletionResponse to use the full type
* Use simpler matcher
* Formatting
* Add a way to convert back an `Either[CompletionFailure, CompletionSuccess]` to a `Completion` for backwards compatibility. This simplifies update for systems that are tightly coupled to `Completion`
* Add test for converting to/from CompletionResponse
* Remove unnecessary brackets
* Add missing header
* Use checked exceptions to preserve backwards compatiblity
* Fix unapply
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
* Add optional submission id to commands.proto
This allows to propagate a submission id. If no id is submitted (the submission id is empty) then we generate a new submission id
CHANGELOG_BEGIN
Add optional submission_id to the commands.proto.
CHANGELOG_END
* Update haskell bindings to include the submission id
* Code review - rename submission id extractor
* Code review - update comment and remove braces from if block
* Fix braces
* participant-integration-api: Encapsulate the initial configuration.
* participant-integration-api: Reduce usage of `LedgerConfiguration`.
* Inline `LedgerConfiguration` wherever it's used.
Most things don't need all its constituent parts; this reduces the
amount of unused properties.
CHANGELOG_BEGIN
- [Integration Kit] The ``LedgerConfiguration`` class has been
removed in favor of ``InitialLedgerConfiguration``. Its usage
has been changed accordingly, with the ``configurationLoadTimeout``
property becoming part of ``ApiServerConfig`` instead.
The default options provided by ``LedgerConfiguration`` have been
removed; you are now encouraged to come up with sensible values for
your own ledger. The ``Configuration.reasonableInitialConfiguration``
value may help.
CHANGELOG_END
* Correct the initial configuration submission delay for KV ledgers.
* kvutils: Mark supertype unused parameters as unused.
* kvutils: Extract out common configuration submission delays.
These values are specific to kvutils; other drivers should come up with
their own.
* configuration: Delete `NoGeneration`, as it's unused.
* daml-lf/data: Move ID aliases to `Ref` from _ledger-api-common_.
This allows us to remove a lot of dependencies on _ledger-api-common_,
and use these aliases in other places where that module is not used.
CHANGELOG_BEGIN
CHANGELOG_END
* participant-integration-api: Remove an unused import.
* http-json-oracle: Remove `ledger-api-common` as a dependency.
* bindings-rxjava: Remove a now-unused dependency.
See https://github.com/digital-asset/daml/issues/10273 for details on
the issue.
Summary is that the logic in the Java bots is fundamentally broken
since it modifies the pending set asynchronously so it can trigger for
the same contract multiple times.
While we can certainly fix that or hack around the bug in the tests,
given that the Java bots are deprecated, marking it flaky seems like a
better use of our time.
changelog_begin
changelog_end
* participant-state: Remove the `ParticipantId` alias.
This alias adds nothing. By using `Ref.ParticipantId` directly, many
packages can remove their dependency on the _participant-state_ package.
CHANGELOG_BEGIN
CHANGELOG_END
* participant-state: Remove the `PackageId` and `Party` aliases.
They don't add anything. Let's just use `Ref`.
* kvutils: Restore missing compat imports.
CHANGELOG_BEGIN
* [Integration Kit] Removed trace_context field from Ledger API and its bindings as we now have trace context propagation support via gRPC metadata. If you are constructing or consuming Ledger API requests or responses directly, you may need to update your code.
CHANGELOG_END
* LF: change type from Try to Either in archive module
This is the first part of restructuring errors in archive module.
This is part of #9974.
CHANGELOG_BEGIN
CHANGELOG_END
* Apply suggestions from code review
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* remove type alias
* apply stephen suggestion
* fix after rebase
* fix test
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
I don't see a reason why it's part of the participant state API, and
it definitely doesn't need to change between v1 and v2.
CHANGELOG_BEGIN
- [Integration Kit] The class ``SeedService`` has been moved from the
*participant-state* Maven package to the *participant-integration-api*
Maven package, under the Java package name
``com.daml.platform.apiserver`` to reflect its usage by the API
server, not the participant state API. If you use this class directly,
you will need to change your imports.
CHANGELOG_END
* LF: Simplify archive reader.
- decouple Reader and Decoder
- introduce case class to handle hash, proto payload, and version
CHANGELOG_BEGIN
CHANGELOG_END
* Address Moritz' review
* cosmetic
* daml-lf/data: Truncate party names in log output, on request.
The party name can grow quite long, so we offer ledger implementors the
opportunity to truncate it in structured log output.
Unfortunately, because we use Logback through the global
`LoggerFactory`, there is no place to inject logging configuration. This
means we also need to use global, mutable state to configure logging
output. I have added a `LoggingConfiguration` class+object in Daml-LF
Data, which may not be the best place, but I can't think of a better
one right now. I suggest we leave it there until it has reason to grow,
at which point we may want to move it.
CHANGELOG_BEGIN
CHANGELOG_END
* logging-entries: Make `ToLoggingValue` mixin-able.
* participant-integration-api: Truncate parties in filters when logging.
* participant-integration-api: Cast to `Party` for logging.
Invalid input should not break the request at this point. No assertions.
* daml-lf/data: Move `Party to LoggingValue` to a new package.
This avoids the transitive dependency issue most of the time.
* daml-lf-data: Move the `Identifier` logging to another package.
Again, reduces the need for transitively depending on _logging-entries_.
I don't find the output from Bazel very helpful most of the time. It
does, however, produce a lot of noise which I have to filter through
when something else goes wrong.
CHANGELOG_BEGIN
CHANGELOG_END
* Java bindings: add DamlRecord, deprecate Record
Fixes#10130
changelog_begin
[Java bindings] In order to avoid clashing with `java.lang.Record` (introduced
in Java 14), `com.daml.ledger.javaapi.data.Record` has been renamed to
`com.daml.ledger.javaapi.data.DamlRecord`. The old name has been used to
denote a sub-type of the newly renamed one, so it can still be used, but it has
been marked as deprecated.
[Java codegen] The Java codegen now uses the `DamlRecord` type wherever `Record`
was used before.
changelog_end
Boy-scout rule:
- removed references to ~old~ ancient versioning
- used `@deprecated` Javadoc annotation wherever meaningful
- some import re-arrangement performed by the linter
* Address https://github.com/digital-asset/daml/pull/10132#discussion_r659705929
This ends up transitively bumping yargs-parser which has a
vulnerability but more generally I also just like being on the latest version.
changelog_begin
changelog_end
* Introduce shell.nix to expose the Nix tooling, if required.
* dev-env: Rewrite the ghcide script to use nix-shell.
* language-support/hs: Use `nix-shell` for export-package.sh.
* Nix: Add a shebang to the Bazel wrapper script.
CHANGELOG_BEGIN
CHANGELOG_END
* dev-env: Standardize the `set` header in `ghcide`.
* upgrade scalacheck to 1.14.3
* regenerate maven_install files
* some different names and implicits
* remove some fromTryCatchNonFatal
* more porting
* port fromTryCatchNonFatal to attempt
* factor the assertions in SignatureSpec to avoid \/
* deal with invariant \/
* make partial unification do what we want
* \/, parse*, and toNel
* many uses of the .right method
* a legitimate use of fromTryCatchThrowable
* rebuild maven pins
* further invariant \/
* OneAnd and Nel interface changes
* further Either games
* \/ and reformatting
* \/ in http-json
* \/ in http-json
* deprecations
* more invariance
* cleanup unused
* more invariance; http-json compiles
* final either follies
* small 2.12 extra incompatibility
* rebuild deps
* revisit a couple earlier fixes using nicer expressions I learned later
* no changelog
CHANGELOG_BEGIN
CHANGELOG_END
* repin 2.12
* Handle module-prefixes in Java codegen
changelog_begin
- [Java Codegen] The Java codegen will now pick up the
`module-prefixes` field from `daml.yaml` which can be used to handle
module name collisions between different DALFs.
changelog_end
* Reference ticket in todos
changelog_begin
changelog_end
* less stupid map initialization
changelog_begin
changelog_end
* Pull out string assembly
changelog_begin
changelog_end
* Update language-support/java/codegen/src/main/scala/com/digitalasset/daml/lf/codegen/CodeGenRunner.scala
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Update language-support/java/codegen/src/main/scala/com/digitalasset/daml/lf/codegen/CodeGenRunner.scala
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* fewer views
changelog_begin
changelog_end
* more assert
changelog_begin
changelog_end
* more private
changelog_begin
changelog_end
* fmt
changelog_begin
changelog_end
* fix scala 2.12
changelog_begin
changelog_end
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Include PackageMetadata in LF interface
I want to use this in codegens but more generally, I think it also
fits well into the scope of the iface library in that it’s only
metadata and relatively stable.
changelog_begin
changelog_end
* Iterating more is less
changelog_begin
changelog_end
* fix tests
changelog_begin
changelog_end
* fmt
changelog_begin
changelog_end
* fix scala 2.12
changelog_begin
changelog_end
* check whether collection.compat is unused when compiling for Scala 2.12
- Instead of always suppressing warnings for collection.compat._,
we should only do it for Scala 2.13
- We can also reduce boilerplate by automatically adding this
option when both silencer_plugin and collection-compat are
present
CHANGELOG_BEGIN
CHANGELOG_END
* remove unused import
* remove another unused import
* remove even more unused imports
* missed compat dependency
* more missed compat dependencies
* missed compat dependency
* use scala_deps in scaladoc_jar
- #8423 inlined the major version expansion, but this seems to
have been prior to proper support by scaladoc_jar
* restore custom handling of participant-integration-api
- fixing scaladoc_jar isn't worth it for a single case, as with
deps vs scala_deps
This is a bit annoying. We have to force react-test-renderer because
otherwise we pull in both React 17 and React 16 which breaks stuff.
We also have to force hosted-git-info which is pulled in transitively
via jest. The next major version of Jest will drop that dependency but
for now there is no other way to get rid of this.
changelog_begin
changelog_end
* Address more exception todos
A bit of a kitchen sink PR to address a bunch of the trivial todos
that didn’t seem worth splitting out into separate PRs.
changelog_begin
changelog_end
* Revert changes to TransactionSpec
changelog_begin
changelog_end
* Switch from `@silent` to `@nowarn`.
This annotation is native to Scala 2.12.13+ and 2.13.2+. It replaces
most usages of `@silent`.
I had to get creative about a couple of use cases that didn't work.
Specifically:
1. Suppressing deprecation warnings works, but Scala 2.12 erroneously
complains that the `@nowarn` is unnecessary. I had to suppress
this warning too with `-Ywarn-unused:-nowarn`.
2. I can't seem to suppress the warning, "The outer reference in this
type test cannot be checked at run time." Instead, I have
refactored the code to remove the warning.
We still need to use the silencer plugin to suppress some warnings about
unused imports (because of compatibility between Scala 2.12 and 2.13),
but this means we no longer need the library, and therefore it is not a
transitive dependency that downstream consumers need to worry about.
CHANGELOG_BEGIN
CHANGELOG_END
* Add some comments around `@nowarn` support.
* language-support/scala: Fix a warning suppression.
* Revert to the default warnings.
Compatibility was complaining.
Not quite sure what is going wrong and if this is the issue but I’m
failing to reproduce it reliably to test this so bumping and seeing if
we still hit it on `main` seems like the easiest option.
changelog_begin
changelog_end
* add the MapOps argument to Compat.MapLike
* use immutable.Map newtype for GenMap instead of InsertOrdMap
- bindings tests and sample-app tests compile under 2.13 and 2.12
* add changelog
CHANGELOG_BEGIN
- [Scala Codegen] ``GenMap`` no longer requires ``InsertOrdMap``;
ordinary Scala immutable ``Map``s may be effectively used
instead. We still encourage use of the ``Primitive.GenMap``
alias for proper typing, future-proofing, and deprecation
warnings.
See `issue #9449 <https://github.com/digital-asset/daml/pull/9449>`__.
CHANGELOG_END
* implicitly convert from Map; test several aspects of the Scala GenMap API
* test best-effort class preservation
* drop the CBF for 2.12, as with TextMap
* test conversion in a contract construction
* remove unused CanBuildFrom compats
* combine Primitive tests
* reenable 2.13-only tests
* remove InsertOrdMap references in Shrink/Show instances
* remove test that GenMap order is preserved by Scala
Setting this manually has resulted in #9397 where we use a scala
version that doesn’t have a silencer version. This PR changes the
quickstart template to use the scala version we also use in our builds
which should avoid them getting out of sync in the future.
changelog_begin
changelog_end
* daml build: add a --access-token-file for remote dependencies
This adds a `ledger.access-token-file` field in the `daml.yaml` project
file and a `--access-token-file` flag to `daml build` to authorize
querying/fetching of remote dependencies.
CHANGELOG_BEGIN
[daml build] A new flag `--access-token-file` is added for the `daml
build` command. It allows the specify the path to an access token to
authenticate against the ledger API. This is needed if the project
depends on a remote Daml package hosted on such a ledger. Alternatively,
the path to the token can also be specified in the `daml.yaml` project
file under the `ledger.access-token-file` field.
CHANGELOG_END
* variance calculation without references or cycles
* an idea for handling the recursive reference case elegantly
* extra data for resolving constraints from [recursive] references later
* note on TypeVar case
* trying a different delayed resolution
* quagmire
* the problem: we were trying to solve too early and mix reference levels
* force inner delays to be pulled out; squash the delays iteratively
* make the variance result accessible
* phantoms are covariant
* scalafmt
* simplest GenMap test
* reference tests
* factoring
* don't treat covariant reference arguments as phantom
* making the wrong reference in delays was breaking solve steps
* test cons list self-recursion
* more recursion testing
* -> is better for 2-tuples here
* test cumulative variance tracking
* uninhabited types have variance too
* test mutual recursion with lots of indirect references
* trigger for failing case in incremental resolution
* redesign delayed constraints to handle nesting properly, and be much simpler
* integrate variance calculation with rest of Scala codegen
* handle concrete type and all-phantoms cases; test
* add integration test for variance inference
* add changelog
CHANGELOG_BEGIN
- [Scala Codegen] Type parameters used in GenMap keys are now supported.
See `issue #8879 <https://github.com/digital-asset/daml/pull/8879>`__.
CHANGELOG_END
* proper doc for covariantVars
- suggested by @cocreature; thanks
* remove useless local var
- suggested by @cocreature; thanks
* add another recursive function to capture more invariants
- suggested by @cocreature; thanks
* absence in what
- suggested by @cocreature; thanks
* use Identifier instead of I
- suggested by @cocreature; thanks
* remove unused type vars; make goSdt cleaner
* also precache variance of choice and key-referenced types
- suggested by @cocreature; thanks
* Add new variant to Value.scala for builtin-exceptions.
final case class ValueBuiltinException[+Cid](tag: String, value: Value[Cid]) extends Value[Cid]
And push through the code consequences.
Most places fixed up.
A couple more things to do in this PR (marked NICK)
A couple of things which can be left for later (marked 8020)
fix build
fix another scala match
changelog_begin
changelog_end
* fix any match
* add marker of code which needs attending to in the PR
* extend ledger-api value.proto & fix LfEngineToApi
* undo/comment-out the change to value.proto
* add tests in HashSpec for BuiltinException
* code but dont yet enable value-gen for builtin exceptions
* address comments which suggest we crash in various places
* support BuiltinException in scenario_service.proto
* one more TODO 8020 tag
* Do not require a JWT token for Health and Reflection services
CHANGELOG_BEGIN
- A JWT token is no longer required to call methods of Health and Reflection services
CHANGELOG_END
* Let service's authorizer decide about rejections
* Updated authorization test
* Added integration test for unsecured authorisation test for the Health service
* Added integration test for unsecured authorisation test for the Server Reflection service
* Updated Claims doc comments
* Minor change
* Reduced code duplication with SecuredServiceCallAuthTests and UnsecuredServiceCallAuthTests
* Added copyrights
* Move response status handling logic to Authorizer
CHANGELOG_BEGIN
- [LF] Release LF 1.12. This version reduce the size of transaction
- [Compiler]: Change the default LF output from 1.8 to 1.11.
CHANGELOG_END
* Ledger API test tool: test against legacy and preview version.
+ use dictionary instead of alias to map version keywords to LF version
CHANGELOG_BEGIN
CHANGELOG_END
improve previous generalization from #8695
- use lf version instead keyword (like 'stable', 'latest', 'dev') to
tag actual target. This will allow two keywords to map to the same
versions without doing twice the compilation/test work.
- use alias to map keywords tag target to versioned tag target.
- move package manage dar to test_commong.
CHANGELOG_BEGIN
CHANGELOG_END
fixes#8498
This fixes the error in 2.13 wtr to the location change of Predef. It
doesn’t yet address the warning wtr to the import of higherKinds. For
now, our build ignores that warning. Trying to figure out if we can
get away with a breaking change here or if we need to hide that change
behind a flag but either way, no need to block fixing the actual error
on that.
changelog_begin
changelog_end
At the very least this should produce better error messages and at
least on my machine it does reduce flakiness significantly by bumping
the timeout and increasing Bazel’s resource allocation (and thereby
reducing parallel runs).
Unfortunately, a proper fix here is much more involved than I have
time for right now.
changelog_begin
changelog_end
* Add --target=1.12 support in the compiler.
changelog_begin
- [DAML Compiler] Add support for ``--target=1.12`` in the DAML compiler.
changelog_end
* version1_12 not version1_11
* Update codegen tests.
* Update codegen tests again
* Fix data-dependencies test.
CHANGELOG_BEGIN
- [Daml-LF] Release LF 1.11
- add suport for Generic Map
- add support for choice observer
- add generic comparison
- add convert of contract ID to string (available only in off-ledger mode)
- reduce size of dar using type interning
CHANGELOG_END
* Upgrade scopt to 4.0.0
Scopt 3.x has some issues with Scala 2.13 because it expects an
immutable Seq on 2.13 meaning you cannot just pass in an Array. Rather
than fixing our callsites to convert to an immutable Seq everywhere,
this PR bumps to Scopt 4.0 which goes back to collection.Seq.
and leaving that aside, I’m a fan of upgrading dependencies anyway :)
changelog_begin
changelog_end
* Use val instead of def
changelog_begin
changelog_end
This PR updates scalafmt and enables trailingCommas =
multiple. Unfortunately, scalafmt broke the version field which means
we cannot fully preserve the rest of the config. I’ve made some
attempts to stay reasonably close to the original config but couldn’t
find an exact equivalent in a lot of cases. I don’t feel strongly
about any of the settings so happy to change them to something else.
As announced, this will be merged on Saturday to avoid too many conflicts.
changelog_begin
changelog_end
The one thing that is still missing is making the generated Scala code
from the codegen compatible with Scala 2.13 so the examples are
excluded for now.
changelog_begin
changelog_end
* rxjava: support for multiparty submissions
This (conceptually) small set of changes adds overrides for the `submit`
family of methods that let clients pass lists of `actAs` and `readAs`
parties rather than a single party.
CHANGELOG_BEGIN
- [Java Codegen] The LedgerClient interface in the rxjava bindings has
been expanded with more overrides to the `submit` family of methods to
account for the new multiparty submission feature.
This is a compile-time breaking change for anyone who has a custom
implementation of the LedgerClient, CommandClient or
CommandSubmissionClient interfaces. Most Java IDEs will be able to
geenrate stub implementations that throw some variant of
UnsupportedOperationException or RuntimeException, which is a viable
workaround until you start using the new multiparty submission
feature.
We expect most users to use the provided implementations of these
interfaces rather than implement them themselves; for those users,
this change is purely additive.
CHANGELOG_END
* review comments
* fromProto
* use Arrays.asList
* Replace many occurrences of DAML with Daml
* Update docs logo
* A few more CLI occurrences
CHANGELOG_BEGIN
- Change DAML capitalization and docs logo
CHANGELOG_END
* Fix some over-eager replacements
* A few mor occurrences in md files
* Address comments in *.proto files
* Change case in comments and strings in .ts files
* Revert changes to frozen proto files
* Also revert LF 1.11
* Update get-daml.sh
* Update windows installer
* Include .py files
* Include comments in .daml files
* More instances in the assistant CLI
* some more help texts
* Port damlc dependencies to Scala 2.13
I got a bit fed up by the fact that going directory by directory
didn’t really work since there are two many interdependencies in
tests (e.g., client tests depend on sandbox, sandbox tests depend on
clients, engine tests depend on DARs which depend on damlc, …).
So before attempting to continue with the per-directory process, this
is a bruteforce approach to break a lot of those cycles by porting all
dependencies of damlc which includes client bindings (for DAML Script)
and Sandbox Classic (also for DAML Script).
If this is too annoying to review let me know and I’ll try to split it
up into a few chunks.
changelog_begin
changelog_end
* Update daml-lf/data/src/main/2.13/com/daml/lf/data/LawlessTraversals.scala
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* fixup lawlesstraversal
changelog_begin
changelog_end
* less iterator more view
changelog_begin
changelog_end
* document safety of unsafeWrapArray
changelog_begin
changelog_end
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
This commit fixes a few copyright headers that have been missed in the
automatic update on Jan 1, as well as the generation code in the compat
workspace so it generates the right headers.
CHANGELOG_BEGIN
CHANGELOG_END
* Support DAML_PROJECT in daml codegen java
fixes#8406
We need to resolve the DAR path relative to the project
root. Otherwise, we’ll just fail to find the file if daml codegen java
is invoked from a different directory.
changelog_begin
changelog_end
* Fix test
changelog_begin
changelog_end
* fmt lalala
changelog_begin
changelog_end
* fix another test
changelog_begin
changelog_end
Fixes#8338
This is a bit of a weird one. The basic issue is fairly clear. We have
code which looks something like:
```
interface MyTemplate<K> {
keyEncode: (k: K) => unknown;
keyDecoder: () => K;
}
interface MyChoice<K = unknown> {
template: () => MyTemplate<K>;
}
function exercise(c: MyChoice) {
console.log(c);
}
const y = (x : MyChoice<undefined>) => {
exercise(x);
}
```
The key type is invariant here since it occurs in both covariant and
contravariant positions. We compile in strict mode so this is a
typescript error. This fails in all typescript versions I tested
including 3.8 which we use in our tests. So why don’t the tests fail?
Afaict, this is because the template constant is defined as an
intersection of the template type and the choices available on the
template. In TypeScript 3.8, this seems to (mostly, we’ll get to a
bit) hide this error. In TypeScript 3.9 and later, you hit it. There
is something in the release notes about intersection types but only
about optional properties which don’t seem to be required
here. Nevertheless, it is definitely related to the typescript
version.
So there are two more weird things about TypeScript 3.8:
1. Sometimes you get the error in the IDE but not in `npm start` and
`npm run build`. Afaict, this is caused by the VSCode plugin being
based on a different TypeScript version, e.g., mine was at 4.1.2 so
this seems to match up with the 3.9 hypothesis.
2. In some cases (not all afaict), the issue shows up in `npm start`
but only intermittendly. As described in #8338, it goes away after
a restart. I have no idea what is going on here. something
something incremental builds are hard 🤷 I’ve spent way too
much time trying to figure it out but since the underlying issue
seems clear, I gave up at some point.
changelog_begin
- [JS Client Libraries] Fix a bug where in some cases calls to
`exercise` and `createAndExercise` failed to typecheck with a mismatch
in the key type.
changelog_end
* participant-integration-api: Dedicated execution context for requests.
CHANGELOG_BEGIN
CHANGELOG_END
* participant-integration-api: Construct the services executor outside.
* participant-integration-api: Share the services EC with the GRPC stack.
* participant-integration-api: Use the new EC wherever possible.
And stop using DirectExecutionContext.
* sandbox-classic: Fix DevModeIT to use the right configuration.
I have no idea why this breaks now, but it was always technically
broken, so I'm fixing it.
* participant-integration-api: Push the services EC up one more level.
* Update newly added ApiParticipantPruning service accordingly
see https://github.com/digital-asset/daml/pull/7988#discussion_r525319097
* participant-integration-api: Ensure the LedgerConfigProvider is ready.
Somehow this slipped through.
* sandbox-classic: Fix `DefaultConfig` in tests.
* language-support/java: Disable seeding in tests again.
Co-authored-by: Oliver Seeliger <oliver.seeliger@digitalasset.com>
Highly unlikely this actually makes a difference in practice but it’s
one less thing I need to look at next time someone makes me analyse
spotbugs results.
changelog_begin
changelog_end
As we strive for more inclusiveness, we are becoming less comfortable
with historically-charged terms being used in our everyday work.
This is targeted for merge on Dec 26, _after_ the necessary
corresponding changes at both the GitHub and Azure Pipelines levels.
CHANGELOG_BEGIN
- DAML Connect development is now conducted from the `main` branch,
rather than the `master` one. If you had any dependency on the
digital-asset/daml repository, you will need to update this parameter.
CHANGELOG_END
See [discourse].
[discourse]: https://discuss.daml.com/t/best-practice-for-getting-ledger-state-in-multiple-nested-react-components/1814/3
CHANGELOG_BEGIN
* [JavaScript Client Libraries] When using our React wrapper from
TypeScript, users could end up having to manually reconstruct a
`QueryResult` type for a specific template, leading to code looking
like (assuming a `User` template):
```
const allUser: QueryResult<User.User, User.User.Key, typeof User.User.templateId> = useStreamQueries(User.User);
```
Our codegen will now generate an additional type definition per
template such that the above can be rewritten as
```
const allUser: User.User.QueryResult = useStreamQueries(User.User);
```
Developers using our JavaScript bindings directly (i.e. without taking
advantage of the TS type definitions) are not affected. Existing
(long-form) type declaractions will also keep working.
Note: In order to make this change, we had to move the definition of
the `QueryResult` type from the `@daml/react` package to the
`@daml/ledger` package. However, the `@daml/react` package is still
exporting it as before, so this is a backwards-compatible change.
CHANGELOG_END
* Upgrade Scala dependencies for 2.13 compatibility
This upgrades a bunch of Scala libraries to versions that have 2.13
support. There are two libraries that are still missing:
- diffson, this has a new version but with significant breaking
changes and it is only used in Naigator console which I hope to kill
before I have to worry about this.
- ai.x:diff, this is used in the ledger API test tool. The library is
abondened but there are a few alternatives.
changelog_begin
changelog_end
* Fix pureconfig
changelog_begin
changelog_end
* Fix Navigator
changelog_begin
changelog_end
* Bump rules_nodejs
rules_nodejs finally added support for module remapping via js_library
so we can kill our custom rule for that.
changelog_begin
changelog_end
* Fix windows
changelog_begin
changelog_end
* .
changelog_begin
changelog_end
This is necessary to at least attempt an upgrade to 2.13 and
generally, I want to keep our rulesets up2date. rules-scala forces the
version of scalatest so we have to bump that at the same time.
This requires changes to basically all Scala test suites since the
import structure has changed and a bunch of things (primarily
scalacheck support) got split out.
Apologies for the giant PR, I don’t see a way to keep it smaller.
changelog_begin
changelog_end
* Add multi-party submissions to the ledger API
CHANGELOG_BEGIN
* [Ledger API] Command submission requests now contain new optional
fields used for multi-party submissions. Such submissions currently
return UNIMPLEMENTED errors, they will be enabled in the future.
CHANGELOG_END
* Adapt Haskell bindings
* Handle the new ledger API fields
* Fix SubmitAndWaitDummyCommand
* Remove unused methods
* Redesign multi-party auth tests
* Remove direct access of request party
* Apply review comments
* Improve protobuf comments
* Multi-party tracker map
* Fix validation logic
* Consistent metric naming
We add the daml-types/daml-ledger libraries as peer-dependencies instead
of dependencies. This will assure that the library is provided by the
importing library and avoid the situation when two different versions of
these libraries are imported by the generated and the user code.
This fixes#8101.
CHANGELOG_BEGIN
CHANGELOG_END
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
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
* ledger-api: Use `proto_jars`.
CHANGELOG_BEGIN
- [Ledger API] The Scala JARs containing the gRPC definitions no longer
contain the *.proto files used to generate the ScalaPB-based classes.
CHANGELOG_END
* Create a source JAR for *.proto files in `proto_jars`.
* ledger-api: Publish the protobuf sources as "ledger-api-proto".
CHANGELOG_BEGIN
- [Ledger API] The *.proto files containing the gRPC definitions are now
provided by a new Maven Central artifact, with the group "com.daml"
and the artifact name "ledger-api-proto".
CHANGELOG_END
* release: We don't need the "main-jar" option.
* Bazel: Proto JARs will always have a Maven artifact suffix.
* Bazel: Simplify Protobuf source file TAR and JAR targets.
* Bazel: Extract out Protobuf functions.
* kvutils: Use ScalaPB to generate a Scala JAR for daml_kvutils.proto.
* Bazel: Delete the unused `da_java_binary` rule, and inline `_wrap_rule`.
* Bazel: Factor out Java/Scala protobuf class generation into a helper.
CHANGELOG_BEGIN
CHANGELOG_END
* daml-lf/archive: Use `proto_jars`.
* Bazel: Remove the visibility modifier from `proto_jars`.
It's too confusing. Just make everything public.
* daml-lf/archive: Push protobuf source tarballs into `proto_jars`.
* Bazel: Add comments to the various parts of `proto_jars`.
* daml-assistant: Do unpleasant things with `location` in Bazel.
Addresses security advisory. I upgraded typedoc as well since that
pulls in the older version of highlight.js and I dont like breaking bounds.
changelog_begin
changelog_end
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
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
* daml ledger: add a max-inbound-message-size flag for grpc
This new flag allows to set the maximal accepted inbound message size
when using gRPC to interact with a legger.
CHANGELOG_BEGIN
CHANGELOG_END
* added a test
This PR adds encoders to the various types defined in `@daml/types`. The
serde mechanism did not need one so far because all of the types we're
currently exposing map one-to-one to an appropriate (or, I suppose,
tolerable) JS equivalent. This will not be the case anymore with generic
maps, which means that if we want to provide our users with decent types
(I do), we'll need some real encoding/decoding moving forward.
CHANGELOG_BEGIN
CHANGELOG_END
* Haskell: Add hlint rule to suggest foldl' over foldl
`foldl` is lazy in a way that almost never is what you want since it
can cause space leaks without any benefit. `foldl'` does not have this
problem. See https://www.well-typed.com/blog/2014/04/fixing-foldl/ for
more details.
CHANGELOG_BEGIN
CHANGELOG_END
* Fix all existing occurrences of foldl
CHANGELOG_BEGIN
CHANGELOG_END
* Bump timeouts in build-and-lint’s
We’ve seen some timeouts on CI so let’s bump everything to 100ms and
see if that fixes it. If it doesn’t, we can increase those 100ms as well.
changelog_begin
changelog_end
* Fix race on registering open event
changelog_begin
changelog_end
Fixes#7846.
CHANGELOG_BEGIN
- JavaScript Client Libraries: The family of React hooks `useStream*`
was logging every `close` event as an error. However, there are
legitimate cases for the connection to be closed (e.g. the component has
been unmounted). The default behaviour will now be to log only
unexpected disconnects and be silent on deliberate connection closes. The
behaviour can be customized by passing a `onClose` callback; we
strongly recommend passing such a callback to handle connection errors
gracefully.
CHANGELOG_END
* Amend docs to introduce the concept of DAML Connect
CHANGELOG_BEGIN
CHANGELOG_END
* Slightly change how Sandbox is positioned in the app-arch
* Mention integrated drivers in app arch docs
* Lowercase DAML network
This follows up on #7066 and exposes the new underlying multi-key and
multi-query stream functions through the React bindings. Following the
same reasoning as in #7066, we therefore deprecate the existing
functions (with no intention of removing them) as they become redundant.
CHANGELOG_BEGIN
* JavaScript Client Libraries: Updated React bindings to expose the
recent addition of multi-key and multi-query streams in @daml/ledger.
The singular versions are marked as deprecated as they have become
redundant.
The upgrade path for `useStreamQuery` is very straightforward: the
query factory remains optional, but if specified it should return an
array of queries instead of a single query. The array may be empty,
which will return all contracts for that template (similar as not
passing in a query factory). The return values of `useStreamQuery` and
`useStreamQueries` are the same type.
```
useStreamQuery(T) --> useStreamQueries(T)
useStreamQuery(T, () => query, ...) --> useStreamQueries(T, () => [query], ...)
```
The upgrade path for `useStreamFetchByKey` is only slightly more
involved as the return type of `useStreamFetchByKeys` is a new type
called `FetchByKeysResult` instead of the existing `FetchResult`.
`FetchByKeysResult` differs from `FetchResult` in that it contains a
`contracts` field with an array of contracts instead of a singular
`contract` field. (It differs from `QueryResult` in that each element of
the returned array can also be `null`, if there is no corresponding
active contract.) Call sites can be updated as follows:
```
const {loading, contract} = useStreamFetchByKey(T, () => k, ...);
-->
const {loading, contracts} = useStreamFetchByKeys(T, () => [k], ...));
const contract = contracts[0];
```
CHANGELOG_END
* language: `daml ledger` commands against JSON API
This is the first step in offering the JSON API to run `daml ledger`
commands. First, only the `list-parties` command is implemented. The
other `daml ledger` commands will follow in separate PR's.
CHANGELOG_BEGIN
[Assistant] The `daml ledger list-parties` command can now query the
ledger via the HTTP JSON API instead the gRPC API for known parties on
the ledger.
CHANGELOG_END
* resources: Move builders into //ledger/ledger-resources.
Keep the actual constructors in a trait, but instantiate it when working
with ledger code.
This allows us to later introduce an extra "context" type parameter to
ResourceOwner.
* resources-akka: Move the builders in to //ledger/ledger-resources.
* resources: Introduce an abstract `Context` parameter for owners.
This replaces the concrete `ExecutionContext`. While it _can_ be an
execution context, it really doesn't matter as long as we can get at one
somehow.
This is being introduced so we can wrap the context in a container,
either for type tagging or to include extra information.
Because our current context _is_ `ExecutionContext`, and an implicit is
provided to extract it, we can end up with two ways to get the same
value. We use shadowing to prevent this. This problem should go away in
the near future when a new context type is added.
CHANGELOG_BEGIN
- [Integration Kit] The `ResourceOwner` type is now parameterized by a
`Context`, which is filled in by the corresponding `Context` class in
the _ledger-resources_ dependency. This allows us to pass extra
information through resource acquisition.
CHANGELOG_END
* ledger-resources: Move `ResourceOwner` here from `resources`.
* ledger-resources: Remove dependencies from outside //ledger.
* ledger-resource: Wrap the acquisition execution context in `Context`.
So we can add a logging context to it.
* resources: Pass the Context, not the ExecutionContext, to Resource.
* Avoid importing `HasExecutionContext`.
* ledger-resources: Publish to Maven Central.
* resources: Make the small changes suggested by @stefanobaghino-da.
Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* ledger-resources: Pull out a trait for test resource contexts.
Saves a few lines of code.
* Restore some imports that were accidentally wildcarded.
* resources: Replace an `implicit def` with a couple of imports.
* participant-integration-api: Simplify the JdbcLedgerDaoBackend tests.
Try and use the right execution context where possible.
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* @daml/types: Improve Unit type
tl;dr: If we ever want to fix the `Query<T>` type from `@daml/ledger`,
we need a better definition of `Unit`.
TypeScript's type system may not be particularly sound, but the type
`{}` still sticks out as being a very special mess. I _think_ it is
something along the lines of
```typescript
type {} = Exclude<object, null> | string | number | boolean;
```
It is definitely not the type of all records or the type of only the
empty record.
I think it is reasonable to expect that the type relation defined by
```typescrupt
type Equiv<T, U> = T extends U ? U extends T ? true : false : false;
```
is extensional equality of types. Unfortunately, it isn't. For
instance, we have
```typescript
Equiv<{}, {[key: string]: string}> == true
```
but the value `{x: 1}` is assignable to type `{}` but not to type
`{[key: string]: string}`.
The type defined by the interface
```typescript
interface Unit {}
```
is a similarly hot mess as the type `{}`. Although they might seem to
be the same, particularly since we have
```typescript
Equiv<{}, Unit> == true and Equiv<Unit, {}> == true
```
here's a way to tell them apart:
```typescript
Equiv<Unit, {[key: string]: string}> == false
```
Thus, I would say the `Unit` type is mildly saner than the `{}` type.
Why does this matter? If we ever want to fix the query `Query<T>` type,
we need to be able to tell the unit type and `TextMap<_>` apart on the
type level. As demonstrated above, this seems impossible if we use `{}`
as the unit type but it is possible if we use the `Unit` type defined
above as the unit type.
Since I couldn't find a single value that is assignable to only one of
`{}` and `Unit` but not the other, this change should not break
anything at all. That said, I'll refrain from a changelog entry.
CHANGELOG_BEGIN
CHANGELOG_END
* Make eslint happy
CHANGELOG_BEGIN
CHANGELOG_END
* add silent_annotations option to da scala bazel functions
* use silent_annotations for several scala targets
* use silencer_plugin instead when the lib isn't used
* use silent_annotations for several more scala targets
* use silencer_lib for strange indirect requirement for running tests
* no changelog
CHANGELOG_BEGIN
CHANGELOG_END
* silent_annotations support for scaladoc
* react: let user specify reconnectThreshold
Requested by a user on [the forum].
[the forum]: https://discuss.daml.com/t/usestreamquery-disconnecting/1325
CHANGELOG_BEGIN
* JavaScript Client Libraries: Users of the React wrapper can now
specify the `reconnectThreshold` parameter of the underlying Ledger
through LedgerProps. This adds an optional attribute to the
LedgerProps type, so existing code does not need any change to keep
working as before (i.e. using the default 30s value).
CHANGELOG_END
* add test
As requested on [the forum].
[the forum]:
https://discuss.daml.com/t/usestreamquery-disconnecting/1325
CHANGELOG_BEGIN
* JavaScript Client Libraries: `useStreamQuery` and
`useStreamFetchByKey` now accept an optional `closeHandler` callback,
which will be called if the underlying WebSocket connection fails.
CHANGELOG_END
A user has [asked on the forum] how their application could handle
WebSocket errors. The unfortunate response at the moment is that they
can't: our React bindings will just spit out an error log, and that's
it. The current code seems to just assume the stream will eventually
reconnect, but the underlying stream does stop trying if it fails two
times in a row faster than `reconnectThreshold`.
[asked on the forum]: https://discuss.daml.com/t/usestreamquery-disconnecting/1325
In trying to address this, and with the context of at some point
expanding the React bindings to the multi-{key,query} API, I realized
that, given the current structure of the code, I might end up having to
solve this issue four times, so I decided to first factor out the stream
handling logic in the existing code, and I believe this makes sense as a
separate PR.
I should note, however, that this is _not_ a refactoring: as indicated
by the amended tests, this PR actually changes the behaviour of
`useStreamFetchByKey`. I believe this counts as a bugfix, but welcome
any pointer as to why the behaviours of `useStreamQuery` and
`useStreamFetchByKey` should differ with respect to the `live` event.
CHANGELOG_BEGIN
* JavaScript Client Libraries: fix a bug where the `useStreamFetchByKey`
hook would, in some circumstances, report a "ready" state (i.e.
`loading: false`) even though the underlying connection had not yet been
fully established.
CHANGELOG_END
* Fix Numeric encoding and decoding in Scala bindings
fixes#7474
There are a few issues here:
1. We used toString which produces an exponential notation in some
cases which is not supported by the ledger API.
2. On the other hand, we used BigDecimal.exact for decoding which
isn’t completely wrong but more lax than what the ledger API supports
1 and 2 are fixed by switching to the respective functions in
daml-lf/data
3. The tests in ValueSpec were never executed! The tests are split
into a scala_library and a scala_test_suite and ValueSpec ended up in
the library. I’ve split out the utilities from the actual code.
4. The generator for Numeric produced things that are not valid
numerics (e.g. 92233720368547758070000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
showed up in one test) which now fails with the more strict requirements.
changelog_begin
changelog_end
* Apply suggestions from code review
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* Address review feedback
changelog_begin
changelog_end
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
With the introduction of the standalone JAR, we cannot rely on the
assistant anymore to pass the default logback config. Users can still
override the logback config with `-Dlogback.configurationFile` if they
need something else but this provides a more sensible default logging
config than seeing a ton of debug logs from netty.
changelog_begin
changelog_end
The notion of `close` on `Stream` seems a bit confused at the moment. As
the code stands (without this PR), if you register a listener for
`'close'` events, you get notified when the underlying WebSocket closes
(even though the stream will then try to open a new one and, if it
manages to reconnect, will keep sending `'change'` events), and you do
not get notified when the stream itself gets closed (by calling
`.close()` on it), because the code in `.close()` removes the listeners
before closing the WebSocket connection, and so also before trying to
send a message to `'close'` listeners. Further, calling `.close()` also
does not seem to work as expected, or at least as I would expect: it
will remove all listeners and close the WebSocket connection, but then
it will immediately open it up again (provided that `reconnectThreshold`
milliseconds have elapsed since the WS was last opened), leaking an open
WebSocket connection.
As part of the same confusion, the current implementation also expects
`'close'` listeners on the stream to receive a WebSocket close event, i.e.
of the form `{code, reason}`.
This PR changes the behaviour such that listeners on the _stream_
`'close'` event:
* do not get notified if the WS connection drops but manages to
reconnect.
* do get notified if the stream closes due to a connection error we
cannot recover from, with a `4001` status code.
* do get notified if the stream is closed by calling the `.close()`
method, with a `4000` status code.
This PR also changes the WS termination logic such that calling the
`.close()` method on the stream actually closes the underlying WebSocket
connection.
CHANGELOG_BEGIN
* JavaScript Client Libraries: fix a bug where, upon closing a stream,
the underlying WebSocket connection may not be properly closed.
CHANGELOG_END
This is an attempt to address #7034 & #7036. Strictly speaking, this
does not match their acceptance criteria, as this only supports multiple
queries, not mixed templates.
Because the two new functions can cover the exact same use cases (and
more) as the existing `streamQuery` and `streamFetchByKey`, the latter
are deprecated. The deprecation cycle I suggest is to deprecate them
immediately by annotating them as such in the documentation (done on
this PR).
That's it. I do not think we ever need to actually remove them, nor to
make them print annoying warnings or anything. There is nothing wrong
with the functions as they stand, they just don't fit in the API
anymore.
We could, at some point, move them to a separate documentation page, or
to the boottm of the existing one, but I feel even removing them from
the documentation is unnecessary.
CHANGELOG_BEGIN
- [JavaScript Client Libraries] Two new methods have been added to
`daml-ledger`: `streamQueries` and `streamFetchByKeys`. They are
similar to the existing singular versions, except they can take
multiple queries and multiple keys, respectively, and return a union
of what the corresponding individual queries/keys would have. Because
these new functions can do everything the existing ones can, we are
deprecating the latter, though there is no plan to remove them.
Upgrade path is straightforward:
```
streamQuery(t); => streamQueries(t, []);
streamQuery(t, undefined); => streamQueries(t, []);
streamQuery(t, q); => streamQueries(t, [q]);
streamFetchByKey(t, k); => streamFetchByKey(t, [k]);
```
There is one caveat, though: `streamFetchByKeys` is a little bit less
lenient in the format in which it expects the key. If your existing
code was conforming to the generated TypeScript code we provide,
everything should keep working, but if you were using plain JS or
bypassing the TS type system, it is possible that you used to
construct keys that will no longer be accepted. The new function
requires all keys to be given in the _output_ format of the JSON API,
which is a little bit more strict than the general JSON <-> LF
conversion rules.
CHANGELOG_END
* ledger-api-client: Add integration tests for the simple stuff.
* sandbox-common: Make `SandboxFixtureWithAuth` a mixin.
This makes it useful with `SandboxNextFixture` as well as
`SandboxFixture`.
Also, add types to non-private fields and methods, and make more fields
protected rather than public.
* ledger-api-client: Add tests to make sure the token is passed through.
CHANGELOG_BEGIN
CHANGELOG_END
* sandbox-common: Tokens are for auth, not auth.
The issue in #6940 has been fixed so in theory this should no longer
fail or at least fail with a different error that we haven’t seen yet
:)
changelog_begin
changelog_end
* Add a useFetch.
CHANGELOG_BEGIN
Add a useFetch hook to the @daml/react bindings for when the user knows
a contractId.
CHANGELOG_END
* Update language-support/ts/daml-react/defaultLedgerContext.ts
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
We allow the `offset` field of a websocket message send in response to a
`streamQuery` request to be `null`. Previously this would cause an
exception to be thrown.
CHANGELOG_BEGIN
CHANGELOG_END
Unfortunately, we still have an error that's cropping up fairly
persistently. While we know what the problem is, until this is fixed,
I'd like to mark the tests as `flaky` to make sure that other builds
aren't held up.
CHANGELOG_BEGIN
CHANGELOG_END
I have to imagine this is a typo: there currently is no way to
unsubscribe from a stream without closing it, as the `off` method we
expose actually redirects to an `on` method internally, which means that
instead of the method no longer being called, it now gets called twice
(or rather, one more time) on each event.
That seems a bit rude.
CHANGELOG_BEGIN
- [JavaScript Client Libraries] Bugfix: calling the `off` method of
event streams returned by `streamQuery` and `streamFetchByKey` now
correctly removes the given listener, rather than adding it again.
CHANGELOG_END
* add -Ywarn-unused to all scalac options
* remove some unused arguments
* remove some unused definitions
* remove some unused variable names
* suppress some unused variable names
* changeExtension doesn't use baseName
* no changelog
CHANGELOG_BEGIN
CHANGELOG_END
* work around no plugins in scenario interpreter perf tests
* remove many more unused things
* remove more unused things, restore some used things
* remove more unused things, restore a couple signature mistakes
* missed import
* unused argument
* remove more unused loggingContexts
* some unused code in triggers
* some unused code in sandbox and kvutils
* some unused code in repl-service and daml-script
* some unused code in bindings-rxjava tests
* some unused code in triggers runner
* more comments on silent usages
- suggested by @cocreature; thanks
* fix missing reference in TestCommands
* more unused in triggers
* more unused in sandbox
* more unused in daml-script
* more unused in ledger-client tests
* more unused in triggers
* more unused in kvutils
* more unused in daml-script
* more unused in sandbox
* remove unused in ledger-api-test-tool
* suppress final special case for codegen unused warnings
.../com/daml/sample/mymain/ContractIdNT.scala:24: warning: parameter value ev 0 in method ContractIdNT Value is never used
implicit def `ContractIdNT Value`[a_a1dk](implicit `ev 0`: ` lfdomainapi`.Value[a_a1dk]): ` lfdomainapi`.Value[_root_.com.daml.sample.MyMain.ContractIdNT[a_a1dk]] = {
^
.../com/daml/sample/mymain/ContractIdNT.scala:41: warning: parameter value eva_a1dk in method ContractIdNT LfEncodable is never used
implicit def `ContractIdNT LfEncodable`[a_a1dk](implicit eva_a1dk: ` lfdomainapi`.encoding.LfEncodable[a_a1dk]): ` lfdomainapi`.encoding.LfEncodable[_root_.com.daml.sample.MyMain.ContractIdNT[a_a1dk]] = {
^
* one more unused in daml-script
* special scaladoc rules may need silencer, too
* unused in compatibility/sandbox-migration
* more commas, a different way to `find`
- suggested by @remyhaemmerle-da; thanks
* help Scala codegen output by passing actor along
* don't generate unused ` view` variables
* macroexpansion replaces _ with a variable name; avoid this
* be explicit about scope of generated PackageIDs object, to avoid warning
* remove silent annotations, which aren't used yet
CHANGELOG_BEGIN
CHANGELOG_END
* Factor out tar/gzip reproducibility flags
* use mktgz in package-app
* Bazel managed tar/gzip
* Remove quiet = True
As stated in the comment this is no longer required with Bazel >= 3.0.
* Build package-app as a sh_binary
This way Bazel will manage the runtime dependencies tar, gzip, mktgz,
and patchelf.
package-app.sh changes directory so it needs to make sure that all paths
are absolute and that the runfiles tree/manifest location is forwarded
to programs called by package-app.sh.
* Avoid file path too long errors
* Fix readlink -f on MacOS
* Document abspath
changelog_begin
changelog_end
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
* Use Bazel builtin pkg_tar rule
* Use @rules_pkg//:pkg.bzl%pkg_tar
The pkg_tar rule builtin to Bazel has been deprecated.
See https://docs.bazel.build/versions/master/be/pkg.html
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
* add -Xlint:doc-detached
- reverts 1feae964e3 from #6798
* attach several scaladocs where they'll actually be included
* no changelog
* attach several more scaladocs where they'll actually be included
* no changelog
CHANGELOG_BEGIN
CHANGELOG_END
This fixes 3 issues:
1. Switch the order in which we assign to `$proc` and
`waitOn`. Without this the cleanup will not do anthing if `beforeAll`
fails since the variable has not been assigned. This results in jest
hanging forever until we hit the Bazel timeout.
2. Increase the timeout on `beforeAll` since we occasionally hit this
on CI.
3. Allocate 2 CPUs to reflect the number of resources required by this test.
changelog_begin
changelog_end
We currently use two different mechanisms for breaking loops in the
`Serializable` companion objects generated for each type:
1. Explicit thunks of the form `() => Decoder<A>`, e.g., in the
definition of the `Serializable` interface itself.
2. the `lazyMemo` combinator, e.g. in enum types, `Optional`s and lists.
This is inconsistent and leads to the introduction of more loop
breakers than actually needed.
This PR changes the situation to use the `lazyMemo` combinator as the
only loop breaker. To this end, we change the definition of the
`Serializable` interface and related similar interfaces to use `Decoder`
directly rather than the thunked up version. This is a *breaking change*
of the affected interfaces. However, the libraries `@daml/ledger` and
`@daml/react` are updated accordingly and hence nothing breaks when
using `daml2js` in combination with these libraries. Furthermore, the
exact definition of the decoder types is considered an implementation
detail since we don't want to tie ourselves long-term to the use of the
`json-type-validation` library, which is mostly unmaintained.
Using `lazy` as the only loop breaker effectively pushes all loop
breakers to the top-level and allows for removing those nested more
deeply in types.
This change should not negatively impact the performance of the
decoding process since it only replaces thunks by memoized thunks and
removes a few calls to `lazyMemo` completely. In fact, we should gain
performance since the decoders in the companion objects are now
memoized.
CHANGELOG_BEGIN
CHANGELOG_END
Currently, if you have a record type `T` with a field of type, say,
`Optional S` and you're decoding a list of type `[T]`, then the decoder
for `S` has to be reconstructed for each element of the list. This is
because the `lazy` combinator from the `json-type-validation` does not
memoize the decoder it receives as a thunk.
This PR adds a new combinator `lazyMemo` which behaves like `lazy` but
also memoizes the decoder on its first invocation. All use sites of the
old `lazy` combinator are then replaced with `lazyMemo`.
We could consider upstreaming `lazyMemo` but I'm not sure how much
effort this is given that `json-type-validation` seems to be in
maintenance mode rather than active development.
CHANGELOG_BEGIN
CHANGELOG_END
Not quite sure why this didn’t fail on the PR but now it complains
that the version of @bazel/typescript and rules_nodejs are
incompatible.
changelog_begin
changelog_end
Currently, the decoders for the container types `List` and `TextMap` use
`jtv.lazy` _within_ their container decoders `jtv.array` and `jtv.dict`.
Since `jtv.lazy` does not memoize its result, this has the disadvantage
that the thunk producing the decoder for the element type is invoked
for each element of the container rather than once for the whole
container. This is a potential performance bottleneck.
This PR moves the use of `jtv.lazy` one level further out in oder to
avoid the potential performance issues without adding any further
downsides.
CHANGELOG_BEGIN
CHANGELOG_END
* Extend `daml new` to accept template as an option
The two positional arguments keep confusing users so this PR changes
things to allow the template to be passed via `--template`. Using a
positional argument still works so this is not breaking.
I’ve updated all docs to use the less confusing syntax.
changelog_begin
- [DAML Assistant] You can now use ``daml new project-name
--template=template-name`` instead of ``daml new project-name
template-name``. The old CLI syntax continues to be supported.
changelog_end
* Update docs/source/getting-started/index.rst
Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
I think testing that constructing the decoders doesn't loop deserves
its own very targeted test on top of the more intergration style test
we already have.
CHANGELOG_BEGIN
CHANGELOG_END
* daml-on-sql: Pull out a new `Main` object that wraps sandbox-classic.
CHANGELOG_BEGIN
CHANGELOG_END
* daml-on-sql: Fail if a JDBC URL is not provided or not for PostgreSQL.
* sandbox-classic: Rename the conformance test H2 database.
* daml-on-sql + sandbox-classic: Report configuration errors cleanly.
This means letting `ProgramResource` catch the errors, log, and exit.
* daml-on-sql: Change the name logged on startup.
* daml-on-sql: Change the default participant ID.
* sandbox-common: Give the ledger name its own tagged string type.
* sandbox-classic: Generate random ledger IDs using the ledger name.
* daml-on-sql: Remove the banner, replacing it with a blank line.
* daml-on-sql: Enable strong seeding by default.
And weak seeding in the conformance tests.
* sandbox-classic: Move the ledger name to a separate parameter.
It's not really configurable.
* sandbox-classic: Move LedgerName from sandbox-common.
* daml-on-sql: Remove "-participant" from the participant ID.
* daml-on-sql: Use `Name` where possible.
* daml-on-sql: Make the ledger ID mandatory.
* Revert "sandbox-classic: Move LedgerName from sandbox-common."
This reverts commit 0dad1584a7.
* daml-on-sql: Print "DAML-on-SQL" in the CLI help, not "Sandbox".
* daml-on-sql + sandbox + sandbox-classic: Split out custom CLI parsing. (#6846)
* participant-state: Simplify naming the seeding modes.
The examples and the comment are hopefully obvious enough. Builtin
types can also produce terminating recursion so we need to make them
lazy.
changelog_begin
- [@daml/daml-types library] Fix an issue where some recursive types
resulted in a stackoverflow.
changelog_end
This PR bumps the akka request timeout in the JSON API which we hit
occasionally in the tests which leads to a 503 error
and the tests timing out.
In addition to bumping the timeout, I’ve also changed the logback file
of the JSON API so we don’t get tons and tons of netty debugging
output and updated the token format since the JSON API warns about the
outdated one.
changelog_begin
changelog_end
* sandbox-common: Move the ledgerIdMode up in the configuration.
* sandbox-classic: Move the configuration from sandbox-common.
CHANGELOG_BEGIN
CHANGELOG_END
* Fix miscellaneous warnings caught by IntelliJ IDEA.
* set many extra scalac -Xlint options for all Scala projects
CHANGELOG_BEGIN
CHANGELOG_END
* move NoCopy to its own file
package.scala:18: warning: it is not recommended to define classes/objects inside of package objects.
If possible, define trait NoCopy in package data instead.
trait NoCopy {
^
* move more traits, classes, and objects to proper packages
- note that `package` is itself a scoping construct, so if your reason
is the apparent aesthetic of placing a bunch of things in one `package
object`, that is easily remedied by deleting the `object` keyword
* fix some type-parameter-shadow warnings
- I'm generally in favor of sensible name-shadowing, following the
"deliberately hide variables that should not be accessed here" school
of thought. But I think type name shadowing isn't quite as valuable
and more likely to confuse than general variable shadowing, so have
experimentally linted it out.
Example warning:
EventsTableFlatEventsRangeQueries.scala:11: warning: type parameter
Offset defined in trait EventsTableFlatEventsRangeQueries shadows class
Offset defined in package v1. You may want to rename your type
parameter, or possibly remove it.
private[events] sealed trait EventsTableFlatEventsRangeQueries[Offset] {
^
* fix more package-object-classes warnings
* fix an inaccessible warning
ContractsService.scala:197: warning: method searchDb in class ContractsService references private class ContractsFetch.
Classes which cannot access ContractsFetch may be unable to override searchDb.
def searchDb(dao: dbbackend.ContractDao, fetch: ContractsFetch)(
^
* enable -Xlint:infer-any
- continuing the saga of #6116, #6132
* enable -explaintypes for more detailed type errors
* missed header for NoCopy; probably should have left it in the package file
* misspelling in comment
* revert -Xlint:doc-detached
- there are a lot of these fixes, and they are noisy, so shifting to a
separate PR
- thanks to @leo-da for pointing out
* Move public code into daml-integration-api
CHANGELOG_BEGIN
[DAML Integration Kit]: Removed sandbox specific code from the API intended to be used by ledger integrations. Use the maven coordinates ``com.daml:participant-integration-api:VERSION`` instead of ``com.daml:ledger-api-server`` or ``com.daml:sandbox``.
CHANGELOG_END
lodash released a non-broken version now and while dependabot isn’t
smart enough to realize this one has a vulnerability it still seems
like a good idea to bump it.
changelog_begin
changelog_end