Commit Graph

541 Commits

Author SHA1 Message Date
Oliver Seeliger
16bbcb74d5
Make ledger api multi-party subscription transaction test singlenode (#3395)
As in multi-node Alice and Bob's contracts end up on different
participants not producing true multi-party subscriptions.
2019-11-11 11:23:11 +01:00
Samir Talwar
1484705852 ledger-api-test-tool: Allocate participants and parties declaratively. (#3401)
* ledger-api-test-tool: Allocate participants and parties declaratively.

Part of a solution to #3380.

Rather than allocating participants and parties line by line, instruct
the test to construct a number up-front.

This will make it easier to serve multi-participant ledgers, as we can
make sure we wait for all parties to be available on all participants
before starting the test. Once we can do that, tests will hopefully be
much less flaky on ledgers other than the Sandbox.

* ledger-api-test-tool: Rename `provision` to `allocate` and document it.

* ledger-api-test-tool: Make Allocation functions private where possible.

* ledger-api-test-tool: Fix the comment for `LedgerTestContext::allocate`.

It got the signature wrong.
2019-11-08 13:31:30 +00:00
Samir Talwar
b3cb869b4b ledger-api-test-tool: Clearer timing information. (#3383)
* ledger-api-test-tool: Just use `Duration::toString` for logging.

* ledger-api-test-tool: Fix reporter highlighting.

Previously, the closing parenthesis around the test duration was not
highlighted. Now neither are.
2019-11-08 12:37:00 +00:00
Samir Talwar
0615166c4d ledger-api-test-tool: Port TransactionBackpressureIT. (#3384)
Closes #2844.

It turns out that this test doesn't really exacerbate any backpressure;
it just fires lots of commands. In the interest of not losing this, I've
ported it to a test in TransactionService.

Without the throttling, we _do_ hit resource exhaustion on Sandbox with
the PostgreSQL server backend. Capping the number of commands at 500,
rather than 1000, seems to solve this.
2019-11-08 09:49:25 +00:00
Gerolf Seitz
d30b6eb94b
Sandbox: fix excessive memory consumption (#3362)
* Implement proper stream pagination

The previous pagination mechanism for streaming ledger entries was implemented
as a recursive method call with manually concatenating akka Sources.
However, this didn't work properly and resulted in all the subsources being
forced immediately, resulting in parallel requests for all pages
(0-100, 100-200, 200-300, ...) instead of the expected mechanism of loading
the first page and on upstream request (i.e. client requests for more data
over grpc) loading the next page of data.

The current mechanism uses Source.unfoldAsync which makes the paging
mechanism work as expected: sequential loading of pages on demand.

* Serialize and deserialize Transactions outside the SQL Executor

This frees up the SQL Executor threads sooner for other work
and the conversion work only happens on a by need basis when
the consumer requests more data.
2019-11-08 10:25:29 +01:00
Andreas Herrmann
6877d5279c
recursively symlink all files in dev_env_tool (#3377)
* dev_env_tool - recursively symlink all files

* dev_env_tool: add prefix attribute

* Replace nodejs by dev_env_tool

* postgresql.exe --> postgres.exe

* Remove unused dev_env_package

And rename dev_env_package --> dev_env_tool

* dev_env_tool macOS compatbility

BSD find does not support `-printf`.

* ReserServiceIT: 4 attempts on Windows
2019-11-08 09:40:26 +01:00
Robert Autenrieth
89d6c7375c
Add a JWT authentication to sandbox (#3283)
Fixes #3363
2019-11-07 23:04:16 +01:00
Gary Verhaegen
7b897d2507
sandbox: specify dar to load as option (#3347) 2019-11-07 20:38:35 +00:00
Oliver Seeliger
0df351b2f7
Multi domain ledger api server fixes (#3359)
* Divulged contract visibility in multi-participant environments #3351
* Ledger api server time service optional ability for testing #3225
* Allow ledger api server to share DAML-on-X DAML engine #2975
* Allow ledger api server participant ids with LedgerString chars #3327
* Ledger api server includes SQL description in errors #3324
2019-11-07 16:15:17 +01:00
Jussi Mäki
b5793b176b Allow building and testing the reference ledger dump on macOS (#3375) 2019-11-07 13:22:38 +00:00
Jussi Mäki
c599f24cac
Refactor proposal for "KeyValueCommitting" (#3116)
* Refactor proposal for "KeyValueCommitting"

This only changes the package uploads as an example.

Embrace the imperative style:
  * we carry a lot of state through the commit steps anyway and immutable maps are actually
    dangerous: we may end up reading from the wrong one etc (has happened).
  * performs much better with transactions that have thousands of outputs (the current monadic commit would
    have quite a lot of overhead for setting all these).

Drop the "Option[DamlStateValue]". This was only for dedup value and the extra complexity for catching the case
where some inputs weren't fetched isn't worth the complexity (tests will catch this anyway).

Return an Iterable[(DamlStateKey, DamlStateValue)]. This way we're clear about the ordering of the outputs.

* Address review and simplify

* Port the change to use daemon thread for preload executor

So that JVM doesn't get stuck when exiting.

* Fix typo
2019-11-07 13:03:19 +01:00
Remy
d39d7974fc daml-lf: freeze version 1.7 (#3340)
* daml-lf: freeze daml-lf 1.7

* speedy: remove useless double checks
2019-11-07 09:51:18 +00:00
Jussi Mäki
ca7bbacd6c Build rules for producing and verifying ledger dumps (#3290)
* Add client_server_build and integrity_test rules

And use them to implement ledger dump of the reference
server and to check it.

* Only build and test ledger dump on Linux. Only run tests relevant to dump.

* Make client_server_build quiet in happy path

* Reformat

* Remove unnecessary runfiles for client_server_build
2019-11-07 09:41:54 +00:00
Samir Talwar
64f1b3ae8d ledger-api-test-tool: Correct test timing output and improve times a little. (#3364)
* ledger-api-test-tool: Use Scala's `Duration` for timeouts.

* ledger-api-test-tool: Remove the parentheses from a getter.

* ledger-api-test-tool: Run tests sequentially.

Using Akka Streams to manage the concurrency.

* ledger-api-test-tool: Parallelize across available processors.

* sandbox/reference-v2: The test timeout scale factor is no longer needed.

Now that we don't run all tests at once, the measurements are much more
accurate.

* sandbox/reference-v2: Run LotsOfPartiesIT 11 times instead of 16.

* ledger-api-test-tool: Highlight slow tests in yellow and red.

* ledger-api-test-tool: Fix some warnings in the Reporter.

* ledger-api-test-tool: Sort the tests afterwards for better concurrency.

Turns out that Akka Streams tries to maintain order at the expense of
running more things, which is not ideal. This is a hack to let us use
`.mapAsyncUnordered` and then re-sort into the original order at the
end.

Ideally `.mapAsync` would detect when subsequent futures have finished
and start running more, even if the first hasn't finished yet.

* ledger-api-test-tool: Inline `availableProcessors` into Config.
2019-11-06 21:22:48 +00:00
Stephen Compall
d0ec381925 json-api: store contracts similar to Extractor's single-table (#3192)
* new library ledger-service/db-backend

* borrow contracts table schema from extractor

* borrow contract insertion, removing some data to be unused

* match contract schema with insert function

* factor insertContract arguments

* offset table declarations

* CLI argument for query store

* surrogate template IDs

* compute surrogate template IDs on-the-fly

* database init action

* incoherent typeclasses, eh

* newtype SurrogateTpId

* offset fetch/update functions

* bad sql

* bulk insert contracts, function for selecting contracts

* expose contract column name for query's usage

* Initializing DB on startup if configured

* dropping existing tables as part of initialization

* fix some query syntax errors

* createSchema flag

* function for streaming transactions with jwt party selected

* formatting

* usage

* collect acs contracts and the ledger offset at the end

* lastOffset

* fixing merge conflicts, updating the way 3rd party deps are specified

* Moving ContractDao into http-json module

so it can take domain AST as an input

* cleanup

* injecting new dependencies

* split transaction batches into inserts and deletes

* generate sql for deleting contracts

* `fetch_sources = True` for java_deps

* make the delete-constructed fragment more efficient; handle empty list here

* pass logHandler for insertContracts

* ContractDao returns ConnectionIO, it's up to the caller to wrap query into a transaction

* fixing typo

* minor cleanup, moving fromLedgerApi factory function into corresponding companion objects

* don't need it any more

* GetActiveContractsResponse => domain.Contract factory

* make concatFragment private

* add partition graph; move other contract-fetching experiments to ContractsFetch

* experimenting with akka sources

* introducing domain.Offset to work around API's empty/null offset cases

* minor cleanup

* decompose fetchActiveContractsFromOffset

* missed via

* ACS splitting graph

* finish doc for ACS splitting graph

* remove unneeded stages

* WIP

* lazily read a stream of ConnectionIO into a single ConnectionIO

* cancel on IO error

* figuring out how to put all the pieces together

* graph WIP

* Removing workflowId from the JSON API

* simplify acsAndBoundary; describe other flow pieces

* WIP

* use Vector in InsertDeleteStep; add variant for ACS (no deletes)

* `org.wartremover.warts.NonUnitStatements` enforced in `http-json` module

* evaluate InsertDeleteStep to a ConnectionIO

* database variant of LfValueCodec, using numbers for numbers

* convert input to JSON, combine insert plans, connect rest of contractsToOffsetIo

* remove strict contractsToOffset sink

* moving dao methods into an object

* putting pieces together

* contractsFromOffset WIP

* should be it

* cleanup

* cleanup

* contractsIo that takes List[domain.TemplateId.RequiredPkg])

* contractsIo that takes List[domain.TemplateId.RequiredPkg])

* cleanup

* put all pieces together, testing

something does not work yet

* diff is not required to return anything

that is why Sink.lastOption that gives Option[domain.Offset]

* factor out tuple split

* use traverse syntax in contractsIo2

* factor explicit flow steps out of graph DSL; remove aggregate

* locally model the Absolute/Begin distinction for offset bookmarking in DB

* Adding test cases to run HTTP Service with Postgres backend

the same set of test cases, run with and without DB backend

* make better use of domain.Offset in OffsetBoundary

* monomorphize InsertDeleteStep#append

* Disabling a test that fails with DB backend

* add release note

* add release note about workflowId

* a test case that checks the number or stored contracts

* trying to figure out why Postgres test fails on Windows with NPE
2019-11-06 13:53:16 -05:00
Samir Talwar
13fdf3471b ledger-api-test-tool: Generate the vector of tests automatically. (#3353)
* ledger-api-test-tool: Avoid having to build the vector of tests.

Instead, maintain a buffer that is added to when tests are defined.

* ledger-api-test-tool: Inline `LedgerTest.apply` into LedgerTestSuite.

* ledger-api-test-tool: Rename `LedgerTest` to `LedgerTestCase`.
2019-11-06 15:16:16 +00:00
Stefano Baghino
c8aaffd62c Add GrpcException extractor (#3344)
* Add GrpcException extractor

* Use GrpcStatus in integration test

* Fix compilation error

* Fix compilation error

* Address https://github.com/digital-asset/daml/pull/3344#discussion_r342981204

* Restricting extractor types
2019-11-06 14:44:06 +00:00
Gerolf Seitz
7a15706101
Added a missing index to the disclosures table (#3343) 2019-11-06 13:48:36 +01:00
Samir Talwar
b20b53ed9c ledger-api-test-tool: Extract non-core test functionality into objects. (#3349) 2019-11-06 10:58:56 +00:00
Samir Talwar
fddaeb1c4a ledger-api-test-tool: Port LotsOfPartiesIT. (#3328)
* ledger-api-test-tool: Port LotsOfPartiesIT.

* ledger-api-test-tool: Run LotsOfPartiesIT with multiple participants.

Odds of me getting this wrong: 80%. Let's find out!

* ledger-api-test-tool: More underscores, methinks.

* ledger-api-test-tool: Improve the readability of the LotsOfParties test.

Instead of all the functional magic, just do things twice. It's even
shorter in some cases.

* ledger-api-test-tool: Not so many parties. :-(

* sandbox: Extract duplication between conformance test definitions.

* sandbox: Run the LotsOfPartiesIT conformance test separately.

* Revert "ledger-api-test-tool: Not so many parties. :-("

This reverts commit 8039a7cc9b.

* sandbox: Add the copyright header to sandbox_conformance_test.bzl.

* Run `./fmt.sh`.

* ledger-api-test-tool: Generalize `sandbox_conformance_test`.

I want to use it with the DAML-on-X reference v2.

* api-server-damlonx/reference-v2: Use `server_conformance_test`.

* api-server-damlonx/reference-v2: Run LotsOfPartiesIT separately.
2019-11-05 19:54:21 +00:00
mziolekda
a6af3fac97
add InternalError to values returned by SubmissionResult (#3331)
* add InternalError to values returned by SubmissionResult

* fix scalafmt issue

* Update ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/services/ApiSubmissionService.scala

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

* Update ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/services/ApiSubmissionService.scala

Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2019-11-05 10:44:26 +01:00
Stefano Baghino
b06a62e543
Remove ambiguous implicit (#3330) 2019-11-04 18:12:35 +01:00
Stefano Baghino
edb2d15cec
Port command-related integration tests (#3320)
* Pre-port cleanup of helpers

* Further clean-up

* Remove dead code

* More cleaning and flattening

* Port first tests from CommandClientIT

* More cleanup and more dead code removal

* Port exercise by key test

* Port observer disclosure tests

* Port tests, remove duplicates and dead code

* Fix compilation error and remove more dead code

* Remove unused import

* Spread helpers to single users, remove materializer from helpers

* More test porting and cleanup

* Remove more dead code

* Restore tests deleted by mistake

* Restore final qualifier removed by mistake

* Fix typo

* Optimize imports

* Move timeout from helper to tests

* Remove unused class

* Never gonna give you up

* Address https://github.com/digital-asset/daml/pull/3320#discussion_r342018581

* Address https://github.com/digital-asset/daml/pull/3320#discussion_r342025161

* Remove removed test :)
2019-11-04 17:30:31 +01:00
Samir Talwar
9d644088e3 ledger/ledger-api-test-tool: Implement diff correctly for sequences. (#3325)
* ledger/ledger-api-test-tool: Implement diff correctly for sequences.

Previously, we were using `x.ai.diff.conversions._`, which converts them
into sets. This is obviously not helpful when comparing, for example,
`Seq(7, 8, 9) and `Seq(7, 7, 8, 9)`, as the assertion will pass.

* ledger/ledger-api-test-tool: When diffing sequences, stay lazy.
2019-11-04 14:20:54 +00:00
Stefano Baghino
96622c9fe7 Expose DB wait/exec times over JMX as well as logs (#3310)
* Expose DB wait/exec times over JMX

* Fix compilation errors

* Fix more compilation errors

* Update unreleased.rst

* Address https://github.com/digital-asset/daml/pull/3310#pullrequestreview-310346159

* Address https://github.com/digital-asset/daml/pull/3310#discussion_r341641717
2019-11-01 17:34:44 +00:00
Jussi Mäki
0ca8580914 Fix the import paths of {value,transaction,blindinginfo}.proto (#3312)
* Fix the import paths of {value,transaction,blindinginfo}.proto

This cleans the imports in daml_kvutils.proto:

  -import "daml-lf/transaction/src/main/protobuf/transaction.proto";
  +import "com/digitalasset/daml/lf/transaction.proto";

This shouldn't be a breaking change to the outside as the proto files
themselves are not published, only the java libraries generated from them.

* Update missed deps
2019-11-01 14:54:55 +00:00
Stefano Baghino
e48944c91d
Fix ledger config test flakiness (#3307) 2019-10-31 15:57:50 -04:00
Stefano Baghino
42051ae037
Add and validate expiration on claims (#3286)
* Add and validate expiration on claims

* Address review comments

* Test existing services for token expiration

* Test expiration mid-stream

* Address https://github.com/digital-asset/daml/pull/3286#pullrequestreview-309710454
2019-10-31 13:14:44 -04:00
Samir Talwar
7ba8fdb231 ledger-api-test-tool: Use java.time where possible. (#3304)
* ledger-api-test-tool: Use java.time instead of doing the sums ourselves.

* ledger-api-test-tool: Use `asProtobuf` everywhere.

* ledger-api-test-tool: Avoid scala.concurrent.duration where possible.

* ledger-api-test-tool: Add the copyright header to ProtobufConverters.
2019-10-31 15:28:16 +00:00
Brian Healey
9d71a408a0
Make Err an abstract class so it is throwable when used from Java (#3297)
* Make Err an abstract class so it is throwable when used from Java

* Update ledger/participant-state/kvutils/src/main/scala/com/daml/ledger/participant/state/kvutils/Err.scala

bring back sealed

Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2019-10-31 11:02:00 -04:00
Samir Talwar
297e5eddff
ledger-api-test-tool: Sort the tests, and add a type. (#3299)
* ledger-api-test-tool: Sort tests.

* ledger-api-test-tool: Add a type for the map of tests.
2019-10-31 14:57:22 +01:00
Gerolf Seitz
9750ccf716
Navigator properly sets the max incoming message size again. (#3302)
The symptom for receiving messages larger than the configured maxInboundMessageSize is a
gRPC error like:

Oct 31, 2019 1:52:37 PM io.grpc.internal.AbstractClientStream$TransportState inboundDataReceived
INFO: Received data on closed stream

Fixes #3301.
2019-10-31 14:56:48 +01:00
Samir Talwar
8baeaf59a1 Delete CommandSubmissionTtlIT. (#3298)
The same behaviour is covered by the LedgerConfigurationService already.

Closes #2839.
2019-10-31 13:32:25 +00:00
Stefano Baghino
d9ae487fec Disallow empty command submission (#3270)
* Disallow empty command submission

Fixes #592
2019-10-31 08:37:58 +01:00
Jussi Mäki
4e440bd0a6 Add kvutils ledger dumps and integrity checker (#3167)
kvutils now supports dumping the ledger to a file via environment
variable: "KVUTILS_LEDGER_DUMP=/tmp/ledger.dump".

The integrity checker tool allows re-processing of ledger dumps to
validate that all submissions, state and log entries can be parsed
and processed. This forms the basis of kvutils data continuity test
suite.

Currently the checker strictly enforces that re-processed
outputs match the inputs exactly, which for now guarantees forwards
and backwards compatibility. The checker will be adapted when
forwards-incompatible changes or new kvutils message versions arise.

A select collection of ledger dumps will be maintained in a separate
repository (to be decided) and these dumps are to be validated by
the DAML CI.
2019-10-30 17:02:00 +00:00
Gerolf Seitz
8650d38c78
Fixed a bug in the DB migration script 10.1 (#3287)
The script would throw an exception for contracts without observers.

Fixes #3284.
2019-10-30 10:58:21 +01:00
Robert Autenrieth
e887318f4f Move AuthService (#3272)
* Move AuthService and Claims

* Move interceptor and authorization wrappers

* Add artifact

* Address review comments
2019-10-29 15:46:43 +00:00
Robert Autenrieth
bc63f2f8de Add missing contract id hash (#3256)
The global implicit disclosure map was missing the `#` prefix for contract ids, which caused subsequent contract id lookups to not find the right contract.
2019-10-29 09:09:21 +01:00
Stefano Baghino
5fbc9a20aa
Remove duplicate DAR reader (#3267)
Fixes #452
2019-10-28 17:02:47 -04:00
Stefano Baghino
d803768405
Remove duplicates of TestExecutionSequencerFactory (#3264)
Fixes #9
2019-10-28 15:56:33 -04:00
Gerolf Seitz
fe7e5615b8
Improve performance of stakeholder retrieval from SQL (#3207)
Instead of loading and deserializing the transaction, we store the
stakeholders in tables contract_signatories and contract_observers.

To avoid having to do an extra roundtrip for fetching the stakeholders,
we aggregate the parties at query time into a % separated string (% is
not a valid character for parties), which we then split again in the
application.

Fixes #2330.
2019-10-28 14:16:21 +01:00
Andreas Herrmann
2bd1db490a
Replace bazel-deps by rules_jvm_external (#3253)
* Update bazel-common to fix javadoc issues

Specifically, to fix the following error

```
ERROR: /home/aj/tweag.io/da/da-bazel-1.1/ledger-api/rs-grpc-bridge/BUILD.bazel:7:1: in javadoc_library rule //ledger-api/rs-grpc-bridge:rs-grpc-bridge_javadoc:
Traceback (most recent call last):
        File "/home/aj/tweag.io/da/da-bazel-1.1/ledger-api/rs-grpc-bridge/BUILD.bazel", line 7
                javadoc_library(name = 'rs-grpc-bridge_javadoc')
        File "/home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/com_github_google_bazel_common/tools/javadoc/javadoc.bzl", line 27, in _javadoc_library
                dep.java.transitive_deps
object of type 'JavaSkylarkApiProvider' has no field 'transitive_deps'
```

* Define Maven deps using rules_jvm_external

* Pin artifacts

* Remove bazel-deps generated targets

* Remove bazel-deps

* Switch to rules_jvm_external targets

* update bazel documentation

* pom_file: There are no more bazel-deps targets

* BAZEL-JVM.md `maven_install` typo
2019-10-28 13:53:14 +01:00
Remy
f3b98ca31d DAML LF: limit allocations for trivial constants (#3212)
* speedy: limit allocation of trivial SValue constants

* daml-lf: limit allocation of constants for Value, Exp, Type

* weaken numeric equality in ledger service test
2019-10-18 15:00:49 +00:00
Stefano Baghino
9571e29c7e
Allow Navigator to use authenticated Ledger API (#3138)
* Make Navigator authenticate with the participant

* Solve shadowed import warning

* Fix tests to work with new methods

* Optimize imports

* More imports optimizations

* Ensure plainText channel is used unless explicitly stated

* Work around a lack of APPDATA on CI

* Add docs

* Update release notes

* Update navigator/frontend/src/ui-core/src/session/UI.tsx

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

* Address https://github.com/digital-asset/daml/pull/3138#discussion_r336403903

* Address https://github.com/digital-asset/daml/pull/3138#discussion_r336382140

* Address https://github.com/digital-asset/daml/pull/3138#discussion_r336383076

* Address https://github.com/digital-asset/daml/pull/3138#discussion_r336389886

* Address https://github.com/digital-asset/daml/pull/3138#discussion_r336391680
2019-10-18 15:39:42 +02:00
Gerolf Seitz
8026297b96
Added Sandbox CLI parameter --max-ttl-seconds (#3223)
This CLI parameter can be used to modify the maximum allowed TTL used by
commands.
2019-10-18 14:14:59 +02:00
Robert Autenrieth
d320f93702
Add integration test for ledger API authorization (#3187)
Fixes #3023
2019-10-17 12:09:35 +02:00
Gerolf Seitz
a5921e0274 Properly fill eventId for active contracts (#3126)
* Properly fill eventId for active contracts

This gets rid of the last remaining bit that assumes
contractId==eventId.

Fixes #65.
Contributes to #2068.

* Do not conflate eventId and contractId in the daml-lf interpreter

* Do not treat contractId as eventId in Ledger.scala

* Remember the transaction that divulged a contract.

* In this scope we can treat divulged contracts the same as disclosed ones

* revert a few more syntactical changes to make the overall diff smaller

* retain the same behavior on the scenario service api

* fix unreleased after rebase
2019-10-16 17:02:04 +00:00
Leonid Shlyapnikov
2a89ce8bb2 JSON API parties endpoint + Sandbox party management fix (#3193)
* Parties endpoint

`PartyManagementClient#listKnownParties` returns an empty List. Why?

* Fix for sandbox parties management (#3177) + JSON API `/parties` endpoint

* release notes

* updating release notes
2019-10-16 15:02:27 +00:00
Stefano Baghino
83e305b667
Port LedgerConfigurationServiceIT (#3188)
* Port LedgerConfigurationServiceIT

* Remove unused imports

* Fix compilation error

* Port SemanticLedgerTestsIT

* Expect failures for negative cases

* Add meaningful parentheses

* Do not require the ledger configuration test commands to succeed

* Remove unused command tracking

* Address https://github.com/digital-asset/daml/pull/3188#issuecomment-542616799

* Update unreleased.rst
2019-10-16 13:15:37 +02:00
Robert Autenrieth
07b75e0008
Command submission let test (#3153)
* Add CommandSubmissionLet test

* Remove old test

* Fix broken test

* Address review comments
2019-10-15 13:25:38 +02:00
Gerolf Seitz
e0cfb84681
Filter the contracts for the ACS already in the database. (#3180)
This avoids unnecessarily loading contracts from the database
that would anyway get discarded later on.
2019-10-15 11:39:45 +02:00
Remy
e45b585307 daml-lf: repackage daml-lf archive proto (daml_lf -> daml_lf_dev) (#3169) 2019-10-15 09:36:11 +00:00
Remy
d64df4b5f7 daml-lf: clean achive bazel build (#3175)
* clean the mess in daml-lf achive bazel build

* add release note

* Address Moritz's comments

* more release notes
2019-10-15 08:36:46 +00:00
Remy
fc1a000090 daml-lf: rename daml_lf_archive_scala target to daml_lf_archive_reader (#3168)
* daml-lf: rename daml_lf_archive_scala target to daml_lf_archive_reader

* fix release
2019-10-14 14:53:50 +00:00
Remy
217405e883 daml-lf: Move archive protofile to a more usual place. (#3166)
* move daml-lf archive protobug to a more usual place

* formatting

* fix kvutils proto

* fix csharp namespace
2019-10-14 13:22:22 +00:00
Robert Autenrieth
9a1b10ef82
Add a mock AuthService (#3125)
A simple AuthService implementation useful for tests
2019-10-08 12:46:43 +02:00
Gerolf Seitz
5592092cc7
Remove DAML-on-X IndexServer and Reference Server (#3108)
It is not needed anymore and can therefore be deleted.
2019-10-08 11:47:21 +02:00
Oliver Seeliger
52302e2a1f
Ledger api index server starts only after indexer initializes db #2974 (#3087) 2019-10-08 10:57:50 +02:00
Robert Autenrieth
284a6d8197
Introduce ledger API authorization (#3051)
... by introducing an AuthService and checking authorization claims in all ledger API services
2019-10-07 22:29:46 +02:00
Jussi Mäki
09e93a6cdc
Fix handling of transient contract keys in kvutils (#3110)
* Add failing test case for transient contract keys

* Add kvutils tests for transient contracts and keys

* Fix handling of transient contracts and keys in kvutils
2019-10-04 14:00:54 +02:00
Oliver Seeliger
7dd482861b
Ledger api server fixes to persist divulged, otherwise unknown contracts #2946 (#3101) 2019-10-04 11:25:50 +02:00
Oliver Seeliger
cd915b64d7
Ledger api server indexer closes akka system on shutdown #2624 (#3089) 2019-10-03 18:57:14 +02:00
Oliver Seeliger
c9658c7813
Multi participant node named logging (#2647) (#3080)
* Upgrade scala-logging and slf4j

* Named logging for multi-participant tests (#2647)
2019-10-03 18:20:57 +02:00
Jussi Mäki
0c72eeaf32
kvutils metrics (#3065)
* Add initial metrics to kvutils

* Improve metrics. Use InsertOrdMap by default in kvutils.

* Add VarGauge
2019-10-03 14:34:12 +02:00
Stefano Baghino
2955c49828
Remove contract keys tests from semantic suite, make contract keys tests multi-node aware (#3058) 2019-09-27 13:51:51 +02:00
Stefano Baghino
717bd38ec0
Read the TTL from the configuration service (#3052)
* Read the TTL from the configuration service

* Address https://github.com/digital-asset/daml/pull/3052#discussion_r328698432

* Fix docs
2019-09-27 12:02:47 +02:00
Stefano Baghino
cde3797eb2
Finish porting TransactionServiceIT (#3043)
* Finish porting TransactionServiceIT

* Go easy on H2

* Address https://github.com/digital-asset/daml/pull/3043#discussion_r328547578
2019-09-26 14:20:02 +02:00
Robert Autenrieth
9583c1f470 Improve ledger sql backend performance (#2998)
* Remove extra key lookup

... when removing contracts

* Only look up contract LET

* Add ADT for let lookups

* Add release notes

Fixes #2888
2019-09-25 12:46:13 +00:00
Robert Autenrieth
afabb584c8
Move PackageServiceIT to the ledger api test tool 2019-09-24 15:17:18 +02:00
Remy
337c5ff215 Engine: drop value versioning in commands (#2995)
* daml-lf: remove value Version from commands

* ledger-api: fix ledger api

* ledger: fix tests

* leger: drop dead code

* Address Gerolf's comment
2019-09-24 12:38:56 +00:00
Stefano Baghino
aad98b4c9e
More transaction service tests ported to the new test tool (#2961)
* Remove dead code

* Port around 30 more tests, delete dead code

* Remove template comment

* Update unreleased.rst

* Address https://github.com/digital-asset/daml/pull/2961#discussion_r327000163

* Address https://github.com/digital-asset/daml/pull/2961#discussion_r326999412

* Address https://github.com/digital-asset/daml/pull/2961#discussion_r326998734

* Address https://github.com/digital-asset/daml/pull/2961#discussion_r326998278

* Address https://github.com/digital-asset/daml/pull/2961#discussion_r326998888

* Address https://github.com/digital-asset/daml/pull/2961#discussion_r326997789
2019-09-23 15:33:32 +02:00
Remy
d540f7aab0 Daml-LF: change Numeric max scale from 38 to 37 (#2969)
* daml-lf: numeric maxScale change from 38 to 37

* daml-lf: update spec

* udpate protobuf comments
2019-09-23 12:39:28 +00:00
Remy
a46f1c041a Daml-LF: make Numeric scale type safe (#2958)
* daml-lf: make numeric scale type safe

* navigator: fix scale

* ledger: fix scale in tests

* Update daml-lf/data/src/main/scala/com/digitalasset/daml/lf/data/NumericModule.scala

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Update ApiCodecCompressedSpec.scala

* Update ApiCodecCompressedSpec.scala
2019-09-18 19:33:52 +00:00
Stefano Baghino
8faca7ec1a
Delete old //ledger/CONTRIBUTING.md (#2956) 2019-09-18 14:54:26 +02:00
Gerolf Seitz
52efe9ccf9 Use the SQL-backend to testing the postgres-backend (#2954) 2019-09-18 12:28:02 +00:00
Gerolf Seitz
b70e289303 ActiveContractsService stream ow always returns at least 1 element (#2799)
This removes the need for clients to handle the special case where the
stream might be empty.
Now the clients can always assume that they receive at least one
response element in the stream.
2019-09-18 11:16:56 +00:00
Gerolf Seitz
96642d9b19
Port TransactionServiceLargeCommandIT. (#2944)
Fixes #2861.
2019-09-18 13:05:46 +02:00
mziolekda
bf9ae046ba
ignore ledger updates that contain commands rejected due to de-duplication (#2939) 2019-09-18 12:21:30 +02:00
Robert Autenrieth
b97ef28de1
Rename BlindingInfo fields (#2883) 2019-09-18 00:28:53 +02:00
Jussi Mäki
11f1735613 Fix contract key uniqueness check in kvutils (#2933)
* Fix contract key uniqueness check in kvutils

Archival of a contract with a key and recreation within the
same transaction is now allowed in kvutils.

* Add assertions to check that new contract has been created with same key
2019-09-17 18:21:41 +02:00
Gerolf Seitz
f32f1b975e
Filter the contracts for the ACS already in the database. (#2931)
This avoids unnecessarily loading contracts from the database
that would anyway get discarded later on.
2019-09-17 15:30:45 +02:00
mziolekda
7c4cc96371
Use separate thread to preload dars in KVBC committer (#2924)
* use separate thread to preload dars in KVBC committer

* fix formatting
2019-09-17 14:48:36 +02:00
Gerolf Seitz
00f4ac133f
Port WronglyTypedContractIdIT to new TestTool. (#2907)
Fixes #2862.
2019-09-16 16:11:30 +02:00
Jussi Mäki
ae6f0fd631
Revert "Do not consider archives that are already loaded in engine (#2898)" (#2910)
This reverts commit 6ed6e0e990.
2019-09-16 15:26:21 +02:00
Stefano Baghino
e37e3ec314
SemanticTests synchronize/wait across participants, specify error codes (#2911) 2019-09-16 15:18:42 +02:00
Stefano Baghino
c1d3c54f65
Port transaction service tests (#2900)
* Delete dead code

* Add test case for contract identifier retrieval when filtering by template

* Factor out retry strategies, make transaction tests multi-node-aware, add one test case

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324541271

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324543869

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324543999

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324544107

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324544193

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324545838

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324545682

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324545947

* Address https://github.com/digital-asset/daml/pull/2900#discussion_r324546075

* Wrap eventual success around exercise exclusively
2019-09-16 14:26:58 +02:00
Gerolf Seitz
ad1b885494
Properly adhere to DbType#supportsParallelWrites in SqlLedger (#2902)
Since we still have issues with parallel writes when using H2,
we should properly only use a single DB connection and executor thread
for that.

Because we didn't do that before for Sandbox, tests like PackageManagement
appeared to be flaky due to racy inserts in H2.
2019-09-16 11:29:07 +02:00
Jussi Mäki
6ed6e0e990 Do not consider archives that are already loaded in engine (#2898) 2019-09-13 15:44:18 +00:00
Jussi Mäki
868cb785ad
Preload packages to engine during upload (#2860)
* Preload packages to engine during upload

* Improve logging in KeyValueCommitting and add timing information

* Fix scenario service tests now that logging is done in interpreter
2019-09-13 14:31:52 +02:00
Oliver Seeliger
d154c2cea9
Specify sql database driver in connection pool (#2877) (#2886)
This is believed to prevent race conditions that yield the following error:

java.lang.RuntimeException: Failed to get driver instance for jdbcUrl=jdbc:postgresql://...
2019-09-11 17:31:42 +02:00
Robert Autenrieth
e288437dc0
Support divulged contracts in a distributed ledger (#2739)
Fixes #2488

Includes some refactoring of ActiveContracts (now ActiveLedgerState).
2019-09-11 14:21:41 +02:00
Jussi Mäki
03962da4e3
Load packages only once in ledger API server (#2835)
* Load packages only once in ledger API server

* rework concurrent package loading
2019-09-11 11:46:36 +02:00
Gerolf Seitz
eefd481b9a
Explicitly run schema migration/validation (#2832)
The Ledger Indexer can now be started in 3 modes:

- validate schema and start
- migrate schema and start
- migrate schema only and exit

Contributes to #2660.
2019-09-10 14:56:35 +02:00
Oliver Seeliger
a0a7a81cde
Add participant state v1 participantId and TransactionId vals (#2821)
for easier code reuse
2019-09-09 16:21:16 +02:00
Stefano Baghino
dc1eb2b151
Make semantic tests multi-node aware (#2770) 2019-09-05 15:38:51 +02:00
Jussi Mäki
2a20a37139 Rename referencedContracts to divulgedContracts (#2741)
* Rename referencedContracts to divulgedContracts

We do not want to provide all referenced contracts as that would
require the ReadService to be able to read all those contracts, or
we would need to bundle the referenced contracts with the transaction.

The new type should match what was discussed in #2488.

* Add changelog entry to participant.state.v1.Version

* Remove divulgedTo from DivulgedContract

We decided not to prematurely add this feature.
2019-09-05 13:27:41 +00:00
Stefano Baghino
4bfabe80fd
First multi-node test (#2737)
* WIP

* Ensure identifier uniqueness across endpoints

* Use Greek alphabet letters for node naming to better tell them apart

* Allow reference server to specify extra participants

* Restore all semantic tests

* Update changelog

* Have exponential backoff retries when creating the endpoint test context
2019-09-05 09:37:51 +02:00
Brian Healey
d2803c4d0f Randomize hint to ensure PartyManagement tests are rerunnable on the same ledger (#2749)
* Randomize hint to ensure tests are rerunnable

* Include descriptive party name prefix for randomized party name cases

* resolve scalafmt woes

* try to resolve failing release azure step
2019-09-04 19:29:34 +00:00
Stefano Baghino
785e41eb2c
Enable multi-node conformance testing (#2735) 2019-09-03 15:57:23 +02:00
Gerolf Seitz
4dbbdaaf52
Use (submitter, command_id, application_id) for command deduplication (#2724) 2019-09-03 10:09:01 +02:00
mziolekda
e8c1c55e24
participant id and list of archives are optional command arguments (#2722) 2019-09-02 17:47:02 +02:00
Stefano Baghino
1d88fc3207
Make party and command identifiers unique across runs (#2721)
* Make party and command identifiers unique across runs

* Fix compilation error
2019-09-02 16:02:20 +02:00
Gerolf Seitz
63a92887dc
Store external offset on every state update. (#2719) 2019-09-02 16:00:13 +02:00
Stefano Baghino
e452aa2cea
Port semantic tests to the new test tool (#2718) 2019-09-02 14:40:10 +02:00
Stefano Baghino
13607031f5
Start porting the transaction service integration tests (#2713)
* Start porting the transaction service integration tests

Contributes to #1373

* Simplify creation of multiple contract in a single transaction

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319562016

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319562566

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319563441

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319563617

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319563788

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319563838

* Fix test case description

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Fix test case description for disclosure

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Fix test description of parallel requests test case

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319883011

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319567251

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319567251

* Run all conformance tests in exclusive mode
2019-09-02 13:45:15 +02:00
mziolekda
051c3641b2
add participant-id as command line option to the damlonx reference server (#2717)
* add participant-id as command line option to the damlonx reference server

* address review comments
2019-09-02 13:43:21 +02:00
Jussi Mäki
07fef0d784 Dispatcher: Provide sub-source in startingAt (#2715)
This allows using the dispatcher in situations where the index is common,
but different data streams are materialized from it.

The practical reason for this is to allow using a single dispatcher to read
from both the ledger_entries and configuration_entries tables, which share
the same ledger offset construction.
2019-09-02 09:05:08 +00:00
Jussi Mäki
a96f3fb736 Disable the checkTtl validation in kvutils (#2714)
The time model is being reworked and the current stack is not prepared
to handle this additional check well.

We will reimplement time model related checks once the redesign has been
completed.
2019-09-02 02:57:40 +00:00
Gerolf Seitz
ecb506e803
SQL diagnostics (#2662)
* Use proper names for the DB connection pools.

* Add some trace logging for DB operations.

This does not capture timing of individual statements but
rather the time for "units of work".
For example "lookup contract" doesn't mean only loading
a single row from the contracts table, but also 2 additional
queries for looking up witnesses and divulgences.

This is not a problem, because this is trace level logging
that helps us debug problems and shouldn't be made sense of by
users at this stage.

* Make description a by-name parameter.

This avoids building up the string if trace logging
is not enabled (i.e. most of the time).
2019-08-30 13:41:44 +02:00
Jussi Mäki
93f39508a3
Add kvutils envelope (#2709)
The kvutils envelope is meant to be used whenever a kvutils produced
data is stored and transmitted over the network. It adds both versioning
and compression to the original message.
2019-08-30 13:28:56 +02:00
Gerolf Seitz
0e80f75ff4
Make sure ActiveContractService sends out a consistent snapshot (#2708)
* Make sure ActiveContractService sends out a consistent snapshot

instead of looking up the latest ledger end, we can only take the latest known ledgerEnd in the scope of SqlLedger.
If we don't do that, we can miss contracts from a partially inserted batch insert of ledger entries
scenario:
1. batch insert transactions A and B at offsets 5 and 6 respectively; A is a huge transaction, B is a small transaction
2. B is inserted earlier than A and the ledger_end column in the parameters table is updated
3. A GetActiveContractsRequest comes in and we look at the latest ledger_end offset in the database. We will see 6 (from transaction B).
4. If we finish streaming the active contracts up to offset 6 before transaction A is properly inserted into the DB, the client will not see the contracts from transaction A
The fix to that is to use the latest known head to the dispatcher, which is updated AFTER a batch has been inserted completely.

This PR also factors out the basic readonly functionality that is
duplicated between SqlLedger and ReadOnlySqlLedger into a class
BaseLedger.

* copyright header
2019-08-30 10:56:30 +02:00
Gerolf Seitz
7311350b55
Extend the timeout for running integration tests with H2 (#2710) 2019-08-30 10:36:40 +02:00
Remy
20649cf78e ledger-api: rename decimal field to numeric in value Proto (#2688)
* add Numeric.java

* ledger-api: rename `decimal` field to `numeric` in value protobuf

* Address Gerolf's comment

* ledger-api: add missing renammings

* ledger-api: relax syntax of numbers that can be sent as numerics

* extractor:  fix

* leger-api: change format of number though ledger api

* daml-lf: fix numeric regexp

* ledger: fix tests
2019-08-29 22:51:33 +00:00
Robert Autenrieth
74cc2056ae
Recover indexer from errors (#2582)
Adds a loop that restarts the indexer
with a delay any time it fails.
2019-08-29 15:06:05 +02:00
Robin Krom
7fca591df0
replace main file with a pointer to the source root (#2687)
* language: compile everything in the source directory

This removes the need to specify a 'main'. Instead we 'source' in
daml.yaml should point to the source root directory.
2019-08-29 13:42:33 +02:00
Oliver Seeliger
8247624fd6
H2database: Limit writes to single connection, add daml-on-x compat test (#2698)
* Add h2 database daml-on-x reference2 server compat test

* Limit H2 database writes to be single-threaded
2019-08-29 13:37:24 +02:00
Oliver Seeliger
834a06a397
Ledger API Server H2 Database support (#2425)
* Ledger API Server H2 Database support (#2528)

* Disable parallel batch ledger append due to lack of H2DB isolation
2019-08-28 14:14:21 +02:00
Stefano Baghino
6d1d0b80c5
Port package management tests to new test tool (#2638)
* Port package management tests to new test tool

* Address https://github.com/digital-asset/daml/pull/2638#discussion_r317025106
2019-08-23 13:55:50 +02:00
Stefano Baghino
c6d1724bf9
Fix party management service test error output (#2639) 2019-08-23 13:06:37 +02:00
Gerolf Seitz
139afa4e59
Properly set connection pool properties (#2637) 2019-08-23 10:24:56 +02:00
Remy
997212c8f4
daml-lf: decommission internal Decimal type in favor of Numeric. (#2594)
* daml-lf: ValueDecimal -> ValueNumeric
* Apply suggestions from Stephen's code review
   Co-Authored-By: Stephen Compall <stephen.compall@daml.com>
* extractor: add comment about Numeric SQL format
2019-08-22 18:07:47 +02:00
Stefano Baghino
d01b649bda
Port party management tests to the new test tool (#2630) 2019-08-22 18:01:46 +02:00
Moritz Kiefer
aaa3d243a4 Fix imports in ActiveContractsService (#2631) 2019-08-22 12:38:01 +00:00
Remy
16d88ebcc0
ledger-api-test: cleanning a bit the build files (#2613)
* ledger-api-test: cleanning a bit the build files
* bazel: adapt client_server_test rule to expands files path as arguments
2019-08-22 13:32:41 +02:00
Jussi Mäki
aaeb58b44f
kvutils: Add authorization checks (#2622) 2019-08-22 13:01:18 +02:00
Stefano Baghino
424bd0cbf4
Restore resource closing ordering in Ledger API server (#2623)
Fixes #2549
2019-08-22 11:44:58 +02:00
Gerolf Seitz
cd3a6f9ffe
Port integration test for ActiveContractsService (#2580) 2019-08-22 11:35:55 +02:00
mziolekda
91c4af5d96
include Test-1.6.dar file used for compatibility testing in the test tool jar file (#2615) 2019-08-21 20:27:58 +02:00
Jussi Mäki
4ecf070860
kvutils: Authorization and config submissions (#2433)
* Initial version for configuration submissions and authorization

* Refactor config submission based on review. Add tests.

* Cleanup test output and comments

* kvutils test-suite

- Add unit tests for kvutils
- Thread the input state into Commit monad
- Fix a bug in handling rejected transactions (from previous refactoring)

* Address PR review

- Add submissionId to configuration changes.
- Revert the dedup of the ParticipantNotAuthorized message. This did not buy much
  and we need to duplicate it anyway when modularizing kvutils.
2019-08-21 18:24:16 +02:00
Stefano Baghino
3f0aaf08f3
Run semantic and divulgence tests on reference-v2 (#2614) 2019-08-21 13:38:14 +02:00
Gerolf Seitz
67d4b7aec6
Upgrade akka to 2.5.23 and akka-http to 10.1.9 (#2576)
When diagnosing error logging from akka when shutting down the ledger
API server, I wanted to give upgrading akka to the latest good release
between akka and akka-http. Incidentally, this actually removed the
errors and the shutdown should now be successful.
2019-08-19 12:34:03 +02:00
Leonid Shlyapnikov
0960c49cff
LedgerClient JWT pass-through in the HTTP JSON API gateway (#2566)
* The first draft of LedgerClient JWT support

not integrated with HTTP JSON API gateway yet.

* JWT pass-through for create and exercise commands

* JWT pass-through for contracts search and lookup

* Removing unused class

* Readme updates
2019-08-17 06:54:05 -04:00
Stefano Baghino
35a36a6fd6
Remove old CommandService integration tests (#2568) 2019-08-16 18:33:17 +02:00
Stefano Baghino
eb965866cc
Simplify new test tool (#2573)
* Simplify new test tool

* Shorten exercise to leverage ContractId

* Remove dead code

* Address https://github.com/digital-asset/daml/pull/2573#discussion_r314702191

* Address https://github.com/digital-asset/daml/pull/2573#discussion_r314700739

* Simplify transaction requests
2019-08-16 16:24:00 +02:00
Gerolf Seitz
a17c6d1fc9
Add Command submission test (#2508)
Also loads all dar packages eagerly in sandbox tests
2019-08-15 16:45:50 +02:00
Gary Verhaegen
99ea93168d
update copyright notices (#2499) 2019-08-13 17:23:03 +01:00
Gary Verhaegen
1d7622c35d
exclude ledger migrations from copyright update (#2514) 2019-08-13 15:24:38 +01:00
Gerolf Seitz
66f85ca530
Add ContractKeys test. (#2491)
This test represents the behavior of contract keys before the change of behavior in DAML LF 1.DEV.
The existing ContractKeys test is renamed to ContractKeysSubmitterIsMaintainer.

The `LedgerTestSuiteRunner` now uses a fixed number of
threads for the runner threadpool. This way we don't flood
the CPU with threads when using a CachedThreadPool.
2019-08-13 15:15:51 +02:00
Remy
c2e2e007e7 Fix release notes about improper freeze of 1.6 (#2489)
* daml-lf: clean up a bit how verion are handle

* fix releases not about imporper release of #1866

* address Gerolf's comments
2019-08-13 08:10:24 +00:00
Gerolf Seitz
9d1af43ec8
Port WitnessesIT to the new test infrastructure. (#2486) 2019-08-13 09:24:08 +02:00
Gerolf Seitz
8f14c19fc9 Move assertion on exception type to match block. (#2495)
Addresses
https://github.com/digital-asset/daml/pull/2282#pullrequestreview-272786088
2019-08-12 12:52:01 -04:00
Gary Verhaegen
bf5995f529
remove mentions of da-int servers (#2485) 2019-08-12 10:42:41 +01:00
Gerolf Seitz
816b93e2c2
Produce a more compact test summary output. (#2483)
Example:

ContractKeys
- Divulged contracts cannot be fetched or looked up by key ... Success
- Contract Keys should reject fetching an undisclosed contract ... Success
- Contract keys should be scoped by maintainer ... Success

Divulgence
- Divulged contracts should not be exposed by the transaction service ... Success
- Divulged contracts should not be exposed by the active contract service ... Success

Identity
- A ledger should return a non-empty string as its identity ... Success

SemanticTests
- Test:consistency_doublespend1 ... Success
- Test:contract_keys_test ... Success
- Test:consistency_doublespend2 ... Success
- Test:authorization_success1 ... Success
- Test:authorization_rule2_failure ... Success
- Test:authorization_rule1_failure ... Success
- Test:privacy_projections1 ... Success
- Test:consistency_doublespend3 ... Success
- Test:authorization_success2_delegation ... Success

Time
- Advancing time should return the new time ... Success<Paste>
2019-08-12 09:13:38 +02:00
Stefano Baghino
afa4659292
New Ledger API test tool (#2282)
* New acceptance test tool prototype

* Fix transaction filter helper

* Address https://github.com/digital-asset/daml/pull/2282#discussion_r308081386

* Address https://github.com/digital-asset/daml/pull/2282#discussion_r308082432

Moreover, creates specific helpers for test DAML code.

* Move helpers from session to context

Remove a circular dependency between session and context, and limits the
usage of implicits.

* Run tests with ledgers out of process

* Prepare for drop in

* Temporary timeout increase

* Move bulk of the logic to the test runner

* Have a map of tests for CLI integration

* Timeout per-test, runner uses context, renaming

* Allow usage of time service, integrate semantic tests

* Integrate CLI SSL configuration

* Integrate failure expectation CLI option

* Integrate with failure output verbosity CLI option

* Integrate with test listing and picking CLI options

* Integrate with timeout scaling CLI option

* Integrate with command TTL CLI option

* Review CODEOWNERS

* Drop previously unimplemented CLI parameters

* Expand test todo list to encompass latest additions

* Deduplicate some testing infrastructure, swap in new test tool

* Remove unused rule

* Address https://github.com/digital-asset/daml/pull/2282#discussion_r311045444

* Address https://github.com/digital-asset/daml/pull/2282#discussion_r311051974

* Address https://github.com/digital-asset/daml/pull/2282#discussion_r311035287

* Address https://github.com/digital-asset/daml/pull/2282#discussion_r311055290

* WIP

* Make gRPC thread factory spawn non-deamon threads

* Remove debug prints, complete divulgence test (missing assertion messages)

* Try to detect assertion failure line number

* Add Sandbox binary that starts an ephemeral postgres instance

This allows us to use the client_server_test bazel macro to run against
the sandbox backed by postgres.

Fixes #1543

* Add Sandbox binary that starts an ephemeral postgres instance

This allows us to use the client_server_test bazel macro to run against
the sandbox backed by postgres.

Fixes #1543

* Address https://github.com/digital-asset/daml/pull/2282#discussion_r311400695

* Remove TlsConfiguration duplicate, move original to commons

* Make assertion more readable

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Fix build errors introduced in previous commit

- exclude time service tests from reference-v2
- add copyright header to TlsConfiguration

* Complete divulgence test and address review comments

Restores comments from original divulgence tests and strives to be as
close to them as possible.

- Address https://github.com/digital-asset/daml/pull/2282#discussion_r311429169
- Address https://github.com/digital-asset/daml/pull/2282#discussion_r311431156
- Address https://github.com/digital-asset/daml/pull/2282#discussion_r311431913

* Delete old divulgence tests

* Restore methods to fetch contracts by template identifier

* Run conformance tests on in-memory sandbox

* Run conformance tests on the persistent sandbox

* Remove workflow identifier workaround

* New contract keys test (#2452)

* Set channel type for LedgerSession

* Add ContractKeysIT

* Run tests against reference-server v2

* Removed the old ContractKeysIT. However, ...

... I cannot remove ContractKeysChecks completely, because we have
another test path for DARs created prior to DAML-LF 1.6, which doesn't
have the submitter == maintainer restriction for contract keys.

* Use codegen instead of custom code

* Add missing copyright headers

* Drop sandbox conformance test suite (seems to not work on Windows CI)

* Make time simpler

* Test tool tests to run only semantic tests

* Make CI behave more consistently

* Add missing files to run tests on Postrgres

* Fix flaky divulgence test, introduce readable identifiers

* Increase sandbox conformance tests timeout

* Address https://github.com/digital-asset/daml/pull/2282#discussion_r312363246

* Reintroduce test resource extraction

* Read semantic tests from the classpath rather than Bazel

* Use codegen types for ContractKeys integration test

allocateParty returns Primitive.Party and create and exercise also
accept Primitive.Party. This way we don't have to keep a String and
Primitive.Party representation around.

* Bump timeout for sandbox conformance tests

* Remove dependency on Bazel runfiles
2019-08-09 17:00:37 +02:00
Gerolf Seitz
353a19c9ae Fix shutdown order to avoid dead letter logging when stopping sandbox (#2471)
It looks like that closing the LedgerApiServer before closing the
AkkaExecutionSequencerPool (AESP) leads to a non-deterministic bunch of dead
letter warnings when stopping sandbox.

Closing the AESP first avoids these warnings.

Fixes #1886
2019-08-09 08:27:17 +00:00
Gary Verhaegen
87d2fd4f31 remove sandbox-head-tarball (#2458)
We can get the same jar out of the SDK tarball.
2019-08-08 16:34:00 +01:00
Gerolf Seitz
6993232593 Fixed a bug that prevent sandbox from loading empty workflow ids. (#2446)
This happened because we translate empty workflow ids to None in the
API-to-domain translation layer. When we store the workflow id, we actually
convert the None case back to an empty string (and not a null value).

When loading the workflow id from the database, we parse the column as a regular
LedgerString, but unfortunately these cannot be empty. Therefore using empty workflow
ids on postgres has been broken since workflow id has changed from a tagged string
to LedgerString.
2019-08-08 11:29:21 +00:00
Gerolf Seitz
d52d3bc451
Semantic tests fall back to wall-clock time if timeservice is not available (#2419) 2019-08-08 13:08:57 +02:00
Michał Majcherski
86bec619d0 Sandbox reset 'ledger ID not found' fix (#2331)
* Sandbox reset 'ledger ID not found' fix

* Improve Haskell Ledger bindings tests

- Add an interceptor to Ledger Sandbox rejecting calls during reset
- Wait for new Sandbox - retrying getLedgerId calls in Haskell's ResetService - retry on errors and when Ledger IDs don't change

* satisfy hlint

* backout unnecessary haskell changes

* fmt.sh
2019-08-06 13:42:16 +01:00
Jussi Mäki
689d969038
kvutils commit refactoring (#2393)
* kvutils refactoring

Move transaction submission processing to its own class and refactor to
stop early on errors.

Throw a known error rather than use sys.error.

* Refactor package and party allocation

* Introduce "Commit" computation abstraction

This also fixes an issue where the command dedup entry was not created
when a later validation failed and a rejection log entry was created.

* Drop input_log_entries. Add contract instance to DamlContractState.

* Add copyright headers

* Add KeyValueCommitting.submissionOutputs

This cleans up implementations that need to know the outputs of a submission
up-front.
2019-08-05 16:30:21 +02:00
Petro Semeniuk
a7afaa2d99
Expose grpc max inbound message size as cli option (#2347) 2019-07-31 20:37:40 +10:00
Michał Majcherski
43d30fd872 Multiple sandbox resets scala test (#2337) 2019-07-31 09:50:45 +02:00
Gerolf Seitz
5da6b9c0ae
Integration test fixes (#2314)
* Avoid double logging for API Services

* Make WitnessesIT a word spec with a "title"

* The test reporter should also print the "should" keyword.

* Enable ALL.THE.TESTS. for reference-server v2
2019-07-30 11:27:57 +02:00
Stefano Baghino
340a4eb6a4
Read stakeholders through the active contract service (#2316)
* Read stakeholders through the active contract service

Fixes #2070

Also standardizes the use of American English spelling for `serialize`
and `deserialize`. Standardize. Serialize. Americanize.

* Remove Haskell bindings test workaround

* Address https://github.com/digital-asset/daml/pull/2316#discussion_r308193661
2019-07-30 10:40:45 +02:00
Leonid Shlyapnikov
b940951a76
HTTP JSON API first version (#1994)
* Cleanup

* WIP

* first integration test + fixture

* minor cleanup

* Implementing ContractService.lookup

* Reverting back to endpoints.all (all2 did not work)

* Cleanup

* replace ApiValue ADT with aliases to daml-lf/transaction Value ADT

* porting rest of navigator to LF Value ADT

* Command Service WIP

* CommandService WIP

* porting more of navigator to LF Value ADT

* last error, not first

* rename ApiValueImplicits file

* special conversion features for ImmArray and FrontStack

- just .to[ImmArray] or .to[FrontStack] any random collection

* finish porting most of navigator main code

* use numeric indices for record field name fallback when pretty-printing

* tuples are not serializable

* use numeric indices for label fallback in JSON verbose encoding

* make traverseEitherStrictly more likely to preserve the seq's class

* to shortcut for ImmArraySeq .to[ImmArraySeq]

* compiling, passing navigator backend tests

* test traverseEitherStrictly more, er, strictly

* pass scalacopts through to scaladoc

* deal with unused warning

* remove unneeded function

* simpler error reporting, more private functions in ApiCodecCompressed

* move slowApply to FrontStack, test it so it actually works

* remove unneeded toStrings; better error from impossible ValueTuple case

* scalafmt FrontStackSpec

* support alternative, label-free record JSON encoding

* Adding domain.CreateCommand + corresponding json formats and dummy json format for lav1.value.Record

* CommandService.create should be done... need to test it

* TODO added

* Cleanup

* move ApiCodecCompressed, ApiValueImplicits, and some aliases to new lf-value-json package

* Using tagged TemplateId type instead of Identifier + exercise command WIP

* adapt navigator to moved pieces

* start defining scalacheck extension to ApiCodecCompressedSpec

* CommandService.exercise + introducing CommandMeta

* Adding command endpoints, can't test them yet, need lf value json formats

* fuse some list operations

- suggested by @stefanobaghino-da; thanks

* blue error message

* Minor fixes after merging librify-navigator-json-compressed, #2136

* experiment with an inductive case in TypedValueGenerators

* finish a List case for TypedValueGenerators; it's revealing

* Introducing API value to LF value converter,

CommandsValidator takes IdentifierResolverLike instead of IdentifierResolver

* cleanup

* remove accidentally readded duplicate aliases

* start tying knots in TypedValueGenerators

* verbatim copy ApiCodecCompressedSpec to lf-value-json

* shift some tests from navigator to lf-value-json

* test Optional and Map for ApiCodecCompressed

* heavier random testing of ApiCodecCompressed

* remove unused dependencies from lf-value-json

* adding value json writer

* cleanup

* Revert "cleanup"

This reverts commit 2e4d153f

* fixing the build

* cleanup

* cleaning up imports

* JsValue to API value is done, needs a test

* cleanup

* use scalac -Ypartial-unification in http-json

* simplify some Traverse instances

* factor CreateCommand and ExerciseCommand traverse instances

* Command create integration test WIP

* Command create integration test WIP, got rid of the JsonReader and JsonWriter for the values, converting values explicitly

* Extracting DomainJsonDecoder and DomainJsonEncoder

* LfV refactoring

* Create command serialize/deserialize test works

* cleanup

* resolving conflicts

* More json encode/decode tests

* logging

* command/create passes integration test now

* Adding readme

* grammar

* TODO added

* GetActiveContractsResponse encoding

* ideintifier conversion renaming

* PackageService resolveTemplateId returns domain.TemplateId now

* Resolving LF Identifier instead of Template ID, this should also work for Exercise command decoding

* cleaning up a bit

* daml-lf: show type in TypedValueGenerators-driven errors

* exercise command json encoding/decoding works

* command/exercise IOU_Transfer integration test passes now

* avoid filter for Gens; makes many contract ID gens not fail

* test ApiCodecCompressed against 100 random types, 20 random values each

* Updating README instructions

* improving error handling, failed futures, get logged and reported to the user now as 500

* [ROUTING DSL] Removing routing DSL, it did not work

* getting rid of HttpEntity.Strict match + cleanup

* fixing the merge conflict

* updating README

* use Show.shows instead of new Show

* List(_) isn't checked, but Seq(_) is slightly safer

* improving test assertions

* Adding /contracts/lookup implementation

* http-json: use ImmArraySeq instead of List; use toRightDisjuction

* http-json: .toList.toSet is shorter than fold

* http-json: replace .leftMap.map with .bimap

* http-json: use subst instead of reimplementing JsonFormat

* http-json: remove unused ExceptionHandler

* http-json: safer == comparison

* Adding two test cases for expected errors

* Adding BazelRunfiles.rlocation magic that supposed to handle windows path for bazel dependencies

* http-json: import, not extend
2019-07-29 16:49:57 -04:00
Rohan Jacob-Rao
0b56eedcea
Better method for finding ID of test package (#2306) 2019-07-29 12:13:23 -04:00
Jussi Mäki
3724a5789e
Contract keys for kvutils (#2304)
* Support for contract keys to kvutils

* Fix handling of CreateEvents with contract keys in semantic tester

* Add ContractKeysIT to tests and fix issues related to fetchByKey

* Address code review
2019-07-29 16:45:24 +02:00
Davin K. Tanabe
acc41c3b84 Idempotent package uploads (#2131)
* Idempotent package uploads

* Log the correct number of duplicates

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>
2019-07-29 11:44:11 +00:00
Gerolf Seitz
04ca108e7b Eliminate grpc-netty runtime warning after grpc upgrade (#2313)
Netty emits a warning if the eventLoopGroup is customize without setting
the corresponding channelType.
2019-07-29 09:39:29 +00:00
Gerolf Seitz
136f6d1c08
Remove ExercisedEvent#contract_creating_event_id. (#2262)
This is a breaking change on the ledger api. So far we could rely on the
assumption that contractId == eventId. This assumption doesn't hold
anymore in a daml-on-x setting, where the eventId is created by the
api server, but the absolute contractId is created by the ledger
implementation.

Instead of going through weird contortions to store the relevant data in
the existing database schema, it is more viable in the long term to
remove that field and instead provide facilities to lookup transactions
by contractId.

Contributes to #2068.
2019-07-29 11:30:01 +02:00
Stephen Compall
5a707960d2
navigator: replace Value<->ledger-api conversion with ledger-api-common functions (#2292)
* ledger: refactor validateValue from CommandsValidator to new ValueValidator

* daml-lf: add a matchable class for leaf Values except ValueContractId

* ledger: use IdentifierResolverLike for CommandsValidator

* daml-lf: add Traverse[FrontStack]

* navigator: define readRecordArgument and readArgument in terms of ledger-api-common ValueValidator

* navigator: clean up fillInVariantTI

* navigator: replace ledger-api Value writer with LfEngineToApi from ledger-api-common

* navigator: use traverse

* navigator: remove dead sequenceMap

* navigator: adapt to new ValueValidator structure

* ledger: dealias validateValue call

* navigator: a good use case for traverseEitherStrictly
2019-07-26 14:24:34 -04:00
Michał Majcherski
37a921516b
Upgrade gRPC JVM libs (#2276)
* Haskell ledger bindings tests setup fix - use --port-file to obtain sandbox's port

* Update gRPC JVM libs

* Add missing gRPC core dependency

* Redirect sandbox's stdout and stderr to /dev/null

* Amend ledger's NettyServerBuilder settings after gRPC upgrade
2019-07-26 14:44:59 +02:00
Robert Autenrieth
164d57a48e
Add notes on writing tests (#2264) 2019-07-24 07:28:50 +02:00
Remy
53de5edbc1 ledger-api: Kill legacy identifier (#2211)
* ledger-api: drop support for legacy identifier

* address scala-codegen: Stephen's comments

* language support: fix test
2019-07-23 20:34:52 +00:00
Gerolf Seitz
6e6b2d67d2
More integration tests for test tool (#2241)
* Add CommandSubmissionTtlIT to Ledger API Test Tool

* Add ActiveContractsServiceIT to Ledger API Test Tool

* Add WitnessesIT to Ledger API Test Tool

* Delete useless test

* Move time manipulation in TransactionServiceHelpers

* Add CommandServiceIT to Ledger API Test Tool

* Add the missing summary case to the ToolReporter
2019-07-23 16:51:28 +02:00
mziolekda
ac06bef329
eliminate v2 version of the participant-state interface (#2255)
* eliminate v2 version of the participant-state interface

* remove participant-state-v1 from release artifacts
2019-07-23 14:59:15 +02:00
Gerolf Seitz
c3731e6721 Only log the file-names and not the entire archive on startup (#2226) 2019-07-19 15:08:42 +00:00
Robert Autenrieth
73545d44a5
Wait for index before completing package upload (#2194)
This makes sure users can immediately query the new
packages after the upload completed.

Fixes #2066
2019-07-18 10:04:41 +02:00
Beth Aitman
cd514eb024 Stdlib doc edits (#2163)
* Stdlib doc edits

* Apply suggestions from code review

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update based on Moritz's suggestion

* Fix ledger-api-integration-tests
2019-07-17 07:54:13 +00:00
Stephen Compall
1a93db264d
navigator: Use LF Value ADT in place of ApiValue ADT (#2053)
* replace ApiValue ADT with aliases to daml-lf/transaction Value ADT

* porting rest of navigator to LF Value ADT

* porting more of navigator to LF Value ADT

* last error, not first

* rename ApiValueImplicits file

* special conversion features for ImmArray and FrontStack

- just .to[ImmArray] or .to[FrontStack] any random collection

* finish porting most of navigator main code

* use numeric indices for record field name fallback when pretty-printing

* tuples are not serializable

* use numeric indices for label fallback in JSON verbose encoding

* make traverseEitherStrictly more likely to preserve the seq's class

* to shortcut for ImmArraySeq .to[ImmArraySeq]

* compiling, passing navigator backend tests

* test traverseEitherStrictly more, er, strictly

* pass scalacopts through to scaladoc

* deal with unused warning

* remove unneeded function

* simpler error reporting, more private functions in ApiCodecCompressed

* move slowApply to FrontStack, test it so it actually works

* remove unneeded toStrings; better error from impossible ValueTuple case

* scalafmt FrontStackSpec

* support alternative, label-free record JSON encoding

* fuse some list operations

- suggested by @stefanobaghino-da; thanks

* blue error message
2019-07-16 10:53:17 -04:00
Stefano Baghino
26caa24c93 Remove dead file (#2140) 2019-07-15 08:51:40 +00:00
Gabor Aranyossy
77964ce426 Keeping loaded packages after reset (#2091)
* keeping loaded packages after reset

removing unnecessary extra reference

changelog

making InMemoryPackageStore immutable

* using Instant.now when loading packages in IndexServer
2019-07-12 12:20:18 +00:00
Stefano Baghino
f80de418f9 Filter out checkpoints in completion stream tailing test (#2122)
Fixes #2121
2019-07-12 12:06:04 +00:00
Stefano Baghino
c651e94f82 Throw away unused resource extensions (#2118) 2019-07-12 08:35:34 +00:00
Gabor Aranyossy
33c746fe9b loading Dars from ZipInputStreams (#2005)
* loading Dars from ZipInputStreams

formatting and cleanup

fixing DarReaderTest not compiling

fmt

using IOUtils to read the ZipInputStream

fixing CodeGen

fixing broken legacy DAR loading

fixed v2 ReferenceServer

cleanup

* fixing rebase conflicts

* introduced a fromFile method to avoid having to do boiler-plating where the input is a File

* addressing leaking resources

* cleanup

* inlining closures

* closing the darStream
2019-07-11 15:37:21 +00:00
Gabor Aranyossy
dc89f3fa72 fixing unhandled passTime cases in scenario loader (#2085)
* fixing unhandled passTime cases in scenario loader

* changelog update
2019-07-10 09:59:14 +00:00
Stefano Baghino
4ff9a6b7ea
Run PartyManagementServiceIT in conformance tests (#2040)
* Run PartyManagementServiceIT in conformance tests

* Poll for persisted user without using Await

Addresses https://github.com/digital-asset/daml/pull/2040#discussion_r301441379

* Remove unnecessary call to ledger end

Address https://github.com/digital-asset/daml/pull/2040#discussion_r301435726

* Review and improve test when endpoint is not implemented

Address https://github.com/digital-asset/daml/pull/2040#discussion_r301480120

* Fix typo in docstring

Address https://github.com/digital-asset/daml/pull/2040#discussion_r301475151

* Adopt exponential backoff for readability polling

Address https://github.com/digital-asset/daml/pull/2040#discussion_r301586140

* Disable PackageManagementServiceIT

* Restore previous testing of party names

* Replace blocking sleep with Akka's after
2019-07-09 18:44:18 +02:00
mziolekda
71e3edb21c clean up versions v1 and v2 of participant-state (#2036) 2019-07-08 15:04:17 +00:00
mziolekda
36ef2d1d1b Generate a list of single package updates for an upload message containing multiple packages (#2031)
* make every PublicPackageUploaded update contain exactly one package

* implement update subscriptions that start with offsets with the same major number

* address review comments
2019-07-08 11:22:28 +00:00
Gerolf Seitz
f310fe45e6 Integration test fixes + enable tests for postgres index|er (#2032)
* Do not convert the transaction id to Long in LedgerBackedIndexService

The InMemoryLedger does this, because it can make certain assumptions
(like transactionId == offset), but the sql based ledger cannot do that,
because the transactionId may be produced by another backend and thus
have a different format.

* Move tests that use contract keys into their own integration test file

This allows us to run the other tests via the ledger api test tool with
the postgres indexer while InMemoryKVParticipantState doesn't support
contract keys yet.

* Remove a few occurrences of LedgerBegin from TransactionServiceIT.

* Rename CommandTransactionChecksNo1866IT to ContractKeysNo1866IT

* Enable TransactionServiceTests,DivulgenceIT,TransactionBackpressureIT for postgres index|er

* format all the things

* Address a few review comments.

See https://github.com/digital-asset/daml/pull/2032#pullrequestreview-258771927

* Extract reusable base class for ContractKeys tests

This is needed because Bazel's scala_test_suite isolates the tests from
another, and one test cannot extend another one.

* Classify the reference-v2 conformance tests with a long timeout
2019-07-08 11:10:55 +00:00
Oliver Seeliger
33695b9961
DamlOnXSubmissionService shuts down ExecutorService on close (#1999)
* DamlOnXSubmissionService shut down of package load executor service

* ReferenceIndexServer specifies viable PackageId

Using dash (-) instead of slash (/)
2019-07-08 08:58:27 +02:00
Stefano Baghino
3799847041 Make PostgresIndexer persist PublicPackagesUploaded (#2022)
Advances #1273

Also adds tests for the data access object to upload packages and fixes
bug that emerged.
2019-07-05 19:04:52 +00:00
mziolekda
7e3d580768 Connect LedgerAPI party and package management with KVUtils (#1985)
* connenct LedgerAPI party and package management with KVUtils

* formatting

* address review comments

* add participantId parameter to sandbox and indexer

* annotate TODO's with github issue numbers
2019-07-05 15:31:17 +00:00
Gerolf Seitz
79d88a4952 dd a reference server main class that starts an ephemeral postgres server (#2024)
This way we can run the test suite of the ledger api test tool against the
postgres index and postgres indexer.
2019-07-05 13:52:43 +00:00
Francesco Mazzoli
ca5d045e62 check that submitter is in maintainers for lookup by key (#1967)
* check that submitter is in maintainers when looking up keys

Fixes #1866. Note that this limitation applies both for `lookupByKey`
and `fetchByKey` -- anything involving retrieving a key is affected.

* add UNTIL-LF to run tests up to a certain version of DAML-LF

* name targets for DAML tests better

* add notes about DAML-LF changes

* commit Test.daml with DAML-LF 1.5 rather than compiling it on the fly

* add scenario tests for #1866

* add warnings about future key behavior in docs

* use flag rather than version when executing
2019-07-05 09:34:26 +00:00
Gary Verhaegen
acbc5de820 remove some build warnings (#2012) 2019-07-04 22:07:49 +00:00
Gerolf Seitz
399cab79be
Make DivulgenceIT work with the test tool (#2002)
1) Change to SuiteResourceManagementAroundAll, transforming the test to
not assume a new/empty ledger for each test case
2) Use distinct workflow ids so the individual test cases don't clash
with each other
3) Use a new UUID for each randomized command id, instead of using the
uuid used per test run.
2019-07-04 18:43:38 +02:00
gleber
3dac96f8d3 Ledger API Test Tool: skip semantic tests on unsupported Ledger API. (#1976)
Semantic tests will be skipped if the specified Ledger API endpoint does not
implement TimeService.

This teaches MultiLedgerFixture to deal with cancelled tests.

This improves Ledger API Test Tool reporter to deal with cancellations better.
2019-07-03 18:27:25 +00:00
Gerolf Seitz
a449d86ee0
Initial Ledger API Server (#1978)
* Add external offset column to parameters

We only ever need to use the external offset when restarting the api
server from a persistent data store to resume the ReadService state
update stream from the last processed offset.

In the PostgresIndexer we then need to store the external offset while
adding a new ledger entry.

* Allow disabling the jmx reporter in metricsmanager

* Implement PostgresIndexer component

* Introduce read-only Ledger and Dao

* SandboxEventIdFormatter treats transactionId as opaque string

* Introduce LedgerBackedIndexService

This can be reused both in the Sandbox and the ApiServer

* Implement PostgresIndex component

* Reference Service based on kvutils-v2 and postgres(index|indexer)

* Disable conformance test for ReferenceServer
2019-07-03 15:25:22 +02:00
Michał Majcherski
5702df7808
windows: fixed client_server_test setup (#1958) 2019-07-03 09:59:29 +02:00
Gabor Aranyossy
7e7c5f08cc started centralizing api Test utils (#1863)
* Centralises testing utilities around:

* transaction filters
* offsets
* parties

* fixed CommandCompletionServiceIT

* overriding the party in commands helper

* fxied wrong filter usage in TransactionServiceLargeCommandIT

* fixing CommandTransactionChecks

* fixing broken tests
2019-07-02 15:06:52 +00:00
Robert Autenrieth
b50ee984a0
Implement a PostgreSQL package store (#1818)
Adds a PostgreSQL package store to the sandbox.

Previously, packages were only stored in memory and
specified as CLI arguments. So if a user uploaded a
package at run time, he needed to add the package to
the CLI when restarting the sandbox.
2019-07-02 15:43:43 +02:00
Stefano Baghino
4774e75eb8 The completion stream RPC defaults to the ledger end as offset (#1961)
* The completion stream RPC defaults to the ledger end as offset

Fixes #1913

Relevant changes are propagated to the Java bindings (including
deprecating a method that would now return a nullable ledger end).

* Refactor completionStream method

* Address review comments

- ignore command creation results
(https://github.com/digital-asset/daml/pull/1961#discussion_r299089539)
- avoid re-connecting to the client for every command
(https://github.com/digital-asset/daml/pull/1961#discussion_r299092328)
- move offset field optionality to domain object
(https://github.com/digital-asset/daml/pull/1961#discussion_r299090451)

* Improve tests
2019-07-02 10:02:43 +00:00
Gabor Aranyossy
2bb8263a5e adapting docs to match state as is regarding not supporting dalf files (#1951)
* adapting docs to match state as is regarding not supporting dalf files

* patching release notes instead

* validating for ZIP files in Cli parser

* guarding for parsing non zipped archives

* Update release-notes.rst

* Update unreleased.rst

Co-Authored-By: Beth Aitman <bethaitman@users.noreply.github.com>

* Update unreleased.rst

* Update release-notes.rst

* Update release-notes.rst
2019-07-01 13:36:56 +00:00
mziolekda
02e94ec845 provide party and package management in KVUtils and participant-state v1 (#1553)
* provide asynchronous interfaces for party and package management on the participant-state

* provide submission id for correlating req with resp on Write- and ReadService

* add asynchronous party allocation in KVUtils

* start conversion of the package upload and party allocation to synchronous paradigm

* implement synchronous versions of party allocamtion and packacge update

* document recent changes and unify concepts between v1 and v2 versions of
the participant-state interface

* scala formatting

* address review comments
2019-07-01 12:57:33 +00:00
Gabor Aranyossy
709112e92b fixing issue of returning inclusive ledger offsets with completions (#1932)
* fixing issue of returning inclusive ledger offsets with completions

* changelog update

* removed TODO

* fixing haskell tests
2019-07-01 07:45:26 +00:00
Ognjen Maric
54cf2ee836
Retain fetch actors during reinterpretation (#1414)
DAMLe: add submitters and retain fetch node actors in reinterpretation

Co-Authored-By: Francesco Mazzoli <f@mazzo.li>
2019-06-28 15:40:52 +02:00
gleber
2089b2dc0d Ledger API tests: option for non-unique identifiers (#1735)
* Ledger API Test Tool: Add --stable-identifiers option.

* Ledger API Test Tool: split stable party and command identifiers options.

This allows to control individually which identifiers are stable and which are
randomized.

* Ledger API tests: introduce TestIdsGenerator.

It combines all places where per-run unification of identifiers was generated.

* Ledger API Tests: use unification methods instead of run*Suffix

* Review fixes
2019-06-28 10:22:50 +00:00
gleber
52e88b3364 Sandbox: streamline log-level scopt option parsing. (#1931) 2019-06-28 09:52:21 +00:00
gleber
eba635fde4 Sandbox: add cli-controlled logging level (#1835) 2019-06-28 08:35:25 +00:00