Commit Graph

119 Commits

Author SHA1 Message Date
Gabor Aranyossy
333d720b1e Package and IdentityService wired through (#1278)
* using IdentityService

* package service wired through

* using ledger id from identityService

* extracting out ApiServer trait

* making ApiServer creation async

* using async tolerance when waiting on ApiServer creation
2019-05-21 14:28:50 +00:00
Gabor Aranyossy
5ede6f48ea index service decomposition (#1240)
* extracting some sub-interfaces

* dump

* dump

* things compile

* extracting more concerns

* comment change

* making configuration service return a stream

* adding documentation around the new interfaces
2019-05-20 12:08:56 +00:00
Robert Autenrieth
b4506ca370 Check contract visibility in SQL sandbox (#959)
* Store divulgence info for contracts

* Store divulgence info for contracts

* some documenting refactors

* Use fail instead of sys.error in test

* Add release note

* Rename migration files

* Fix typo

* Fix updating divulgence info in scenarios

The ACS was comparing differently formatted contract IDs.

Fixes #1166
2019-05-16 09:54:21 +02:00
Stephen Compall
c6a382db70 warn on use of 'return' Scala keyword; remove most usages (#956)
*  enable Return wartremover wart

* remove return keyword from various places in daml-lf

* remove return keyword from various places in ledger

* simpler ImmArray equals

* move traverseEitherStrictly to point of use

* remove return from ledger-api-server-example
2019-05-13 17:10:29 +00:00
Jussi Mäki
a23000446b
Check contract visibility in reference index service (#947)
* Use Sandbox's ActiveContracts in reference index service

This properly handles contract key updates and adds the required
checks for contract activeness and visibility.

Could consider moving the ActiveContracts.scala into another library,
but since we're soon starting the work to bring sandbox onto the
daml-on-x stack we might postpone that.

* reformat

* Exclude logback.xml from sandbox the library

This allows users of sandbox as a library to specify their
own logging configuration.
2019-05-08 14:36:28 +02:00
Remy
0489c6e0a5
Daml lf type safty (Party & PackageId) (#761)
* daml-lf: split SimpleString into Party and PackageId

* daml-lf remove parameter from DefinitionRef
2019-05-06 20:40:43 +02:00
Jussi Mäki
32a168a999
Index service refactoring (#928)
* Add configuration to LedgerInitialConditions

* Wait until index state is established in reference index service

This fixes a race condition where the daml-on-x server has been
brought up before the index service can serve it.

* Remove ledgerId checks from index service

Now that we have decided on non-changing ledger identifiers, remove
the ledgerId checks from index service and simplify the interface.

* Reformat and fix leftover ??? from DamlOnXTransactionService
2019-05-06 13:59:06 +02:00
Gabor Aranyossy
990a8ea5db
Dispatcher cleanup (#855)
* dispatcher cleanup

* doc improvements

* extracting SubSource from Dispatcher

* moving tests
2019-05-06 11:43:51 +02:00
Gerolf Seitz
ecf6ece8c4
CommandService returns useful data for successful submissions (#875)
Submitting a command via the CommandService now returns either the
transaction id (SubmitAndWaitForTransactionId), the flat transaction
(SubmitAndWaitForTransactionResponse), or the transaction tree
(SubmitAndWaitForTransactionTreeResponse).

This means that users don't have to wade through the transaction stream
to retrieve the resulting transaction. This is particularly useful in
combination with #479.

Fixes #406
2019-05-03 16:01:41 +02:00
Jussi Mäki
746c69255e
Move out classes from participant-state package object (#849)
Having the classes specified in the package object makes the
unusable from Java.
2019-05-02 17:16:27 +02:00
gleber
77edbba8d3 reference-server: Fix offset handling for empty resulting transaction streams. (#793)
* reference-server: Add invariant that observed offset is monotonic.

* reference-server: Fix offset handling for empty resulting transaction streams.

If the requested transaction stream (by range) returns empty, code - previously
- would reset 'currentOffset' to None, which was breaking invariants for the
next transaction stream request. Ensure that 'currentOffset' is maintained in
such scenario.
2019-04-30 14:50:17 +00:00
Jussi Mäki
105ed7aba6
DamlOnX participant-state key-value utilities (#637)
* Work in progress for the key-value participant-state utilities

* WIP on kvutils reference

* Try out "InMemoryKVParticipantState" in the reference server

* Work in progress on the rewrite based on code review

Main idea here is that there's functions to produce
submissions, and function to process a submission and
produce the log entries, and a function to convert
a log entry into 'Update'.

* WIP

* Add documented traits to clean up the key-value utility interfaces

* reorganize and address code review

* Add tests for in-memory kvutils example plus fix few missing bits

* Documentation, logging and heartbeats

* Move heartbeat source init out of actor preStart

* Add DamlOnXTimeService. Package inputs. Fix entryId references.

Semantic tests pass now.

* copyright headers & reformat

* Fix input computation, improve docs in daml_kvutils.proto

The DamlContractState input entries were missing for fetches
and non-consuming exercises.

* Disable SemanticTests.timeTravel

This test only works against Sandbox with a static time model,
not against arbitrary daml-on-x implementations. We can re-enable
it once a test service shim has been implemented.
2019-04-29 13:37:16 +02:00
mziolekda
cb56af6f79
validate invariants on the transaction streams in indexer (#561)
* validate invariants on the transaction streams, terminate them on violation

* provide unit tests for offset validators
2019-04-25 14:58:37 +02:00
Jussi Mäki
7c275b17fb DamlOnX refactoring: Drop StateInit, Long Offset (#519)
* daml-on-x: Drop StateInit and use AtomicReference

- Drop the StateInit update message and introduce "getLedgerInitialConditions".
- Switch to AtomicReference from SyncVar as this is non-blocking and hence safer to use from Akka.

* ledger/participant-state: Rename recordTimeEpoch to initialRecordTime

and use the time from timeProvider at the ledger object initialization
time as the initial record time.

* fmt

* Fix use of repo as external workspace. Fix compilation issue in IndexState.scala

* Refix the use of this repo as external bazel workspace

* Fix compilation after rebase

* refmt
2019-04-23 12:56:40 +00:00
Jussi Mäki
91449122f7
Add damlonx artifacts to the release (#627) 2019-04-23 14:00:55 +02:00
Remy
de69ed61db
Leger Api. Simplify Ledger Api domain (#577)
* drop domain.Identifier in favor of Ref.Identifier
* drop domain.Party in favor of Ref.Party
2019-04-17 17:03:23 +02:00
mziolekda
02dd917699
make reference index service stop repeating last event indefinitely + refactoring (#482)
* remove early returns

* make reference index service stop repeating last event indefinitely

* make all services follow more consistent design, no unnecessary inherits, no unnecessary methods

* scala format
2019-04-16 11:42:36 +02:00
gleber
aa70c7f64e
Enforce consistent formatting of BUILD files. (#412)
* Add buildifier targets.

The tool allows to check and format BUILD files in the repo.

To check if files are well formatted, run:

    bazel run //:buildifier

To fix badly-formatted files run:

    bazel run //:buildifier-fix

* Cleanup dade-copyright-headers formatting.

* Fix dade-copyright-headers on files with just the copyright.

* Run buildifier automatically on CI via 'fmt.sh'.

* Reformat all BUILD files with buildifier.

Excludes autogenerated Bazel files.
2019-04-12 13:10:16 +02:00
Jussi Mäki
b77cf2c56b
DamlOnX reference implementation (#348)
* Add participant-state and participant-state-index APIs and reference implementations

This adds the (still WIP) interfaces and the in-memory reference implementations
of participant-state and participant-state-index.

See issue #137.

* Pass ledgerId through to getLedgerEnd method

This is needed in the daml-on-x implementation of the
transaction service.

* Add api-server-damlonx and the reference server

This is the initial version of the ledger-api server built on top of
the participant state APIs.

While functionally complete (modulo test services), it has only yet
been tested with the semantic tester. The server and the participant
state APIs are still under active development.

See issue #137.

* Apply scalafmt and copyright headers to new damlonx code

* ledger/damlonx: Fix build errors after merge from master

* ledger/participant-state: separate out the reference impl

* ledger/participant-state-index: separate out reference impl

* ledger/damlonx: Refactoring

- Refactor participant-state into multiple modules
- Introduce structured offset and update id types (vector of ints)
- Properly parse ledger feature flags

* ledger: Disable failing semantic test. Decrease grouping duration.

* scalafmt, fix after merge

* Add missing copyright headers

* ledger/damlonx: Add Simon's comments

* ledger/damlonx: Remove UpdateId, use Offset in both state and state-index.

* ledger/damlonx: scalafmt

* damlonxserver: review participant-state interface

Includes adding issue links for postponed fixes.

* daml-on-x-server: review reference implementation

Fixme's added to https://github.com/digital-asset/daml/pull/348 and
extra issues creaed in https://github.com/digital-asset/daml/milestone/4

* ledger/damlonx: Use SimpleString

* ledgre/damlonx: Backtrack on SimpleString change

See issue #398

* daml-on-x-server: drop unused 'index.impl.reference.package.scala'

* daml-on-x-server: add note on potential transient contracts bug

* ledger/participant-state*: post-merge fixes
2019-04-11 18:05:08 +02:00