This change adds a simple retry logic to the ledger websocket methods.
If the connection is closed, and the connection was previously healthy,
meaning it was live and running for more than 30 seconds, we try to
reconnect to the stream.
CHANGELOG_BEGIN
CHANGELOG_END
pgp.keyserver.io seems to have lost our key
somehow. pool.sks-keyservers.net is the pool that includes the MIT gpg
keyserver and others so hopefully it is somewhat reliable.
changelog_begin
changelog_end
* Diff with messaging feature and some noise manually removed
* Bazel target to use patch file in other build targets
* Patch file as data dep for integration tests
* Attempt to patch and test messaging feature in create-daml-app test
changelog_begin
changelog_end
* Use exports_files instead of filegroup
* Remove file existence checks that don't make sense
* Add patch to dev_env and reference it from integration tests
* Include patch on windows for later
* Set up yarn env again after codegen
* Restore file check
* Fix typo in comment on util function
* Add Tasty steps to make process explicit
* Use messaging patch for code snippets in GSG
* Use messaging code from template instead of copy
* Remove copied message code
* Refactor script to copy template code with messaging patch
* No need to retry second yarn install (only local deps should be updated)
* Used `daml codegen java` instead of calling the codegen from maven
This should hopefully fix the issues with mismatched versions of
slf4j.
changelog_begin
changelog_end
* Move config to daml.yaml
* Remove alternative invocation via maven from docs
We started serving the LedgerAPI from the new schema in #5104, #5305, #5346,
and #5397.
We must therefore also add a migration that moves the data from
ledger_entries to the new tables.
To keep the migration relatively stable with respect to refactoring the
code, I copied a bunch of files to
`db.migration.postgres.v25_backfill_participant_events`.
As a bonus, I added a line to logback.xml so that we get the usual
sandbox output on startup.
CHANGELOG_BEGIN
CHANGELOG_END
* participant_contracts write path
Writes contracts alongside events for interpretation and validation.
changelog_begin
changelog_end
* Fix self-referencing foreign key
* Address https://github.com/digital-asset/daml/pull/5522#discussion_r406289145
* Compute divulgence only if necessary
* Do not attempt at persisting witnesses for transient contracts
* Drop new tables when resetting
* Fix unstableSplitOn
unstableSplitOn is supposed to behave like splitOn but fast™ but it
didn’t live up to that promise for a few reasons:
1. Java’s split method by default drops empty strings at the
end. Passing a second negative parameter avoids that.
2. Java’s split method does regex splitting so we need to quote the
string.
3. Java’s split method splits on an empty pattern whereas we want to
simply preserve the input.
I’ve added regression tests for this and for unstableDrop and a few
other functions while I was at it.
changelog_begin
changelog_end
* Update compiler/damlc/tests/daml-test-files/UnstableText.daml
Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>
Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
* sandbox: Time command execution.
* sandbox: Tiny cleanups in StoreBackedCommandExecutor.
* sandbox: Add metrics for fetching within execution.
CHANGELOG_BEGIN
- [Ledger API Server] Add metrics under "daml.execution" to measure
command execution time, and fetching within command execution.
CHANGELOG_END
* sandbox: Revert the ApiSubmissionService metric prefix.
It can be private again.
* sandbox: Record a mark on a meter on command execution retries.
* Haskell: Add assertFileExists to DA.Test.Util
This PR adds a helper function `assertFileExists` that captures the
`doesFileExist ... >>= assertBool ...` pattern that is very common in
our Haskell test suites. It also adds the inverse
`assertFileDoesNotExist` function. Both functions are now used where
appropriate.
CHANGELOG_BEGIN
CHANGELOG_END
* Add directory dependency to test-util lib
CHANGELOG_BEGIN
CHANGELOG_END
This is a spin off from the work for making module prefixing
work. There I wanted to be able to use the `GeneratePackageMap` rule
to get access to the modules in an LF package which requires to be in
an Action rather than in IO.
This resulted in a much larger refactoring than I expected, so here is
a list of changes to ease review:
1. I’ve split off Development/IDE/Core/RuleTypes/Daml.hs into its own
Bazel targets to avoid cycles. This allows us to use a rule without
depending on the implementation of that rule.
2. Development/IDE/Core/IdeState/Daml.hs has moved into its own Bazel
target. There is a lot of stuff that needs `withDamlIdeState` now
since the `ghcide` `initialise` function does not add our Shake rule
for getting the GHC session and making all of that depend on
damlc:lib creates a mess.
3. The actual logic of the initialization has stayed the same but
moved into a rule in Development/IDE/Core/Rules/Daml.hs.
4. As mentioned above, a few things that could previously get away
with only the rules provided by ghcide now need our own rules so
they switched to `withDamlIdeState`. This mainly affects `damlc
docs`.
5. Making daml-docs work with the ofInterestRule is a bit tricky.I did
find the issue and included the fix but also disabled the
ofInterestRule since it really does not make sense to generate Core
in the background.
changelog_begin
changelog_end
- removes unnecessary reference to offsets
- pushes event identifier translation out to enable code re-use
- event identifier translation is inline in other iterations, no significant perf degradation
- this will allow to share code between event and contract witness table objects
changelog_begin
changelog_end
* sandbox: Remove `ErrorCause.Sequencer`.
It doesn't seem to be constructed anywhere.
Feel free to close this if it's used outside the repository.
CHANGELOG_BEGIN
CHANGELOG_END
* sandbox: Don't deconstruct when we can check types in a pattern match.
* sandbox: Move command execution into its own package.
* sandbox: Make LedgerTimeHelper into a CommandExecutor implementation.
CHANGELOG_BEGIN
CHANGELOG_END
* sandbox: Rename CommandExecutorImpl to StoreBackedCommandExecutor.
And pass it objects, not functions.
* sandbox: Reorder result cases in StoreBackedCommandExecutor.
* sandbox: Inject the LedgerTimeAwareCommandExecutor.
* sandbox: Pull out the default time provider type into a constant.
* sandbox: Name ResetService tests consistently.
* sandbox: Reset the time service when resetting in Static Time mode.
The test, unfortunately, is ``@Ignore`d due to flakiness in CI, so won't
actually be run. However, I _hope_ we're going to remove that
annotation eventually, and it allowed me to test-drive the fix on my
machine, so it's still helpful.
CHANGELOG_BEGIN
- [Sandbox] Fix a regression in the ResetService which did not reset the
TimeService in static time mode.
CHANGELOG_END
Turns out not every participant can support seeding (yet).
CHANGELOG_BEGIN
- [Ledger API Server] Re-introduce an option to disable seeding. This
does not affect Sandbox.
CHANGELOG_END
* Adding `--port-file` support
* ``--port-file`` support
* Updating docs
changelog_begin
[JSON API] Add support for ``--port-file`` command line option.
``--http-port 0 --port-file ./json-api.port`` will pick up a free port
and write it into ``./json-api.port` file.
changelog_end
* reformatting
* Usage grammar
* use bimap
* Adding `PortFiles` utility for creating and deleting port files on JVM exit
* Adding scaladoc explaining that the port file should be deleted on
JVM termination.
* Updating usage and docs to reflect that the file must be unique and
will be deleted on graceful shutdown
* Relying on `java.nio.file.FileAlreadyExistsException` to determine the
case when failed due to the nonunique file name.
* toString instead of Exception.getMessage
java.nio exception's getMessage can be just a file name, need the class
name to capture the error context.
* updatePortFile -> createPortFile
* write to file instead of write into file
* daml-lf/data: Improve performance of `areEqual`.
`areEqual` constructs a one-element `FrontStack`, which should be cheap,
but turns out to be expensive because it constructs builders along the
way. This provides overloads for `apply` that construct the FrontStack
directly, rather than jumping through hoops.
This also changes the behavior of `FrontStack#equals` to check the
length first, which makes the tests work but might also help
performance.
* daml-lf/data: Merge `length` and `len`.
In `FrontStack`, `BackStack`, and `ImmArray`.
No reason to have `def length = len` when `len` can just be public.
* daml-lf/interpreter: Allocate the right-sized list for arguments.
We spend a fair amount of time in `ArrayList#add`; this lessens that by
making sure than when we clone the `args` array for function
application, we leave some room for adding the arguments.
CHANGELOG_BEGIN
CHANGELOG_END
* daml-lf/data: Revert accidentally-lengthened imports.
Co-Authored-By: Stephen Compall <stephen.compall@daml.com>
* daml-lf/interpreter: Rename `functionArgs` to `extendedArgs`.
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
Over the past three weeks or so, I have not seen a single case where the
"get commit" step failed erroneously, i.e. all failures were genuine
pushes, which we don't care about. Therefore, I hacve decided to remove
the `tell_gary` code, as it is long, a bit hairy, and duplicated.
In the meantime I've also discovered there actually is a way to tell
Azure not to run these steps on a canceled build, which I believe makes
sense, so I've added that.
CHANGELOG_BEGIN
CHANGELOG_END
* daml2js: Write all dependencies into package.json
The dependencies of the generated packages on `@daml/types` and
`@mojotech/json-type-validation` somehow got lost either during a
refactoring or when changing how we depend on other generated packages.
The tests simply running `daml2ts` did not catch this because we write
a temporary `package.json` one level higher up in the directory tree
in order to `yarn install` the dependencies only once.
The tests using the generated packages also did not catch this since
they depend on `@daml/types`, which in turn depends on
`@mojotech/json-type-validation`, themselves and hence had both packages
in scope.
In other words, this is very tricky to test. We try to alleviate this
problem by sharing the code for generating the dependencies between the
function writing the actual `package.json` files and the one writing
the temporary `package.json`. This makes sure that these dependencies
do not get out of sync again.
CHANGELOG_BEGIN
CHANGELOG_END
* Adjust tests
CHANGELOG_BEGIN
CHANGELOG_END
* Set the `Bearer ` prefix in bindings.
* Make the `Bearer ` prefix in the authorization header mandatory.
* Bearer prefix can be removed from the token file.
CHANGELOG_BEGIN
[Extractor]: The ``Bearer `` prefix can be removed from the token file.
It is added automatically.
[Navigator]: The ``Bearer `` prefix can be removed from the token file.
It is added automatically.
[DAML Script] The ``Bearer `` prefix can be removed from the token file. It
is added automatically.
[DAML Repl] The ``Bearer `` prefix can be removed from the token file. It is
added automatically.
[Scala Bindings] The ``Bearer `` prefix can be removed from the token. It is
added automatically.
[Java Bindings] The ``Bearer `` prefix can be removed from the token. It is
added automatically.
[DAML Integration Kit] ``AuthService`` implementations MUST read the
``Authorization`` header and the value of the header MUST start with
``Bearer ``.
CHANGELOG_END
Currently, on a release commit on master, if the commit fails, we get
the message from the target PR, which is confusing. This should
(hopefully; it's a bit hard to test as it would require setting up a
release PR that succeeds but fails on master) get us the title of the
release commit, which hopefully will be less confusing.
CHANGELOG_BEGIN
CHANGELOG_END
Yarn does not pick up changes to file: dependencies and link:
dependencies are unusable because Windows so we add an explicit
install step that refreshes them. It doesn’t make any sense to do
dependency resolution again here and could break something for
unrelated reasons so I added --frozen-lockfile as well.
changelog_begin
changelog_end
* Produce performance tests for all envelopes
CHANGELOG_BEGIN
[TestTool] Provide performance tests for all performance envelopes
CHANGELOG_END
* Follow Scala's recommended pattern for enum-like hierarchies
We avoided infix syntax here for `elem` but still used it for
`notElem` which doesn’t make much sense. Also we lost the config to
disable the lint when integrating the example in this repo. This
resulted in our own code producing a lint which is obviously a bad
idea.
side note: I think this lint does make sense once you
are familiar with the syntax and I feel slightly bad about disabling
more and more lints so for now I’m keeping it in the config.
changelog_begin
changelog_end
The call to `yarn build` in the Getting Started guide is completely
useless for everything that follows (it would only be necessary if you
want to deploy the app) and quite time consuming. Let's just remove it!
CHANGELOG_BEGIN
CHANGELOG_END