Commit Graph

11 Commits

Author SHA1 Message Date
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
Jussi Mäki
2328914ba4 Update participant-state-kvutils based on feedback (#780)
- Make `getLedgerInitialConditions` a `Source` to mirror `stateUpdates`.
  This makes it easier to implement in Java.

- Expose transaction submission outputs with `KeyValueSubmission.transactionOutputs`
  for ledger implementations that require knowledge of outputs up-front.

- Fix typo in unpackDamLLogEntry.
2019-04-30 09:14:20 +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
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
Simon Meier
d522effecb
daml-on-x-server: document all participant state interfaces (#432)
* daml-on-x-server: document all participant state interfaces
2019-04-12 17:43:45 +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