* kvutils: Factor out a base class for ledger exporter implementations.
CHANGELOG_BEGIN
CHANGELOG_END
* kvutils: Use piped streams in LedgerDataExporterSpecBase.
* kvutils: Rename "FileBased…" to "SerializationBasedLedgerDataExporter".
* kvutils: Wrap Deserialization in a class for polymorphism purposes.
* kvutils: Pull out submission info variables in the ledger export test.
* kvutils: Inline (De)Serialization into the exporter.
* kvutils: Replace usage of Deserialization with LedgerDataImporter.
* kvutils: Don't synchronize on making an InMemorySubmissionAggregator.
* kvutils: Pass a SubmissionInfo to LedgerDataExporter.
* kvutils: Reflow a long string to make it readable.
It turns out that if you give the CSV reporter a non-existent directory,
it crashes. I did not expect this.
This constructs the directory so you don't have to worry about that.
CHANGELOG_BEGIN
CHANGELOG_END
This is the same technique as `DerivativeGauge` from the metrics
library, but with less code, because Scala is prettier than Java.
CHANGELOG_BEGIN
CHANGELOG_END
to distributed ledgers with differing ledger ids. This
accommodates distributed vDaml setups with participants with
matching ledger ids.
changelog_begin
changelog_end
* Remove authentication service from trigger service
This rips out the integration with ref-ledger-authenticator and
together with that the weird http basic auth which doesn’t actually
work for ref-ledger-authenticator outside of its testing mode and also
includes some very sketchy stuff like storing user
passwords (encrypted but still).
While the exact details of the new approach towards auth are still not
completely clear, it is clear that it is going to be sufficiently
different from what we did before that starting from a clean slate is
easier.
changelog_begin
- [Trigger Service] Parties are now specified in request bodies as
opposed to via HTTP Basic auth. This is done in preparation for
running the trigger service against authenticated ledgers.
changelog_end
* Fix integration tests
changelog_begin
changelog_end
* Deprecate noop `--application-id`
changelog_begin
[JSON API]
Hiding and deprecating `--application-id` command-line option. JSON API never used it.
It is required to instantiate LedgerClientConfiguration and was not used for any command submission.
JSON API uses Application ID specified in the JWT. See #7162
changelog_end
* removing further usage of noop applicationId
* a bit of explanation what this is for
Apparently `[[]]` links don't work to external resources. I wanted to
turn the first referencee into a link too but that contains too many
weird characters.
CHANGELOG_BEGIN
CHANGELOG_END
@leo-da is taking care of 1.5.0-snapshot.20200825.5071.0.d33e130f (#7233), so they get pushed back to the end of the line.
Please do not merge this before #7233.
CHANGELOG_BEGIN
CHANGELOG_END
Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
* Clarify how to start a test ledger, and run json api with & w/o query storage
* Remove the json-api --help output and replace with a note.
* Update JSON API Authorization/Authentication sections
* Minor improvements to query section
* CHANGELOG_BEGIN
[Docs] Improve the JSON API documentation, clarify the common json-api options, and update the authorization/authentication section.
CHANGELOG_END
* Note why you would specify a Command ID in the JSON API
* Clarify how the Authorization token works
* Add warning to always run the JSON API behind a reverse proxy
* Apply suggestions from code review
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* Change how we refer to the different access tokens used by the JSON API
* applicationId doesn't need to match --application-id
* remove reference to planned jwt library
* Update party allocation instructions/explanation
* Remove IAM references from Ledger API Auth
* Stop lying about secrets
* Auth shouldn't be party-specific
* Needed more stars
* Apply suggestions from code review
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* Update Ledger API access token description
* Additional clarifications on the two types of tokens
* Note that each request to the JSON API can only come from a single party
* Apply suggestions from code review
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* Clarify getting access tokens from your ledger operator
* Add link to JWT format in the sandbox
* Fix inconsistent title level
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
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.
@leo-da is in charge of this release.
CHANGELOG_BEGIN
CHANGELOG_END
Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
A `Struct[+X]` is a list of pair `(FieldName, X)` ordered by first
component.
We use this data-structure to represent TStruct LF type.
It will be used in upcomming PRs to sorted fields in Struct values.
CHANGELOG_BEGIN
CHANGELOG_END
* kvutils: Factor out ledger dump timers into a class.
* kvutils: Use `Paths` in the integrity checkers.
Strings give me the heebie-jeebies.
CHANGELOG_BEGIN
CHANGELOG_END
The similar scenario tests are also disabled on Windows and the script
tests are flaky on Windows due to timeouts.
changelog_begin
changelog_end
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
* Enable DAML Script service by default and document it
fixes#7193
changelog_begin
- [DAML Script] DAML Scripts are now run in DAML Studio just like
scenarios. The functionality for inspecting the results is
identical. If you encounter issues, please report them.
changelog_end
* fix double "is identical"
changelog_begin
changelog_end
* kvutils: Add `override` annotations for the exporters.
* kvutils: Test the ledger export (v2).
* kvutils: Mark integrity tests as small.
* kvutils: Add assertions to the FileBasedLedgerDataExporter.
Just confirming my understanding of how this works. Verified with the
Ledger API Test Tool and some proprietary code.
* kvutils: Move the definition of `CorrelationId` to the package file.
* kvutils: Pass a submission write set through the batch pipeline.
This allows for less mutability all over the place.
CHANGELOG_BEGIN
CHANGELOG_END
* kvutils: Move export finishing into its own type.
* kvutils: Move some nested types upwards.
* kvutils: Split Deserialization from Serialization.
* kvutils: Extract out common behavior in (De)Serialization.
* kvutils: Don't use a singleton for LedgerDataExporter.
Instead, construct it once.
* kvutils: Make sure we close the export file when we're done.
* kvutils: Simplify `Debug` in the same manner as `LedgerDataExport`.
* kvutils: Fix a test name.
Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>
* kvutils: Remove backticks around "export".
* kvutils: Move the test `BatchedSubmissionValidator#apply` into the test.
Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>
* [KVL-222] Add participant id to index metadata dump
changelog_begin
changelog_end
* Test SqlLedger participant id initialization
* Test JdbcIndexer participant id initialization
* Make RecoveringIndexerSpec final and remove unused trait
* Normalize struct field order in the LF spec.
This commit changes the LF spec to ensure that struct field order is ignored whenever reasonable.
* Rename "type synonym resolution" to "type normalization", and change the rule for structs to also normalize the order of fields.
* Make the struct type "well-formed" only if the struct fields are sorted by field name. (This matches the way "well-formed" is only used for normalized types. E.g. type synonyms are not considered "well-formed" by the spec. This nomenclature should possibly be fixed in a separate PR.)
* Change the struct con expression type rule accordingly.
* Change the definition of a struct value. A struct value is now a struct expression where all the field expressions are values, and all the field names are sorted.
* Change the evaluation rule for struct expressions to also sort the fields by field name in the process.
As far as I know, this spec matches the behavior of the LF engine. I also tried to make the treatment of struct field order in the types match the treatment of struct field order in expressions (i.e. normalized structs always have sorted fields, but non-normalized structs do not).
changelog_begin
changelog_end
* Apply suggestions from code review
Co-authored-by: Remy <remy.haemmerle@daml.com>
* Update daml-lf/spec/daml-lf-1.rst
Co-authored-by: Remy <remy.haemmerle@daml.com>
* kvutils: Use `eventually` in BatchingQueueSpec to fix a flaky test.
We cannot assume that the queue will shut down faster than we can check
its state.
* kvutils: Increase timeouts in BatchingQueueSpec to fix flakiness.
50 milliseconds is pretty fast when tests are running in parallel.
CHANGELOG_BEGIN
CHANGELOG_END
This is primarily intended to improve error reporting in DAML Script,
in particular, https://github.com/digital-asset/daml/issues/7192 which
is a blocker for replacing scenarios by DAML Script.
However, I think it is also a very reasonable feature in general.
changelog_begin
changelog_end
Furthermore, does not mention PostgreSQL in the message, as
the HikariJdbcConnectionProvider is shared across all our
usages of RDBMSs (including H2 and Sqlite).
changelog_begin
changelog_end
* Adding `package-max-inbound-message-size`
this is to allow separate configuration settings for command submission
and package management ledger clients
* Fixing formatting
* Updating docs
changelog_begin
[JSON API] Adding `--package-max-inbound-message-size` command line option.
Optional max inbound message size in bytes used for uploading and downloading package updates. Defaults to the `max-inbound-message-size` setting.
changelog_end
* Addressing code review comments
Adds a Boolean check for the existence of an active contract with a
given key (that is visible with the current set of authorizations), and
explain `lookupByKey` in terms of it to hopefully clarify the relationship
between `lookupByKey` and `fetchByKey`.
Fixes#7143; see that for more information.
CHANGELOG_BEGIN
- [DAML Standard Library] Added a new function `visibleByKey`
which, given a contract key, returns True if the current context can
see an active contract with that key.
CHANGELOG_END
* Fix handling of transient contracts in extractor
fixes#7201
As described in the issue, the problem was that we completely ignored
the order of events and always processed exercises before creates
which falls apart as soon as they are in the same transaction.
I still think that in the current state doing creates before exercises
would be fine but this seems like the kind of assumption that breaks
very quickly during refactoring (e.g. let’s say you start creating
foreign key references) so instead this PR fixes this properly by
iterating over the transaction tree in pre-order.
This turns out to be a bit more complex than I expected it to be since
we filter the tree on the client side and afterwards we have lost
enough information so that we cannot traverse the tree instead
anymore. Therefore, the “tree” type in extractor now contains a list
of events in pre-order and a comment that it’s not actually a valid
tree or subtransaction.
changelog_begin
- [Extractor] Fix a bug that resulted in transient contracts (created
and archived within the same transaction) to not be displayed as
archived. See #7201 for details.
changelog_end
* Update extractor/src/main/scala/com/digitalasset/extractor/ledger/types/TransactionTree.scala
Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
* Suffix with template name
changelog_begin
changelog_end
Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
* REPL test `:json` command
changelog_begin
changelog_end
* Implement :json command in DAML REPL
changelog_begin
- [DAML REPL] You can now convert DAML expressions to JSON in the DAML
REPL using the meta-command ``:json`` for example ``:json [1, 2, 3]``.
changelog_end
* Extend DAML REPL documentation
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
* Refactor SQLLedger initialization routine
Small refactoring to make initialization a bit more readable. Performed
while moving forward with the addition of the participant identifier to
the parameters table (so a few minor details have leaked into this PR).
changelog_begin
changelog_end
* Fix compilation errors
* Address https://github.com/digital-asset/daml/pull/7200#discussion_r474630880
* Fix test, lower test logging noise
* depend on flyway in trigger service; duplicate FlywayMigrations from sandbox
* bring in postgres/h2 detection, other data-source elements needed; use scalalogging
* use DataSource instead of DriverManager for DbTriggerDao, pass to flyway too
- initialization order isn't quite right yet
* hardcode postgres in triggers flyway path
* found an init order that doesn't fail in tests
* better pools for production, and don't forget to close them
* move most init SQL to first migration file
* make logHandler implicit again
- seems to have been an accidental implication of #6334
* move remaining create to V1__Init.sql
* use Prod poolSize
* prove that PostStop signals are never seen (in tests)
* move all the shutdown to Stop message
* remove dead code in DbFlywayMigrations
* always "initialize" database
CHANGELOG_BEGIN
- [Trigger Service] The database format has changed to allow migrations in
future releases. Databases are always initialized or migrated to the current
version on start, so use of ``--init-db`` is no longer required.
See `issue #7092 <https://github.com/digital-asset/daml/pull/7092>`__.
CHANGELOG_END
* it should always be obvious when there is no escape
* remove logs from experiments
* remove receiveSignal PostStop
* remove unused imports
I have created the corresponding user and repositories on Artifactory,
and tested the `curl` command manually. I'll add the corresponding
credentials to Azure once this is approved.
CHANGELOG_BEGIN
CHANGELOG_END
* IDE distinguish scripts and scenarios
The code lens above DAML script definitions now reads `Script results`
instead of `Scenario results`.
This also adds DAML Script test cases to the lsp-tests.
The functionality for testing scenario and script code-lenses in the
`Utils` module is identical. However, this adds dedicated definitions
for scripts to clearly distinguish the scenario and script test-cases.
changelog_begin
changelog_end
* Add sum type to distinguish Scenario and Script
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
* 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.