Commit Graph

753 Commits

Author SHA1 Message Date
Robert Autenrieth
3f597aae16
New ledger time (#5100)
* Tighten result type

Command execution can't result in a sequencer error

* New helper method for extracting used contracts

* New error clause

* Add a DAO query for the maximum time of contracts

* Implement algorithm for finding ledger time

CHANGELOG_BEGIN
CHANGELOG_END

* fixup ledgerTimeHelper

* Use new ledger time algorithm

* Mark LET/MRT as deprecated

CHANGELOG_BEGIN
- [Ledger API] DAML ledgers have switched to a new ledger time model.
  The ledger_effective_time and maximum_record_time fields of command submission are deprecated,
  the ledger time of transactions is instead set automatically by the ledger API server.
  Ledger time is no longer strictly monotonically increasing, but only follows causal monotonicity:
  ledger time of transactions is greater than or equal to the ledger time of any used contract.
  See `#4345 <https://github.com/digital-asset/daml/issues/4345>`__.
CHANGELOG_END

* Add ledger time skew check

* Remove command updater

LET/MRT are now deprecated, this class is now useless

* Remove old time model validator

* Switch to new time model check: kvutils

* Switch to new time model check: in-memory ledger

* Switch to new time model check: SqlLedger

* Use initial ledger config

* Ignore user provided LET

* Use TimeProvider in submission services

* Use deduplication_time in daml-script runner

- Also remove unnecessary command completion output of CommandTracker.
- Remove usage of maximum record time in CommandTracker.

* Use arbitrary default value for deduplication time

* Use built-in Instant ordering

* Remove obsolete test

* Remove obsolete test: CommandStaticTimeIT

* Refactor test: TransactionMRTCompliance

* Disable test: CommandTrackerFlow timeout

* thread maxDeduplicationTime through to CommandTracker

* Improve test

* Refactor command client configuration

* Deduplication time should always use UTC

* Add missing method in TimedIndexService after rebase

* Put more details into the deduplication error response.

* Use system time for command dedup submittedAt.

* Use explicit UTC time source in command validator

* Revert CommandTracker[Flow] to previous completion-recovering-behavior

* Adapt scala client command config to new config params

Co-authored-by: Gerolf Seitz <gerolf.seitz@digitalasset.com>
2020-03-25 09:28:56 +01:00
Samir Talwar
2887f28cc1
kvutils: Inject the metrics registry instead of using SharedMetricRegistries. (#5161)
* kvutils: Remove an unnecessary `@SuppressWarnings`.

* kvutils: Reduce the scope of fields and methods in `Committer`.

* kvutils: Inject the metric registry into `KeyValueCommitting`.

CHANGELOG_BEGIN
CHANGELOG_END

* kvutils: Inject the metric registry into the committers.

* kvutils: Inject the metric registry into `ProcessTransactionSubmission`.

* kvutils: Avoid shared metric registries in tests.

* kvutils: Recreate the metrics registry per participant state.

* kvutils: Add trailing commas to parameter lists.

Flagrantly encouraged by @stefanobaghino-da.

* recovering-indexer: Don't re-use the metric registry in tests.
2020-03-24 19:41:19 +00:00
Stefano Baghino
a8a38a099e
Refactor conversion of pairs of offsets (#5159)
This way sharing code between new and old implementation should be easier.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-24 17:21:59 +01:00
Remy
d834b9b029
Sandbox: make contract id seeding flag public (#5153)
* Sandbox: Reveal contract id seeding flag

CHANGELOG_BEGIN
- [Sandbox] Add support for random contract identifiers.  See section
  `Contract Identifiers Generation` section in
  docs/source/tools/sandbox.rst
CHANGELOG_END
2020-03-24 15:51:23 +01:00
Samir Talwar
e4c2df827c
kvutils: Move ProcessTransactionSubmission parameters into #run. (#5151)
* kvutils: Avoid global `inputState` in `ProcessTransactionSubmission`.

* kvutils: Avoid transaction variables in `ProcessTransactionSubmission`.

Globals, bad.

* kvutils: Simplify imports in `ProcessTransactionSubmission`.

* kvutils: Move `ProcessTransactionSubmission` parameters into `#run`.

CHANGELOG_BEGIN
CHANGELOG_END

* kvutils: Move `engine` to the ProcessTransactionSubmission constructor.
2020-03-24 12:59:53 +00:00
Stefano Baghino
337a3a8269
Increase the time allowed for DB-backed reset service to complete tests (#5156)
The database-backed reset service can (understandably) go a bit slower than the one backed by the in-memory ledger.

This should help avoiding flaky tests.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-24 12:04:19 +00:00
Stefano Baghino
181df8f3ab
Act on Option2Iterable wart (#5154)
Some Option2Iterable ignore annotations are not needed, others were needed for unused methods.

In a few occasions we were ignoring the warning for the very purpose for which is was there,
i.e. avoiding an implicit conversion. I'm all for not verifying this rule if we agree we
don't need it.

For ProcessFailedException it was a bit gratuitous, I changed the way in which the exception
message is built.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-24 11:25:05 +00:00
Stefano Baghino
37b7d855b8
Add test to ensure that the reset truncates all tables (#5142)
* Add test to ensure that the reset truncates all tables

The test can be adjusted over time to accomodate for exceptions (which are already there).

Unfortunataly we have to add a new couple of queries to support both Postgres and H2.

Fixes #5130

CHANGELOG_BEGIN
CHANGELOG_END

* Make loose check on configuration_entries
2020-03-24 09:18:14 +00:00
Remy
8fb86b7133
Engine: create type for immutable byte array (#5140)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-24 09:04:52 +01:00
Samir Talwar
22aa642a9f
sandbox: Add timers for all read, write, and index service methods. (#5147)
CHANGELOG_BEGIN
- [Sandbox] Added metrics under "daml.services" for various internal
  events.
CHANGELOG_END
2020-03-24 07:03:33 +00:00
Samir Talwar
e853012626
kvutils/app: Share the metrics registry between indexer and API server. (#5139)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-23 15:31:21 +00:00
Robert Autenrieth
c477b63a04
Store initial ledger configuration (#5126)
This is required by the "initialize before transaction acceptance"
invariant of the ReadService interface.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-23 15:39:13 +01:00
Stefano Baghino
c26effb235
Expose both JDBC URL and database type in tests, centralize initialization (#5133)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-23 12:17:24 +00:00
Stefano Baghino
ceeb7c3487
Re-use AkkaBeforeAndAfterAll in AbstractSandboxFixture (#5132)
* Re-use AkkaBeforeAndAfterAll in AbstractSandboxFixture

CHANGELOG_BEGIN
CHANGELOG_END

* Do not expose the Akka execution context directly
2020-03-23 11:56:47 +00:00
Samir Talwar
3d6ecc13b6
Sandbox: Configurable metrics output. (#5113)
* sandbox: Clean up `MetricsReporting` a little.

Make sure it closes both reporters, and avoid starting things in a
constructor.

* sandbox: Add hidden options for enable metrics reporting.

* sandbox: Add a disambiguating name to the DB connection/thread pools.

CHANGELOG_BEGIN
- [Sandbox] DB connection pool metrics names have changed slightly, from
  ``daml.index.db.connection`` to ``daml.index.db.connection.sandbox``.
- [Ledger Integration Kit] DB connection pool metrics names have changed
  to disambiguate the StandaloneApiServer from the
  StandaloneIndexerServer. The former now has a ``.ledger-api-server``
  suffix, and the latter now has a ``.indexer`` suffix.
CHANGELOG_END

* sandbox-next: Use the same metrics registry for the API and indexer.

* sandbox: Give a useful error message on an invalid metrics reporter.

And simplify the error messages.

With the arguments `--client-auth=foo --metrics-reporter=foo`, we now
get the output:

```
Error: Option --client-auth failed when given 'foo'. Must be one of
  "none", "optional", or "require".
Error: Option --metrics-reporter failed when given 'foo'. Must be one of
  "console", or "csv:PATH".
Try --help for more information.
```

* sandbox: Pull out more helpers in `MetricsReporting`.

* sandbox: Rename MetricsReporter classes so they don't clash.

* sandbox: Wrap the `name` parameter in a `ServerName` tagged string.

For safety. Yours, not mine.

* sandbox: Push metrics to Graphite with `--metrics-reporter=graphite`.

* sandbox: Make `MetricsReporter.Graphite` singly-lazy, not doubly-.

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

* sandbox: Replace `ServerName` with `ServerRole`.

* sandbox: Fix usage of `ServerRole.Testing` in `LedgerResource`.

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2020-03-23 10:59:13 +00:00
Stefano Baghino
c00af40fe5
Cleanup: InfiniteRetries is used only in sandox-perf (#5131)
* Cleanup: InfiniteRetries is used only in sandox-perf

CHANGELOG_BEGIN
CHANGELOG_END

* Fix import
2020-03-23 10:49:11 +00:00
Stefano Baghino
97ec70e508
Add missing truncations from reset service and fix perf tests (#5129)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-23 10:36:32 +00:00
Gerolf Seitz
f9fb888cc4
Allow for predictable contractIDs and transactionIDs (#5112)
- New seeding type "Static" that uses a fixed seed for generating new seeds.
This is only used in Sandbox and Sandbox-next.

- Remove the fuzzing for submission time in Engine.scala

- DAML-on-SQL: Create new log entry IDs from a provided SeedService.
This allows for generating deterministic transaction IDs in
Sandbox-Next.

Fixes #5107

CHANGELOG_BEGIN
[Sandbox] Add contract-id-seeding=static to allow for predictable contract IDs. This is useful for documentation,
to be able to refer to a specific contract ID instead of having to write "note down the contract ID you see on the screen. we will use it later."
[DAML-on-SQL] Derive the next log entry ID using the provided SeedService. This allows us to also deterministically create transactionIds in static time mode together with `--contract-id-seeding=static`. This should only be used for demos or documentation.
CHANGELOG_END
2020-03-23 10:55:40 +01:00
Samir Talwar
3e95bb7bec
Sandbox: Simplify the ApiCommandService a little. (#5125)
* sandbox: Remove a few levels of indentation in `ApiCommandService`.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox: Get rid of the `LowLevelCommandServiceAccess` trait.

It only has one implementation. Just use it.

* sandbox: Remove unused type aliases from ApiCommandService.
2020-03-23 08:55:25 +00:00
Samir Talwar
28c78e5978
sandbox | kvutils/app: Re-use the Materializer in the JdbcIndexer. (#5124)
* kvutils/app|sandbox: Rename `system` to `actorSystem`.

* sandbox: Pass a materializer in to the StandaloneIndexerServer.

There's no need for it to construct one when the caller always has one
available.

CHANGELOG_BEGIN
CHANGELOG_END

* recovering-indexer: Use `SubmissionId` instead of `LedgerString`.

Where appropriate.

* sandbox: Use the materializer implicitly in JdbcIndexer.
2020-03-23 08:55:19 +00:00
Oliver Seeliger
45acfec218
Ledger api server indexer initializes proper ledger_end after restart (#5122)
by reading parameters.ledger_end column instead of parameters.external_ledger_end.

CHANGELOG_BEGIN
[Ledger API Server]: Upon restart, ledger api server continues consuming unconsumed events rather than
all events from beginning.
CHANGELOG_END

Closes #5121
2020-03-23 09:53:48 +01:00
Gerolf Seitz
e82b8d743b
Add missing truncate for participant_events (#5117)
The missing truncate caused "Duplicate Submissions" after a reset in
between the performance tests.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-23 09:06:02 +01:00
Stefano Baghino
f67c32b002
Integrate transaction lookup on new schema in Ledger API (#5104)
* Integrate transaction lookup on new schema in Ledger API

Re-wires all transaction lookups to the new schema

CHANGELOG_BEGIN
CHANGELOG_END

* Always return the agreement text

CHANGELOG_BEGIN
[Ledger API Server] The metric 'daml.index.lookup_transaction' has been
replaced by 'daml.index.lookup_flat_transaction_by_id' and
'daml.index.lookup_transaction_tree_by_id', which record the same events
but with more granularity regarding the type of lookup.
CHANGELOG_END

* Ensure agreement text invariant in a single place

* Do not compare the order in which witness parties appear in an event

* Hide command identifier from non-submitters in transaction trees

* Fix time assigned to transaction to be the ledger effective time and not the record time

* Store transactions from initial state into the new schema
2020-03-20 17:22:42 +00:00
Samir Talwar
1ffd23a6a2
Sandbox: Make JdbcLedgerDao create its own execution context. (#5091)
* sandbox: Don't let just anyone construct a DbDispatcher.

It's the job of the JdbcLedgerDao.

* sandbox: Clean up the DbDispatcher a little.

* sandbox: JdbcLedgerDao now creates its own execution context.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox: Make `defaultNumberOfShortLivedConnections` private.
2020-03-20 15:30:35 +00:00
Stefano Baghino
febace7391
Add lookup for transaction tree by id (#5089)
* Add lookup for transaction tree by id

CHANGELOG_BEGIN
CHANGELOG_END

* Address https://github.com/digital-asset/daml/pull/5089#discussion_r395156203

* Address https://github.com/digital-asset/daml/pull/5089#discussion_r395163051

* Address https://github.com/digital-asset/daml/pull/5089#discussion_r395165561

* Address multiple comments

- https://github.com/digital-asset/daml/pull/5089#discussion_r395185084
- https://github.com/digital-asset/daml/pull/5089#discussion_r395185290
- https://github.com/digital-asset/daml/pull/5089#discussion_r395185461

* Address https://github.com/digital-asset/daml/pull/5089#discussion_r395157643

* Address https://github.com/digital-asset/daml/pull/5089#discussion_r395160343

* Address https://github.com/digital-asset/daml/pull/5089#discussion_r395482878

* Use refactored testing utilities

* Add test for partial transaction visibility
2020-03-20 13:28:11 +01:00
Stefano Baghino
a7c01e1b6f
Refactor transaction generation and add generation of more complex transaction (#5101)
Makes storing and generating test transaction more composable (store just takes a generated transaction)

- Add a nonTransient utility method to retrieve contracts that have been created but not consumed as part of a transaction
- Add an addChildren utility method to add children to a transaction to allow to create more complex test transactions
- Add a transaction generator that uses the aforementioned addChildren to create a more complex transaction

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-20 12:03:18 +01:00
Samir Talwar
6f9b516251
Sandbox: Remove duplication in JdbcIndexerFactory. (#5096)
* sandbox: Remove duplicate parameters in JdbcIndexerFactory.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox: `InitializedJdbcIndexerFactory` is just a ResourceOwner now.

* sandbox: Rename helper methods in `JdbcIndexerFactory`.

* sandbox: Make `JdbcIndexer#initialized` look like it does something.
2020-03-20 09:45:40 +00:00
Stefano Baghino
d966c17f0b
Refactor events (#5097)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-19 19:18:47 +01:00
Samir Talwar
82f2685e89
sandbox: Fix warnings by making test variables private. (#5086)
And move them to a companion object, just in case.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-19 14:12:06 +00:00
Stefano Baghino
499fd1b75a
Add method to look up flat transaction by id (#5080)
* Add method to look up flat transaction by id

CHANGELOG_BEGIN
CHANGELOG_END

* Limit visibility of helper
2020-03-19 10:01:09 +01:00
Oliver Seeliger
e50a33019c
StandaloneApiServer facility for lf-seeding opt-out (#5078)
Until all DAML-on-X implementations have a chance to implement
seeding support for daml-lf contract-ids.

Closes #5077

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-19 08:50:15 +00:00
nickchapman-da
d81caa9568
rework daml_compile bazel rule (#5070)
Avoiding `damlc compile/package` commands (which we would like to deprecate), and replace with plain `damlc build` together with a post dar->dalf extraction step in the couple of places where we actually want the .dalf for testing.

changelog_begin
changelog_end
2020-03-18 23:06:55 +00:00
Stefano Baghino
856ed80728
Add tests for completion reader in JdbcLedgerDaoSpec (#5072)
* Add tests for completion reader in JdbcLedgerDaoSpec

CHANGELOG_BEGIN
CHANGELOG_END

* Add test for completion, make offset checks more strict

* Fix badly typed check

* Comment reason for weird matcher use

* Address https://github.com/digital-asset/daml/pull/5072#discussion_r394447235

* Address https://github.com/digital-asset/daml/pull/5072#discussion_r394447981

* Address https://github.com/digital-asset/daml/pull/5072#discussion_r394448506

* Address https://github.com/digital-asset/daml/pull/5072#discussion_r394451069
2020-03-18 16:34:36 +00:00
Stefano Baghino
f93333a503
Run JdbcLedgerDaoSpec on both H2 and Postgres (#5065)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-18 13:50:38 +01:00
Moritz Kiefer
0471b26d70
Get openssl from msys2 (#5063)
* Get openssl from msys2

changelog_begin
changelog_end

* Try to fix opensl config location
2020-03-18 13:09:03 +01:00
Stefano Baghino
0cefe98945
Modularize JdbcLedgerDaoSpec (#5061)
* Modularize JdbcLedgerDaoSpec

Adding more tests, but breaking it up a bit to make sense of it beforehand.

CHANGELOG_BEGIN
CHANGELOG_END

* Remove unnecessary suppressed warnings
2020-03-18 10:41:31 +00:00
Samir Talwar
cbeeb5aafc
sandbox: Fail to start if a time mode is not explicitly specified. (#5033)
* sandbox: Fail to start if a time mode is not explicitly specified.

CHANGELOG_BEGIN
- [Sandbox] Sandbox is switching from Static Time mode to Wall Clock
  Time mode as the default. To ensure that our users know about this,
  for one version, there will be no default time mode. Instead, users
  will have to explicitly select their preferred time mode by means of
  the `--static-time` or `--wall-clock-time` switches. In the next
  release, Wall Clock Time will become the default, and users who are
  happy with the defaults will no longer need to specify the time mode.
CHANGELOG_END

* daml-script|triggers: Specify time mode when testing against Sandbox.

* daml-assistant: Default the Sandbox to wall clock time.

CHANGELOG_BEGIN
- [DAML Assistant] Initializing a new DAML project adds a switch to
  ``daml.yaml`` to ensure Sandbox can continue to start with ``daml
  start``::

      sandbox-options:
        - --wall-clock-time
CHANGELOG_END

* docs: Update the DAML Script and Triggers docs to use Wall Clock time.

It's now what Sandbox will use by default when using `daml init`.

* docs: Change the Quickstart to run Sandbox in wall clock time.

This explains why the contract IDs may vary.

It also updates the manual release testing script to match.
2020-03-18 08:25:03 +00:00
Gerolf Seitz
cf032a02cf
Introduce Stable Offsets (#4953)
A "stable offset" in the context of the Participant Server is the offset
that was provided by the ledger backend (be it kvutils, corda, daml on sql).

The Participant Server does not keep a participant-local offset anymore.
In a single domain/kvutil setup, this makes offsets stable across participants,
since all participants will see the same offset for the same transaction.

The following changes were needed to achieve this:
- The participant server always uses the offset provided by the backend
  AS IS (no more +1 magic).
- Offsets provided to the Ledger API in requests must be treated as
  startExclusive and endInclusive (previously beginInclusive and
  endExclusive).

CHANGELOG_BEGIN
[Ledger API]: Offsets have been redefined. Instead of being represented
by a number or a structured string, an offset is now an opaque string
that can be compared lexicographically.
[DAML Integration Kit]: The bounds for ``Dispatcher`` are now
startExclusive and endInclusive.
CHANGELOG_END

---------
ledger api:
ledger_offset.proto
  Changed definition of offsets, since they can now be compared
  lexicographically.

---------
participant-state-api:
Offset:
  Changed from Array[Long] to ByteString. Ledgers need to make sure that the
  offsets produced are strictly monotonically increasing according to
  lexicographical order.

---------
akka-streams:
Dispatcher, DispatcherImpl, SubSource:
  Changed interval handling to exclusive/inclusive.

---------
ledger-on-memory:
InMemoryLedgerReaderWriter, InMemoryState:
  Changed interval handling to exclusive/inclusive.

---------
ledger-on-sql:
CommonQueries, SqlLedgerReaderWriter:
  Change interval in query and boundary handling.

---------
kvutils:
KeyValueParticipantStateReader, KVOffset:
  Convenience functions for kvutils to add or remove sub-indexes for
  offsets.
  KV ledger implementations can use KVOffset to construct a structured offset.

---------
Participant Server:
JdbcLedgerDao:
  Use Offset instead of Long.
  Fetch offsets directly as Offset from the database with proper anorm
  integration.
  Change interval handling to exclusive/inclusive.

CommandCompletionsReader, CommandCompletionsTable:
  Change interval handling to exclusive/inclusive.

BaseLedger:
  Use Offset instead of Long.
  Change interval handling to exclusive/inclusive.

Conversions:
  Anorm integration for using Offset in queries and result parsers.

JdbcIndexer:
  Remove references to "extenalLedgerEnd" and participant-local Long
  offset (headRef).

---------
sandbox:
In general:
  Use the Offset type everywhere instead of Long.

SQL migrations:
  Change all offset columns to bytea or BINARY.

LedgerBackedIndexService:
  Proper bounds checking has been pushed down to Dispatcher, which
  allowed simplifying the acceptedTransactions implementation.

InMemoryLedger, LedgerEntries:
  Change interval handling to exclusive/inclusive.
  Transaction lookup by ID is now O(n) because transaction IDs are not
  necessarily the same as the offset.

SqlLedger:
  Remove external offset references.
2020-03-18 08:43:41 +01:00
Robert Autenrieth
a546269519
Improve ReadService docs (#5043)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-18 07:26:45 +01:00
Miklos
9aa61ec3da
Basic documentation for simplified ledger integration API (#5032)
* Switched to ByteString from Array[Byte] on almost all simplified API interfaces.

* Sort output by keys.

* Added comment.
CHANGELOG_BEGIN
CHANGELOG_END

* Removed DamlLogEntryId from LedgerEntry.

* Return a SortedMap ordering output state by its keys' hash in order to have deterministic ordering.

* Code tidying.

* Added implicit conversion for anorm for ByteStrings to make SQL queries cleaner.

* Ooops, missed adding a header.

* Avoid copying bytes by anorm by using ByteString.newInput()

* Added some Scaladoc to simplified API interfaces.

* Added docs to LedgerStateAccess.

* Reverted some changes.

* Added some docs to ValidatingCommitter.

* Corrected some typos.

* Added package-level documentation to kvutils.api.

* Clarified convenience classes for LedgerStateOperations.

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

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

* Minor rewording.

* Added missing header.

* Fixed problem with merge.

Co-authored-by: Gerolf Seitz <gerolf.seitz@digitalasset.com>
2020-03-17 17:02:27 +00:00
Miklos
c3068b2955
Allow reusing same ValidatingCommitter for multiple participants (#5041)
* Pass submitting participant ID as parameter to ValidatingCommitter.

* Made reference to processSubmission.
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-17 13:06:39 +00:00
Robert Autenrieth
29b4518cff
Add the invalid ledger time rejection reason (#5023)
* Add the invalid ledger time rejection reason

CHANGELOG_BEGIN
CHANGELOG_END

* Move definitions

* Improve wording
2020-03-17 14:06:20 +01:00
Stefano Baghino
54904e201f
Add missing migration for events to H2 (#5040)
Missing from #5029, raised the incorrect behavior of TransactionWriter.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-17 11:34:46 +00:00
Stefano Baghino
13f44ff3d9
Write transactions ready to be served by the Ledger API (#5029)
* Write transactions ready to be served by the Ledger API

CHANGELOG_BEGIN
CHANGELOG_END

* Address https://github.com/digital-asset/daml/pull/5029#discussion_r393192752

* Address https://github.com/digital-asset/daml/pull/5029#discussion_r393191059

* Address https://github.com/digital-asset/daml/pull/5029#discussion_r393201832

* Address https://github.com/digital-asset/daml/pull/5029#discussion_r393492987
2020-03-17 10:36:44 +01:00
Robert Autenrieth
970fa3dbdb
Remove monotonic record time assumption (#5026)
* Remove monotonic record time assumption

CHANGELOG_BEGIN
CHANGELOG_END

* Improve wording
2020-03-17 09:30:36 +01:00
fabiotudone-da
8d8d5dbb27
Add a --version cmdline option to test-tool. (#4996)
* Add a `--version` cmdline option to test-tool.

CHANGELOG_BEGIN
[TestTool] Add a --version command line option to test tool.
CHANGELOG_END

* 🐛 Fix compilation and runtime errors

* Add copyright header

* Fix formatting

* Rebase upon (merged) https://github.com/digital-asset/daml/pull/5004

* Remove unneeded `//:MVN_VERSION` resource

* Remove unneeded maven build config
2020-03-16 22:51:42 +01:00
Leonid Shlyapnikov
acb41c5829
Fetch by parties endpoint to use new getParties gRPC call (#5027)
* fetch by parties endpoint to use new getParties gRPC call

changelog_begin
changelog_end

* addressing code review comments, thanks @S11001001 and @SamirTalwar-DA

* Update ledger/ledger-api-client/src/main/scala/com/digitalasset/ledger/client/services/admin/PartyManagementClient.scala

thanks @S11001001

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

* addressing code review comments, thanks @S11001001 and @SamirTalwar-DA

* addressing code review comments, thanks @S11001001 and @SamirTalwar-DA

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2020-03-16 16:42:01 -04:00
Samir Talwar
b9acad2c6d
kvutils: Don't supply execution contexts to ResourceOwners. (#5010)
* kvutils: Remove the unnecessary execution context from the test base.

* kvutils: Remove the unnecessary execution context from the writer.

* ledger-on-sql: Make a proper owner so it has a proper execution context.

This means the parallelization now needs to come from the test, so I've
augmented ParticipantStateIntegrationSpecBase to take a proper execution
context instead of the serial one that ScalaTest provides, with a
default of `ExecutionContext.global`.

* ledger-on-memory: Make a proper owner with a proper execution context.

* kvutils/app: Remove `executionContext` from LedgerFactory.

Shouldn't need it in `ResourceOwner`. I was bad.

CHANGELOG_BEGIN
CHANGELOG_END

* ledger-on-memory: Make ResourceOwners real classes.

* ledger-on-sql: Make the ResourceOwner a real class.

* ledger-on-sql: Cause side effects on resource acquisition.

Not on owner construction.
2020-03-16 19:05:23 +00:00
Samir Talwar
ad3c3b326b
sandbox: Make sure we can get the details of an empty list of parties. (#5030)
This would fail only on PostgreSQL because `IN ()` is invalid. H2 seems
to be fine with it.

CHANGELOG_BEGIN
- [Ledger API Server] Support a call to `GetParties` with an empty list
  of parties.
CHANGELOG_END
2020-03-16 18:39:41 +00:00
Miklos
04a0723c81
Switch from Array[Byte] to ByteString on simplified ledger integration API (#4984)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-16 18:02:50 +01:00