Commit Graph

3526 Commits

Author SHA1 Message Date
Moritz Kiefer
42b4441159
Bump openssl (#5054)
* Bump openssl

The previous one has stopped working for some reason :sadpanda:

changelog_begin
changelog_end

* daml-assistant: Add `--wall-clock-time` to the Sandbox Next test.

Missed this due to doing two things at once.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-03-18 10:24:05 +01:00
Moritz Kiefer
bd6db5be68
Handle failures during trigger initialization synchronously (#5046)
Previously the http endpoint for starting a trigger would always
return immediately. Based on the recent refactorings, we now do the
non-IO trigger initialization synchronously and return a failed http
status code with an error message.

This also refactors the code to only have one (mutable) set of
compiled packages which is a prerequisite for dynamic package uploads.

changelog_begin
changelog_end
2020-03-18 10:23:41 +01:00
Samir Talwar
7510d0d404
daml-assistant: Add daml sandbox-next. (#5045)
* daml-assistant: Add `daml sandbox-next`.

CHANGELOG_BEGIN
- [DAML Assistant] You can now run a pre-release version of Sandbox with
  ``daml sandbox-next`` so you can test it out and verify everything is
  working as expected. Running this will launch Sandbox rebuilt on a
  more modern architecture. An upcoming release of DAML will switch over
  to the new implementation by default.
CHANGELOG_END

* daml-assistant: Explain that sandbox-next is experimental.

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* daml-assistant: Copy-pasta an integration test for `daml sandbox-next`.

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-03-18 08:25:08 +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
Nemanja
8505135ec2
Wording fixes in GSG (#5018)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-18 08:39:31 +01:00
Nemanja
40ef8b18c7
GSG Application architecture diagram (#5017)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-18 08:39:00 +01:00
Robert Autenrieth
a546269519
Improve ReadService docs (#5043)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-18 07:26:45 +01:00
Remy
eae3844ed9
Engine: Replace SResultMissingDefinition by SResultNeedPackage (#5039)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-17 19:25:57 +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
Shayne Fletcher
e71cba698e
daml2ts : Simplify docs, use mapped types for enums. (#5044)
* Simplify docs, use mapped types for enums.

changelog_begin
changelog_end

* remove serializale check

* add 'keys' property to enums

* Simplify docs just a little bit more
2020-03-17 16:27:46 +00:00
Moritz Kiefer
fb86152f8c
Move non-IO initialization out of trigger runner (#5042)
Previously parts of the initialization, in particular, the code for
finding the filter and the heartbeat were part of the Runner. This led
to an akward API and didn’t really make any sense.

Now all of this code is part of a pure `Trigger.fromIdentifier`
method and the runner only takes care of actually running the
ledger. This could also be useful for the trigger service where we
might want to synchronously call `getIdentifier` so users get some
indication if there request even points to a valid trigger
directly. However, this is not tackled by this PR.

changelog_begin
changelog_end
2020-03-17 15:26:58 +01: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
Moritz Kiefer
cc2ca20336
Make trigger runner specific to a given trigger (#5038)
Previously the runner class was in a weird state where it was specific
to a DAR but not to an individual trigger. This meant that you had to
pass around a fair bit of state which got a bit awkward. This PR
addresses this by making the trigger class specific to the trigger.

It also now accepts `CompiledPackages` instead of a DAR which should
make it easier in the trigger service to support dynamic package
uploads.

changelog_begin
changelog_end
2020-03-17 11:51:06 +01:00
Remy
6e535e6c42
DAM-LF minor fixes relative to GenMap (#5028)
Here we fix some minor issue relatives to GenMap.

In particular:
    * validity of keys are checked when GenMap is created.
    * interface test
    * outdated comments
2020-03-17 11:00:33 +01: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
Moritz Kiefer
3da5e4fae7
Give repl tests a long timeout (#5034)
Apparently adding the TLS and auth tests has made this necessary now.

changelog_begin
changelog_end
2020-03-16 20:43:30 +00: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
Remy
04196597a7
forbid non-generic comparison in 1.dev (#5020)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-16 17:25:43 +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
Remy
da79d89cc8
DAML-LF fix semantics of GenMap insert, lookup, and delete (#5024)
to follow the DAML-LF spec

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-16 16:39:14 +00:00
associahedron
80d96ce39f
Use new primitives in tagToEnum# conversion. (#5025)
changelog_begin
changelog_end
2020-03-16 16:27:12 +00:00
Moritz Kiefer
1956dd2f89
Update checked in DAR to one built with DAML-LF 1.8 (#5021)
1.dev is changing in ways wich break this as predicted by the comment,
so let’s freeze this now that we have a release that supports this.

changelog_begin
changelog_end
2020-03-16 16:54:19 +01:00
Robert Autenrieth
d90cd2c542
Output whether command execution depends on time (#5019)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-16 15:28:45 +00:00
Moritz Kiefer
9aa68cac4f
Fix detection of package ids for triggers (#5016)
Previously we assumed that the module name was globally unique in the
DAR which is definitely not guaranteed. Now we instead detect the
package id of the trigger library based on the type of the trigger we
are running which doesn’t fall apart if there are multiple versions of
the trigger library.

I’ve also removed the check for the package id of the trigger library
since I’d like the trigger runner to be backwarts compatible from now on (we
didn’t break that in a while).

This is slightly ugly since the Runner class is currently not specific
to a single trigger but only the individual methods are aware of the
specific trigger identifier. I’ll refactor this in a separate PR.

changelog_begin
changelog_end
2020-03-16 16:13:42 +01:00
Remy
ac8554eddd
Engine: drop old internal comparsion builtin (#4990)
* Engine: drop old internal comparison builtin

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-16 15:15:32 +01:00
Robin Krom
e537b496ee
Deprecate useExercise (#4972)
* language:daml-react: deprecate useExercise

We replace 'useExercise', 'useExerciseByKey' with 'useLedger' and expect
a user to call the ledger methods instead.

CHANGELOG_BEGIN
CHANGELOG_END

* addressing martin's comments
2020-03-16 14:55:59 +01:00
Robert Autenrieth
48b0b9519e
Remove expired deduplication entries (#4967)
* Periodically clear expired deduplication entries

CHANGELOG_BEGIN
CHANGELOG_END

Fixes #4959

* Increase cache maintenance frequency

The previous value was only good for testing purposes

* Actually remove deduplication entries

* Clear deduplication cache for IndexAndWriteService
2020-03-16 14:02:41 +01:00
associahedron
8911234ae3
Use new generic comparison primitives. (#5014)
This PR exposes the new generic comparison primitives, preferring them
to the older comparison primitives whenever they are available. It also
separates the generic comparison feature from the GenMap feature,
because that just makes sense.

changelog_begin
changelog_end
2020-03-16 12:10:03 +00:00
Remy
1c26f63fad
DAML-LF: GenMap Spec (#4981)
* DAML-LF: GenMap Spec

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-16 13:09:44 +01:00
dependabot[bot]
712767d0be
Bump acorn from 6.3.0 to 6.4.1 in /navigator/frontend (#5007)
Bumps [acorn](https://github.com/acornjs/acorn) from 6.3.0 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.3.0...6.4.1)

Signed-off-by: dependabot[bot] <support@github.com>

changelog_begin
changelog_end

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-03-16 12:31:47 +01:00
dependabot[bot]
45ccaf1826
Bump acorn from 6.1.1 to 6.4.1 (#5006)
Bumps [acorn](https://github.com/acornjs/acorn) from 6.1.1 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.1.1...6.4.1)

Signed-off-by: dependabot[bot] <support@github.com>

changelog_begin
changelog_end

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-03-16 12:26:08 +01:00
Moritz Kiefer
76c9ddfb59
Fix typo in docs for multiparty agreement (#5011)
changelog_begin
changelog_end
2020-03-16 12:08:05 +01:00
Gary Verhaegen
eb857d6dd3
skip fmt check for release (#5012)
The formatting check used to be git-repo-dependent (see #4985), which is
preventing our candidate 0.13.55 from building.

This PR introduces a temporary hack to disable format checking on
release PRs & commits. It should be reverted once 0.13.55 is released.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-16 12:05:26 +01:00
Samir Talwar
d9971f677f
sandbox: Avoid daemon threads in AbstractSandboxFixture. (#4940)
* sandbox: Avoid daemon threads in AbstractSandboxFixture.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox: In tests, shut down the Sandbox first, not last.
2020-03-16 10:41:19 +00:00
Moritz Kiefer
44d843f9ef
Support authentication and TLS in DAML repl (#4998)
* Support authentication and TLS in DAML repl

changelog_begin

- [DAML Repl - Experimental] You can now connect to a ledger via TLS
  by passing ``--tls`` to ``daml repl``

- [DAML Repl - Experimental] You can now connect to a ledger with
  authentication by passing the token via ``--access-token-file`` to
  ``daml repl``.

changelog_end

* try to fix linking on windows

* windows is weird

* gnah
2020-03-16 10:43:57 +01:00
Moritz Kiefer
39bb4eb1f7
Set sdk version in damlc package (#4999)
While `damlc package` should really just go away, the fix here is
simple enough that it makes sense to include it.

fixes #4994

changelog_begin
changelog_end
2020-03-16 10:15:06 +01:00
Stefano Baghino
1f0534ea4f
Spin-off BuildInfo into its own (micro-)library (#5004)
* Spin-off BuildInfo into its own (micro-)library

CHANGELOG_BEGIN
CHANGELOG_END

* Fix dependencies

* Remove unused dependency
2020-03-16 09:04:00 +01:00
Shayne Fletcher
8f4404b945
Avoid explicit test for package.json exists (#5005)
changelog_begin
changelog_end
2020-03-14 18:00:37 -04:00
Robin Krom
990be40168
docs: typedoc comments for daml-types (#5000)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-13 22:18:54 +01:00
Shayne Fletcher
17d85afbf6
The -p flag to daml2ts is mandatory; create package.json if not there (#5001)
changelog_begin
changelog_end
2020-03-13 17:15:53 -04:00
Robin Krom
b3f20dda8d
docs: Nicer typedocs for daml-ledger (#4993)
This polishes the generated docs for daml-ledger.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-13 22:04:10 +01:00
Remy
c76e0bc1e0
DAML-LF add support for generic comparison in archive (#4983)
* DAML-LF: add generic comparison to archive
2020-03-13 20:13:13 +01:00
Leonid Shlyapnikov
5c2ed56c8e
Allocate party JSON API endpoint (#4991)
* Allocate party JSON API endpoint

changelog_begin

[JSON API - Experimental]
Allocate party endpoint added: ``/v1/parties/allocate``. See #4638.

changelog_end

* cleanup

* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/LedgerClientJwt.scala

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

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2020-03-13 14:06:08 -04:00