Commit Graph

66 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
a0a7a81cde
Add participant state v1 participantId and TransactionId vals (#2821)
for easier code reuse
2019-09-09 16:21:16 +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
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
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
Jussi Mäki
aaeb58b44f
kvutils: Add authorization checks (#2622) 2019-08-22 13:01:18 +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
Gary Verhaegen
99ea93168d
update copyright notices (#2499) 2019-08-13 17:23:03 +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
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
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
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
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
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
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
Remy
c412d4e3d2 Add pretty C# namespaces in archive and leger-api protos (#1911)
* add nice C# namespace for in leger-api proto

fixes #1901

* add pretty C# namespace for archive protos

fix #1900
2019-06-27 11:39:33 +00:00
Robert Autenrieth
77d916288a
Update participant state v2 interfaces (#1800)
Moves party allocation to its own WriteService trait (similar to package upload).

Changes uploadDar to uploadPackages, so that the write service does not depend on the DAR file format.

Adds or improves many comments.
2019-06-27 11:44:15 +02:00
Jussi Mäki
c23af0eaa0
Introduce contract key to exercise node (#1783)
* Introduce contract key to exercise node

Track the contract key in NodeExercises. This is in
preparation for adding the key into exercise events, and
for support for contract keys in kvutils, where we need
to be able to compute the outputs of the submission, e.g.
the contract key that would be unset by a consuming exercise.

This introduces transaction version 8.

* Move release note on contract keys in exercises to unreleased.rst

* Address Stephen's review

- Drop changelog entry for this change as it is not user facing
- Add info on version 8 to transaction.rst. Fix typo in version 7.
- Reorder VersionTimeline as per review
- Only compare the NodeExercise 'key' if it is set in the original
  transaction (in order to compare transactions in a backwards
  compatible manner)

* Unbork unreleased.rst
2019-06-27 09:57:40 +02:00
Robert Autenrieth
439830b5bc
Update participant state v2 interfaces (#1767)
... with recent changes done to v1
2019-06-20 13:03:46 +02:00
Gerolf Seitz
0ab4199bc6
Preparations for Index + Indexer (#1766)
* Add missing domain.RejectionReason cases
* Use java.time.Instant instead of damlf Timestamp
* Make applicationId, submitterParty, commandId optional in LedgerEntry.Transaction
2019-06-19 16:28:28 +02:00
Robert Autenrieth
c14b909c71 Implement package management API in the sandbox (#1610)
* store archive size in `DarReader`

* rename `SandboxTemplateStore` to `SandboxPackageStore`

* store package info in `SandboxPackageStore`

* introduce package upload / read to write / index services

not tested yet, just a ton of plumbing

* WIP test the package service

* Fix build errors after rebase

* Move packages service to v2

* Ledger API client uses ledger API types

* Fix ReflectionIT

* Correctly handle uploading invalid dar files

* Fix reading DAR entry file sizes

* Improve package management IT

* Improve handling of duplicate packages

* Fix language-support build

* Use unique party and command names

* Rename lfpackage to language

* Rename SandboxPackageStore to InMemoryPackageStore

* Remove getCurrentTime ledger method

* Improve package management IT

* Move InMemoryActiveContracts and InMemoryPackageStore

* Use case object for UploadDarResult.Ok

* Address review comments

* Update release notes

Fixes #1311

* Use BazelRunfiles in test
2019-06-19 12:31:53 +00:00
Remy
0591075187 cleanup daml-lf scala packages (#1581)
* cleanup daml-lf scala packages

* Address Stephen's Comments

* update maven coordinates of language package
2019-06-12 15:55:48 +00:00
mziolekda
319e042860 create separate bazel targets for participant-state-v2 (#1562) 2019-06-11 08:00:02 +00:00
Gabor Aranyossy
e80e2f55c4 removed dependency on SandboxConfig from ApiServices (#1555)
* removed dependency on SandboxConfig from ApiServices

* using v2 state API applying some backporting where necessary

* cleanup
2019-06-07 12:06:40 +00:00
mziolekda
4389cbc83e Provide initial implementation of package management in the KVUtils (#1498)
* Provide initial implementation of package management in the KVUtils

* rename updateArchives to updatePublicPackages and add them to the abstract interface

* remove participant-state:reference app from published artifacts

* adopt the changes to the recent version split
2019-06-07 07:03:02 +00:00
mziolekda
7efceffb60 introduce participant-state interface v2 (#1541)
* introduce participant-state interface v2 to allow spliting daml-on-x workstream from sandbox

* correct code comments documenting the v2 participant-state package
2019-06-06 20:43:12 +00:00
Gabor Aranyossy
9cb6baacdf removing ledger backend module (#1524)
* removed ledger backend module

* removed artifact publishing

* some formatting

* updated comment

* changing names

* Update ledger/participant-state/src/main/scala/com/daml/ledger/participant/state/v1/SubmitterInfo.scala

Co-Authored-By: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2019-06-05 11:01:52 +00:00
Robert Autenrieth
f30b6404cd
Add party management to participant state (#1510) 2019-06-04 15:19:25 +02:00
Remy
294abecf5d daml-lf remove LedgerIdString (#1376) 2019-05-24 12:08:28 +00:00
Remy
4f18b1afa7 DAML-LF internal type safety (#1192)
* Rename Value's ContractId to VContractId

* daml-lf: a bit more about PartyId

* daml-lf: Concatenable MatchingStringModule

* daml-lf make clear type used for Scenarios only

* daml-lf create ContractId, LedgerId, TransactionId

* sandbox-sql conversion util

* LedgerName -> LedgerString

* futher type cleanup in the sandbox

* daml-lf add test for LedgerString

* fixing tests

* a bit more safety in the DB

* Address Stephen's comments

* fix rebase

* More fixes for StringModule

* change length of LedgerString (256 -> 255)
2019-05-24 09:53:29 +00:00
Jussi Mäki
31cf7d75a1
Add foldWithPathState and computePerPartyProjectionRoots (#1249)
The foldWithPathState is a fold over the transaction that allows
keeping extra state along the path of the traversal.

We add computePerPartyProjectionRoots in preparation for the
work on privacy-aware kvutils, where transaction nodes are stored
separately rather than in one blob. This function allows us to compute
the projected transaction roots for each party mentioned in the
transaction. We require this information to establish the order
of the root nodes when the size and form of the transaction is
blinded by assigning random node ids.
2019-05-21 18:02:39 +02:00
Gabor Aranyossy
f48b7c764e introducing WriteService in Sandbox (#1193)
* introdocing WriteService in Sandbox

* changing submit to return java CompletableStage

* introduced TimeModelChecker interface

* removing whitespaces

* doc updates

* dependency order fix
2019-05-17 08:59:19 +00:00
Jussi Mäki
44c67547f5 Add tracking of disclosure to contract state (#1059)
* Add tracking of disclosure to contract state

And clean up some of the error handling in processSubmission.

* Do not add, but rather union the divulged parties
2019-05-16 21:43:14 +00:00
Jussi Mäki
0dc49ea811
Fixes to kvutils when used as external workspace (#984)
* Export daml_kvutils_java_proto and add (un)packDamlLogEntryId

Export needed when using kvutils via bazel from another workspace.

* Use 'String' for participant state's LedgerId

Ref.PackageId is the wrong thing, and likely MatchingStringModule
isn't very usable from Java.
2019-05-07 17:55:11 +02:00