Commit Graph

184 Commits

Author SHA1 Message Date
Remy
dcbf9947f4
[Triggers] make message batch size configurable (#15929) 2023-01-03 13:32:10 +00:00
Remy
a40938d71a
[Triggers] fix versioning (#15992)
- fix wrong comparison for create event
- add patch number in scala version names
- change 2.6 -> 2.5.1 in anticipantion of #15902 backport
2023-01-03 12:45:57 +00:00
Remy
c37d4a257b
[Trigger] Batch messages in case of backpressure (#15902)
Co-authored-by: Carl Pulley <carl.pulley@digitalasset.com>
Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
Co-authored-by: Carl Pulley <106966370+carlpulley-da@users.noreply.github.com>
2022-12-19 09:28:02 +01:00
Remy
f1aca5e11c
[Speedy] create Scenario Machine (#15588) 2022-12-16 08:20:42 +00:00
Nicu Reut
25f1254120
Move the metrics API to the observability module [PLEN-35] (#15831) 2022-12-12 09:35:55 +00:00
Carl Pulley
5d62deeda6
Reduce trigger INFO logging noise 2022-11-25 17:48:23 +00:00
Carl Pulley
898d8cbf88
Quick fixes to stablise trigger behaviour (#15700)
CHANGELOG_BEGIN
* [Triggers] Revert changes for in-flight rate limit controls
CHANGELOG_END
2022-11-25 14:00:44 +01:00
Carl Pulley
28fc3606ea
Trigger rule logging
* fixes #15489

CHANGELOG_BEGIN
CHANGELOG_END
2022-11-23 10:02:17 +00:00
Carl Pulley
4cc9ca00c2
Added in TriggerContext to carry logging contexts for trigger flows
CHANGELOG_BEGIN
CHANGELOG_END
2022-11-21 19:08:35 +00:00
Carl Pulley
7f973e4698
Logging of trigger in-flight command updates
CHANGELOG_BEGIN
CHANGELOG_END
2022-11-21 18:02:02 +00:00
Carl Pulley
7f425e3c5e
Basic infrastructure for using logging contexts
CHANGELOG_BEGIN
CHANGELOG_END
2022-11-21 16:14:49 +00:00
Carl Pulley
3627b62d00
Ensure high level triggers project their user state
CHANGELOG_BEGIN
CHANGELOG_END
2022-11-21 12:13:17 +00:00
Carl Pulley
8c704407c1
Fixes for trigger logback.xml config
CHANGELOG_BEGIN
CHANGELOG_END
2022-11-21 10:06:47 +00:00
Remy
7cac969756
[Speedy] Inline LedgerMode in the Machine (#15514) 2022-11-15 14:47:22 +00:00
Remy
10539aa9ad
[Triggers] strengthen compilation flags (#15512) 2022-11-14 17:33:50 +01:00
Carl Pulley
c43ee235d2
Provide log-encoder option for trigger-runner and trigger-service to enable json logging
CHANGELOG_BEGIN
* JSON encoder support for trigger controlled via CLI option --log-encoder

CHANGELOG_END
2022-11-09 16:46:45 +00:00
Carl Pulley
22f6148098
Common command line args for configuring logging
CHANGELOG_BEGIN
* Trigger CLI and service now support log level setting view -v, --debug and --log-level-root
CHANGELOG_END
2022-11-09 15:16:12 +00:00
Carl Pulley
6da1cd8a05
rate limit in-flight ledger command submissions for trigger runners
CHANGELOG_BEGIN
* triggers may now control (via configuration) the rate at which they submit commands to the ledger. Command submission may be rate limited (to control trigger burst behaviour) and ledger submissions will *only* occur if in-flight command submissions are below threshold values.

CHANGELOG_END
2022-11-09 14:38:31 +00:00
Remy
f240917e94
[Speedy] Drop second argument of SResultFinal (#15429) 2022-11-04 14:20:21 +01:00
Carl Pulley
1b4a812d37
Use a TrieMap to manage pendingCommandIds in trigger runners
* Fixes #15376

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-28 12:49:01 +01:00
Carl Pulley
c407c4b635
Versioned triggering and correct parsing of TransactionMsg
CHANGELOG_BEGIN
CHANGELOG_END
2022-10-26 15:08:37 +01:00
Remy
15dd81b524
[Trigger] update Created with interface (#15299)
CHANGELOG_BEGIN
CHANGELOG_END
2022-10-24 10:00:01 +02:00
Remy
4fa22e85c1
[Triggers] Version Trigger Daml code (#15298)
We track in `DA.Trigger.Internal` the version of the API between the Daml code and the scala code of the Triggers.

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-21 11:36:59 +02:00
Carl Pulley
3d53aae871
Enable interface registration for interfaces in triggers
CHANGELOG_BEGIN
CHANGELOG_END
2022-10-20 12:54:03 +01:00
Remy
b0d840019b
[Script] Do not use type constructor in AnyInterfaceChoice anymore (#15188)
companion PR of digital-asset/ghc#137

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-20 10:30:20 +00:00
Remy
3eca44b025
[Trigger] refactor Converter (#15247)
* [Trigger] refactor converter

This will ease versioning of trigger converter we will need to introduce interface support.

CHANGELOG_BEGIN
CHANGELOG_END

* Adress Carl's review
2022-10-17 14:42:13 +00:00
nickchapman-da
3180094987
[engine] avoid construction of unrestricted speedy expression applications (#15079)
Avoid construction of unrestricted speedy expression applications.SEApp (alias for SEAppGeneral)

- Replace occurrences of SEApp(General) to use SEAppAtomic, with SELet1 as required
- Add new helper SEApp for many cases where arguments are simple values.
- Rename the most general unrestricted constructor as SEAppGeneral_DEPRECATED. The only remaining use is by fromUpdateSExpr and fromScenarioSExpr, due to our unprincipled approach to stack-trace. See TODO in pushLocation. I hope to fix this in a future PR.
- Rename the slightly less unrestricted constructor as SEAppOnlyFunIsAtomic_DEPRECATED. The only call site being in Anf.scala (for the case when ANF is not performed). Maybe one day we can perform ANF in all cases, and hence remove this one remaining usage.
2022-09-26 14:33:51 +01:00
nickchapman-da
bbfcc55af7
[engine] Transmit completed transaction via SResultFinalValue. (#14416)
* Transmit completed transaction via SResultFinalValue.

changelog_begin
changelog_end

* remove spurious mods

* mark two commented-out tests with TODO 14431

* address small comments

* rename: SResultFinalValue --> SResultFinal
2022-07-18 09:45:37 +00:00
Remy
52ec65040f
[Engine] Rename values/arguments of type PackageInterface (#14305)
to avoid confusion with Daml interface.

CHANGELOG_BEGIN
CHANGELOG_END
2022-07-01 15:38:04 +02:00
Remy
7638e086ae
Script: infer the typeId of Choice in daml (#13971)
part of #13653

goes with digital-asset/ghc#122

CHANGELOG_BEGIN
CHANGELOG_END
2022-06-02 14:02:12 +00:00
Remy
f4338bdece
Trigger: return less confusing message when trigger is not found. (#13904)
* Trigger: return less confusing message when trigger is not found.

fixes #13893

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-18 09:31:16 +00:00
Nicu Reut
a792de39a5
Update scalafmt to 3.5.1. (#13584)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-28 09:57:04 +00:00
Remy
79af226966
LF: Add a convenient companion object for ArrayList (#13684)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-26 12:36:36 +02:00
Remy
e834a7b85c
Triggers: Connect Logging context from Triggers to the Speedy. (#13009)
Follow up of #12976.
fixes #12208

CHANGELOG_BEGIN
CHANGELOG_END
2022-02-22 18:28:49 +01:00
Remy
ac3d9a4647
LF: Add LoggingContext to Speedy Machine (#12976)
This advances the state of #12208

CHANGELOG_BEGIN
CHANGELOG_END
2022-02-21 13:34:46 +01:00
Brian Healey
e70237a673
upgrade scalapb/netty/grpc/protobuf in proven combination (#12628)
* upgrade scalapb/netty/grpc/protobuf in proven combination

CHANGELOG_BEGIN
Upgrade scalapb, netty, grpc, protobuf and guava versions
CHANGELOG_END

* bazel reformat

* match grpc version in deps.bzl

* upgrade akka

* keep grpc version to 1.43 that is used in latest nixpkgs-unstable

* rebase and regen

* update SHA for scalapb tarball

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2022-02-03 08:38:38 -05:00
Remy
5cdf9b95fb
Remove some unecessary implictly with Factory (#12559)
CHANGELOG_BEGIN
CHANGELOG_END
2022-01-26 13:28:26 +00:00
Stefano Baghino
f1cd4b1c7c
Remove dependencies on compatibility libraries (#12548)
Continues the work started in https://github.com/digital-asset/daml/pull/12543

These libraries were only needed to transition from Scala 2.12 to 2.13
and are no longer useful as all the necessary items are now available
in Scala 2.13.

changelog_begin
changelog_end
2022-01-24 18:04:07 +00:00
Stefano Baghino
aec3390904
Replace silencer plugin with built-in warning configuration (#12543)
Since Scala 2.13.2, Scala introduced built-in support to
manage warnings in a more granular fashion, thus making
the silencer plugin we are currently using no longer
strictly useful. Removing compiler plugins also removes
friction from migrating to Scala 3 in the future. As a
cherry on top, the built-in warning configuration also
allows to check whether a `@nowarn` actually does
anything, allowing us to proactively remove unused
warnings should the need arise.

[Here][1] is s a blog post by the Scala team about it.

Warnings have been either solved or preserved if useful,
trying to minimize the scope (keeping it at the single
expression scope if possible). In particular, all
remaining usages of the Scala Collection API compatibility
module have been removed.

Using the silencer plugin also apparently hid a few
remaining usages of compatibility libraries that were used
as part of the transition from Scala 2.12 to Scala 2.13
that are no longer needed. Removing those warnings
highlighted those.

changelog_begin
changelog_end

[1]: https://www.scala-lang.org/2021/01/12/configuring-and-suppressing-warnings.html
2022-01-24 15:01:35 +00:00
Moritz Kiefer
688f1e1e0b
Drop v0 contract ids (#12464)
* Drop v0 contract ids

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2022-01-20 15:28:27 +00:00
Stefano Baghino
4af48bbccc
Split channel configuration from LedgerClientConfiguration (#12433)
* Split channel configuration from LedgerClientConfiguration

Fixes #12391

The channel configuration now has to be provided separately from the
configuration specific to the ledger client. In this way we avoid
situations where the builder is provided with some configuration
that gets overridden.

changelog_begin
[Scala bindings] The channel configuration has been split from the
LedgerClientConfiguration class. Provide the gRPC channel specific
configuration separately or use a builder. The channel configuration
no longer overrides the builder.
changelog_end

* Fix compilation issues in //ledger-service/...
2022-01-18 10:03:33 +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
Moritz Kiefer
0c9683183c
Support user management in standalone trigger runner (#12190)
* Support user management in standalone trigger runner

This PR adds a `--ledger-user` option to the trigger runner which runs
the trigger as the primary party of the user and with all readAs
claims available to the user.

fixes #12025

changelog_begin

- [Daml Trigger] `daml trigger` now accepts a `--ledger-user` option
  which can be used instead of specifying the primary party and all
  other parties the user has claims to as ``-ledger-party` and
  ``-ledger-readas`.

changelog_end

* .

changelog_begin
changelog_end
2021-12-17 16:45:16 +00:00
Moritz Kiefer
8179c73763
Drop support for Daml-LF party literals from the Scala side (#11922)
* Drop support for Daml-LF party literals from the Scala side

This PR enforces that forbidPartyLiterals is always `true` and drops
the corresponding literals from the AST. Haskell side is in #11930

fixes #11581

changelog_begin
changelog_end

* Update daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/ComparisonSBuiltinTest.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

* Revert "Update daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/ComparisonSBuiltinTest.scala"

This reverts commit 55e542ce4e3a7fd15544ee703de3277ffc309b17.

Co-authored-by: Remy <remy.haemmerle@daml.com>
2021-12-01 10:37:42 +00:00
nicu-da
8f458d8d2a
[ledger-api] Include the completion offset in the command_service.proto responses [KVL-1171] (#11658)
CHANGELOG_BEGIN
[ledger-api] - Include the completion offset in the responses from the command_service.proto
CHANGELOG_END
2021-11-18 04:37:26 -08:00
nickchapman-da
2dd5289a35
different types for different speedy phases (#11605)
* Refactor speedy to distinuish SExpr types before/after ANF compilation phase

CHANGELOG_BEGIN
CHANGELOG_END

* remove commment/marker left in error

* make SExpr0 private to speedy

* reinstate (non-pp) print of original expression in AnfTest faiure

* avoid use of s./t. prefixes for expressions in SBuiltin; add 3 TODO markers

* inline "runtime" apply methods of SDefinitionRef into sole caller: SBCallInterface

* avoid use of t. prefix in SExpr0

* change s./t. prefix to source./target.

* add comment to summarize differences between SExpr0 and SExpr
2021-11-11 08:21:12 +00:00
Moritz Kiefer
07ad3e0d9a
Suport multi-party readAs in triggers (#11299)
* Suport multi-party readAs in triggers

fixes #7640

This does not yet include the trigger service. We’ll tackle that separately.

changelog_begin

- [Daml Triggers] Triggers now support readAs parties. They can be
  specified via `--ledger-readas a,b,c`. As part of this change
  ``testRule`` gained an extra argument to specify the `readAs`
  parties. If you previously used

  ```
  testRule trigger party acsBuilder commandsInFlight s
  ```

  you now need to use

  ```
  testRule trigger party [] acsBuilder commandsInFlight s
  ```

changelog_end

* Update triggers/tests/src/test/scala/com/digitalasset/daml/lf/engine/trigger/test/AbstractFuncTests.scala

Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>

Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
2021-10-20 18:17:15 +00:00
Moritz Kiefer
50ea92f7b3
Use ApiTypes.Party instead of String in the trigger runner (#11298)
changelog_begin
changelog_end
2021-10-20 10:06:20 +02:00
tudor-da
2fc7490df2
[Self-service error codes] Adapt error factories [DPP-656] (#11270)
* Moved ErrorCodesVersionSwitcher to //ledger/error

CHANGELOG_BEGIN
CHANGELOG_END

* Rename ErrorCodeLoggingContext to ContextualizedErrorLogger

* Refactored ErrorFactories
* All error factories use ContextualizedErrorLogger for being able to dispatch self-service error codes.
* The ContextualizedErrorLogger is passed down from the dispatching Ledger API services.
* ErrorFactoriesSpec asserts both legacy (V1) and self-service error codes (V2).

* Adapted ApiSubmissionService

* Addressed Marcin's review comments
2021-10-18 16:46:20 +02:00
Robin Krom
9835ccb1ef
trigger runner: added hidden dev-mode-unsafe flag (#11205)
This adds a hidden `dev-mode-unsafe` flag to the trigger runner to allow
running against a daml-lf 1.dev version dar.

CHANGELOG_BEGIN
CHANGELOG_END
2021-10-12 10:54:23 +00:00