Commit Graph

2030 Commits

Author SHA1 Message Date
Marton Nagy
284edfc4cd
Fix FlywayMigrations datasource (#10666)
* Use StorageBackend.createDatasource instead
* remove dependencies
* refactor FlywayMigrations interface for simplicity

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-26 02:22:52 +02:00
nicu-da
7cc698948c
Add multiple ways of specifying deduplication [KVL-1047] (#10601)
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>
2021-08-25 05:58:03 -07:00
Samir Talwar
53be19f86c
participant-integration-api: Ensure that all waiting, failed, and closed trackers are cleaned up. (#10662)
* participant-integration-api: Clean up failed trackers.

Otherwise they can hang around forever.

CHANGELOG_BEGIN
CHANGELOG_END

* participant-integration-api: Ensure that all trackers are closed.

* participant-integration-api: Ensure that waiting trackers are closed.

* participant-integration-api: Store the tracker map future in the state.

* participant-integration-api: Fix a race in `TrackerMap`.

If the supplied `Future` to `AsyncResourceState` is too fast, the state
may not be set. We need to initialize the state immediately.

* participant-integration-api: Add more comments to `TrackerMap`.
2021-08-25 12:53:13 +00:00
Samir Talwar
b27cde6440
participant-integration-api: Move tracker code around, and tidy up tests. (#10663)
* participant-integration-api: Delete `SizeCappedMap`. It's unused.

* participant-integration-api: `TrackerImpl` → `QueueBackedTracker`.

CHANGELOG_BEGIN
CHANGELOG_END

* participant-integration-api: Clean up QueueBackedTrackerSpec.
2021-08-25 10:55:26 +00:00
nickchapman-da
387c68b9eb
Normalize transaction values within the engine (#10648)
Create normalized TXs when a partial TX is finalised.

Except in limited cases! (i.e for scenario-runner, sandbox)

CHANGELOG_BEGIN
CHANGELOG_END

normalize values in the engine as they are converted from speedy-values

fix 2.12 build

backout redundant change

ensure byKey field is correctly normalized when constructed by engine

rename flag: valueNormalization -> transactionNormalization

improve comment

delete commented-out code

rename: toValueNorm --> toNormalizedValue

rename: (SValue.) toValue --> toUnNormalizedValue

revert changes to ptx so that the interface to insertCreate() etc is Value-based (not SValue-based)

improve comments

respell: toUnNormalizedValue --> toUnnormalizedValue

fix build
2021-08-25 09:53:26 +01:00
Samir Talwar
ef239fdd1a
participant-integration-api: Move TrackerMap code around. [KVL-1009] (#10653)
* participant-integration-api: Make `TrackerMap` a `Tracker`.

Mostly by moving parameters around.

CHANGELOG_BEGIN
CHANGELOG_END

* participant-integration-api: Clean up `TrackerMap` a little more.

* participant-integration-api: Make `TrackerMap` generic.

* participant-integration-api: Move `Tracker.WithLastSubmission`.

It's only used by `TrackerMap`, so now it's an internal class there.

* participant-integration-api: Only provide the key to `newTracker`.

* participant-integration-api: Subsume the `TrackerMap` cleanup schedule.

* participant-integration-api: Construct the tracker map outside.

* ledger-api-common: Remove some unnecessary braces.

* participant-integration-api: Prettify `TrackerMap` some more.

* participant-integration-api: Make `TrackerMap.selfCleaning` a class.

* participant-integration-api: Add some tests for TrackerMap.

* participant-integration-api: Convert a method to `Runnable`, 2.12-style.

Apparently underscores aren't good enough.

* ledger-api-client: Delete CompletionSuccess#unapply.

It doesn't work on Scala 2.12.
2021-08-25 06:30:39 +00:00
Marton Nagy
640fb68342
Make Index DB enable multiple party additions [DPP-546] (#10623)
Preparation, small fixes

* Remove unnecessary TODO
* Fix FieldStrategy.idempotentInsert type parameters

Changing the DB-Schema

This change adapts the DB schema for all supported backends. After this change we only populate the party_entries table, and on the query side we reconstruct the state from this.

* Drop the party table
* Add indexing to party_entries

Adapting StorageBackend: ingestion

Since we only ingest party_entries, the party population needs to be removed.

* Drop the party table in ingestion code
* Fixes test

Adapting StorageBackend: queries

Queries needs to be adapted to construct the state from the read side.

* Rewrite queries.
* Fixes reset implementations.

Adapting JdbcLedgerDao

Since underlying storage changed, JdbcLedgerDao can be simplified: no special treatment needed with duplicate errors, since these errors are impossible to happen.
Removing JdbcLedgerDao tests, and adding a new test, testing the behavior of the new event-source party model. Please note: this database refactoring only applies to the append-only schema, so for the mutating schema the test is disabled.
During implementation a bug surfaced: it was not possible anymore to store the is_local information via JdbcLedgerDao.storePartyEntry. Although this bug is a minor issue, since that method is only used from single participant environment, still a fix was also implemented for this, by passing a magic participantId upon non-local party storage.

* Simplify storePartyEntry.
* Fixes bug introduced by append-only.
* adds/adapts tests

Refactoring: remove not used duplicateKeyError from StorageBackend

Changes to JdbcLedgerDao rendered this duplicateKeyError unused.

* Removes unused duplicateKeyError

Adapting sandbox-classic

In sandbox-classic it is not allowed to have updates for parties. Essentially the updates concerning already existent parties were dropped silently with logging without effect.
Here I started by pinning down this behaviour in the SqlLedgerSpec and SqlLedgerSpecAppendOnly. These tests were implemented with the original code in mind.
Then adapted the SqlLedger method: making sure of uniqueness by first trying to lookup the to-be-persisted party.

* Added tests grabbing a hold on original behavior
* Adapted implementation to ensure same behavior

Switching to correct is_local derivation for party queries as per review

* Adapting implementation: switching to aggregated table and a query on that
* Introducing QueryStrategy.booleanOrAggregationFunction to support Oracle
* Moving party related queries to PartyStorageBackendTemplate
* Fixes JdbcLedgerDaoPartiesSpec tests, and add another test case

Also:

* Align Update interface documentation
* Switching to explicit optionality in party query implementation asa per review

Co-authored-by: Simon Meier <meiersi-da@users.noreply.github.com>

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-24 19:24:27 +02:00
Remy
b22de6893b
LF: Contract ID suffix check in Preprocessor (#10642)
This PR makes possible to check for contract IDs suffix during
preprocessing.

This is the first part of the task 3 described in #10504.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-24 18:45:33 +02:00
Miklos
6e4a24c28c
participant-state: Generate correct gRPC error codes by v2 WriteService [KVL-1081] (#10656)
* Corrected returned gRPC error codes.

* Added some tests.
CHANGELOG_BEGIN
CHANGELOG_END

* Reformatted.

* Code tidying.
CHANGELOG_BEGIN
[Integration Kit] Corrected gRPC error codes returned by v2 `WriteService` adaptor.
CHANGELOG_END

* Another try at fixing the changelog.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-24 14:42:27 +00:00
Robert Autenrieth
a471f15aa8
Dpp-558 Fix startexclusive queries on oracle (#10649)
* Add tests for command completions
* Fix offset-greater-than-offset comparisons
* Reformat SQL queries for a more uniform style

changelog_begin
changelog_end
2021-08-24 13:37:40 +02:00
fabiotudone-da
e99254fd3e
Augment completion.proto with deduplication-related info [KVL-1057] (#10619)
* Augment completion.proto with deduplication-related info

CHANGELOG_BEGIN
CHANGELOG_END

* Explicitly specify fields not yet filled in when building Completion

* Time-based deduplication periods are measured in record time of completions

* Add deduplication_offset as a deduplication_period option

* Don't skip proto field numbers

* CompletionFromTransaction: use default Completion constructor

* submission_rank: reserve proto field for future use

* Add comment about reserved proto field
2021-08-24 12:55:03 +02:00
Samir Talwar
a00608c8b3
participant-integration-api: Accommodate changes to max dedup time. (#10650)
Previously, if the max deduplication time was extended, the participant
_might_ retain the old time for certain submissions.

CHANGELOG_BEGIN
- [Ledger API Server] The API server manages a single command tracker
  per (application ID × submitters) pair. This tracker would read the
  current ledger configuration's maximum deduplication time on creation,
  but never updated it, leading to trackers that might inadvertently
  reject a submission when it should have been accepted. The tracker now
  reads the latest ledger configuration.
CHANGELOG_END
2021-08-24 09:28:18 +00:00
tudor-da
29c546c949
[Divulgence pruning] Added prune_all_divulged_contracts to PruneRequest [DPP-534] (#10635)
* Added `prune_all_divulged_contracts` to ParticipantPruningService.Prune
* KeyValueParticipantStateWriter.prune returns UNIMPLEMENTED if called with `pruneAllDivulgedContracts` set

CHANGELOG_BEGIN
CHANGELOG_END

* Addressed review comments

* Apply suggestions from code review

Co-authored-by: mziolekda <marcin.ziolek@digitalasset.com>

Co-authored-by: mziolekda <marcin.ziolek@digitalasset.com>
2021-08-23 20:52:27 +00:00
tudor-da
dea57ca099
In-memory fan-out optimizations (#10558)
* Time conversion duration between buffer event and API domain transaction
* Compute partiesTemplates inversion mapping outside events transformation
* Other small optimizations

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-23 20:31:23 +02:00
Robert Autenrieth
8501832757
DPP-468 StorageBackend tests (#10529)
* Add StorageBackend tests

changelog_begin
changelog_end

* Fix Oracle tests

* Do not use empty byte arrays

* Format

* Fix after rebase

* Substitute type params with type bounded ingest method

* Remove empty line

* Assert on configuration contents

* Fix Oracle build

* Add tests for ingestion initialization

* fmt

* Add test for leftover data after reset

* Add resetAll

* Use resetAll between tests

Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com>
2021-08-23 10:41:25 +02:00
Samir Talwar
733590d591
ledger-api-health: Use the Scala health status values everywhere. (#10640)
The methods are intended to be used by Java code, where Scala
`case object` values can be unidiomatic.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-20 16:50:20 +00:00
Samir Talwar
f77cd0a81c
participant-integration-api: Attempt to fix RecoveringIndexerSpec. (#10639)
* participant-integration-api: Add logging to RecoveringIndexerSpec.

It's flaky, and I would like to know exactly what's going on here.

* participant-integration-api: Attempt to fix RecoveringIndexerSpec.

The checks for the health status are racy. I'm hoping increasing the
timeouts will help a little.

CHANGELOG_BEGIN
CHANGELOG_END

* participant-integration-api: Inline timeouts in RecoveringIndexerSpec.
2021-08-20 15:06:25 +00:00
Samir Talwar
9d7f60f03e
participant-integration-api: Fix a flaky test. (#10637)
The `LedgerConfigurationSubscriptionFromIndexSpec` was flaky due to
stubs not specifying all behavior for `IndexConfigManagementService`.

This fixes the underlying issue by avoiding stubs in favor of fakes,
which means that _all_ behavior must be modelled.

Note: Martin Fowler has an excellent, terse description of [the various
forms of test doubles][TestDouble].

[TestDouble]: https://www.martinfowler.com/bliki/TestDouble.html

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-20 12:53:43 +00:00
Samir Talwar
c0fbad1f6e
participant-integration-api: Remove limitMaxCommandsInFlight. (#10626)
This is always set to `true`, so let's just hard-code it.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-20 07:56:38 +00:00
Oliver Seeliger
b4af6d1155
Canton testing: Mark one more DeeplyNestedValueIT test flaky (#10636)
changelog_begin
changelog_end
2021-08-20 09:22:59 +02:00
Oliver Seeliger
e807f4a918
Upgrade to a newer canton version (post 0.27.0 snapshot version) (#10632)
* Upgrade to a newer canton version (post 0.27.0 snapshot version)

with canton-community configuration that supports higher throughput.

changelog_begin
changelog_end

* Disable flaky reject DeeplyNestedValueIT:Reject tests that time out half the time
2021-08-20 06:10:54 +00:00
Brian Healey
c4513f2eea
Oracle append-only schema: enable contract id index on participant_events_xxxx tables (#10633)
* Enable contract id index on oracle participant_events_xxx tables in append only schema

* update oracle append sqlfile sha

* fixes #10125

* update sha

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-19 21:52:05 +00:00
Remy
3598e0928c
LF: Drop contract ID Freshness check (#10620)
As stated in #10504 the contract ID freshness check cannot be
implemented correctly in general.

This PR drops the support for this (buggy) check.

This corresponds to the fist task of #10504.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-19 18:07:29 +02:00
Samir Talwar
37c999e237
ledger-on-sql: Increase the concurrency for conformance tests. (#10622)
This was limited a while back during the initial development of
_ledger-on-sql_ for reasons I can't remember. Let's stop doing that.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-19 14:04:09 +00:00
Robert Autenrieth
46e8c7d762
DPP-460 Extract constant for event sequential IDs (#10564)
* Extract constant for event sequential IDs

changelog_begin
changelog_end

* Rename zero to beforeBegin

* Replace more occurences of 0L
2021-08-19 13:32:37 +02:00
Robert Autenrieth
121047e0ea
DPP-460 Parameter storage consolidation (#10472)
* Refactor ParameterStorageBackend

- a single method for atomic ledger initialization
- a single method to look up the ledger end

changelog_begin
changelog_end

* Add a test

* Fix reading event sequential ids

* Remove debug statements

* Allow ledgerEnd on an empty database

* Initialization is not safe to call concurrently

* Remove leftovers from isolation level change

* Use unit return type

for initialization methods

* Allow getParticipantId on an empty database

* Use exceptions instead of a return type ADT

* Don't use Try for initialization

* Clean up parameters table

* Simplify parameter storage api

* Address review suggestion

* Address review comment

* Address review comment

* Prefer ledger id over participant id mismatch

* Address review comment

* Move type definition

* Remove useleess new keyword

* Renove unused import

* Inline result mapping

* Fix reporting of mismatching participantId
2021-08-19 10:45:17 +02:00
Samir Talwar
c38703ec84
participant-integration-api: Store a status gRPC protobuf. [KVL-1005] (#10600)
* participant-integration-api: Construct completions in one place.

* sandbox-classic: Inline `CompletionFromTransaction#apply`.

It's only used here; there's no reason to keep it in the
_participant-integration-api_.

* participant-integration-api: Store a status gRPC protobuf.

Instead of storing the status code and message, we store a serialized
`google.rpc.Status` protocol buffers message. This allows us to pass
through any additional information reported by the driver `ReadService`.

The migration is only done for the append-only database, and preserves
old data in the existing columns. New data will only be written to the
new column.

CHANGELOG_BEGIN
CHANGELOG_END

* participant-integration-api: Improve comments in migrations.

Co-authored-by: Fabio Tudone <fabio.tudone@digitalasset.com>

* participant-integration-api: Further improvements to migrations.

* participant-integration-api: Store the rejection status as 3 columns.

Serializing the details but keeping the code and message columns
populated.

* participant-integration-api: Publish the indexer protobuf to Maven.

Co-authored-by: Fabio Tudone <fabio.tudone@digitalasset.com>
2021-08-18 17:59:14 +00:00
Andreas Lochbihler
0af5b49484
make FinalReason a case class (#10614)
CHANGELOG_BEGIN
CHANGELOG_END
2021-08-18 17:33:54 +02:00
Samir Talwar
8dd136fc7d
bazel-tools: Replace runner with either runner_with_port_check or runner_with_port_file. (#10615)
* Use `extra` in the port file runner, rather than `temporary`.

* ledger-api-test-tool-on-canton: Use the port check runner.

Much simpler than the port file runner for our purposes.

* Replace `runner` with `runner_with_port_file`.

Rather than expecting a particular set of command-line-arguments, we use
templating.

CHANGELOG_BEGIN
CHANGELOG_END

* Rename the `runner_with_port_check` target to the default.
2021-08-18 15:23:45 +00:00
pbatko-da
19c3d28ebf
Remove GenMissingString class because it is not used (#10608)
CHANGELOG_BEGIN
CHANGELOG_END
2021-08-18 16:08:25 +02:00
Samir Talwar
3227e860e0
Use the port file and dynamic port generation in client/server tests. (#10604)
* Use the port file and dynamic port generation in client/server tests.

This creates a runner named `runner_with_port_file` which knows how to
interpolate two variables, `%PORT_FILE%` and `%PORT%`. This allows us to
use the `port-file` argument to the kvutils runner rather than
hard-coding a port for conformance tests.

For now, we only use this for generating the kvutils reference ledger
export.

CHANGELOG_BEGIN
CHANGELOG_END

* Simplify the runner_with_port_file considerably.

It doesn't need to check if the port is open; we trust that the process
will do it.

This also makes sure the port file will be cleaned up, and reduces the
number of dependencies by making use of more functions in `extra`.

* Simplify port file generation in the new client-server runner.

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Simplify the runner_with_port_file further.

This doesn't need to work if the server doesn't take a port file.

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-08-18 13:25:58 +00:00
nicu-da
975a5fb32b
Move DeduplicationPeriod to ledger-api-domain [KVL-1047] (#10590)
* Move `DeduplicationPeriod` to ledger-api-domain so that it ca be reused and passed down from the ledger-api-client to into the v2.SubmitterInfo

CHANGELOG_BEGIN
participant-state - move `DeduplicationPeriod` to ledger-api-domain
CHANGELOG_END

* Revert unrelated changes
2021-08-18 13:34:26 +02:00
Samir Talwar
3822a8c886
ledger-api-test-tool: Split TransactionServiceIT into lots of suites. (#10585)
* ledger-api-test-tool: Make IntelliJ happy with TransactionServiceIT.

* ledger-api-test-tool: Collect TransactionServiceIT tests into groups.

* ledger-api-test-tool: Split TransactionServiceIT into lots of suites.

CHANGELOG_BEGIN
- [Ledger API Test Tool] The ``TransactionServiceIT`` test suite has
  been split into many test suites. If you are including or excluding
  it, you will need to use the new test suite names, or you can use
  "TransactionService" as a prefix for all of them.

  If you are including or excluding individual tests, you will need to
  update your arguments with the new test suite. You can find the new
  test suite by running the test tool with the ``--list-all``
  flag and looking for the test's short identifier. The short
  identifiers have not changed, with the exception of
  ``TXNoContractKey``, which has been renamed to ``CKNoContractKey`` and
  is now in the ``ContractKeysIT`` test suite.
 CHANGELOG_END
2021-08-17 14:52:54 +00:00
Samir Talwar
386965c466
Upgrade Flyway to v7. (#10594)
Flyway v6.5 does not officially support the latest versions of
PostgreSQL.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-17 10:29:13 +00:00
Samir Talwar
5c8025269d
ledger-grpc: Fix the directory paths. [KVL-1005] (#10586)
* ledger-grpc: Fix the directory paths.

This brings _ledger-grpc_ in line with other projects. Scala main files
should be under "src/main/scala", and test files should be under
"src/test/suite/scala".

CHANGELOG_BEGIN
CHANGELOG_END

* ledger-grpc: Moar imports.
2021-08-16 16:38:00 +00:00
nickchapman-da
9db5ccfc4e
Normalize transactions & values as a separate pass (#10524)
* Normalize transactions & values as a separate pass. Use for simpler defintiion of isReplayedBy.

CHANGELOG_BEGIN
CHANGELOG_END

normalize transaction version

* remove stray import from bad merge which breaks scala 2_12 build

* change isReplayedBy to only norm its RIGHT (replay) argument

* add forgotton normalization for ValueEmum

* switch to use existing value normalization code (remove my newly coded duplicate code)

* normalize submittedTransaction before calling engine.validate

* dont call normalizeTx from Engine.validate

* *do* call normalizeTx from Engine.validate
2021-08-16 14:54:50 +00:00
tudor-da
99e1d78bb8
[Integrity Checker] Implemented pairwise Update normalizer (#10530)
* [Integrity Checker] Implemented pairwise Update normalizer

CHANGELOG_BEGIN
CHANGELOG_END

* Apply suggestions from code review

Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>

* Addressed review comments

Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>
2021-08-16 15:46:38 +02:00
nicu-da
cc37bc39cb
Set ErrorInfo metadata flag for definite_answer [KVL-1005] (#10583)
* Set ErrorInfo metadata flag for definite_answer, which is propagated from the completion status

CHANGELOG_BEGIN
ledger-api-client - Propagate definite_answer as metadata in the GRPC response for submit/submitAndWait
CHANGELOG_END

* Keep alphabetical order for bazel build files

* Add test for inclusion of metadata

* Formatting
2021-08-16 13:09:34 +00:00
Marton Nagy
1fc281f07e
ContractStorageBackend consolidation [DPP-462] (#10402)
* Adding CompletionStorageBackendTemplate
* Adding ContractStorageBackendTemplate
* Splitting EventStrategy and creating QueryStrategy
* Adding ComposableQuery for composable anorm string interpolation
* Adapting Backend implementations

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-16 11:56:28 +02:00
nicu-da
933b58e3aa
Extract grpc statuses to separate module [KVL-1005] (#10582)
* Extract grpc statuses to separate module for reuse

CHANGELOG_BEGIN
CHANGELOG_END

* Fix alphabetical order

* Formatting
2021-08-16 08:21:25 +00:00
nicu-da
0ef894447f
Use explicit types to track failures when submitting a request for execution [KVL-1005] (#10567)
* Use explicit types to track failures when submitting a request for execution

To distinguish from execution failures (represented by `CompletionFailure`) which is also exposed as part of the akka-bindings, we introduced `TrackingCompletionFailures` which can also represent the failure to add the request to the execution queue.

CHANGELOG_BEGIN
CHANGELOG_END

* Fix formatting

* Apply suggestions from code review

Co-authored-by: Hubert Slojewski <hubert.slojewski@digitalasset.com>

* Inline handling of errors in the tracker to eliminate the need for the secondary promise and simplify the code

* Update testing for the new error handling

* Remove brackets and make code compatible with 2.12

* Apply suggestions from code review

Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>

* Review cleanup and use inside for cleaner tests

Co-authored-by: Hubert Slojewski <hubert.slojewski@digitalasset.com>
Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>
2021-08-16 08:22:59 +02:00
Samir Talwar
4b8b67a1b5
Upgrade Scalatest to v3.2.9. (#10576)
* 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.
2021-08-12 23:19:35 +00:00
Samir Talwar
41e60f7302
Upgrade to Scala 2.12.14 and 2.13.6. (#10573)
* Upgrade to Scala 2.12.14.

* Upgrade Scala to 2.13.6.

CHANGELOG_BEGIN
CHANGELOG_END

* compability: Re-pin the Maven dependencies.
2021-08-12 14:25:53 +00:00
Samir Talwar
c69880ccf1
ledger-api-test-tool: Enforce test naming standards. (#10562)
* ledger-api-test-tool: Add some basic unit tests for test names.

* ledger-api-test-tool: Ensure that test names are not prefixes of others.

This makes sure that we can include or exclude any given test, without
affecting others.

* ledger-api-test-tool:Ensure that all tests have different names.

Looks like we had some copy-pasta.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-12 06:44:44 +00:00
nicu-da
ee34d0f80c
Track command - use types for error handling instead of grpc statuses [KVL-1005] (#10503)
* 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>
2021-08-12 08:37:53 +02:00
Andreas Lochbihler
5728bbc14f
add cryptographic hash method to ChangeId and base equality on hash (#10554)
CHANGELOG_BEGIN
CHANGELOG_END
2021-08-11 17:34:44 +02:00
Samir Talwar
2e4f2946fc
kvutils: Improve the test coverage of OffsetBuilder, and support negative numbers. (#10537)
* kvutils: Add property-based tests for the offset builder.

* kvutils: Avoid using `BigInt` in offset parsing.

This also means we can theoretically support negative offsets, even if
in practice it's probably a bad idea.

CHANGELOG_BEGIN
CHANGELOG_END

* kvutils: Further property-based tests for OffsetBuilder.

* kvutils: Improve a comment in OffsetBuilder.

Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>

Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>
2021-08-11 14:31:26 +00:00
nicu-da
99f59007bf
Add flag to enable/disable command deduplication [KVL-1006] (#10518)
* Add flag to enable/disable command deduplication

* Remove flags for configuration as it should not be exposed externally

* Move deduplicationEnabled flag to the write service.

The deduplication enabled flag is tightly coupled to the WriteService implementation so the flag has been moved to the WriteService trait so that it's explicitly defined.

CHANGELOG_BEGIN
Command deduplication is enabled/disabled based on the write service implementation.
v1 WriteService enables command deduplication while v2 WriteService disabled it
CHANGELOG_END

* Rename deduplication flag
Set sandbox deduplication to true and proxy write service to the delegage
2021-08-11 09:27:25 +02:00
Kamil Bozek
3b1d1ac7ac
IndexerBenchmark: an option for defining minimum update rate [DPP-541] (#10540)
* Changed default metrics reporting interval to 1 second

* Min update rate SLO

* Return exit code 1 on benchmark failure

* CHANGELOG_BEGIN
- [Integration Kit] - indexer-benchmark - added --min-update-rate option for defining required update rate
CHANGELOG_END
2021-08-10 23:08:06 +02:00
Oliver Seeliger
511f27c4d6
H2 Storage backend support for canton jdbc urls with user/password (#10523)
* H2 Storage backend support for canton jdbc urls with user/password

The H2 database's JdbcDataSource does not like seeing user/password
properties in the jdbc url raising errors upon hikari connection pool
initialization:

`org.h2.jdbc.JdbcSQLNonTransientConnectionException: Duplicate property "USER"`

expecting to be able to set user and password separately from passing on
the jdbc url.

As h2 is not supported in production and to get canton integration tests past this
resorting to parsing the jdbc url looking for user/password properties, removing
them from the url and instead setting them explicitly on the data source object.

changelog_begin
changelog_end

* Review feedback
2021-08-10 18:34:21 +00:00
fabiotudone-da
23168a87d8
KV / integrity checker: conflate Disputed, InvalidLedgerTime and Inconsistent rejection reasons [KVL-1059] (#10515)
* Integrity checker: conflate Disputed, InvalidLedgerTime and Inconsistent

CHANGELOG_BEGIN
CHANGELOG_END

* RejectionReasonNormalizer -> CommandRejectionRedesignNormalizer
2021-08-09 11:16:01 +02:00
Samir Talwar
683cccc57f
timer-utils: If RetryStrategy eventually fails, explain what happened. (#10511)
For example, if the attempts limit is exceeded, say so.

I hope this will be useful in diagnosing flaky tests.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-09 07:32:25 +00:00
Samir Talwar
4406e98117
Create a proper state enum in LedgerConfigurationSubscriptionFromIndex. [KVL-1046] (#10508)
* Add tests for rejections in LedgerConfigurationSubscriptionFromIndex.

* Create a proper state enum in LedgerConfigurationSubscriptionFromIndex.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-06 16:03:12 +00:00
Samir Talwar
fe1c678531
sandbox: Attempt to make the reset service tests less flaky. (#10507)
* sandbox: Do less when resetting.

We don't need to reconstruct some basic things.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox: When testing the reset service, keep trying.

If we scale up the test duration, we also need to scale up the timeouts.

* timer-utils: If `RetryStrategy` eventually fails, explain what happened.

For example, if the attempts limit is exceeded, say so.

* Revert "timer-utils: If `RetryStrategy` eventually fails, explain what happened."

This reverts commit 6647681688.
2021-08-06 15:26:25 +00:00
Samir Talwar
07da936421
participant-integration-api: Always wait for the first config lookup. (#10500)
* participant-integration-api: Always wait for the first config lookup.

This means we don't have to guess how long a `lookupConfiguration()`
round trip will take. Instead we can just submit the initial
configuration if one is not found.

Some drivers may still need to wait a while for other reasons.

CHANGELOG_BEGIN
CHANGELOG_END

* kvutils: Explain `delayBeforeSubmitting`.

Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>

Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2021-08-06 12:47:31 +00:00
Samir Talwar
9da6b04202
participant-integration-api: Make the initial ledger config optional. [KVL-1046] (#10498)
* participant-integration-api: Make the initial ledger config optional.

CHANGELOG_BEGIN
- [Integration Kit] The initial ledger configuration is now optional;
  if it is not specified, the participant will not attempt to submit a
  configuration, but instead wait for something else to provision the
  ledger with a configuration.

  This behavior is intended to be used by ledger drivers that have
  alternative means of setting up the initial ledger configuration. If
  no configuration is provisioned, the participant server will not be
  able to submit commands to the ledger.
CHANGELOG_END

* participant-integration-api: Avoid `Option#zip`.

It returns an `Iterable` in Scala 2.12, which is not helpful.
2021-08-06 09:22:06 +00:00
Samir Talwar
a7fa7d3aa8
participant-integration-api: Rename and restructure the configuration initialization classes. [KVL-1046] (#10496)
* Rename configuration initialization classes.

CHANGELOG_BEGIN
CHANGELOG_END

* Add call parentheses to `latestConfiguration()`, because it's impure.

* Split construction of configuration classes into multiple steps.

* participant-integration-api: Rename a class. Again.
2021-08-06 07:08:48 +00:00
nicu-da
35641b7f62
Add submission id to the GRPC api [KVL-999] (#10467)
* 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
2021-08-06 08:54:54 +02:00
Samir Talwar
df78f9cb1e
Replace LedgerConfiguration with InitialLedgerConfiguration or the load timeout. [KVL-1058] (#10487)
* 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.
2021-08-05 16:31:45 +00:00
Samir Talwar
12599e7f06
Disable configuration management until the ledger has a configuration. [KVL-1058] (#10478)
* participant-integration-api: Move test constants to a companion object.

TelemetrySpecBase doesn't need to expose those through inheritance.

* Avoid mocks in the configuration management service test.

* Add tests for `ConfigManagementService.GetTimeModel`.

* Add tests for `ConfigManagementService.SetTimeModel`.

* Disable configuration management until the ledger has a configuration.

CHANGELOG_BEGIN
- [API Server] The configuration management service previously returned
  the participant-specified default configuration if none was found on
  the ledger. This can be misleading, and so the ``GetTimeModel``
  endpoint now returns a gRPC ``NOT_FOUND`` error if no configuration
  has been found yet. Similarly, the ``SetTimeModel`` endpoint returns a
  gRPC ``UNAVAILABLE`` error.

  This should only happen if the participant gives up waiting for the
  ledger to provide a configuration, which is very unlikely in a
  production setting. In this case, the ledger will also not respond to
  command submissions.
CHANGELOG_END

* participant-integration-api: Extract some test variables for clarity.

In ApiConfigManagementServiceSpec.

* sandbox: Improve some variable and parameter names in tests for clarity.

* Improve the error message in case of a missing ledger configuration.

Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>

* ledger-api-common: Improve an error status constructor name.

Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>

Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>
2021-08-04 20:34:22 +00:00
Oliver Seeliger
50c7b79f83
Indexer db MigrateOnEmptySchemaAndStart startup mode and migrateOnly hook (#10457)
* Indexer db MigrateOnEmptySchemaAndStart startup mode and migrateOnly hook

changelog_begin
Indexer: The indexer now supports the MigrateOnEmptySchemaAndStart startup mode that only performs migrations
on brand-new databases. In addition "real upgrades" are now supported via a new "StandaloneIndexerServer.migrateOnly"
entry point.
changelog_end

* Adding `additionalMigrationPaths` facility for testing on canton side
2021-08-04 13:44:02 +02:00
Remy
c243f82525
LF: Clean up of Errors (#10052)
part of #9974

 - rename `msg` field to `message`
 - drop `engine.Error.Validation.Generic`
 - rename argument `where` to `location`
 - Builtin set the `dependsOnTime` before throwing the callback `SResultNeedTime`

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-03 18:35:34 +02:00
Samir Talwar
45ed615891
participant-integration-api: Use Scheduler, and add more tests to configuration initialization. [KVL-1046] (#10461)
* participant-integration-api: Use `Scheduler` instead of `Materializer`.

Simpler API, and we can inject a test scheduler to make the tests more
reliable.

CHANGELOG_BEGIN
CHANGELOG_END

* participant-integration-api: Use a test scheduler in tests.

This makes the tests faster and more reliable.

* participant-integration-api: Cancel timeout when the config is found.

* participant-integration-api: Fail properly if config lookup fails.

* participant-integration-api: Handle failures in provisioning config.

* participant-integration-api: Test shutting down the config provisioner.

* participant-integration-api: Use the scheduler cancellations.

More useful than a boolean.

* participant-integration-api: Handle submission ID generation failure.

Unfortunately this is untestable, because the only output is logging,
which we can't test right now.

* resources-akka: Add `ResourceOwner.forCancellable`.

* participant-integration-api: Simplify the config provisioner.

This makes it a set of functions; we don't need a class. There is no
exposed behavior.

* participant-integration-api: Use the services EC to initialize config.

* participant-integration-api: Add comments around `release`.

Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>

* Revert "participant-integration-api: Handle submission ID generation failure."

This reverts commit 72b13771a7.

* participant-integration-api: Factor out a `LedgerConfigProvider` class.

Again.

TBH, it is cleaner than multiple parameter methods.

Also adds more Scaladoc.

* resources-akka: `ResourceOwner.forCancellable` is now generic.

It returns whatever type the `acquire` function returns, to allow for
subtypes of `Cancellable`.

Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>
2021-08-03 14:49:00 +00:00
mziolekda
f1c7548b7a
remove unstable marker for append-only features (#10465)
CHANGELOG_BEGIN
CHANGELOG_END
2021-08-03 10:09:11 +00:00
Oliver Seeliger
a074bb1c50
Append-only schema h2 database fix (#10462)
* Append-only schema h2 database fix

Remove reference to public schema

changelog_begin
changelog_end

* Fix sha256 accordingly
2021-08-02 19:28:44 +00:00
Remy
1971274893
Reactive canton conformance test aginst LF 1.13 (#10458)
Now we compile the conformance test for 1.13, we can run conton
against 1.13.

follow up of #10456

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-02 19:43:37 +02:00
Samir Talwar
db7728ad4f
participant-integration-api: Split LedgerConfigProvider into two, and add test cases. [KVL-1046] (#10455)
* participant-integration-api: Split `LedgerConfigProvider` into two.

We now have a read-only `CurrentLedgerConfiguration`, and a write-only
`LedgerConfigProvisioner`.

CHANGELOG_BEGIN
CHANGELOG_END

* participant-integration-api: Improve logging in LedgerConfigProvisioner.

Making use of the logging context.

* participant-integration-api: Extract a CurrentLedgerConfiguration trait.

This highlighted a few issues in the tests where we were unnecessarily
calling methods.

* participant-integration-api: Split LedgerConfigProviderSpec.

We can test the two components individually now.

* participant-integration-api: Add a test for streaming the config.

* participant-integration-api: Add tests for provisioning configuration.

* participant-integration-api: Move configuration code into a new package.

* participant-integration-api: Fake ledger config in tests.

Now that there's an interface, we can use it without worrying about
streaming from the index.

* participant-integration-api: Use `List`, not `Seq`, in test fixtures.

Scala 2.12 thinks `Seq.apply` yields a possibly-mutable sequence, which
is incompatible with `Source.apply`.

* participant-integration-api: Explain how `LedgerConfigProvider` works.
2021-08-02 16:07:35 +00:00
fabiotudone-da
5157ad6df3
KV: Fix KV's TransactionCommitter's rejection trace logs [KVL-1023] (#10454)
* Fix KV TransactionCommitter's rejection trace logs

CHANGELOG_BEGIN
CHANGELOG_END

* Remove unused logging context in Rejections.buildRejectionEntry

* fmt

* Log transaction rejection during post-execution as well

* buildRejectionStep -> reject

* immediateRejectionStep -> reject

* Update ledger/participant-state/kvutils/src/main/scala/com/daml/ledger/validator/preexecution/WriteSetSelector.scala

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>

* Hide buildRejectionEntry and wrap it as preExecutionOutOfTimeBoundsRejectionEntry

* Fix post-executor's rejection reason

* Improve preExecutionOutOfTimeBoundsRejectionEntry

* Remove unused import

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2021-08-02 14:50:36 +00:00
Moritz Kiefer
4cf5641678
Build & releases 1.13 Ledger API test tool (#10456)
Temporary hack to unblock Canton until they finish their exception support.

changelog_begin
changelog_end
2021-08-02 13:27:45 +00:00
nicu-da
ac0aef2892
Handle post-execution conflicts in the pre-execution workflow [KVL-806] (#10450)
* Stop execution when conflicts are detected and remove any retries.

As the current logic for retries had a flaw where we would continue the flow even if we had conflicts, we're removing the retries and fixing the flaw by dropping the transaction. In the future we might add back the retries if we need them.

CHANGELOG_BEGIN
Fix bug where post-execution conflict detection was ignored in the pre-execution workflow
CHANGELOG_END

* Extract common pre-execution test code

* Add test for pre-execution conflict detection

* Finish submission aggregator only on actual success

* Code review formatting

* Use recover to handle conflicts, simpler and clearer than transform

* Update test to verify submission is not submitted when dropping transaction
2021-08-02 13:25:09 +02:00
Samir Talwar
621b2e4a0c
Tidy up braces and whitespace in LedgerTimeAwareCommandExecutor. (#10451)
No real reason except that this was bugging me.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-02 09:44:47 +00:00
Miklos
a55210f7cf
Handle non-existent contract IDs defined in the transaction when validating model conformance [KVL-1041] (#10434)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-30 13:09:01 +02:00
Samir Talwar
9c08e4cf7e
Move logging value definitions alongside their objects. (#10439)
* logging-entries: Make `LoggingEntries` a non-case class.

There's no reason for it to need `equals`, etc.

CHANGELOG_BEGIN
CHANGELOG_END

* ledger-api-domain: Convert commands into a logging value.

Instead of having a function, let's use `ToLoggingContext`.

This also adds a couple of missing items, and always logs `workflowId`.

* participant-state: Convert updates into a logging value.

Instead of having a function, let's use `ToLoggingContext`.

This changes some of the logging context structure, but otherwise
everything remains the same.

* Make sure Scaladoc is lined up for modified code.
2021-07-29 09:21:27 +00:00
Remy
41642ab6b1
Refactor KV Benchmarks for Daml-LF Protobuf translations (#10433)
- Drop the wrapper `Versioned` and use directly the `VersionedValue` proto class. Values
  should not be handled alone outside the Engine.
- Add benchmarks to aggregate (de)serialization and (en/de)coding
- This also fixes a recursion limit decoding issue that appears with #10393.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-28 17:00:09 +02:00
Samir Talwar
d666f76fbb
participant-integration-api: Switch to the v2 participant state API. [KVL-1002] (#10398)
* participant-state: Give `ChangeId` its own file.

* participant-state: Introduce `v1.CompletionInfo` for a while.

`CompletionInfo` is identical to `SubmitterInfo`. Its purpose is to make
the migration to v2 easier. It should not make it into the final
version.

* participant-integration-api: Switch to the v2 participant state API.

This means that:

  - the API server and indexer expect v2 API traits
    - adapters are provided if you need to elevate your v1 API usage
  - the indexer internally uses v2 Updates
  - rejections are switched over to use the v2 format
  - Sandbox Classic uses v2 as the internal representation too (because
    it interacts directly with the underlying indexer representation,
    and is therefore tightly coupled)

_kvutils_ and other users of the `StandaloneApiServer` and
`StandaloneIndexerServer` use the adapters.

CHANGELOG_BEGIN
- [Integration Kit] The API server and indexer have switched over to v2
  of the participant-state API. You can continue to use the v1 API, but
  you will need to wrap your ``ReadService`` and ``WriteService``
  objects in the ``AdaptedV1ReadService`` and ``AdaptedV1WriteSerivce``
  classes.
CHANGELOG_END

* participant-state: Remove v1.CompletionInfo.

It's served its purpose.

* kvutils: Remove an unnecessary line from `Runner`.

* ledger-api-common: Delete a TODO; we'll track it elsewhere.

* participant-integration-api: Use full words in `JdbcLedgerDao`.

Just a little bit of cleanup.

* ledger-api-common: Extract out the random submission ID generator.

And introduce a trait, because, well, this is still the JVM.
2021-07-28 14:59:23 +00:00
Remy
41009f79cc
Compiler: Make LF 1.14 the default output (#10394)
CHANGELOG_BEGIN

- [Compiler] Default compiler output LF version is now 1.14

CHANGELOG_END
2021-07-28 12:14:56 +02:00
Remy
cf7b1bb8b5
LF: ValueDecoder set recursion limit for values. (#10393)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-28 12:14:15 +02:00
Miklos
b5e9d86114
Moved DamlSubmission* into separate proto file [KVL-980] (#10362)
CHANGELOG_BEGIN
[Integration Kit] Moved definitions of `DamlSubmission` and `DamlSubmissionBatch` to a separate proto file under the package `com.daml.ledger.participant.state.kvutils.wire`. In case you are directly referencing these messages you will have to update your imports.
CHANGELOG_END
2021-07-27 20:58:13 +02:00
Sofia Faro
0da814d250
Let stable packages bypass LF version restrictions. (#10377)
* Stable packages bypass version restrictions.

Part of #10029

changelog_begin
changelog_end

* Add missing bypass

* scalafmt

* Fix tests

* fix script runner

* Fix scenario service

* Dont make stable packages configurable

* unused import

* revert unnecessary formatting changes

* Added a StableOnly engine mode and a conformance test that uses it

* buildifier-fix

* Inline LanguageVersions.StableOnly

* scalafmt

* Remove EngineMode in favor of representing the version range directly

* Add -unsafe to flag name

* Apply suggestions from code review
2021-07-27 18:51:00 +00:00
Miklos
3ca46a4bcb
Removed unused import. (#10425)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-27 15:22:22 +00:00
Samir Talwar
7c88b56e16
participant-integration-api: Fix completion debug log output. (#10415)
* participant-integration-api: Fix completion debug log output.

So it doesn't embed Scala class names.

**Before:**

```
DEBUG c.d.p.a.s.ApiCommandCompletionService - Responding with completions: List(LoggingEntries(Map(commandId -> OfString(SemanticDoubleSpendBasic-alpha-2992c8731c2f-command-1), statusCode -> OfString(0)))), context: {parties: ["SemanticDoubleSpendBasic-alpha-2992c8731c2f-party-1"], offset: "000000000000000a0000000000000000"}
```

**After:**

```
DEBUG c.d.p.a.s.ApiCommandCompletionService - Responding with completions: [{commandId: SemanticDoubleSpendBasic-alpha-29a7c9d39f7b-command-1, statusCode: 0}], context: {parties: ["SemanticDoubleSpendBasic-alpha-29a7c9d39f7b-party-1"], offset: "000000000000000a0000000000000000"}
```

CHANGELOG_BEGIN
CHANGELOG_END

* participant-integration-api: Move completion stream logs into context.

It's structured data; let's treat it as such.
2021-07-27 12:53:38 +00:00
Remy
72cf2f36d3
LF: replace bazel keyword stable by default (#10410)
to refer to the compiler default LF output.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-27 09:27:03 +02:00
danielporterda
39c6e0b329
Fix oracle message too long error (#10413)
* simplify oracle migration scripts

* CHANGELOG_BEGIN
simplify oracle migration scripts
CHANGELOG_END
2021-07-26 23:13:41 -04:00
Oliver Seeliger
2094e24f28
Indexer ValidateAndWaitOnly startup mode for canton participant HA (#10290)
* Indexer ValidateAndWaitOnly startup mode for canton participant HA

changelog_begin
changelog_end

* Review feedback
2021-07-26 18:32:33 +02:00
Kamil Bożek
3cedd83447
Easy to parse ledger-api-bench-tool logs (#10320)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-26 15:56:12 +02:00
Samir Talwar
b325e8a8b8
participant-state: Remove WriteService#rejectSubmission. (#10407)
It's not currently used. We will re-introduce it when we plan on
actually implementing it.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-26 13:03:05 +00:00
Samir Talwar
9be520c3e8
Keep the participant-state API prefixed. [KVL-1002] (#10405)
* participant-integration-api: Keep the state API prefixed.

So we can easily change the version.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox-classic: Keep the state API prefixed.
2021-07-26 13:00:44 +00:00
Kamil Bożek
8b337bda4b
Publish ledger-indexer-benchmark (#10401)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-26 13:53:56 +02:00
Samir Talwar
9e05f38f51
ledger-api-domain: Store the deduplication duration in Commands. [KVL-1002] (#10403)
* ledger-api-domain: Store the deduplication duration in `Commands`.

We can compute the max deduplication time from this later.

CHANGELOG_BEGIN
CHANGELOG_END

* ledger-api-domain: Refactor out `Commands#deduplicateUntil`.
2021-07-26 11:49:17 +00:00
Samir Talwar
b9518ce2f4
participant-state-metrics: Add wrappers for v2. (#10404)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-26 11:06:02 +00:00
Samir Talwar
d7077e154f
Introduce locally-defined Rejection reasons instead of the participant-state rejection reason type. [KVL-1002] (#10376)
* participant-integration-api: Reduce usage of the state RejectionReason.

Use a local `Rejection` enumeration instead.

This also changes an implicit conversion to be a somewhat-explicit
conversion.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox-classic: Internalize rejection reasons.

Instead of using RejectionReasonV0, we can declare them locally.

* kvutils: Create internal rejection reasons in the committer.

These can be converted to state rejection reasons later.

By using internal rejection representations, we're not coupled to the
state API.

* sandbox-classic: Remove unused code from `Rejection`.

* participant-integration-api: Push the rejection reason conversion down.

Just a little bit further.

* participant-integration-api: Add tests for converting rejection reasons.

* participant-integration-api: Remove an unused test dependency.
2021-07-23 13:20:00 +00:00
tudor-da
96f048330a
[Divulgence pruning] Conformance tests implementation [DPP-484] (#10385)
* [Divulgence pruning] Conformance tests implementation

CHANGELOG_BEGIN
[Integration kit] Extended the Ledger API test tool with tests for the pruning of all divulgence events.
CHANGELOG_END

* Addressed review comments
2021-07-23 14:33:52 +02:00
Remy
4a33c03f72
LF: Add check of nesting in SValue.toValue (#10370)
The conversion of SValue to Value already ensures the resulting value
has a serializable type. Here we add a check to ensure it does not
overpass the maximum allow nesting.
2021-07-22 17:49:54 +02:00
mziolekda
74751ba9a8
Populate workflow-id in the test-tool scenarios (#10372)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-22 14:12:53 +02:00
Samir Talwar
37ff1a60fe
ledger-configuration: Return a structured error from checkTime. [KVL-1002] (#10373)
* ledger-configuration: More rigorous tests for LedgerTimeModel.

Let's actually check the return values, not just the constructor.

* ledger-configuration: Create a type that represents time out of range.

Only used in testing for now.

* ledger-configuration: Return a structured error from `checkTime`.

CHANGELOG_BEGIN
CHANGELOG_END

* ledger-configuration: We like braces.

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-07-22 10:56:05 +00:00
Marton Nagy
c0a24fe9b6
HA PoC behind a feature flag [DPP-426] (#10227)
* Removing previous Async commit features

Previous async commit features had
- async commit configured by conifg-param
- special treatments to stil force sync commit for certain threadpools
- special treatment to stil force sync commit on transaction level for certain transactions.

This is a preparation step to clean the path for adding a new approach for async commit treatment:
- only session/connection level async configuration
- no transaction level special treatments
- only enable async commit for specific Connection pools (where it is needed / is safe)

* Add DataSourceStorageBackend

- to spawn DataSources in a controlled fashion
  these will be needed in upcoming commits for the HikariCP
- DataSources can have Connection init hooks defined with the help of the InitHookDataSourceProxy (this is needed for HA implementation)
- added DataSourceConfig to capture needed level of fine-tuning for DataSource creation

* Switches to DataSource wrapping in HikariCP instantiation
* Adds DBLockStorageBackend

- this is the abstraction and the implementation of database level locking
- with support for Oracle and Postgres

* Adds HaCoordinator and implementation
* Wiring of HaCoordinator in parallel indexer
* Adds feature flag

changelog_begin
changelog_end
2021-07-22 00:36:32 +02:00
Remy
63739fa712
Add conformance test for deeply nested values (#10319)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-21 20:00:26 +02:00
Remy
faf479e8c8
LF: add context in LookupError (#10314)
This is part of #9974.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-21 19:03:53 +02:00
fabiotudone-da
49745f6e47
Re-add application_id to DamlCommandDedupKey [KVL-1000] (#10341)
* Re-add `application_id` to DamlCommandDedupKey

CHANGELOG_BEGIN
CHANGELOG_END

* Fix test

* Merge main

* commandDedupKey: reorder calls to proto builder setters according to proto order

* Empty commit to set the changelog

CHANGELOG_BEGIN
[Integration Kit] The command de-duplication key now also includes the daml application ID
CHANGELOG_END
2021-07-21 14:16:51 +00:00
Hubert Slojewski
628aa22f51
kvutils: Refined transaction validation [KVL-1015] (#10066)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-21 14:20:17 +02:00
Samir Talwar
d1e84c8563
participant-integration-api: Fill out stubs in ApiSubmissionServiceSpec. (#10349)
* participant-integration-api: Fill out stubs in ApiSubmissionServiceSpec.

This test fails sometimes and it's hard to figure out why because of the
number of benign stack traces in the logs, caused by missing stubs.

By filling out the stubs so that `LedgerConfigProvider` can use them, we
get much clearer test logs, which should hopefully help us diagnose the
error properly next time the test fails in CI.

CHANGELOG_BEGIN
CHANGELOG_END

* participant-integration-api: Fix flake in ApiSubmissionServiceSpec.

Writing the configuration is non-deterministic and unnecessary.

* participant-integration-api: Use resources in ApiSubmissionServiceSpec.

Not always the best idea to use a resource after it's been released. And
this isn't Rust, so we can't force that at compile time.
2021-07-21 11:26:46 +00:00
Miklos
bdc3e509b3
Separate ledger export related message from other kvutils messages [KVL-980] (#10343)
CHANGELOG_BEGIN
* [Integration Kit] Made `daml_kvutils.proto`'s location follow its proto package and moved `LedgerExportEntry` into a separate proto file. You may have to update your proto import statements in case you are directly importing proto files from the kvutils library.
CHANGELOG_END
2021-07-21 12:23:33 +02:00
Samir Talwar
70e8ff46da
participant-integration-api: De-spacify PostCommitValidationSpec. (#10350)
There was far, far too much whitespace in this test file.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-21 10:10:22 +00:00
Samir Talwar
cf2b61e6ac
participant-state: Remove the aliases to Ref.LedgerString. (#10325)
* participant-state: Remove the aliases to `Ref.LedgerString`.

Use the aliases directly in `Ref` instead.

CHANGELOG_BEGIN
CHANGELOG_END

* daml-lf/data: Improve comments on ID aliases.

* daml-lf/data: Fix a typo in a comment.

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-07-21 08:34:46 +00:00
Miklos
271f9daedd
Added back DeduplicationPeriod.DeduplicationOffset [KVL-998] (#10324)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-20 17:48:04 +02:00
mziolekda
742bdcbeea
Describe prometheus in daml-on-sql README (#10307)
* Describe prometheus in daml-on-sql README
CHANGELOG_BEGIN
CHANGELOG_END

* changes post-review
2021-07-20 17:44:57 +02:00
tudor-da
93d0ed6821
[Mutable cache] Resolve with full lookup on negative cache read-through lookups [DPP-501] (#10262)
* [Mutable cache] Resolve with full lookup on missed cache thread-throughs
* Do not store negative lookups
* Metrics for counting divulgence and full lookups
* Metrics for counting read-through not found

CHANGELOG_BEGIN
CHANGELOG_END

* Added comment detailing secondary lookups for divulgence

* Apply suggestions from code review

Co-authored-by: Simon Meier <meiersi-da@users.noreply.github.com>

Co-authored-by: Simon Meier <meiersi-da@users.noreply.github.com>
2021-07-20 16:15:04 +02:00
Samir Talwar
c3bc26fd1c
daml-lf/data: Move ID aliases to Ref from _ledger-api-common_. [KVL-1002] (#10323)
* 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.
2021-07-20 11:01:19 +00:00
tudor-da
a6bf892f72
[In-memory fan-out] CLI parameters update (#10250)
* [In-memory fan-out] CLI parameters update
* Enforce consistency for experimental CLI parameters for append-only, mutable state cache and in-memory fan-out
* Set default in-memory fan-out buffer size to 10K.

CHANGELOG_BEGIN
CHANGELOG_END

* Addressed review comments
2021-07-20 07:47:31 +00:00
Marton Nagy
5fa49c3312
Disables flaky test suite of InstrumentedSource.bufferedSource (#10321)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-20 06:48:49 +00:00
Samir Talwar
9a01065f29
participant-state: Remove the Daml-LF transaction and value aliases. [KVL-1002] (#10317)
* participant-state: Remove the Daml-LF transaction aliases.

They add nothing.

CHANGELOG_BEGIN
CHANGELOG_END

* participant-state: Move the `ContractInst` alias to where it's used.

Either inlining it or extracting out a similar alias elsewhere.

This further removes dependencies on _participant-state_.

* Fix a couple of typos.

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-07-19 18:32:28 +00:00
Remy
159728d716
LF: use Either by default in all archive reader API (#10295)
This is a follow up of #10277.
This is part of #9974.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-19 19:48:37 +02:00
Victor Peter Rouven Müller
80b65f6def
[DOCS] Add documentation for the JSON API metrics (#10312)
* [DOCS] Add documentation for the JSON API metrics

changelog_begin

- [JSON-API] You can now find a section `Metrics` in the http-json api documentation explaining how to enable metrics and which are available

changelog_end

* Fix rst build warnings

* Update docs/source/json-api/metrics.rst

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Adapt metrics doc to state that it IS an exhaustive list and remove wrong copy pasta text & add info about prometheus

* Update the legal values for the metrics reporter cli option

* shorten the description, the change prior was unnecessary ._.

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-07-19 17:32:23 +02:00
nickchapman-da
0e09f3ba08
Remove optLocation field from transaction nodes. (#10301)
* Remove Optional[Location] field from transaction nodes.

xoptLocation

working but very messy!

cleanup PartialTransaction code

pass locationInfo in CompleteTransaction

dont pass locationInfo in SumittedTransaction

pass optLocation to CheckAuthorization

temp reinstate xoptLocation in ExerciseContextInfo

cleanup Conversions.scala

remove Optional[Location] field from transaction nodes.

CHANGELOG_BEGIN
CHANGELOG_END

* fix bad merge

* fix build after merge

* rename

* doc comment, and question
2021-07-19 13:03:30 +00:00
fabiotudone-da
e62852fbfd
Make ledger API test tool's 'max-connection-attempts' into an option (#10311)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-19 14:43:44 +02:00
Samir Talwar
bd12170af2
participant-state: Remove the ParticipantId, PackageId, and Party aliases. [KVL-1002] (#10308)
* 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.
2021-07-19 12:31:25 +00:00
Samir Talwar
bd35f80efa
ledger-configuration: Correct the protobuf package. [KVL-1002] (#10302)
* ledger-configuration: Correct the protobuf package.

CHANGELOG_BEGIN
- [Integration Kit] The *ledger_configuration.proto* Protobuf definition
  has been repackaged under ``com.daml.ledger.configuration``, and the
  Java and C# packages have been renamed accordingly. If you are using
  this Protobuf definition, you will need to update your imports. The
  Maven artifact name has not changed.
CHANGELOG_END

* ledger-configuration: Resolve a naming collision in Scala 2.12.
2021-07-19 11:00:11 +00:00
fabiotudone-da
d69328d281
Ledger API Test Tool: add a --max-connection-attempts command line option [KVL-977] (#10297)
* Add a `--max-connection-attempts` command line option to the Ledger API Test Tool

BEGIN_CHANGELOG

- [Integration Kit] Add a `--max-connection-attempts` command line option to the Ledger API Test Tool

END_CHANGELOG

* Remove `.unbounded()` from the cmdline option

* fmt

* Restore `.unbounded()` in `[endpoints...]`

BEGIN_CHANGELOG
- [Integration Kit] Add a `--max-connection-attempts` command line option to the Ledger API Test Tool
END_CHANGELOG

* Remove stale comment

CHANGELOG_BEGIN
- [Integration Kit] Add a `--max-connection-attempts` command line option to the Ledger API Test Tool
CHANGELOG_END

* Update ledger/ledger-api-test-tool/src/main/scala/com/daml/ledger/api/testtool/infrastructure/LedgerTestCasesRunner.scala

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

* fmt

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-07-19 09:52:32 +00:00
Samir Talwar
1ee53c0736
participant-state-index: Use Ref directly. (#10299)
This avoids the dependency on _participant-state_.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-15 17:21:03 +00:00
Miklos
0eba812109
Remove trace_context field from Ledger API [KVL-1021] (#10256)
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
2021-07-15 19:06:25 +02:00
Samir Talwar
88886beb8d
ledger-configuration: Add tests for the Configuration decoding methods. [KVL-1002] (#10293)
* ledger-configuration: Add tests for Configuration.

CHANGELOG_BEGIN
CHANGELOG_END

* ledger-configuration: Reject a negative maximum deduplication time.

* ledger-configuration: Remove duplication in Configuration.

* ledger-configuration: Make some Configuration methods private.

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

* ledger-configuration: Remove some extra braces.

* ledger-configuration: Use tables to simplify rejection tests.

* ledger-configuration: Add a test for an unknown version.

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-07-15 16:15:08 +00:00
Samir Talwar
cb29f34d4b
ledger-offset: Move Offset to a new package. [KVL-1002] (#10296)
* ledger-offset: Move `Offset` to a new package.

CHANGELOG_BEGIN
- [Integration Kit] The ``Offset`` type has been moved to a new Maven
  package, ``ledger-offset``, from the ``participant-state`` package.
  The Java package has been renamed to ``com.daml.ledger.offset``. If
  you are using this type, you will need to update your dependencies and
  imports.
CHANGELOG_END

* Avoid rewrapping offsets for no reason.

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

* participant-integration-api: Sort some imports.

* participant-integration-api: Fix dependencies for the Oracle tests.

I didn't add `ledger-offset`.

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-07-15 17:53:03 +02:00
Samir Talwar
70b12f04d0
ledger-on-sql: Remove conformance tests for H2 and SQLite files. (#10291)
We don't use these in any kind of production setting, and it reduces the
CI overhead a lot.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-15 13:31:25 +00:00
Samir Talwar
a9a0b70b85
ledger-configuration: Extract the configuration from participant-state. [KVL-1002] (#10279)
* ledger-configuration: Extract configuration from participant-state.

The configuration is often used without the state, and doesn't need to
be versioned in the same way.

CHANGELOG_BEGIN
- [Integration Kit] The ledger configuration classes, ``Configuration``,
  ``LedgerInitialConditions``, and ``TimeModel``, have been moved from
  *participant-state* to a separate package named
  *ledger-configuration*, in the Java package
  ``com.daml.ledger.configuration``. You will need to update your
  dependencies and imports.
CHANGELOG_END

* participant-state: Remove the `LedgerId` aliases.

* ledger-configuration: Rename `TimeModel` to `LedgerTimeModel`.

This avoids confusion with the protobuf-generated `TimeModel` classes.

CHANGELOG_BEGIN
- [Integration Kit] ``TimeModel`` has been renamed to
  ``LedgerTimeModel``. If you are using the ledger configuration classes
  directly, you may need to update your code.
CHANGELOG_END

* ledger-configuration: Remove colons in LedgerInitialConditions' docs.

* kvutils: Restore a missing compat import.

* participant-integration-api: Add ledger-configuration to Oracle tests.

* sandbox-common: Fix `--max-ledger-time-skew` docs.

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-07-15 13:03:19 +00:00
Robert Autenrieth
d565cae913
DPP-457 Add UpdateToDbdto tests (#10116)
* Extract interface for LfValueTranslation

* Add unit tests for UpdateToDbDto

changelog_begin
changelog_end

* Move constants to companion object

* Address review comments

* Address review comments
2021-07-15 12:00:46 +02:00
tudor-da
ba8e829c8d
[In-memory fan-out] Oracle support (#10263)
* [In-memory fan-out] Oracle support

CHANGELOG_BEGIN
CHANGELOG_END

* Correct so Oracle backend works with fan out enabled - add implicit conversion and correct view defaulting for BLOB fields
Add missing tests to oracle append only spec as it lagged behind postgres and h2
Regen sql sha for oracle

CHANGELOG_BEGIN
CHANGELOG_END

* avoid global import of implicit that is not needed

* reduce duplication on conformance test targets

* update sha for oracle append only flyway scripts

Co-authored-by: Brian Healey <brian.healey@digitalasset.com>
2021-07-14 21:10:12 +00:00
Remy
a8f190214c
LF: change type from Try to Either in archive module (#10277)
* 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>
2021-07-14 19:24:31 +00:00
Marton Nagy
191d3b82ce
Add unit test to SequentialWriteDao [DPP-456] (#10265)
* also fix an expectation in the ParallelIndexerFactorySpec

changelog_begin
changelog_end
2021-07-14 14:25:06 +00:00
mziolekda
2271f93b69
Fix crash on duplicate submissionId (#10242)
* CHANGELOG_BEGIN
Fix crash in ConfigManagement- and PackageManagement- services on duplicate submissionsIds from different participants.
Extend ledger-api-test-tool to cover the duplicate submissionId cases.
CHANGELOG_END

* Addressing review comments and fixing failing tests

* format

* address more review comments

* adopt after rebase to main
2021-07-14 14:12:31 +00:00
Remy
906184ce1a
LF: Simplify UniversalDarReader (#10271)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-14 15:38:22 +02:00
Remy
caf85a2270
LF: rationalize archive Parser/Reader/Decoder (#10239)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-14 11:05:17 +02:00
Miklos
21a9e62f27
Add disclaimer to participant state v2 API [KVL-998] (#10254)
* Added disclaimer to Read/WriteService.

* Removed NeedCompletionOffsetForSubmissionId rejection reason.

* CHANGELOG_BEGIN
CHANGELOG_END

* Added disclaimers to adaptors regarding partial implementation.
2021-07-14 08:42:49 +00:00
Samir Talwar
6c63f96ba9
participant-integration-api: Move SeedService here. (#10261)
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
2021-07-14 08:35:29 +00:00
Hubert Slojewski
58c0b4694a
kvutils: Simplify usage of Rejections [KVL-1015] (#10258)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-14 09:15:39 +02:00
Hubert Slojewski
41aba1ca39
kvutils: Move unrelated test cases to a proper test class [KVL-1015] (#10257)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-14 09:15:25 +02:00
Samir Talwar
1f35db17c7
ledger-on-sql: Use random log entry ID allocation so we don't depend on SeedService. [KVL-1002] (#10255)
* ledger-on-sql: Abstract out the log entry ID allocator.

This is so we don't need to depend on `SeedService`.

CHANGELOG_BEGIN
CHANGELOG_END

* kvutils: Remove `allocateRandomLogEntryId` from production code.

* kvutils: Remove `SubmissionValidator.create`, as it's only for tests.

And remove default parameters for
`SubmissionValidator.createForTimeMode`.

* ledger-on-sql: Use the random log entry ID allocator.

In Sandbox, we still use the seed service, but this is not necessary
for ledger-on-sql tests.

* kvutils: Make `LogEntryIdAllocator.random` an `object`.

* ledger-on-sql: Move `RandomLogEntryIdAllocator` here.

It's not used anywhere else.

* ledger-on-sql: Add some documentation about the application code.

Just to make it clear it's not used in production.
2021-07-13 17:10:30 +00:00
tudor-da
de7a08fa7b
[In-memory fan-out] Handle null submitters in getTransactionLogUpdates (#10248)
* [In-memory fan-out] Handle `null` submitters in getTransactionLogUpdates

CHANGELOG_BEGIN
CHANGELOG_END

* Address review comments
2021-07-13 12:11:27 +00:00
Miklos
584169a2cc
Participant state v1-to-v2 adaptors [KVL-1002] (#10246)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-13 13:35:35 +02:00
Kamil Bożek
edaf541063
Adapt ledger-api-bench-tool to work with LR [DPP-424] (#10171)
* Print ledger-api-bench-tool final report when a stream in ended by shutting down API server
CHANGELOG_BEGIN
CHANGELOG_END

* Log ledger-api-bench-tool failure with specific header to make it compatible with the lr-sidecar

* Print final report on graceful shutdown even if streams are not complete

* trigger build
2021-07-13 09:58:51 +02:00
Marton Nagy
05e5218d06
Consolidating EventStorageBackend (#10224)
* Switching to composed anorm queries
* Switching to data-driven prepared statements where possible

changelog_begin
changelog_end
2021-07-12 19:55:52 +02:00
tudor-da
3fd3abfb26
Instrument buffer after contract state events stream (#10209)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-12 19:37:32 +02:00
Miklos
643a2de006
v2 participant state API draft [KVL-998] (#10210)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-12 18:11:52 +02:00
Marton Nagy
5abcd0482e
Adds Unit tests for parallel-ingestion [DPP-455] (#10238)
changelog_begin
changelog_end
2021-07-12 14:46:12 +00:00
Hubert Slojewski
3cdedcf885
kvutils: Extract validators from TransactionCommitter [KVL-1015] (#10235)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-12 15:04:18 +02:00
Remy
4eba4b00e8
Ledger: decouple BD value serialization library from archive library. (#10218)
The DB serialization library should no use damlLfCodedInputStream from
(archive decoding) to decode values.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-09 15:42:13 +02:00
Marton Nagy
48393444df
TODO Cleanup: QueryNonPruned [DPP-459] (#10225)
changelog_begin
changelog_end
2021-07-09 09:20:56 +00:00
tudor-da
0bea5e3ef7
Allow retriable lookupMaximumLedgerTime on contention (#10211)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-09 09:30:05 +02:00
Remy
f19f5b0821
LF: Simplify DarReader (#10217)
This PR simplifies a bit DarReader and UniversalDarReader

This is a follow up of #10208.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-08 17:03:45 +02:00
Remy
ebb76dca4c
LF: reorganize errors in com.daml.lf.archive (#10213)
* LF: reorganize errors in com.daml.lf.archive

part of #9974

CHANGELOG_BEGIN
CHANGELOG_END

* fix
2021-07-08 13:03:42 +00:00
Remy
41b8448b17
LF: Simplify archive reader. (#10208)
* 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
2021-07-07 19:56:40 +00:00
Moritz Kiefer
4fe626a055
Drop logging on CompletionSource (#10190)
The debug logs don’t seem all that useful and we don’t have them for
other sources, e.g., TransactionSource. They also come with error logs
for failed sources which again is inconsistent with other sources,
noisy and confusing.

changelog_begin
changelog_end
2021-07-06 16:12:05 +00:00
Gary Verhaegen
8750c0c47c
reduce noise in Scala bindings (#10187)
It's unlikely most clients will want all the details of the stack trace.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-06 15:02:40 +02:00
tudor-da
7b93923c16
[In-memory fan-out] Performance optimizations [DPP-470] (#10127)
* [In-memory fan-out] Fix execution contexts in ReadOnlySqlLedgerWithMutableCache
* servicesExecutionContext is used in all non-resource components
* Remove widespread use of resourceContext

CHANGELOG_BEGIN
CHANGELOG_END

* [In-memory fan-out] TransactionLogUpdatesConversions optimization
* Lazily convert to transaction trees in TransactionLogUpdatesConversions.ToTransactionTree

* Addressed review comments
2021-07-06 09:11:46 +02:00
Samir Talwar
e7e8a5705b
daml-lf/data: Optionally truncate party names in structured logs. [KVL-996] (#10163)
* 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_.
2021-07-01 16:50:49 +00:00
Samir Talwar
5493e4e2b1
language-support/scala/codegen: Set the logging level to WARN. (#10165)
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
2021-07-01 16:49:46 +00:00
mziolekda
40bec44bf9
Simple draw of stopping indexing upon unhealthy DbDispatcher (#10154)
changelog_begin
changelog_end

Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com>
2021-07-01 10:05:18 +02:00
Samir Talwar
eda1245311
daml-lf/data: Add a conversion from Ref.Identifier to LoggingValue. (#10157)
I am getting quite tired of (Bazel + Scala)'s attitude to transitive
dependencies.

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-30 20:05:06 +00:00
Samir Talwar
888f02aa4d
ledger-api-common: There's only one way to order absolute offsets. (#10153)
Let's not mess around with injectable orderings.

This has the pleasant side effect of removing dependencies.

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-30 14:17:59 +00:00
Kamil Bożek
9c7b506922
Increase timeout for TransactionServiceIT:TXFlatTransactionsVisibility (#10150)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-30 15:00:14 +02:00
Samir Talwar
c929a14486
logging-entries: Split from contextualized-logging. [KVL-996] (#10149)
* logging-entries: Split from contextualized-logging.

This allows us to introduce it to Daml-LF without bringing in the
Logback, Logstash, and gRPC dependencies.

CHANGELOG_BEGIN
CHANGELOG_END

* logging-entries: Fix dependencies for 2.12.

* logging-entries: Missed one more Scala 2.12 dependency.

* release: Publish logging-entries.
2021-06-30 12:08:33 +00:00
tudor-da
d5d6cfacff
[Mutable state cache] contractStateEvents bounded DB fetch size [DPP-464] (#10092)
* [Mutable state cache] TransactionsReader.getContractStateEvents bounded fetch page size

CHANGELOG_BEGIN
CHANGELOG_END

* Improved TransactionsReader.splitRange
* Removed explicit minChunkSize
* Added property check test

* Metrics for getContractStateEvents and getTransactionLogUpdates chunk fetch size

* Addressed review comments

* Adress Kamil's review comment

* Miklos' suggestion

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-06-30 09:25:07 +00:00
Samir Talwar
84e1f3a7f1
participant-integration-api: Move transaction requests to structured logging. [KVL-996] (#10141)
* participant-integration-api: Remove the subscription ID.

Pretty sure it's not used except for a single log line, which makes it
useless as a correlation ID.

If we want to correlate logs, let's add a correlation ID.

* participant-integration-api: Move transaction requests to trace logging.

Most of the useful information is already in the logging context. We
don't need to log the data structure too.

CHANGELOG_BEGIN
- [Ledger API Server] The amount of data logged in the API transaction
  service has been reduced at INFO level. Please enable TRACE logging to
  log the request data structures.
CHANGELOG_END

* participant-integration-api: Reorder methods in ApiTransactionService.

* participant-integration-api: Add the word "request" to some log lines.

* participant-integration-api: Add a logging prefix for string offsets.

* ledger-api-domain: `immutable.Set` -> `Set`.

It's an alias.

* participant-integration-api: Log transaction filters on subscription.

* participant-integration-api: Log transaction filters.

Just the parties isn't enough information.

* participant-integration-api: Log the entire transaction request.

Structured, because otherwise it's hard to throw things away later.

* contextualized-logging: Avoid `View` because it's not in Scala 2.12.

* contextualized-logging: Add tests for booleans.

* contextualized-logging: Avoid methods that accept views.

Scala 2.12 really doesn't like me when I do that.

* participant-integration-api: One more try at building with Scala 2.12.
2021-06-30 05:32:48 +00:00
Kamil Bożek
b79d02e28e
ledger-api-bench-tool - exposed metrics for Prometheus [DPP-471] (#10103)
* ledger-api-bench-tool: prometheus metrics prototype

* Total count metric exposed

* Re-enabled unit tests

* Exposed size metric

* Exposed delay metric

* Exposed consumption speed metric

* Separate exported metrics infrastructure

* Exposed metrics for active contract and completions streams

* Removed unused comment

* CHANGELOG_BEGIN
- [Integration Kit] - ledger-api-bench-tool - exposed metrics via Dropwizard metrics (e.g. for Prometheus)
CHANGELOG_END

* Fix linting

* Renamed  to

* Renamed damlMetrics to exposedMetrics, pt 2

* Improved resource management for metrics reporters

* Use global logger for metrics report
2021-06-29 19:29:13 +02:00
Moritz Kiefer
b61e519a3a
Release ledger API test tool per LF version (#10142)
Currently it is impossible to test new features until they land in the
default LF version. This is clearly not great. This PR releases one
Ledger API test tool per LF version (with the LF version being in the
name) to make it easier for Canton and others to test new features.

Note that at least the way things are setup now we won’t go back in
time. We will only publish stable, preview & dev but not older
versions. If needed, we could expand that in the future.

changelog_begin
changelog_end
2021-06-29 16:54:39 +00:00
Kamil Bożek
ef9a04caf5
Divulgence crash tests [DPP-433] (#9942)
* A test case for crashing participant in a multi-node env with divulged contracts

* Fixed test naming

CHANGELOG_BEGIN
CHANGELOG_END

* Additional usability check for the disclosed contract

* A newline

* Verify that fetching an archived contract is not possible

* Second test case

* A `ledger-api-test-tool` test case for divulging a contract with key twice on multiple participants [DPP-433] (#9970)

* A test case for divulging a contract with a key twice on multiple participants

CHANGELOG_BEGIN
CHANGELOG_END

* Use autogenerated archive method

* Trigger build

* Increased timeout for TransactionServiceIT:TXInvisibleTransactionTreeByEventId
2021-06-29 15:49:23 +02:00
Sofia Faro
a6ee10be9a
Move visibility checks into speedy. (#10136)
* pass readAs to Engine.interpret/submit

* rename VisibleByKey -> Visibility

* Stop generating SResultNeedLocalKeyVisible

* engine: Remove localKeyVisible in Result.consume

* Don't run visibility checks during validation.

changelog_begin
changelog_end

* return of the scalafmt

* rename SVisibility -> SVisibleToStakeholders

* Extend documentation in engine for new argument

* sneaky error caused by merge
2021-06-29 11:36:55 +01:00
Samir Talwar
c764fbe573
contextualized-logging: Introduce different logging types for more structure. [KVL-996] (#10134)
* contextualized-logging: Automatically convert logging values to strings.

For now, this has almost the same behavior, but it allows us to
customize the output in the future.

The main change is that the log format has gone from:

    context: {a=b, x=1, foo=bar}

to:

    context: {a: "b", x: "1", foo: "bar"}

* contextualized-logging: Move `writeTo` inside `LoggingValue`.

* contextualized-logging: Allow for more than just strings.

`null`, numbers, and sequences are now correctly logged.

The log format has gone from:

    context: {a: "b", x: "1", foo: "bar", parties: "[alice, bob]"}

to:

    context: {a: "b", x: 1, foo: "bar", parties: ["alice", "bob"]}

CHANGELOG_BEGIN
- The log output of Daml components has changed so that the structured
  part is closer to JSON. This allows us to distinguish and parse
  numbers and lists. If you are parsing this log output, you may need to
  change your parser.

  The log output has changed from:

  .. code-block::

     context: {a=b, x=1, foo=bar, parties=[alice, bob]}

  to:

  .. code-block::

     context: {a: "b", x: 1, foo: "bar", parties: ["alice", "bob"]}

CHANGELOG_END

* contextualized-logging: Extract the string serializer.

* Use non-string logging where possible.

* contextualized-logging: Split logging values from serialization.

So that callers don't have to know about Jackson.

* contextualized-logging: `SeqView` is `Iterable`. Don't need both.

* contextualized-logging: Make `ToStringToLoggingValue` a `val`.

Co-Authored-By: Stephen Compall <stephen.compall@daml.com>

* contextualized-logging: Add a transient dependency for 2.12 only.

This required more infrastructure than I thought it would.

* kvutils: Make it explicit that we're logging the hashes of archives.

The implicit was found to be a little confusing.

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2021-06-29 09:16:26 +00:00
Brian Healey
678cab0327
10050 append only schema on oracle (#10051)
* Oracle compliant append only schema

CHANGELOG_BEGIN
CHANGELOG_END

WIP : oracle on new appendonly schema

* diff to postgres dump, create consolidated view

* diff to postgres dump to ensure all oracle setup is equiv

* recompute sha for changed oracle flyway scripts

* drop old tables to prevent clash on name of new participant_events view

* recompute sha for flyway script

* prelim oracle StorageBackend

* Adds support for special preparedStatement for oracle

* Add support and wires to setObject by default everywhere
* Add the full OracleField suite with TODOs for convenience
* Wires OracleField suite to OracleFieldStrategy

changelog_begin
changelog_end

* enable debug version of oracle driver

* conversion Instant -> Timestamp for oracle

* WIP: primitive println debugging

* Passing PackagesSpec with appendonlyschema on Oracle
Rename size column to siz to avoid reserved word clash, including migration script for postgres

* include sha for new postgres migration script

* add missing copyright header

* cleanup

* passing party spec for appendonly on oracle

* passing configuration spec for appendonly on oracle

* scalafmt

* bazel buildifier reformat

* use db generic FETCH NEXT n ROW ONLY rather than limit for cross db compat

* siz instead of size for packages table on all dbs and schema

* revert enabling oracle jdbc debug

* Support Array[String] -> String conversion (and vice versa) for JSON array
Remove as aliases for tables as this does not work with oracle
Extract submitters clause for all db types
Use append transaction injector for oracle append only spec

* scalafmt

* correct oracle failing active contract spec tests

* wire in JdbcLedgerDaoCompletionsSpec

* remove semi-colons for ending statements that are problematic for oracle driver

* all tests up to divulgence passing for append only on oracle

* all appendonly tests passing on oracle

* remove ignore on fall back to limit-based query with consistent results

* do not change name of size column in packages table for mutable schema for all DBs

* do not change name of size column in packages table for mutable schema for all DBs

* standalone oracle appendonly schema script
regen shas on flyway scripts
revert some cosmetic refactoring in CommonStorageBackend

* Fixes conversion to parties from Oracle-JSON at flatEventWitnessesColumn

* Switches from composit SQLs to single SQLs at prepared statements to accommodate Oracle limitation

* Fixes arrayIntersectionWhereClause by applying patch from mutable Oracle schema integration

* Fixes queries with empty startExclusive Offsets

* First draw adding Oracle conformance test suites to CI

* wire in the oracle conformance tests for CI

* Use cross-db fetch next $n rows only syntax instead of limit syntax that works only for postgres/h2

* rename siz to package_size

* recompute shas

* scalafmt and include sha check for oracle append only flyway script

* correct missing package_size rename

* remove some todos -- correct corrupted V1__Init.sql

* Update ledger/ledger-on-sql/src/test/lib/scala/com/daml/ledger/on/sql/MainWithEphemeralOracleUser.scala

Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>

* correct version number for postgres rename column scripts

* remove unnecessary migration tables for oracle append only

* review feedback: rename createEventFilter as requested, remove todos

* review feedback: case consistency

* review feedback: update todos with issue markers

* review feedback: cleanup

* review feedback: OracleField and OracleSchema cleanup

* Fixing Table generators to use preparedData for convenience

* Placing TODOs for refactorings later

* Renames initial append-only oracle script, for convenience

* Falls back to original behavior as far prepared statements go at couple of queries

Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com>
Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2021-06-28 18:51:48 -04:00
Stephen Compall
f5e5062470
ensure that signatories and observers are disjoint in ledger-api CreatedEvents (#10123)
* document that signatories shouldn't appear in observers in ledger-api

CHANGELOG_BEGIN
CHANGELOG_END

* add disjoint signatories/observers checks to ACS and transaction ledger-api tests

* scala 2.12 compatibility

* "never" replaces "should not"

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-06-28 20:28:31 +00:00
mziolekda
ffc88d52b4
print version of the ledger api test tool as part of the report (#10119)
* print version of the ledger api test tool as part of the report
CHANGELOG_BEGIN
CHANGELOG_END

* correct bazel file
2021-06-28 17:35:32 +02:00
mziolekda
621cfa4a91
Resolve contract keys conflicts in disclosed contracts (#9948) (#10034)
* Resolve contract keys conflicts in disclosed contracts (#9948)

* build queries for nullifications of past key

* format code

CHANGELOG_BEGIN
In case a contract key is already present in a past contract in the contract table nullify it. This gets rid of contract keys of previously disclosed contracts. We never discover that disclosed contracts get archived, so we get conflicts on such past keys
CHANGELOG_END

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* correct oracle implemantation (new)

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-06-28 17:04:18 +02:00
Remy
3df2566305
Scenario: move Scenario Error Throwable to scenario package (#10075)
com.daml.lf.speedy.SErrorScenario => com.daml.lf.scenario.Error

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-28 12:04:57 +00:00
Remy
398300b76f
LF: Move Speedy Interpretation Error to transaction package (#10091)
to be accessible from any package

part of #9974

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-25 20:50:15 +02:00
Robert Autenrieth
7745693648
Remove duplicate index (#10084)
changelog_begin
changelog_end
2021-06-25 10:32:08 +02:00
Robert Autenrieth
1b617ae22d
DPP-428 Add missing indices for index initialization (#10083)
* Add missing indices for index initialization

changelog_begin
changelog_end

* Do not create unnecessary indices

* Create indices in H2

* Fix Oracle migration hash

* Verify all migration hashes
2021-06-25 10:31:58 +02:00
Samir Talwar
af9382ce92
contextualized-logging: Reduce the API surface and avoid name collisions. (#10102)
* contextualized-logging: Remove `Map` from the `LoggingContextOf` API.

* contextualized-logging: Encapsulate entries.

CHANGELOG_BEGIN
CHANGELOG_END

* contextualized-logging: Disambiguate `withEnrichedLoggingContext`.

So forthcoming implicit conversions won't confuse the compiler.

* contextualized-logging: Remove a now-unused compat import.

* contextualized-logging: Avoid overloading `LoggingEntries#apply`.

* contextualized-logging: Remove the silencer plugin.
2021-06-24 16:21:26 +00:00
Remy
f745f10394
LF: Realease LF 1.14 (#10077)
CHANGELOG_BEGIN
- [LF] Add support for Excepction
CHANGELOG_END
2021-06-24 13:44:09 +02:00
Marton Nagy
05056ddd8c
Cut a flaky expectation some more slack (#10106)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-24 11:35:41 +00:00
mziolekda
29ddc88dcb
remove redundant spaces in the log format (#10093)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-24 07:36:03 +00:00
Robert Autenrieth
01e329f2de
DPP-432 Add exception tests to the JdbcLedgerDao suite (#10040)
* Add exception tests

changelog_begin
changelog_end

* Add another test

This one tests a transaction that can only be
produced by a privacy-aware ledger.

* Address review comments
2021-06-23 23:20:18 +02:00
tudor-da
cbca779657
[In-memory fan-out] Ensure getTransactionLogUpdates with max fetch size (#10064)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-23 16:32:58 +00:00
mziolekda
db60d15b5e
Log ledger api validation failures at info level (#10080)
* CHANGELOG_BEGIN
Log ledger api validation failures at info level
CHANGELOG_END

* log validation failures in Api*Service family of classes

* address review comments
2021-06-23 13:31:48 +00:00
Victor Peter Rouven Müller
1f5aa4491c
[JSON-API] Add metrics for ledger command submission timing (#10076)
changelog_begin

- [JSON-API] Timing metrics which measure how long the processing of a command submission request takes on the ledger are now available

changelog_end
2021-06-22 15:59:23 +00:00
Victor Peter Rouven Müller
0391f3529f
[JSON-API] Add db metrics & response construction metrics (#10068)
changelog_begin

- [JSON-API] The database operations (regardless of in-memory or postgres) contain now metrics for fetching contracts by id or key (seperate metrics foreach)
- [JSON-API] The time for a repsonse payload construction of a request is now also tracked in a metric

changelog_end
2021-06-22 10:34:29 +02:00
tudor-da
ab8bac53ea
[In-memory fan-out] BuffersUpdater subscribes from the ledger end (#10037)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-21 14:37:55 +00:00
Victor Peter Rouven Müller
e4585295c6
[JSON-API] Add moar timing metrics (#10045)
* [JSON-API] Add more timing metrics

changelog_begin

- [JSON-API] Timing metrics are now available for party management, package management, command submission and query endpoints.
- [JSON-API] Also added a timing metric for parsing and decoding of incoming json payloads

changelog_end

* Add comments to new metrics

* Split metrics up more & remove obsolete metric

* Split up timers for query endpoints
2021-06-21 14:37:36 +00:00
tudor-da
a205d0e446
Enriched conformance tests for transactions (trees) streams (#9977)
* Check transactions from streams in TXHideCommandIdToNonSubmittingStakeholders
* Symetrically implement TXTreeHideCommandIdToNonSubmittingStakeholders
* Check witness non-leakage in TXRequestingPartiesWitnessVisibility
* Check witness non-leakage in TXTreesRequestingPartiesWitnessVisibility

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-21 11:23:45 +02:00
danielporterda
f3106c3e34
I9996 value limits it fails oracle (#10027)
* Creating OR predicate to reduce length of string literals
CHANGELOG_BEGIN
CHANGELOG_END

* removing unnecessary thrown exception
CHANGELOG_BEGIN
CHANGELOG_END

* switching to camel case for constants
CHANGELOG_BEGIN
CHANGELOG_END

* run format
CHANGELOG_BEGIN
CHANGELOG_END

* remove tolist conversion
CHANGELOG_BEGIN
CHANGELOG_END

* scalafmt

Co-authored-by: Brian Healey <brian.healey@digitalasset.com>
2021-06-17 23:48:31 +00:00
Marton Nagy
0fbc1ee67d
H2 support for append only schema (part2) [DPP-394] (#10030)
* Preparation: pull up initialisation
* Preparation: introduce partyArrayContext for more flexibility
* Preparation: add append-only-from-scratch feature to FlywayMigrations
* Add squashed Flyway migration for append-only H2
* Add support for H2 StorageBackend
* Extend conformance test suites for H2
* Extend JDBCLedgerDao unit test suites for H2
* Extend sandbox-classic unit test suites for H2
* Fixing typo, some renames based on review

changelog_begin
changelog_end
2021-06-17 15:34:25 +02:00
tudor-da
eee484b996
Implemented in-memory buffers prunning in BaseLedger (#9936)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-17 13:56:12 +02:00
Kamil Bożek
b96639ebc3
Do not terminate streams when no end-offset given in ledger-api-bench-tool [DPP-422] (#10035)
* Do not terminate transactions/transaction trees streams when no end-offset provided in the ledger-api-bench-tool

CHANGELOG_BEGIN
CHANGELOG_END

* Minor change
2021-06-17 13:30:16 +02:00
Marton Nagy
591176ccb9
Remove SqlSequence, cleanup code (#10042)
changelog_begin
changelog_end
2021-06-17 08:14:58 +00:00
Victor Peter Rouven Müller
1852830833
[JSON-API] Concurrent query etc. metrics (#10031)
* [JSON-API] Concurrent query etc. metrics

changelog_begin

- [JSON-API] The metrics which describe the amount of these concurrent events is now available:
	- running http request
	- command submissions
	- package allocations
	- party allocations

changelog_end

* Rename running metrics to throughput ones & add comments on the metrics

* Adjust names of other existing metrics too, to have for the json api a more consistent metrics naming
2021-06-16 17:08:06 +00:00
Brian Healey
993591e53b
truncate party name for 64 chars for multi-valued submitters to avoid… (#10000)
* truncate party name for 64 chars for multi-valued submitters to avoid excessively long metrics name

CHANGELOG_BEGIN
[metrics] Limit size of multi party metrics to ease consumption
CHANGELOG_END

* Use just first party for dynamic metrics when there are multiple parties involved
2021-06-16 08:52:27 -04:00
mziolekda
7a2a349daf
Log context of all updates written to the database (#10010)
* Log context of all updates written to the database
CHANGELOG_BEGIN
For every update in the index db log the full context at the INFO level.
CHANGELOG_END

* one more missing log
2021-06-16 13:48:15 +02:00
Marton Nagy
0fbfd9918b
DPP-394 h2 support for append only schema (#10009)
This is a preparation for H2 integration: reworking/opening up the ingestion DSL

* Pull more execution logic to PGTable, as preparing for batch insert execution
* Pull out Table from PGTable, add support for deletion (preparation for JDBC batch execution)
* Abstract over Schema (preparation for JDBC batch execution)
* Opening up Field, abstract over table creation (preparation for JDBC batch execution)
* Move code to common (preparation for JDBC batch execution)
* Add generic JDBC batch execution
* Add generic JDBC batch deletion and some more generic Field-s
* Pulling out PGSmallintOptional to support the postgres flavor
* Generalizing idempotentInsert in FieldStrategy
* Capture non empty data logic and comment in a util function
* Seal access to Schema internals

changelog_begin
changelog_end
2021-06-16 11:16:31 +02:00
Robert Autenrieth
adeba20659
DPP-403 log flyway progress (#9964)
* Log migration progress on kvutils participants

changelog_begin
changelog_end

* Log flyway progress in daml-on-sql

* Revert "Log flyway progress in daml-on-sql"

This reverts commit 7809b8cc54.

* Log flyway progress on daml-on-sql

... using a duplicated file
2021-06-15 21:32:27 +02:00
tudor-da
e49c7c8db7
[In-memory fan-out] BufferedTransactionsReader implementation [DPP-413] [DPP-414] (#9882)
* [In-memory fan-out] BufferedTransactionsReader implementation
* getTransactions
* getTransactionTrees

CHANGELOG_BEGIN
CHANGELOG_END

* Address review comments
2021-06-15 16:29:53 +02:00
Moritz Kiefer
998f106ee6
Drop pkgIds argument from Engine.validatePackages (#9986)
* Drop pkgIds argument from Engine.validatePackages

Doesn’t do anything useful, we just use it to validate that it matches
the keys of pkgs.

changelog_begin
changelog_end

* add test showing broken behavior

* Fix buggy tests

changelog_begin
changelog_end

Co-authored-by: Remy Haemmerle <Remy.Haemmerle@daml.com>
2021-06-15 10:58:43 +02:00
tudor-da
ae5010f3ef
[Mutable state cache] Start cache from latest ledger head (#9998)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-15 08:07:59 +00:00
Marton Nagy
66d38cd24d
Storage query abstraction first sketch (#9959)
changelog_begin
changelog_end
2021-06-14 16:05:57 +00:00
danielporterda
b6faace335
Changing oracle backend from using varray to json array (#9943)
* oracle varray to json

CHANGELOG_BEGIN
CHANGELOG_END

* various cleanup, mostly removing printlns

* remove oracle connection from conversions and dependencies, cleaning up vestigial scala side varray code

* fix lazylist/stream issue by using java stream. remove braces
2021-06-14 09:34:05 -04:00
Remy
d7d6e37785
LF: Structure Engine Errors. (#9971)
This PR is part of the effort to improve engine Errors.  Here we
classify all the errors the engine can report in 4 categories:

- Errors happening during package loading

- Error happening during command/transaction preprocessing

- Error happening during interpretation

- Error happening during transaction validation


part of #9974

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-14 08:43:00 +02:00
Robert Autenrieth
e1db529162
DPP-390 configurable event decoding parallelism (#9931)
* Make events decoding parallelism configurable

changelog_begin
changelog_end

* Add CLI parameters

* Rename parameter

* Change default value

* Reuse parameter

* Rename cli flag
2021-06-10 23:18:56 +02:00
tudor-da
4634147ed1
Adds Indexer state to GRPC health checks [DPP-434] (#9951)
* Adds Indexer state to GRPC health checks [DPP-434]

CHANGELOG_BEGIN
[Integration Kit] The state of the participant indexer can now be checked via the GRPC health endpoint
CHANGELOG_END

* Addressed review comments
2021-06-10 17:01:05 +00:00
fabiotudone-da
b7fd8338c4
Increase eventually timeout when waiting for queue to be killed (#9955)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-10 13:26:40 +00:00
Moritz Kiefer
3093a98b87
Forward port additional contract keys validation tests (#9944)
This PR adds the 3 additional testcases from #9941

Should have added that right when I touched this and fixed the bug but
better late than never.

changelog_begin
changelog_end
2021-06-10 09:36:35 +02:00
Kamil Bożek
4e49cf6814
ledger-api-bench-tool - Active contracts stream, completions stream [DPP-398, DPP-399] (#9857)
* ledger-api-bench-tool: Active contracts streams

CHANGELOG_BEGIN
- [Integration Kit] - ledger-api-bench-tool - reading active contract streams
CHANGELOG_END

* ledger-api-bench-tool: Completions stream (#9872)

CHANGELOG_BEGIN
- [Integration Kit] - ledger-api-bench-tool - Reading completions stream
CHANGELOG_END
2021-06-09 09:55:07 +02:00
Victor Peter Rouven Müller
e9a2e2e7f2
Allow two different time formats as input for the metrics reporting interval (#9926)
* Allow two different time formats as input for the metrics reporting interval and accordingly revert to using the old test for the CommonCliSpecBase in sandbox-common

changelog_begin

- for applications which support the --metrics-reporter-interval cli option, these now support both the java and scala duration string format (e.g. PT1M30S and 1.5min)

changelog_end

* Replace the thrown RuntimeException in the DurationFormat reader with an IllegalArgumentException

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Try parsing java duration first

* Add test which covers the scala duration format too in the CommonCliSpecBase of sandbox-common

* Add comment about java duration format

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-06-08 17:35:47 +00:00
Victor Peter Rouven Müller
4037b1cd9e
Add metrics to the http json service (#9923)
* Introduce metrics in the http-json service

changelog_begin

[HTTP/JSON API]
- metrics reporting can now be chosen via the command line option --metrics-reporter (currently hidden), valid options are console, csv://, graphite:// and prometheus://
- metrics reporting interval can also now be chosen via a command line option --metrics-reporting-interval (currently hidden)

changelog_end

* Move MetricsReporter and it's dependencies into //ledger/metrics

* Restore non-ugly formatting for that one section in Endpoints.scala

* Update ledger/sandbox-common/src/test/lib/scala/platform/sandbox/cli/CommonCliSpecBase.scala

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* Hide metrics option for http-json

* Propagate context exception for the parseUri function in MetricsReporter.scala

* Move cliHint value above parseUri function to have a better structure (it's used once before it's defined and once after it's defined, which is weird to me)

* Use better value name than optMr & optFd in cliopts Metrics.scala

* Remove import order changes & whitespace changes

* Revert usage of Nanoseconds for conversion from scala duration to java duration to usage of Seconds

* Shorten hideIfRequested function

* Fix another rearranged import

* Fix another whitespace removal

* Readd metrics cli option to sandbox after refactoring

* Add missing return type annotation for invalidRead in MetricsReporter

* Readd newline in https OptionParser.scala

* Remove unecessary import

* Update ledger/sandbox-common/src/main/scala/platform/sandbox/cli/CommonCliBase.scala

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

* Align setter & config name for metricsReportingInterval setting too in CommonCliBase.scala

* Rename http_json_api in Metrics.scala of metrics project to HttpJsonApi

* Reformat CommonCliBase.scala of sandbox-common project

* Fix CommonCliSpecBase test of sandbox

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-06-08 15:54:01 +00:00
tudor-da
69ef6243cb
Fix flaky InstrumentedSourceSpec test (#9921)
* Lower expectations in `signal mostly full buffer if slow consumer`

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-08 12:27:03 +00:00
Remy
cbcec32e70
LF: clean up the remaining Exception TODOs (#9913)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-08 11:49:02 +02:00
Robert Autenrieth
ddf93fc413
Address TODOs in JdbcIndexer (#9911)
changelog_begin
changelog_end
2021-06-07 22:17:08 +02:00
Hubert Slojewski
a0d3e80fd6
Add missing telemetryContext instances in the ledger-api-client's Ctx (#9916)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-07 18:24:04 +02:00
Oliver Seeliger
1e009b4ac2
Upgrade canton to 0.25.0-snapshot supporting lf-1.13 and enable/fix tests (#9915)
Made three tests more flexible in terms of expected error message:
1. CommandServiceIT:CSReturnStackTrace extended parsing to support details= and ;-based format of error properties - found by @daravep
2. CommandServiceIT:CSCreateAndBadExerciseChoice reenable previously expected prior to 7bc925e4d2 as a viable error output
3. CommandSubmissionCompletionIT:CSCRefuseBadChoice - same as 2.

changelog_begin
changelog_end
2021-06-07 14:32:18 +00:00
tudor-da
b4247c1511
[In-memory fan-out] BuffersUpdater implementation (#9858)
* [In-memory fan-out] BuffersUpdater implementation
* Instantiated the TransactionsBuffer in ReadOnlySqlLedgerWithMutableCache
* Implementations and tests for the BuffersUpdater which updates:
* * The MutableCacheBackedContractStore
* * TransactionsBuffer
* Introduced `buffered-ledger-api-streams-unsafe` CLI flag for enabling in-memory fan-out flow
* Enabled the `buffered-ledger-api-streams-unsafe` in ledger-on-sql conformance test for append-only schema

CHANGELOG_BEGIN
CHANGELOG_END

* [In-memory fan-out] BuffersUpdater implementation
* Instantiated the TransactionsBuffer in ReadOnlySqlLedgerWithMutableCache
* Implementations and tests for the BuffersUpdater which updates:
* * The MutableCacheBackedContractStore
* * TransactionsBuffer
* Introduced `buffered-ledger-api-streams-unsafe` CLI flag for enabling in-memory fan-out flow
* Enabled the `buffered-ledger-api-streams-unsafe` in ledger-on-sql conformance test for append-only schema

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-07 09:21:12 +00:00
Robert Autenrieth
7e733c3cee
DPP-390 remove appendonly todos (#9910)
* Remove TODO

Removing all type casts is too much work for little gain.

changelog_begin
changelog_end

* Address todo
2021-06-07 08:20:44 +00:00
Samir Talwar
b22c04654d
ledger-api-test-tool: Only wait for parties on participants under test. (#9903)
* ledger-api-test-tool: Improve logging when reporting waiting failed.

We use a stringified version of the participant when reporting on a
failed `waitForParties` call.

* ledger-api-test-tool: Only wait for parties on participants under test.

Most tests only use one participant, so we can speed up waiting
considerably if we don't wait on the other participants in those cases.

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-03 12:49:21 +00:00
Moritz Kiefer
4660e57e0c
Fix typoed participant name in ExceptionsIT (#9901)
changelog_begin
changelog_end
2021-06-03 14:38:53 +02:00
Marton Nagy
316069d047
Postgres batching refinements (#9898)
* Switch from shortcut to support nullable types to explicit Optional PGField-s
* Add scaladoc to type parameters of PGField
* Typo fix

changelog_begin
changelog_end
2021-06-03 11:34:33 +00:00
Remy
7bc925e4d2
LF: Factorize the logic for AST lookup (#9871)
Factorize the logic for AST lookup in
 - compiler 
 - type checker 
 - preprocessor
 - script triggers 
 - some tests

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-03 13:32:56 +02:00
Robert Autenrieth
2fa250f06a
DPP-387 Remove migration todos (#9896)
* Remove TODO

changelog_begin
changelog_end

* Reorder fields

Sort by size to avoid padding

* fixup remove todo

* Remove todo

* Rename migration
2021-06-03 12:22:06 +02:00
Robert Autenrieth
dc79830239
DPP-393 Enable sandbox tests for the append-only schema (#9876)
* Enable sandbox tests for the append-only schema

changelog_begin
changelog_end

* Address review comment
2021-06-02 23:09:37 +00:00
Marton Nagy
3c83b77dd8
Parallel Ingestion renames (#9894)
* DBDTOV1 -> DbDto
* UpdateToDBDTOV1 -> UpdateToDbDto

changelog_begin
changelog_end
2021-06-02 21:33:45 +00:00
Marton Nagy
6e48034edc
Dpp 392 todo cleanup postgre batch (#9875)
TODO Cleanup: postgre-batching

* First draw of PGSchema and PostgresDbBatch
* Add runtime check of input to prevent string-array serialisation issues
* Remove TODO pointing out missing indexes: since those deletes are operating on tables of small size, and since execution of those queries only at initialisation: this performance improvement is not necessary

changelog_begin
changelog_end
2021-06-02 22:06:08 +02:00
tudor-da
4a4dde0f19
Implemented JdbcLedgerDaoTransactionLogUpdatesSpec (#9813)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-02 12:17:11 +00:00
mziolekda
f36f556b73
Metrics for streamed elements (#9873)
* CHANGELOG_BEGIN
Add metrics counting the elements in transaction, transaction-tree, completion and acs streams
CHANGELOG_END

* format scala

* address review comments
2021-06-02 11:39:09 +00:00
Hubert Slojewski
c0359ac9ae
Add trace context propagation in CommandClient.trackCommandsUnbounded [KVL-961] (#9833)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-01 13:31:58 +02:00
Robert Autenrieth
e5d4553208
Remove flyway warning when using the append-only schema (#9840)
The removed line was only useful for java migrations,
which we don't have.

changelog_begin
changelog_end
2021-06-01 11:05:08 +02:00
Robert Autenrieth
a4e33c9e1b
Add metrics to parallel indexer (#9841)
changelog_begin
changelog_end
2021-06-01 11:04:57 +02:00
mziolekda
8fc45432d1
Uniform configuration of the command service across all ledgers (#9839)
* Uniform configuration of the command service across all ledgers

* CHANGELOG_BEGIN
Modify command line options of the ledgers based on the kvutils/app library:
- Remove max-commands-in-flight sub-option from the participant group.
- Add command service configuration options in line with sandbox and daml-on-sql: max-commands-in-flight, max-parallel-submissions, input-buffer-size
CHANGELOG_END
2021-05-31 16:22:00 +00:00
Kamil Bożek
1f4a958432
ledger-api-bench-tool - single-value metrics (#9822)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-31 16:37:07 +02:00
Kamil Bożek
6a1c7974dd
ledger-api-bench-tool: TLS support (#9824)
CHANGELOG_BEGIN
- [Integration Kit] - TLS support for the ledger-api-bench-tool
CHANGELOG_END
2021-05-31 16:23:36 +02:00
tudor-da
55283472df
Test TransactionsReader.getContractStateEvents within the JDBC DAO suite (#9849)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-31 15:56:49 +02:00
tudor-da
a645971e72
Enable mutable-contract-state-cache for ledger-on-SQL append-only tests (#9836)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-28 15:33:38 +00:00
tudor-da
859cae3b46
[Mutable contract state cache] Tests for contract/key state new methods in ContractsReader (#9825)
* Test cases added for lookupKeyState and lookupContractState

CHANGELOG_BEGIN
CHANGELOG_END

* Update ledger/participant-integration-api/src/test/lib/scala/platform/store/dao/JdbcLedgerDaoContractsAppendOnlySpec.scala

Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>

Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2021-05-28 13:49:47 +00:00
tudor-da
6e17e2de75
[In memory fan-out] Transaction log updates stream implementation (#9792)
* [In memory fan-out] Transaction log updates stream implementation

CHANGELOG_BEGIN
CHANGELOG_END

* Addressed review comments
2021-05-28 12:23:33 +00:00
Kamil Bożek
cb06fb3448
ledger-api-bench-tool - min consumption speed SLO [DPP-401] (#9808)
* Move ledger-api-bench-tool classes to individual files

CHANGELOG_BEGIN
CHANGELOG_END

* min-consumption-speed SLO for the ledger-api-bench-tool

CHANGELOG_BEGIN
- [Integration Kit] - ledger-api-bench-tool - new consumption speed service-level objective for the ledger-api-bench-tool, configurable with a CLI parameter --min-consumption-speed
CHANGELOG_END

* Redefined consumption speed metric calculation

* Moved objectives to a separate package
2021-05-28 12:11:29 +02:00
tudor-da
63bc0d1a96
EventsBuffer implementation for in-memory fan-out for Ledger API serving (#9775)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-28 08:23:34 +02:00
daravep
6caa61c9d4
participant-state: rejection reason abstractions (#9764)
Before this change, any write-service was restricted to the predefined
set of rejection reasons which couldn't capture the complex canton
rejection reasons.
In order to open up the path for a redesign, I've migrated the current
rejection reasons into a V0 version and opened the abstract class for
customized implementations. I've also added a temporary method to tunnel
synchronous rejections through the ledger api server.

CHANGELOG_BEGIN
- Participant-state: Introduced versioned form of rejection reason
CHANGELOG_END
2021-05-27 19:06:36 +02:00
Samir Talwar
63c471fa79
Upgrade protobuf-java and scalapb. [KVL-938] (#9713)
* Upgrade protobuf-java and scalapb.

CHANGELOG_BEGIN
CHANGELOG_END

* Bazel: Generate ScalaPB classes without `unknownFields`.

This is very annoying because it means that extractors need an extra
`_` for no good reason. It also breaks Circe's automatic derivation.

Including unknown fields is the default behavior in Protocol Buffers for
Java now, and we'll probably have to reckon with it at some point, but
let's kick that can down the road a little.

* Upgrade protobuf-java to 3.17.1.

This is identical to 3.17.0, but let's track it anyway.

* Bazel: Move ScalaPB versions into their own file.

They don't need to go into the generated one.
2021-05-27 13:41:28 +00:00
Kamil Bożek
f177c1a6e4
ledger-api-bench-tool - Moved classes to individual files [DPP-401] (#9803)
* Move ledger-api-bench-tool classes to individual files

CHANGELOG_BEGIN
CHANGELOG_END

* Moved MaxDelay to a separate file
2021-05-27 12:12:40 +02:00
Remy
1f021b25c6
LF: Drop Builtin Exceptions completly (#9790)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-26 19:30:44 +02:00
Robert Autenrieth
2e9c56e52c
DPP-393 Activate JdbcLedgerDao suite for the append-only schema (#9793)
* Fix missing microseconds

* More lenient error string matching

* Fix typo

* Fix ledger time tests

Previously, the computed blinding info
did not contain any divulgence, which lead to
no divulgence events being stored.

* Implement JdbcLedgerDao tests for the append-only schema

changelog_begin
changelog_end

* Apply review comment
2021-05-26 14:32:45 +02:00
Kamil Bożek
3241ad6a41
ledger-api-bench-tool - updated metrics reporting model [DPP-400] (#9749)
* Simplified metrics names

* Metrics returning domain values instead of formatted strings

* Always returning metric Value objects with possibly optional contents

* Use the new metric Value classes

* Remove the old metric reporting mechanism

* CHANGELOG_BEGIN
CHANGELOG_END

* Fixed 2.12 build

* Removed random generators from metric tests

* Fixed 2.12 build

* Improved readability of the size metric calculation

* Minor change

* `ledger-api-bench-tool`: max consumption delay SLO [DPP-400] (#9785)

* ServiceLevelObjective trait

* Added copyright to a new file

* A model for combining metrics and objectives in type families

* Mechanism for returning metric violation information

* Return error code when SLOs violated

* Use type parameter for the result of transaction service methods

* max-delay command line parameter for the max delay SLO

* Logging violated objectives in the final report

* Simplified size rate metric value

* CHANGELOG_BEGIN
- [Integration Kit] - ledger-api-bench-tool - new parameter max-delay for specifying the service-level objective for max delay
CHANGELOG_END

* Fixed tests

* Simplified MetricsManager.Message trait

* Fixed build errors

* Changed objectives violated message

* Removed DelayObjective trait

* Comments improvement

* Ordering for MaxDelay.Value

* Removed redundant method from the ServiceLevelObjective trait
2021-05-26 13:16:57 +02:00
Moritz Kiefer
0b24655742
Fix archive calls in ExceptionsIT (#9787)
thanks to @oliverse-da for catching this.

changelog_begin
changelog_end
2021-05-25 13:58:31 +02:00
Moritz Kiefer
1b428be7d2
Add ledger API test tool tests for rollback projections (#9778)
* Add ledger API test tool tests for rollback projections

This adds 3 tests for projections under rollback nodes.

The first one is relatively clear hopefully and tests divulgence.

The other two are a bit more intricate. For both of those we can also
not test too much via the ledger API since we don’t actually get
access to rollback nodes. However, it still seems useful to at least
exercise those code paths and make sure they don’t do anything
horribbly wrong.

The second test tests the normalization rules from
https://github.com/digital-asset/daml/blob/main/docs/source/concepts/ledger-model/ledger-exceptions.rst#privacy

The last one tests a more complex structure with deeply nested
rollback nodes and different informees.

changelog_begin
changelog_end

* Update ledger/test-common/src/main/daml/semantic/Exceptions.daml

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2021-05-25 08:53:43 +02:00
Robert Autenrieth
66b8f19407
DPP-406 split append only migration (#9777)
* Rename migrations

* Split the append-only migration

changelog_begin
changelog_end
2021-05-21 16:36:19 +02:00
Victor Peter Rouven Müller
ed36caa99a
Make use of nameOf for naming telemetry traces in participant-integration-api (#9762)
* Make use of nameOf for naming telemetry traces in participant-integration-api

changelog_begin
changelog_end

* Add copyright header to Telemetry.scala

* Add a simple nameof macro lib which has one function to return the fqn of the current method

* Make use of the new nameof lib within the repo to shorten the code further

* Remove old dependency on nameof macro

* Readd lines which have been accidentally removed
2021-05-21 12:34:55 +00:00
Marton Nagy
6f20d78056
Makes sandbox-classic compression configurable (#9770)
* Adds configuration parameter and wiring
* Only append only schema is supported (for mutating schema it has no effect)

changelog_begin
changelog_end
2021-05-21 12:12:20 +00:00