This moves IndexerIT into its own package, and swaps the dependency from
reference-v2 to ledger-on-memory.
This test should ideally live in the sandbox code, but because it
depends on ledger-on-memory, it's easier to keep it separate.
Also rewrites a lot of the code because the API is different. The tests
should now be clearer too.
I've also marked the test as flaky, because, well, it is.
CHANGELOG_BEGIN
CHANGELOG_END
Unfortunately, we need to work around some bazel issues which lead to
confliciting versions of react in our tests. This workaround cannot be
used the tests are invoked via `yarn test`. Thus, we only use it when
we the tests from bazel. We use the existence of the environment
variable `TEST_WORKSPACE` as a proxy for whether we run from bazel.
CHANGELOG_BEGIN
CHANGELOG_END
This was initially done as an optimization but now that we’ve used
telemetry for a while this hasn’t really been necessary and we’ve
spend way more time on people being confused by the fact that
telemetry messages are only flushed on shutdown.
Furthermore, I’m also slighlty worried that flushing the telemetry
messages on shutdown might go wrong on Windows given that everything
there seems to insist on hard-killing proesses.
changelog_begin
changelog_end
* Explain UI better in app arch section
Still rough but better than the void of information there currently.
changelog_begin
changelog_end
* Finish sentence
* Refactor handling of package names and versions
This is a preparatory refactoring PR in preparation for propagating
package metadata into DAML-LF. There are no actual changes in here.
Primarily the changes consist of 3 things:
1. In options, we split the `optMbPackageName` field which previously
contained the unit id into `optMbPackageName` and
`optMbPackageVersion`.
2. We use newtypes for names and versions and try to keep them pretty
much everywhere (the only place missing is `splitUnitId`, I’ll do that
separately).
3. We use `UnitId` where we want `name-version`.
As was probably to be expected, this surfaced some minor issues. They
are pretty much exclusively in debugging or “internal” commands so
I’ve mostly just added notes/todos.
changelog_begin
changelog_end
* cry about applicativedo
changelog_begin
- [DAML Script - Experimental] Support running DAML scripts against an
authenticated ledger. The token is passed via ``--access-token-file``.
changelog_end
* @daml/react: Add an initial test suite
This only tests that the `useQuery` hook does the right thing once the
call to `Ledger.query` has resolved.
CHANGELOG_BEGIN
CHANGELOG_END
* Workaround for "Invalid hook call."
* Fix lint in BUILD file
CHANGELOG_BEGIN
CHANGELOG_END
Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
* Reword introduction and explanation of codegen
CHANGELOG_BEGIN
CHANGELOG_END
* Say DAR instead of archive
Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* Remove 'i'll explain later'
* Include links to sections of this guide
* More links
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Currently, we're using the first heartbeat as a guesstimate when we're
switching from the ACS to the live stream. These days, the JSON API has
a marker, namely `{live: true}`, to indicate this switch. This PR,
makes use of that marker.
CHANGELOG_BEGIN
CHANGELOG_END
* Revert "sandbox: Log, explaining the removal of static time and scenarios. (#4582)"
This reverts commit b5cb341e8d.
CHANGELOG_BEGIN
- [Sandbox] Removed the warnings regarding static time and scenarios on
initialization. We will not deprecate these until we have a stable
path forward.
CHANGELOG_END
* Sandbox: Include the log level in output.
* ledger-on-sql: Provide queries in the transaction lambda.
* ledger-on-sql: Split read queries out from write queries.
Can't run write queries from a read transaction.
CHANGELOG_BEGIN
CHANGELOG_END
* ledger-on-sql: Pass the connection into the `Queries` constructors.
Way less typing this way round.
* Update MainView in App Arch section
* Update Feed to MessageList
* Update MessageEdit and MainView components and description in First Feature section
CHANGELOG_BEGIN
CHANGELOG_END
* Underline length
Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
`addDays d (- r)` looks a bit confusing and it’s not obvious that
negative numbers even work.
changelog_begin
- [DAML Standard Library] Add `subtractDays` to the DAML Standard Library.
changelog_end
* Add package metadata to DAML-LF proto and the Haskell AST
This adds package metadata (currently only the package name and
version) to DAML-LF and the corresponding Haskell ASTs. This is useful
for debugging and “codegens” (typescript, damlc dependencies, …)
This PR does not yet add it to the Scala side or change the compiler
to actually produce this metadata.
Part of #4412
changelog_begin
changelog_end
* Address review comments
We have seen a number of failures recently where the collect_build_data
and notify_user steps failed to fetch their branch commit from GitHub.
Trying to reproduce locally doesn't work (i.e. fetching the same sha
succeeds), so we're currently assuming transient network errors.
This PR adds a retry mechanism as well as a Slack message to help me
keep tabs on the issue.
CHANGELOG_BEGIN
CHANGELOG_END
* sandbox: If the ledger ID isn't provided, use the one in the database.
Previously, we would fail if working against an existing ledger, and not
explicitly providing the ledger ID. This was the case even if the ledger
ID was randomly generated initially.
CHANGELOG_BEGIN
- [Sandbox] If no ledger ID is provided when running against an existing
ledger, use the existing ID. Previously, Sandbox would fail to start.
CHANGELOG_END
* sandbox: The ReadOnlySqlLedger should always receive a ledger ID.
It's read-only; it can't create one.
* sandbox: Stop using `equal` in SqlLedgerSpec.
* sandbox: Test that the ledger ID is as specified in SqlLedgerSpec.
* sandbox: Let the top-level runner handle a ledger ID mismatch.
And clean up the log text.
* sandbox: Initialize the ledger properly when the ID is dynamic.
* sandbox: Use `Vector`, not `List`, for SqlLedger initialization.
Append with Vector, good. List, bad.
* ledger-api-common: Make `LedgerApiMode.Dynamic` an object.
And add Java-style static factory methods.
* kvutils/app | ledger-on-{memory,sql}: Make `ledgerId` optional.
It should be generated or retrieved from the persistence layer by the
ledger itself.
* kvutils: Make the ledger ID optional in the tests.
* ledger-on-sql: Store the ledger ID, and reject conflicting IDs.
* ledger-on-sql: Make more things final.
* ledger-on-sql: Document the `ledger_meta.table_key` column better.
* sandbox: Don't hardcode the number of packages in the test DAR.
It changes.
* ledger-on-sql: Merge the `head` resource owner with the `dispatcher`.
* sandbox: Use backticks to simplify pattern match in ReadOnlySqlLedger.
* ledger-on-sql: Extract methods in `owner`.
Currently, contract ids are simply presented by strings. Thus, it is very
easy to accidentally mix up contract ids of different templates. This PR
is an attempt to provide more safety in this regard. It prevents contract
ids of template types which are not in a _structural_ subtyping
relationship from being mixed up. This is far from perfect, but clearly
better than what we have now.
CHANGELOG_BEGIN
CHANGELOG_END
* [engine] optimize conversion of hash to string
* Revert "Bump daml-lf engine test timeout (#4591)"
This reverts commit 9495d78240.
* use guava to convert bytes to string
* changelog
CHANGELOG_BEGIN
CHANGELOG_END
* Engine:
Switch BaseEncoding to lowercase
* formatting
* Push down completion requests to data access layer
This is largely a refactoring. The externally observable behavior is unchanged, but:
- a sub-dao is created for command completions (with the intent of breaking up the dao completely in future commits)
- the command completions dao can, in theory, directly fetch completions off the index
- in practice this is not implemented here to keep this PR as small as possible
Filtering ledger entries to get completions is moved to a function that is in turn used by:
- the ledger dao
- the in-memory sandbox
The plan for the former is to add a new table where completion-relevant data is stored so that it can be fetched quickly.
The plan for the latter is to get rid of it once DAML-on-SQL ships.
CHANGELOG_BEGIN
CHANGELOG_END
* Fix off-by-one error in the in-memory sandbox
This is one of the tests that keeps breaking every time we change the
number of packages `damlc build` outputs by default which is quite
annoying.
The actual change is trivial, we just read the number of packages from
the manifest. The diff is mostly just propagating this through everything.
changelog_begin
changelog_end
This is pretty much a verbatim copy of the `useStreamQuery` hook but it
works against the `/v1/stream/fetch` endpoint of the JSON API.
CHANGELOG_BEGIN
CHANGELOG_END
* Add type-level strings in DAML.
This PR adds a `PromotedText` stable package, with `PromotedText` type, which is used to encode type-level strings from DAML into DAML-LF. The reason for this is to preserve the `HasField` instance argument. This PR adds a test that `HasField` is succesfully reconstructed incontexts, during data-dependencies, which wasn't possible before.
changelog_begin
changelog_end
* adresss comments
* fix overly specific tests
* Use KeyHasher to serialize contract keys in kvutils
- Use Value instead of VersionedValue in GlobalKey as the versioning does not make sense here
and may be misleading as the a value with a different version but same meaning would still
be the same key.
- Relocate the KeyHasher to ledger-api-common so kvutils can use it (otherwise cyclic dependencies)
- Replace storing of the contract key as a VersionedValue with the hash produced by KeyHasher.
This is backwards incompatible. A compatible option would require us to query the key with both
the old way and the new way which is unattenable. We're making a calculated breaking change.
CHANGELOG_BEGIN
- [DAML Ledger Integration Kit] Serialize contract keys using a hash instead of the value in kvutils.
This is a backwards incompatible change to kvutils.
CHANGELOG_END
* Use proper hasher for contract keys and not KeyHasher
- Use Hash.scala, not KeyHasher.scala.
- Add hash to GlobalKey as we want the hash to be computed from the inside.
The use of KeyHasher will be later deprecated and replaced by this.
* Use "sealed abstract case class" trick instead of private ctor
and rebase fix
* Revert change to unsupported value version decode error
* Reformat code
* Add kvutils changelog entry and bump the version
We have seen a few telemetry messages with the SDK version set to
`null` which is obviously not very useful. I suspect this is probably
because some users invoke damlc directly. This change is backwards
compatible since the ToJSON instance does encode `version = Just "x"` as
`"version" = "x"` and version = Nothing as `version = null`.
changelog_begin
changelog_end
Manually matching on every package isn’t actually testing for anything
meaningful since the number of packages here really isn’t something
that we should test since we change it quite regularly in the
compiler.
changelog_begin
changelog_end
CHANGELOG_BEGIN
- [Sandbox] Static time mode is being deprecated in the future. A warning has been added to notify users of this fact.
- [Sandbox] Scenarios are being deprecated in the future, in favor of `DAML Script <https://docs.daml.com/daml-script/>`_. A warning has been added to notify users of this fact.
CHANGELOG_END
* kvutils: Extract a committer from the uses of `SubmissionValidator`.
This makes the clock injectable too.
* kvutils: Provide logging contexts in the `Runner`.
* sandbox: Remove the `StaticAllowBackwards` time provider type.
It's not used anywhere.
* sandbox: Fix warnings in CliSpec.
* sandbox: Ensure that we cannot specify both static and wall-clock time.
* sandbox-next: Crash if wall clock time is not specified.
* sandbox-next: Document more known issues in the new Sandbox.
* sandbox: Add a Clock (and some tests) to TimeServiceBackend.
* sandbox-next: Support static time.
CHANGELOG_BEGIN
- [Sandbox Next] Re-establish static time mode.
CHANGELOG_END
* ledger-on-(memory|sql): Expect a `() => Instant`, not a `Clock`.
This is a bit ugly but after spending some time digging into the
issues in rules_haskell around data-files, this seems like the most
sensible option especially given that we also want to ship them in the
SDK which woud require additional work even if we do fix it in
rules_haskell.
fixes#4457
changelog_begin
changelog_end
There's no point in first testing for the length of the array and then
testing all elements individually. That's what arrays are for. :)
CHANGELOG_BEGIN
CHANGELOG_END