Commit Graph

119 Commits

Author SHA1 Message Date
tudor-da
6da1cde1b3
Simplify IndexService hierarchy [DPP-932] (#13043)
* Squash LedgerBackedIndexService, SpannedIndexService and MeteredReadOnlyLedger
into ReadOnlyLedgerImpl

changelog_begin
changelog_end

* Rename ReadOnlyLedgerImpl to IndexServiceImpl

* Metrics cleanup
* Remove redundant metered layer stemming from MeteredReadOnlyLedger

* Simplified getLedgerId

* Addressed Marton's review comments
2022-03-01 14:30:30 +01:00
Simon Maxen
507494e768
Support for final metering reports [DPP-819] (#12973)
Metering reports may now be final

changelog_begin
Metering reports may now be final
changelog_end
2022-02-21 15:43:39 +00:00
pbatko-da
98d5bd5f53
[User management] Add submission-id to the logs for mutating user management calls [DPP-887] (#12955)
changelog_begin
changelog_end
2022-02-17 14:29:58 +01:00
pbatko-da
b3f8fad987
[User management] Better ListUsers tests and general way to clean up new users [DPP-831] [DPP-889] (#12790)
changelog_begin
changelog_end
2022-02-16 13:23:55 +01:00
nicu-da
55fef9cf6a
[ledger-api] - Rename max deduplication time to max deduplication duration [KVL-1311] (#12939)
changelog_begin
ledger-api - rename ledger configuration max_deduplication_time to max_deduplication_duration
changelog_end
2022-02-15 21:14:26 +01:00
Simon Maxen
cc4c06c640
Metering Aggregation [DPP-818] (#12723)
* Add support for aggregated transaction metering

changelog_begin
Support added for aggregated transaction metering
changelog_end

* Update with review comments
2022-02-14 11:36:23 +00:00
pbatko-da
099c827338
[User management] Add user based authorization support to bench-tool. (#12871)
Adds a new bench-tool CLI option: '--user-based-authorization-secret=<secret>' that enables user based authorization.

changelog_begin
changelog_end
2022-02-11 14:45:31 +01:00
Marton Nagy
f27977953d
Clean maximum ledger time interface (#12844)
* add Scala Doc, change name for communicating the purpose better
* change return type for not passing data in exceptions
* adapt usage

changelog_begin
changelog_end
2022-02-10 02:06:59 +00:00
Marton Nagy
cbff4b124a
LAPI code cleanup (pure refactoring) (#12768)
removing dead code

changelog_begin
changelog_end
2022-02-07 12:43:06 +00:00
pbatko-da
7137b46543
[User management] Use pagination for listing users [DPP-840] (#12610)
CHANGELOG_BEGIN
Ledger API Specification: UserManagementService.ListUsers is now using pagination
CHANGELOG_END
2022-02-03 20:32:50 +01:00
tudor-da
5390505627
Remove participant-side command deduplication [DPP-848] (#12677)
* Remove participant-side command deduplication

changelog_begin
changelog_end

* Addressed review comments
2022-02-01 20:50:25 +00:00
Simon Maxen
6cdda6fbf7
Metering report [DPP-817] (#12604)
With experimental support for non-aggregated metering reporting

changelog_begin
with experimental support for non-aggregated metering reporting
changelog_end
2022-02-01 10:38:04 +00:00
pbatko-da
4ec336dd6a
[User management] Enforce 1k user rights limit [DPP-833] (#12558)
CHANGELOG_BEGIN
Ledger API Specification: Maximum number of user rights per user is now limited to 1000 and is added to UserManagementFeature in VersionService. getLedgerApiVersion endpoint.
CHANGELOG_END
2022-01-27 22:12:34 +01:00
pbatko-da
4fe6e53b9d
[User management] Persistence with caching (#12344)
Adding
 - `PersistentUserManagementStore` and `CachedUserManagementStore`,
 - `UserManagementStorageBackendTemplate` and sql migrations,
 - CLI flags: `--user-management-max-cache-size` and `--user-management-cache-expiry`;
 And wiring `PersistentUserManagementStore` where before we had `InMemoryUserManagementStore`.
2022-01-18 15:59:22 +01:00
Simon Meier
6dd0eb774e
ledger api server: support auth0 usernames (#12308)
* ledger api: support Auth0 user names in user management

See the `IdString.UserId` and `IdString.ApplicationId` comments wrt the
character classes being introduced.

Many thanks to @cocreature for helping with deciding on the exact
restrictions of user-ids.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-10 12:58:43 +00:00
Gary Verhaegen
d2e2c21684
update copyright headers (#12240)
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.

I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 16:36:51 +00:00
Simon Meier
f223528bfb
Implement PoC of user management for Ledger API server (fix #12014) (#12063)
CHANGELOG_BEGIN
- [User Management]: add support for managing participant node users and authenticating
  requests as these users using standard JWT tokens.
CHANGELOG_END

Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com>
Co-authored-by: Adriaan Moors <90182053+adriaanm-da@users.noreply.github.com>
2021-12-13 17:58:30 +01:00
nicu-da
61334cff77
kvutils - Add Writer which can handle deduplication periods as offsets [KVL-1172] (#11900)
changelog_begin
changelog_end
2021-11-29 10:28:07 -08:00
Remy
58e69ade1a
LF: replace "dev" LF version by "1.dev" in bazel files (#11894)
the more consistent, as asked by Moritz in review of #11820

CHANGELOG_BEGIN
CHANGELOG_END
2021-11-26 12:23:17 +00:00
Robert Autenrieth
1309c2f819
DPP-587 Use Timestamp instead of Instant (#11183)
* Use Timestamp instead of Instant

Time has microsecond resolution in Daml

changelog_begin
changelog_end

* Revert accidental newline changes

* Remove unused conversion modes

* Apply review comments
2021-10-26 08:54:47 +02:00
Remy
a1d94e10ba
LF: Create special case class for VersionedContractInstance (#11127)
To replace usage of ContractInstance[VersionedValue]

CHANGELOG_BEGIN
CHANGELOG_END
2021-10-14 08:53:26 +02:00
Moritz Kiefer
8e22bb6b2d
Drop ContractId typeparameter from Value (#10827)
99% of our usecases use Value[ContractId] so this PR just fixes it.

The few other usescases are:

1. Value[Nothing] which we use for keys. This is technically more
precise but we benefit very little from it.
2. Value[String] mostly because in a few places we are lazy.

We don’t have any code which benefits from being polymorphic in the
contract id type.

changelog_begin
changelog_end
2021-09-16 08:46:57 +00:00
tudor-da
96ad9b5ab8
[Divulgence pruning] All divulgence events pruning [DPP-483] (#10634)
* All divulgence events pruning
* Add `pruneAllDivulgedContracts` to `IndexParticipantPruningService`
* Add `participant_pruned_all_contracts_up_to_inclusive` in `parameters` table
* `pruneEvents` prunes all divulgence events
* Adapt `ParticipantPruningIT` to check for divulgence with and without `pruna_all_divulged_contracts`
* Create multi-participant pruning test in ledger-on-memory

CHANGELOG_BEGIN
CHANGELOG_END

* CommonStorageBackend
* Enrich pruning descriptions
* Logging for command completions pruning
* Move divulgence pruning back to the beginning of pruning sequence

* Addressed review comments

* PRDivulgenceArchivalPruning adapted for privacy-aware ledgers

* Rebased to main

* Disable ParticipantPruningIT tests targeting append-only schema in mutable schema conformance tests in ledger-on-sql

* Adapted order of SQL migration queries

* Documentation of appendonlydao.JdbcLedgerDao.prune

* Apply suggestions from code review

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

Co-authored-by: Simon Meier <meiersi-da@users.noreply.github.com>
2021-08-26 08:45:01 +00:00
Samir Talwar
bd12170af2
participant-state: Remove the ParticipantId, PackageId, and Party aliases. [KVL-1002] (#10308)
* participant-state: Remove the `ParticipantId` alias.

This alias adds nothing. By using `Ref.ParticipantId` directly, many
packages can remove their dependency on the _participant-state_ package.

CHANGELOG_BEGIN
CHANGELOG_END

* participant-state: Remove the `PackageId` and `Party` aliases.

They don't add anything. Let's just use `Ref`.

* kvutils: Restore missing compat imports.
2021-07-19 12:31:25 +00:00
Samir Talwar
1ee53c0736
participant-state-index: Use Ref directly. (#10299)
This avoids the dependency on _participant-state_.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-15 17:21:03 +00:00
Samir Talwar
cb29f34d4b
ledger-offset: Move Offset to a new package. [KVL-1002] (#10296)
* ledger-offset: Move `Offset` to a new package.

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

* Avoid rewrapping offsets for no reason.

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

* participant-integration-api: Sort some imports.

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

I didn't add `ledger-offset`.

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-07-15 17:53:03 +02:00
Samir Talwar
a9a0b70b85
ledger-configuration: Extract the configuration from participant-state. [KVL-1002] (#10279)
* ledger-configuration: Extract configuration from participant-state.

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

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

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

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

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

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

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

* kvutils: Restore a missing compat import.

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

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

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

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-07-15 13:03:19 +00:00
Miklos
b1ca310866
ledger: Damlification of Scala files (#9667)
* Damlification of Scala files (primarily comments and strings).

* Corrected a typo.
CHANGELOG_BEGIN
CHANGELOG_END

* Fixed build.

* Fixed test case for acronyms.

* Reformatted.
2021-05-20 10:21:04 +00:00
Moritz Kiefer
22ce940954
Upgrade scalafmt and enable trailing commas (#8437)
This PR updates scalafmt and enables trailingCommas =
multiple. Unfortunately, scalafmt broke the version field which means
we cannot fully preserve the rest of the config. I’ve made some
attempts to stay reasonably close to the original config but couldn’t
find an exact equivalent in a lot of cases. I don’t feel strongly
about any of the settings so happy to change them to something else.

As announced, this will be merged on Saturday to avoid too many conflicts.

changelog_begin
changelog_end
2021-01-09 11:37:37 +01:00
Moritz Kiefer
424faa923a
Port damlc dependencies to Scala 2.13 (#8423)
* Port damlc dependencies to Scala 2.13

I got a bit fed up by the fact that going directory by directory
didn’t really work since there are two many interdependencies in
tests (e.g., client tests depend on sandbox, sandbox tests depend on
clients, engine tests depend on DARs which depend on damlc, …).

So before attempting to continue with the per-directory process, this
is a bruteforce approach to break a lot of those cycles by porting all
dependencies of damlc which includes client bindings (for DAML Script)
and Sandbox Classic (also for DAML Script).

If this is too annoying to review let me know and I’ll try to split it
up into a few chunks.

changelog_begin
changelog_end

* Update daml-lf/data/src/main/2.13/com/daml/lf/data/LawlessTraversals.scala

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

* fixup lawlesstraversal

changelog_begin
changelog_end

* less iterator more view

changelog_begin
changelog_end

* document safety of unsafeWrapArray

changelog_begin
changelog_end

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2021-01-08 07:22:38 +01:00
Gary Verhaegen
a925f0174c
update copyright notices for 2021 (#8257)
* update copyright notices for 2021

To be merged on 2021-01-01.

CHANGELOG_BEGIN
CHANGELOG_END

* patch-bazel-windows & da-ghc-lib
2021-01-01 19:49:51 +01:00
Kamil Bożek
5db4ca687b
Multi-party command submission [KVL-699] (#8152)
Changes:
- replaced submitter: Party with actAs: Set[Party] and readAs: Set[Party] in com.daml.ledger.api.domain.Commands
- adapted contract and key lookups for multi-party submissions

* Changed single Commands to accept multiple submitters

* Removed submitter field from Commands

* Replaced submitters with actAs and readAs in Commands

* Moved actAs and readAs to com.daml.ledger.api.Commands

* Contract lookup tests

* Key lookup tests

CHANGELOG_BEGIN
CHANGELOG_END

* Formatted code changes

* Remove unused method

* Formatting fixes

* Simplified logical condition for active contracts visibility

* Removed unused temporary method in Commands

* Unified contract key lookup query for different type of db types

* Simplified ContractReader class structure

* Improved dao unit tests

* Unit tests for lookups as a divulgee

* Reduced code duplication in unit tests

* Minor improvement

* Formatted code

* Fixed a ContractsReader's query

* Improved unit tests

* Explanation for engine's command authorizers and contract readers

* Minor fixes

* Adapted SpannedIndexService for the multi-party submission
2020-12-11 10:04:15 +01:00
Robert Autenrieth
35d52e956e
Prepare index database for multi-party submissions [KVL-700] (#8035)
* Support multiple submitters in LedgerEntry

CHANGELOG_BEGIN
CHANGELOG_END

* Adapt the database schema

* Fix party formatting

* Add some tests

* Change logic for when requesters see commands

* Disable test that can't work

* Handle empty sets in array intersection

* Don't query completions as an empty set

... this should never happen in practice

* Add test for filtering command IDs

* Enable multiple parties in command deduplication (#8092)

* Enable multiple parties in command deduplication

CHANGELOG_BEGIN
CHANGELOG_END

* Update ledger/participant-integration-api/src/main/scala/platform/store/dao/LedgerDao.scala

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

* Update ledger/participant-integration-api/src/main/scala/platform/store/dao/LedgerDao.scala

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

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

* Apply review suggestions

* Remove useless function

* Fix EventsTablePostgresql

* Apply review comments

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2020-12-04 21:47:52 +01:00
Samir Talwar
052f69cde9
ledger-api: Use proto_jars, and publish Protobuf sources separately from the Scala classes. [KVL-714] (#8091)
* ledger-api: Use `proto_jars`.

CHANGELOG_BEGIN
- [Ledger API] The Scala JARs containing the gRPC definitions no longer
  contain the *.proto files used to generate the ScalaPB-based classes.
CHANGELOG_END

* Create a source JAR for *.proto files in `proto_jars`.

* ledger-api: Publish the protobuf sources as "ledger-api-proto".

CHANGELOG_BEGIN
- [Ledger API] The *.proto files containing the gRPC definitions are now
  provided by a new Maven Central artifact, with the group "com.daml"
  and the artifact name "ledger-api-proto".
CHANGELOG_END

* release: We don't need the "main-jar" option.

* Bazel: Proto JARs will always have a Maven artifact suffix.

* Bazel: Simplify Protobuf source file TAR and JAR targets.

* Bazel: Extract out Protobuf functions.
2020-11-27 17:14:48 +00:00
Samir Talwar
9976b4cd50
Bazel: Factor out logic around Protobuf JARs. [KVL-714] (#8084)
* kvutils: Use ScalaPB to generate a Scala JAR for daml_kvutils.proto.

* Bazel: Delete the unused `da_java_binary` rule, and inline `_wrap_rule`.

* Bazel: Factor out Java/Scala protobuf class generation into a helper.

CHANGELOG_BEGIN
CHANGELOG_END

* daml-lf/archive: Use `proto_jars`.

* Bazel: Remove the visibility modifier from `proto_jars`.

It's too confusing. Just make everything public.

* daml-lf/archive: Push protobuf source tarballs into `proto_jars`.

* Bazel: Add comments to the various parts of `proto_jars`.

* daml-assistant: Do unpleasant things with `location` in Bazel.
2020-11-27 08:34:53 +00:00
Oliver Seeliger
83f11aa784
Participant pruning ledger api server support ported from Canton (#7988)
* Participant pruning ledger api server support ported from Canton

CHANGELOG_BEGIN
- [Ledger API]: The preview of `ParticipantPruningService` enables ledger participants to prune the "front" of ledger state at the participant including the ledger api server index.
CHANGELOG_END

* Review feedback from Stefano

* Add pruning tests plus missed command completions change

* Review feedback from Robert

* Improved test readability by having populate helper return offsets

* Review feedback

* Ledger api changes to pruning api and disable canton pruning test

- Change return result to PruneResponse
- Change type of PruneRequest.prune_up_to to string

* Review feedback: Use ApiOffsetSConverter for logged offsets
2020-11-23 15:28:04 +01:00
Samir Talwar
d0ffc2c8c5
participant-integration-api: Factor out similar behavior in the admin service implementations. (#7171)
* participant-integration-api: Factor out `pollUntilPersisted`.

CHANGELOG_BEGIN
CHANGELOG_END

* participant-integration-api: Flatten `flatMap`s in admin services.

* participant-integration-api: Use the `FutureConverters` implicits.

* participant-integration-api: Inline `waitForEntry` again.

* participant-integration-api: Commas are great.

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

* participant-integration-api: Pass the EC to `pollUntilPersisted`.

* participant-integration-api: Extract out more into SynchronousResponse.

* participant-state-index: Stream entries from an optional offset.

Makes them consistent with configuration entries.

* participant-integration-api: Move the ledger end into the strategy.

* participant-integration-api: Use SynchronousResponse everywhere.

* participant-integration-api: Pass inputs to SynchronousResponse#submit.

* participant-integration-api: Add docs to SynchronousResponse.

* participant-integration-api: Add a changelog entry.

CHANGELOG_BEGIN
- [Ledger API] The ConfigurationManagementService will now use the same
  description as other services in case of certain errors. The error
  status codes have not changed.
CHANGELOG_END

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2020-08-19 10:24:48 +00:00
Stefano Baghino
e972872128
Properly use LoggingContext in Participant Server (#6924)
* Properly use LoggingContext in Participant Server

Fixes #6837

Spreads usage of LoggingContext and ContextualizedLogger throughout the participant server.

changelog_begin
[Sandbox/Integration Kit] We have enriched the contextual information
exposed by the Ledger API server. You should note richer logging information,
which can be read either via unstructured or structured logging frameworks.
A paragraph on how to configure structured logging has been added to the docs.
For more on the issue, see https://github.com/digital-asset/daml/issues/6837.
changelog_end

* Make everything compile

* Leave only actual commands on trace level on submission

* Shorter log messages on submission

* Don't add values down the call stack

* Document good practices regarding the logging context

* Add context to write service implementations

* Add logging context to tests

* Document logging for DAML on SQL

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463503013

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463508117

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463515665

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463513157

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463516359

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463516895

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463518813

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463520210

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463521501

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463521593

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463525453

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463525560

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463525672

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463525742

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463526837

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463527054

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463527523

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463527814

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463527958

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463527900

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463527997

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463528050

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463542877

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463543051

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463543614

* Address https://github.com/digital-asset/daml/pull/6924#discussion_r463543692
2020-07-31 12:40:13 +00:00
Stephen Compall
4355406259
add more scalac 2.12 warnings (#6798)
* set many extra scalac -Xlint options for all Scala projects

CHANGELOG_BEGIN
CHANGELOG_END

* move NoCopy to its own file

package.scala:18: warning: it is not recommended to define classes/objects inside of package objects.
If possible, define trait NoCopy in package data instead.
  trait NoCopy {
        ^

* move more traits, classes, and objects to proper packages

- note that `package` is itself a scoping construct, so if your reason
  is the apparent aesthetic of placing a bunch of things in one `package
  object`, that is easily remedied by deleting the `object` keyword

* fix some type-parameter-shadow warnings

- I'm generally in favor of sensible name-shadowing, following the
  "deliberately hide variables that should not be accessed here" school
  of thought.  But I think type name shadowing isn't quite as valuable
  and more likely to confuse than general variable shadowing, so have
  experimentally linted it out.

  Example warning:

EventsTableFlatEventsRangeQueries.scala:11: warning: type parameter
 Offset defined in trait EventsTableFlatEventsRangeQueries shadows class
 Offset defined in package v1. You may want to rename your type
 parameter, or possibly remove it.
private[events] sealed trait EventsTableFlatEventsRangeQueries[Offset] {
                                                               ^

* fix more package-object-classes warnings

* fix an inaccessible warning

ContractsService.scala:197: warning: method searchDb in class ContractsService references private class ContractsFetch.
Classes which cannot access ContractsFetch may be unable to override searchDb.
  def searchDb(dao: dbbackend.ContractDao, fetch: ContractsFetch)(
      ^

* enable -Xlint:infer-any

- continuing the saga of #6116, #6132

* enable -explaintypes for more detailed type errors

* missed header for NoCopy; probably should have left it in the package file

* misspelling in comment

* revert -Xlint:doc-detached

- there are a lot of these fixes, and they are noisy, so shifting to a
  separate PR
- thanks to @leo-da for pointing out
2020-07-21 08:18:01 -04:00
Remy
a629959c09
LF: Move GlobalKey and GlobalKeyWithMaintainers outside Node (#6795)
CHANGELOG_BEGIN
CHANGELOG_END
2020-07-21 09:08:36 +02:00
Remy
9e456a1016
DAML-LF: Kill RelativeContractId (#5991)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-25 22:30:45 +02:00
Robert Autenrieth
7e448d810c
Always use the latest ledger config (#5669)
CHANGELOG_BEGIN
- [Sandbox] The ledger API server will now always use the most recent ledger configuration.
  Until a ledger configuration is read from the ledger, command submissions will fail with the UNAVAILABLE error.
CHANGELOG_END

In kvutils, the first ledger configuration change needs
to have a generation one higher than the one returned
by getLedgerInitialConditions().

Remove initial config writing from sandbox as it's now written by the ledger API server
2020-05-06 12:12:23 +02:00
Stefano Baghino
f81efb3d9d
Add new participant schema contracts table (#5541)
* Add new participant schema contracts table

- full implementation (both read and write path)
- fixes #5514

changelog_begin
[Ledger API Server] Fixed a bug that prevented validating transactions
containing reference to contracts that did not originate on the local
participant. See `issue #5514 <https://github.com/digital-asset/daml/issues/5514>`_.
changelog_end

* Format fixes and addressing comments

- address https://github.com/digital-asset/daml/pull/5541#discussion_r408806775
- address https://github.com/digital-asset/daml/pull/5541#discussion_r408806964
- address https://github.com/digital-asset/daml/pull/5541#discussion_r408812745

* Address https://github.com/digital-asset/daml/pull/5541#discussion_r408815185

* Address https://github.com/digital-asset/daml/pull/5541#discussion_r408813067

* Fix mistake in comment

* Apply suggestions from code review

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

* Fix compilation error

* Add data migration

Tested by https://github.com/stefanobaghino-da/test-5541-data-migration

* Address https://github.com/digital-asset/daml/pull/5541#discussion_r409386378

* Address https://github.com/digital-asset/daml/pull/5541#discussion_r409385174

* Address https://github.com/digital-asset/daml/pull/5541#discussion_r409367606

* Simplify migration

* Address review

- address https://github.com/digital-asset/daml/pull/5541#discussion_r410344423
- address https://github.com/digital-asset/daml/pull/5541#discussion_r410339914

* Update ledger/sandbox/src/main/resources/db/migration/postgres/V26_0__Contracts_new_schema.sql

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

* Fix migration for privacy-aware ledgers

* Remove leftover query

* Fix migration hashes

Co-authored-by: Gerolf Seitz <gerolf.seitz@daml.com>
2020-04-17 20:07:20 +00:00
Gerolf Seitz
a2d785e3ee
Use com.daml as root package (#5343)
Packages com.digitalasset.daml and com.daml have been unified under com.daml

Ledger API and DAML-LF DEV protos have also been moved from `com/digitalasset`
to `com/daml` on the file system.
Protos for already released DAML LF versions (1.6, 1.7, 1.8) stay in the
package `com.digitalasset`.

CHANGELOG_BEGIN
[SDK] All Java and Scala packages starting with
``com.digitalasset.daml`` and ``com.digitalasset`` are now consolidated
under ``com.daml``. Simply changing imports should be enough to
migrate your code.
CHANGELOG_END
2020-04-05 19:49:57 +02:00
Stefano Baghino
e2cab1c162
Integrate new active contracts reader in Ledger API (#5397)
changelog_begin
changelog_end
2020-04-03 08:17:42 +00:00
Robert Autenrieth
3945708192
Don't deduplicate failed submissions (#5333)
* Pass explicit submitter and command Id

* Stop deduplicating commands on submission failure

CHANGELOG_BEGIN
CHANGELOG_END

* Add test
2020-04-01 23:38:23 +00:00
Gerolf Seitz
329320bad9
Organize maven coordinates (#5272)
* Use com.daml as groupId for all artifacts

CHANGELOG_BEGIN
[SDK] Changed the groupId for Maven artifacts to ``com.daml``.
CHANGELOG_END

* Add 2 additional maven related checks to the release binary

1. Check that all maven upload artifacts use com.daml as the groupId
2. Check that all maven upload artifacts have a unique artifactId

* Address @cocreature's comments in https://github.com/digital-asset/daml/pull/5272#pullrequestreview-385026181
2020-04-01 11:41:18 +02:00
Robert Autenrieth
f8cd628c2f
Remove old time model from ledger config (#5216)
* Remove old time model from ledger config

CHANGELOG_BEGIN
- [Ledger API] Fields related to the old ledger time
  model have been removed from the configuration
  management service and the ledger configuration service.
CHANGELOG_END

* Update ledger/ledger-api-test-tool/src/main/scala/com/daml/ledger/api/testtool/tests/LedgerConfigurationService.scala

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

Co-authored-by: Gerolf Seitz <gerolf.seitz@digitalasset.com>
2020-03-30 08:46:22 +02:00
Gary Verhaegen
1872c668a5
replace DAML Authors with DA in copyright headers (#5228)
Change requested by Manoj.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 01:26:10 +01:00
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