* Participant pruning ledger api server support ported from Canton
CHANGELOG_BEGIN
- [Ledger API]: The preview of `ParticipantPruningService` enables ledger participants to prune the "front" of ledger state at the participant including the ledger api server index.
CHANGELOG_END
* Review feedback from Stefano
* Add pruning tests plus missed command completions change
* Review feedback from Robert
* Improved test readability by having populate helper return offsets
* Review feedback
* Ledger api changes to pruning api and disable canton pruning test
- Change return result to PruneResponse
- Change type of PruneRequest.prune_up_to to string
* Review feedback: Use ApiOffsetSConverter for logged offsets
* kvutils/tools: Fix the integrity checker so it compares state updates.
Previously, it would always take the list of updates _before_ processing
the import, leading to this useless check:
Comparing expected and actual state updates.
Successfully compared 0 state updates.
This makes the snapshotting lazy (by using a function instead of a
value), ensuring we actually perform the assertion.
CHANGELOG_BEGIN
CHANGELOG_END
* kvutils/tools: Add a test for the state updates regression.
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
Add a description of how to enable LaTeX input mode when editing the
DAML-LF spec in VS Code. Also add some additional symbols.
CHANGELOG_BEGIN
CHANGELOG_END
* Test and fix Conversions#encodeBlindingInfo
* Fix rebase
* Read and prefer pre-computed blinding info when decoding KV transaction log entries
CHANGELOG_BEGIN
CHANGELOG_END
* Fix rebase
* Tidy up
* Tidy up
* Fill DamlTransactionEntry#bindingInfo during TransactionCommitter#blind
CHANGELOG_BEGIN
CHANGELOG_END
* Test and fix Conversions#encodeBlindingInfo
* Fix rebase
* Fix non-determinism
* Reduce visibility
* Tidy up
* Do not backpressure from the command tracker output to the submission flow.
This is required to meet the contract of CommandClient.trackCommandsUnbounded, which allows for submitting an unbounded number of commands.
This is in turn required to use CommandClient.trackCommandsUnbounded as part of a flow that retries (some of the) failed command submissions.
CHANGELOG_BEGIN
CHANGELOG_END
* Revert "Do not backpressure from the command tracker output to the submission flow. This is required to meet the contract of CommandClient.trackCommandsUnbounded, which allows for submitting an unbounded number of commands. This is in turn required to use CommandClient.trackCommandsUnbounded as part of a flow that retries (some of the) failed command submissions."
This reverts commit 20c0b8e3
* Adding a disclaimer to the CommandClient so that users are not totally surprised about unexpected backpressure.
* concretize item on "serving the API"
CHANGELOG_BEGIN
CHANGELOG_END
* Revert "concretize item on "serving the API""
This reverts commit 83e35114c4.
* change authentication to authorization
* remove "etc." to make item clearer
Some features, in particular daml-lf encoding features, don't make any sense to have an associated CPP flag. I made the CPP flag optional and removed these unnecessary feature flags (based mostly on whether the flags were used in the standard library).
changelog_begin
changelog_end
fixes#7978
There is no new test in the trigger service since the existing test
for the custom application id already hits this. The difference is
that now the test authorization server will produce a token with the
application id set to what we request rather than the wildcard token
we used before.
changelog_begin
changelog_end
* Minor improvements to getting started doc
* add empty changelog
changelog_begin
changelog_end
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
akka-http gets a bit unhappy if you block within requests and we also
use the unsafeToFuture in the JSON API so it seems sensible to do the
same in both.
I’ve moved out the initDb option out of the Server actor both because
it seemed cleaner than calling sys.exit in the actor and because it
was annoying to fit it in.
changelog_begin
changelog_end
* Adapt to new desugaring for choice observers.
update hash of ghc patch.
changelog_begin
changelog_end
update ghc patch to final version
update stack-snapshot hashes for ghc-lib(-parser)
update stackage_snapshot.json, following `bazel run @stackage-unpinned//:pin`
expose Optional constructors for desugared code to use
adapt LFConversion to expect a 4-tuple for a desugared choice def/sig
update LFConversion for choice-observers
first example using new choice observer syntax.
fix scala type checker to have correct scoping rules for choice-observers
remove comment from example which says it is broken
improve variable names
improve tests for choice-observer clause
only test choice-observers SINCE 1.dev
add jq queries for choice observeres
make positive statement in jq test which checks choice obserers are present
test behaviour of choice observers
squash me
typo
* test more choice-observer divulgence
* Update documention for choice observers.
changelog_begin
Support choice observers in 1.dev
changelog_end
* fix docs build
* fix daml docs choice-observers example
* address comments: rewording text
* annotate choices observers as early-access in documention
* split out documentation code-snippets which require --target=1.dev
* final tweaks to documentation text
* Rewrite multiple binding lets sequentially.
This PR enforces a sequential evaluation and dependency on
multiple-binding lets, by rewriting,
let x1 = e1
x2 = e2
...
xn = en
in b
Into a chain of single-binding let expressions,
let x1 = e1 in
let x2 = e2 in
...
let xn = en in
b
And likewise, rewriting multi-binding let statements in a "do" block,
do
...
let x1 = e1
x2 = e2
...
xn = en
...
Into single-binding let statements,
do
...
let x1 = e1
let x2 = e2
...
let xn = en
...
This PR fixes#6788 and adds a bunch of tests.
This is a bugfix, but it may break existing code that relies on
out-of-order let bindings. The suggested fix is to simply reorder
the let bindings, placing them in order of their dependency.
CHANGELOG_BEGIN
- [DAML Compiler] The DAML compiler now enforces sequential
ordering for ``let`` expressions with multiple bindings.
This fixes a bug where ``let`` expressions would be evaluated
in the wrong order.
CHANGELOG_END
* Update compiler/damlc/daml-preprocessor/src/DA/Daml/Preprocessor.hs
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* adjust last binding behavior
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
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
This makes the test a lot faster, not just because we don't restart the
Sandbox, but because we don't restart PostgreSQL either.
CHANGELOG_BEGIN
CHANGELOG_END
@garyverhaegen-da is taking care of 1.8.0-snapshot.20201117.5661.0.76fae40c (#7994), so they get pushed back to the end of the line.
Please do not merge this before #7994.
CHANGELOG_BEGIN
CHANGELOG_END
Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
* extractor: Use pattern matching to get better error messages.
If the gRPC exception status is not the one we expect, this will ensure
that we log the entire exception and not just the status.
CHANGELOG_BEGIN
CHANGELOG_END
* extractor: Make VeryLargeArchiveSpec an async spec.
* DAML-LF: Add interning for type to DAML-LF 1.dev
We add two new features to DAML-LF 1.dev:
* a per package list (or table) of `Type` messages, and
* a new case in the `Type` message which is an index into this table.
In combination, these two features can be used to allow DAML-LF
encoders to perform hash-consing of `Type` messages. We also change the
Haskell implementation of our DAML-LF encoder to do exactly that when
targetting DAML-LF 1.dev.
Doing this has a few benefits:
1. The DALFs produced by `damlc` get smaller: I've seen a case where
the size dropped from 69MB to 45MB.
2. DAML-LF decoders need to decode less data.
3. Decoded packages use less memory because identical structures are
now shared. This is particularly helpful in situations where we need
to keep the interface (or signature) of a package in memory for a
long time.
This PR mostly takes care of the Haskell implementation. However, we
need to make the Scala implementation of the decoder aware of the new
features as well since we have tests that load DAML-LF 1.dev into the
engine. A decoder and _targeted_ tests on the Scala side will follow
in a separate PR.
CHANGELOG_BEGIN
CHANGELOG_END
* Make jq tests aware of type interning
CHANGELOG_BEGIN
CHANGELOG_END
* Improve jq test
CHANGELOG_BEGIN
CHANGELOG_END
* Apply Remy's suggestions
Co-authored-by: Remy <remy.haemmerle@daml.com>
* Improve the imperative bits
CHANGELOG_BEGIN
CHANGELOG_END
Co-authored-by: Remy <remy.haemmerle@daml.com>
* test-common: Make FiniteStreamObserver more lenient.
We can't protect against all possible race conditions; we just have to
accept that sometimes `onNext` will be called after `onCompleted`, or
`onCompleted` will be called twice, or…
CHANGELOG_BEGIN
CHANGELOG_END
* test-common: Avoid calling `onCompleted` twice in `TimeBoundObserver`.
* Add to indexer updates and prefer optional blinding info
CHANGELOG_BEGIN
CHANGELOG_END
* Formatting
* Relax adherence to Scala naming convention for better readability
* resources: Release sequenced resources in parallel.
This isn't used much, but has been bothering me for a while. While we
acquire the resources in parallel, we used to release them sequentially.
This reimplements `sequence` so they're released all at once.
CHANGELOG_BEGIN
CHANGELOG_END
* resources: Drop an unnecessary `.map`.
* resources: Fix the Scaladoc for `sequence`.
This PR has been created by a script, which is not very smart and does not have all the context. Please do double-check that the version prefix is correct before merging.
@garyverhaegen-da is in charge of this release.
CHANGELOG_BEGIN
CHANGELOG_END
Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
This fixes the following bug:
1. The command tracker is closed as part of the command service.
2. The dispatcher is closed.
3. The command tracker accesses the dispatcher, resulting in an exception ("Dispatcher is closed").
CHANGELOG_BEGIN
Avoid error message "Dispatcher is closed" on shutdown.
CHANGELOG_END
* Suppress debug and trace logging for Sandbox tests.
* participant-integration-api: Don't submit config after shutting down.
* sandbox: When testing the reset service, wait for the ledger config.
If we don't wait for the ledger configuration, we could potentially ask
for completions before the server is fully ready.
* sandbox-common: Reduce the number of reset attempts in testing.
Now we're also checking for ledger configuration, the time for a reset
to be "accepted" is longer, so 5 tries in 30 seconds is a bit flaky.
Reducing to 4 seems reasonable.
* sandbox: Stop marking the reset service tests as flaky.
I don't have conclusive proof that they're no longer flaky, but I'm
fairly confident. We can revert this commit if they turn out to still
need some attention.
CHANGELOG_BEGIN
CHANGELOG_END
* sandbox-common: Check the configuration shows up in reset service tests.
* sandbox-common: Factor out logback-test.xml.
This is to reduce the likelyhood of these tests timint out. Bazel will
generate a dedicated test target per `.scala` file. Meaning the tests
can run in parallel and each test target should have a shorter overall
runtime.
changelog_begin
changelog_end
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
* Obtain refresh token from Auth0
Auth0 requires the `offline_access` scope to be set to return a refresh
token.
See https://auth0.com/docs/tokens/refresh-tokens/get-refresh-tokens
Additionally, the `audience` claim needs to be set to obtain a JWT
access token and a refresh token.
See https://auth0.com/docs/tokens/refresh-tokens
changelog_begin
changelog_end
* Implement refresh endpoint on auth middleware
Following the refresh spec [1] and Auth0 documentation [2].
[1]: https://tools.ietf.org/html/rfc6749#section-6
[2]: https://auth0.com/docs/tokens/refresh-tokens/use-refresh-tokens
* Adapt Auth0 example configuration
Ignore any requests outside the ledger-api audience.
Don't throw on missing query fields. Otherwise the unhandled exception
would prevent unrelated requests from succeeding. E.g. token refresh
requests would always fail.
* Forward unauthorized/forbidden response on refresh
* re-use precomputed token payload
* Implement token refresh in auth test server
Reuses the association between authorization code and token payload to
associate refresh tokens and token payload.
Adds an expiry to the generated token to make tokens distinguishable
across refresh.
* obtain refresh token in test client
* Test auth server refresh token
* auth test server clock configurable
The clock used to define token expiry is configurable
* Override default clock in test fixture
* implement an adjustable clock
* Test token refresh with adjustable clock
* Test token expiry on /auth backend
* Test case for auth middleware /refresh endpoint
* handle malformed code/refresh token in auth server
* Forward client errors on middleware refresh
* Test middleware refresh failure
* Clarify meaning of offline accesss
* Remove redundant testing only comment
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
changelog_begin
changelog_end
typos
undo change to old instructions
test & fix new instructions
remove old instructions
rename new instructions
copyright at top
remove update date from text
tee when running example
instruct to make initial build
* Make application ID configurable in trigger service
fixes#7671
changelog_begin
- [Trigger Service] The application id used by a trigger can now be
configured by an optional `applicationId` in the start request.
changelog_end
* Update triggers/service/src/main/scala/com/digitalasset/daml/lf/engine/trigger/Server.scala
Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
Previously we didn’t build up the `OneAnd[Set, Party]` properly and
included the one party in the set as well. This was an issue if you
have the same party multiple times, most likely in readAs and
actAs (but not limited to that). This then lead to SQL queries failing
since we tried to insert twice for a given party. This PR fixes that
by properly deduplicating the parties and adding a test for this.
changelog_begin
- [JSON API] Fix a regression introduced in SDK 1.7.0, where using a
party multiple times in the same JWT token (e.g., readAs and actAs)
broke database queries for that party. Note that there is never a
reason to include a party multiple times since actAs implies readAs.
changelog_end