Commit Graph

1841 Commits

Author SHA1 Message Date
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