Commit Graph

134 Commits

Author SHA1 Message Date
pbatko-da
6dcdaa411c
[DPP-589] Add CLI flag to select minimum enabled TLS version (#10854)
- Add support for specifying either 1.2 or 1.3 as minimum TLS versions for ledger api server.
- Log enabled protocols (~TLS versions) and cipher suites at server and client startup.
- Add integration tests against Sandbox-classic and Sandbox

CHANGELOG_BEGIN
Sandbox: Add CLI flag to select minimum enabled TLS version for ledger API server.
CHANGELOG_END
2021-09-14 12:37:38 +02:00
Hubert Slojewski
b50bb8e437
Populate definite_answer in ApiException [KVL-1004] (#10832)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-13 16:28:39 +00:00
Remy
1e1c452b36
LF: drop ad-hoc FrontStack builders (#10839)
Following #10763, we drop the ad-hoc builders for `FrontStack`.

* Building a `Fronstack` from individuals elements should be done with
  standard scala buidler.

* Building a `Fronstack` from a `TraversableOne` should be done with
  the scala 2.13 `.to(FrontStack)` methd

* Building a `Fronstack` from a `ImmArray` should be done with the
  `toImmArray` method.

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-13 17:49:09 +02:00
Remy
97bda3ca36
LF: V1 Contract ID check in Preprocessor (#10687)
This PR makes possible to reject V0 contract IDs during preprocessing.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-30 20:14:55 +02:00
nickchapman-da
387c68b9eb
Normalize transaction values within the engine (#10648)
Create normalized TXs when a partial TX is finalised.

Except in limited cases! (i.e for scenario-runner, sandbox)

CHANGELOG_BEGIN
CHANGELOG_END

normalize values in the engine as they are converted from speedy-values

fix 2.12 build

backout redundant change

ensure byKey field is correctly normalized when constructed by engine

rename flag: valueNormalization -> transactionNormalization

improve comment

delete commented-out code

rename: toValueNorm --> toNormalizedValue

rename: (SValue.) toValue --> toUnNormalizedValue

revert changes to ptx so that the interface to insertCreate() etc is Value-based (not SValue-based)

improve comments

respell: toUnNormalizedValue --> toUnnormalizedValue

fix build
2021-08-25 09:53:26 +01:00
Remy
b22de6893b
LF: Contract ID suffix check in Preprocessor (#10642)
This PR makes possible to check for contract IDs suffix during
preprocessing.

This is the first part of the task 3 described in #10504.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-24 18:45:33 +02:00
Remy
a8f190214c
LF: change type from Try to Either in archive module (#10277)
* LF: change type from Try to Either in archive module

This is the first part of restructuring errors in archive module.
This is part of #9974.

CHANGELOG_BEGIN
CHANGELOG_END

* Apply suggestions from code review

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

* remove type alias

* apply stephen suggestion

* fix after rebase

* fix test

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2021-07-14 19:24:31 +00:00
Remy
caf85a2270
LF: rationalize archive Parser/Reader/Decoder (#10239)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-14 11:05:17 +02:00
Sofia Faro
b8e2198873
Separate traces from warnings in engine. (#10253)
* Separate traces from warnings in engine.

I decided to separate the engine warnings from the tracelog after all,
because I think it will make testing and maintenance easier in the
long run.

Part of #9947, follow up from #10179

changelog_begin
changelog_end

* scalafmt

* Apply suggestions from code review

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

* dont use case class for WarningLog

* revert TraceLog changes from last PR

* Scala 2.12 doesnt have ArrayBuffer.addOne :(

* remove isWarnEnabled check

Co-authored-by: Remy <remy.haemmerle@daml.com>
2021-07-13 14:24:27 +00:00
Remy
f19f5b0821
LF: Simplify DarReader (#10217)
This PR simplifies a bit DarReader and UniversalDarReader

This is a follow up of #10208.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-08 17:03:45 +02:00
Remy
41b8448b17
LF: Simplify archive reader. (#10208)
* LF: Simplify archive reader.

- decouple Reader and Decoder
- introduce case class to handle hash, proto payload, and version

CHANGELOG_BEGIN
CHANGELOG_END

* Address Moritz' review

* cosmetic
2021-07-07 19:56:40 +00:00
Samir Talwar
c929a14486
logging-entries: Split from contextualized-logging. [KVL-996] (#10149)
* logging-entries: Split from contextualized-logging.

This allows us to introduce it to Daml-LF without bringing in the
Logback, Logstash, and gRPC dependencies.

CHANGELOG_BEGIN
CHANGELOG_END

* logging-entries: Fix dependencies for 2.12.

* logging-entries: Missed one more Scala 2.12 dependency.

* release: Publish logging-entries.
2021-06-30 12:08:33 +00:00
Samir Talwar
c764fbe573
contextualized-logging: Introduce different logging types for more structure. [KVL-996] (#10134)
* contextualized-logging: Automatically convert logging values to strings.

For now, this has almost the same behavior, but it allows us to
customize the output in the future.

The main change is that the log format has gone from:

    context: {a=b, x=1, foo=bar}

to:

    context: {a: "b", x: "1", foo: "bar"}

* contextualized-logging: Move `writeTo` inside `LoggingValue`.

* contextualized-logging: Allow for more than just strings.

`null`, numbers, and sequences are now correctly logged.

The log format has gone from:

    context: {a: "b", x: "1", foo: "bar", parties: "[alice, bob]"}

to:

    context: {a: "b", x: 1, foo: "bar", parties: ["alice", "bob"]}

CHANGELOG_BEGIN
- The log output of Daml components has changed so that the structured
  part is closer to JSON. This allows us to distinguish and parse
  numbers and lists. If you are parsing this log output, you may need to
  change your parser.

  The log output has changed from:

  .. code-block::

     context: {a=b, x=1, foo=bar, parties=[alice, bob]}

  to:

  .. code-block::

     context: {a: "b", x: 1, foo: "bar", parties: ["alice", "bob"]}

CHANGELOG_END

* contextualized-logging: Extract the string serializer.

* Use non-string logging where possible.

* contextualized-logging: Split logging values from serialization.

So that callers don't have to know about Jackson.

* contextualized-logging: `SeqView` is `Iterable`. Don't need both.

* contextualized-logging: Make `ToStringToLoggingValue` a `val`.

Co-Authored-By: Stephen Compall <stephen.compall@daml.com>

* contextualized-logging: Add a transient dependency for 2.12 only.

This required more infrastructure than I thought it would.

* kvutils: Make it explicit that we're logging the hashes of archives.

The implicit was found to be a little confusing.

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2021-06-29 09:16:26 +00:00
Samir Talwar
af9382ce92
contextualized-logging: Reduce the API surface and avoid name collisions. (#10102)
* contextualized-logging: Remove `Map` from the `LoggingContextOf` API.

* contextualized-logging: Encapsulate entries.

CHANGELOG_BEGIN
CHANGELOG_END

* contextualized-logging: Disambiguate `withEnrichedLoggingContext`.

So forthcoming implicit conversions won't confuse the compiler.

* contextualized-logging: Remove a now-unused compat import.

* contextualized-logging: Avoid overloading `LoggingEntries#apply`.

* contextualized-logging: Remove the silencer plugin.
2021-06-24 16:21:26 +00:00
Stephen Compall
401069ef00
prepare for upgrade to Scalaz 7.3.3 (#9997)
* upgrade scalacheck to 1.14.3

* regenerate maven_install files

* some different names and implicits

* remove some fromTryCatchNonFatal

* more porting

* port fromTryCatchNonFatal to attempt

* factor the assertions in SignatureSpec to avoid \/

* deal with invariant \/

* make partial unification do what we want

* \/, parse*, and toNel

* many uses of the .right method

* a legitimate use of fromTryCatchThrowable

* rebuild maven pins

* further invariant \/

* OneAnd and Nel interface changes

* further Either games

* \/ and reformatting

* \/ in http-json

* \/ in http-json

* deprecations

* more invariance

* cleanup unused

* more invariance; http-json compiles

* final either follies

* small 2.12 extra incompatibility

* rebuild deps

* revisit a couple earlier fixes using nicer expressions I learned later

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* repin 2.12
2021-06-15 14:41:48 -04:00
Remy
7bc925e4d2
LF: Factorize the logic for AST lookup (#9871)
Factorize the logic for AST lookup in
 - compiler 
 - type checker 
 - preprocessor
 - script triggers 
 - some tests

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-03 13:32:56 +02:00
Victor Peter Rouven Müller
beb2d138f2
Add cli option & system property to enable json only logging for http json service (#9725)
changelog_begin
- [Ledger HTTP Json Service] Logging output can now be in JSON either via providing the cli option `--log-encoder json` or via setting the env var `LOG_FORMAT_JSON=true`
changelog_end
2021-05-20 13:28:34 +00:00
Miklos
cd9933328a
runtime: Damlification of Scala files (#9668)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-17 10:28:50 +02:00
Moritz Kiefer
40e1a39f2c
Port //triggers/... to Scala 2.13 (#8781)
changelog_begin
changelog_end
2021-02-09 13:35:05 +01:00
Remy
de14275528
triggers: do not use the type information from SRecord (#8623)
This type information is there for debugging purpose, one should not
use it.  We use type from SAny instead.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-26 12:08:53 +01: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
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
Andreas Herrmann
8bceeb13de
Handle token expiry in trigger service (#8037)
* Enable adjustable clock in trigger service tests

changelog_begin
changelog_end

* Test user side token expiry

* Test service side token refresh

* Use AccessToken wrapper in TriggerRunnerImpl

* Store refresh token in trigger DB

* add refresh token to trigger runner config

* TriggerTokenExpired message to server

* TriggerTokenRefresh message to server

* refresh trigger token and update db

* Restart trigger with fresh token

* Test second token expiry

* Refresh token on running trigger

changelog_begin
* [Triggers] UNAUTHENTICATED errors will now terminate the trigger.
  These errors are no longer available for handling in the trigger DAML
  code. Instead, they are forwarded to the trigger service for handling,
  e.g. access token refresh.
changelog_end

* todo note

* Move triggerRunnerName and getRunner into object

* Factor out token refresh

* Factor out getActiveContracts

* factor out create command

* Add logging to token refresh

* Handle token expiry in TriggerRunner

TriggerRunnerImpl throws a dedicated exception when it fails on an
expired access token (any unauthenticated error to be precise).
The TriggerRunner supervisor reacts to this child failure by
requesting a token refresh and restart on the trigger server and
stopping itself.
The trigger server requests a new access and refresh token on the auth
middleware and restarts the trigger.

This works around an issue with actor supervisors in akka-actor-typed.
A stop supervisor wrapped within a restart supervisor will not cause a
stop as expected. Instead, the restart supervisor will trigger as well
and restart the actor. The work around uses a custom behavior
interceptor to emulate the appropriate stop supervisors as closely as
possible. We cannot properly emulate ChildFailed signals this way, so
we use dedicated messages intead.

* throw --> Future.failedo

* getOrFail helper

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-12-02 16:17:45 +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
Stephen Compall
b35c9fcb3d
slow down trigger on RESOURCE_EXHAUSTED failures (#7820)
* restate the submit stage as a Flow and derived Sink

* take submit out of the trigger-to-submit flow

* type for the failures produced directly by command submission

* directly connect the msgSource failure queue to the submitter output

* parens

* slow down submission as we exceed max parallel submissions

* restricting alterF so it will be usable with ConcurrentMap

* disable buffer for the delay

* split out the delay function

* drafting a retry loop

* degenerate test for retry loop, factoring the forAllFuture utility

* map input to retrying properly

* make retrying accessible to tests

* test happy path and fix off-by-one

* further tests for retrying

* reveal that elements can get lost

* more determinism in test

* let failures block further elements from being attempted

- Previously failures would go into a separate queue, where they awaited expiry
  of their delay and further initial upstream elements were given their first
  tries.  However, closing the upstream could mean that queue was dropped, and
  detecting that situation is not trivial.  So, instead, we don't use a separate
  queue.

* plug retrying into the trigger submission flow

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* remove throttle; pendingCommandIds may leak

* report random parameter on failure

* revert comment about throttling

* explanation for fail in the error queue

- suggested by @cocreature; thanks
2020-11-10 21:36:48 +00:00
Moritz Kiefer
05b4f95967
Avoid verbose mode in DAML Script and DAML triggers (#7870)
We only expose the DAML values to users which don’t depend on this, so
we might as well avoid the unnecessary costs associated with verbose
mode especially since those are expected to increase in the
foreseeable future.

changelog_begin
changelog_end
2020-11-03 18:37:13 +01:00
Stephen Compall
6e26d8c408
properly stream commands from initialState trigger actions (#7812)
* graph component for running UnfoldStates

* proper doc for flatMapConcatNode

* nicer internal signatures

* refactor TriggerMsg encoder

* restate trigger sink in the graph DSL

* UnfoldState functions that might be useful

* express trigger sink with graphed initial state

* fix doc comment

* add SourceShape2, a SourceShape with two outlets

* add toSource for UnfoldState

* test for iterator

* do not submit for initialState out-of-band; feed into the graph instead

* factor the forAll Future pattern for testing

* test flatMapConcatNode directly

* add changelog

CHANGELOG_BEGIN
- [Triggers] Each trigger will submit up to 8 commands at a time, rather than
  submitting as fast as possible.  This applies to submissions in progress,
  rather than completed but pending submissions; the latter's limit is still
  subject to the ledger's own limits.
  See `issue #7812 <https://github.com/digital-asset/daml/pull/7812>`__.
CHANGELOG_END

* remove uncons and append, which were not needed

* log initial evaluated state again

* shape port aliases

- suggested by @cocreature; thanks
2020-10-27 17:36:24 +00:00
Stephen Compall
26d49d0a68
trigger request submissions backpressure the transaction stream (#7753)
* let free interpreter suspend on a SubmitRequest

* move UnfoldState to separate file, start a custom flow for flatmapping to it

* proper handlers, getting tangled in the mutable state of it all

* tests and conversion utilities for UnfoldState

* working UnfoldState flow with far fewer tricky details, passes test

* note on laziness

* missed t update

* test empty lists better

* add bifunctor for UnfoldState

* refactor message filtering

* split message parsing from the fold

* add copyright headers to new files

* let the flow from an UnfoldState emit the states

* test flatMapConcatStates's special output semantics

* pass submit's Future back to the holder of the SubmitRequest

* parallel submission stage, here with limit 8

* feed a stream of SubmitRequests to the command submission stage

* don't fail request submit stream stage on submit failure

- There was no way before for submission errors to report themselves to the free
  interpreter, which just saw Unit; now we don't drop the Future on the floor,
  so we properly turn "normal" submission errors into success, and actually
  propagate any "real" errors to the stream instead of logging.

* note that initialState command submissions are not throttled or backpressured

* add the parallel submission size to the failure queue size

- defense against deadlock should we later change to propagate enqueuing
  failures to the stream

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* clean up the initial namespace of getTriggerSink
2020-10-23 10:00:38 -04:00
Remy
dc34d4f637
LF: add PackageInterface a lightweigh Package (#7577)
CHANGELOG_BEGIN
CHANGELOG_END
2020-10-13 12:41:22 +02:00
Remy
ea2a637a11
LF: decouple template from record in the Scala Ast. (#7631)
CHANGELOG_BEGIN
CHANGELOG_END
2020-10-12 11:28:30 +02:00
Stephen Compall
dc204a37a7
remove known command ID from trigger state once Transaction and Completion message are seen (#7598)
- no assumption about order

- multiple transactions/completions are treated as one

CHANGELOG_BEGIN
CHANGELOG_END
2020-10-07 18:32:49 +00:00
Stephen Compall
ff706d5762
Trigger monad's Submit emits a command ID instead of accepting one (#7587)
* make TriggerF's Submit emit a command ID instead of accepting one

- LowLevel updated

- interpreter in Scala updated, preserving Message semantics as closely as possible

* remove nextCommandId and all management from high-level Trigger API implementation

* a note about TriggerF and simulateRule

* port submitCommands calls from tests

CHANGELOG_BEGIN
- [Triggers] The CommandIds as accessed from trigger DAML code are now exactly the command
  IDs used in command submission to the ledger; as such, they will vary randomly from run
  to run of the trigger rule.  To enable this, the low-level ``submitCommands`` function
  no longer accepts a command ID, instead returning one; there is no change to the
  corresponding high-level ``emitCommands`` function, so high-level triggers should only
  see improved and easier-to-understand logging.
  See `issue #7587 <https://github.com/digital-asset/daml/pull/7587>`__.
CHANGELOG_END

* port Scala-side assertion of trigger test

* rename commandIdMap to commandIdsUsed

* test that command IDs are like the ones we expect from the runner
2020-10-07 08:34:41 -04:00
Stephen Compall
0e71a2d3d2
interpret allowed updates and other actions in a free Trigger monad, like Script (#7456)
* conservatively move daml-script, trigger SValue interpreters to common library

* introduce expect and JavaList pattern for converters

* clean up trigger Converter Command interpretation

* add Church Free monad

* add an action language for trigger updates

* add expectE to remove some of the joins

* convert more of the converters to expect

* tool for unrolling Free/Roll

* split handleStepResult up and clean up its pattern

* handleStepFreeResult to interpret TriggerF

* replace Free Church with Pure/Roll free from Script

* newtype for ActionTrigger

* replace update in low-level Trigger with Free TriggerF

* submit one Commands at a time

* boolean blindness strikes again

* log missed TriggerF steps

* comment actual Submit contents

* match #7501 fromPureSExpr sig change in 00b80b8ea3

* avoid using forwardPort in runTrigger

* push State back into DAML, so it can be excluded from the action list

* push Message back into DAML, unifying the action language for initialState and update

* bringing TriggerF into initial state

* really add TriggerF into initial state, with all ports, tested

* add ActionTrigger class, express initialState in its terms

* add all TriggerF actions to existing TriggerA

* Trigger.rule will no longer have Time argument

* rename getS, setS to get, put, matching C.M.T.State from transformers

* make high-level Rule evaluate to the underlying TriggerF sequence

* Assert's testRule doesn't have a transform yet

* move DamlTuple2 to common converter library

- suggested by @cocreature; thanks

* combine the two Frees, provide from Script

* remove time argument from integration tests

CHANGELOG_BEGIN
- [Triggers] The ``Time`` argument was removed from the trigger rule function; instead, it
  can be fetched within the ``TriggerA`` ``do`` block by ``getTime``, as with ``Update``
  and ``Scenario``.  The ``LowLevel`` trigger interface has been redesigned; such triggers
  need to be rewritten or ported to high-level triggers.
  See `issue #7456 <https://github.com/digital-asset/daml/pull/7456>`_.
CHANGELOG_END

* add trigger rule simulator to support Assert module

* missed new Free module

- left in script per @cocreature

* remove retract as we ended up using foldFree for that purpose instead

- suggested by @cocreature; thanks

* throw ConverterException instead of RuntimeException

- suggested by @cocreature; thanks

* remove Time argument from coin-upgrade-trigger

* port trigger service tests

* port trigger scenario test

* put TriggerSetup and TriggerRule into LowLevel.Trigger instead of unboxed Free

- suggested by @cocreature; thanks

* remove Time argument from trigger compatibility test

* submit commands as soon as each `emitCommands` is sequenced

- we still collect a list, but only for tracking commandsInFlight

* filter out compatibility tests for triggers before now

* remove commented imports, libraries from new shared converter

* make the TriggerF interpreter tail-recursive

* remove unused compatibility trait

* add back new state logging

* remove refactoring comment

* rewrite some LowLevel initialStates in do

* hide Daml.Script.Free from docs

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* remove forwardPortInitialState

- suggested by @cocreature; thanks

* manually port low-level updates

- suggested by @cocreature; thanks

* remove forwardPort

- suggested by @cocreature; thanks

* fail faster on unrecognized TriggerF

- suggested by @cocreature; thanks

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-10-02 14:18:13 -04:00
Moritz Kiefer
00b80b8ea3
Separate off-ledger ond on-ledger speedy (#7501)
* Separate off-ledger ond on-ledger speedy

changelog_begin
changelog_end

* Add OnLedgerBuiltin abstract class

changelog_begin
changelog_end

* fix typo

changelog_begin
changelog_end

* Fix borked rebase

changelog_begin
changelog_end

* Remove unscoped withOnLedger

changelog_begin
changelog_end
2020-09-29 10:05:45 +00:00
Stephen Compall
0b72b6f716
more trigger service logs; tagged LoggingContext (#7205)
* get a LoggingContext into the TriggerRunnerImpl

* make some implicits more implicitly scoped and explicitly ascribed

* make some private/final markings

* most of JsonFormat[Identifier] is in companion

* experimental LoggingContext with phantom type

* ActorContext#log isn't really doing that much

* more details of LoggingContextOf

* make LoggingContextOf compile

* add trigger message logging, yet without context

* fix parent compile errors

* use Config as the phantom for its own logging extensions

* LocalDateTimeFormat cleanup

* switch TriggerRunner to contextual logging

* add trigger definition ID to logs

* log trigger-submitted commands, fix trigger test compile

* log trigger stopping and DAR uploads

* add context to PostStop/PreRestart logs

* add changelog

CHANGELOG_BEGIN
- [Triggers] More detailed logging of trigger actions and trigger service actions.
  See `issue #7205 <https://github.com/digital-asset/daml/pull/7205>`_.
CHANGELOG_END

* missed copyright header

* switch to Unit, scala/bug#9240 fixed
2020-09-03 17:47:09 +00:00
Samir Talwar
2b3cf1b3c0
ledger-api-client: Rename maxInboundMessageSize to maxInboundMetadataSize. (#7290)
* ledger-api-client: `maxInboundMessageSize` -> `maxInboundMetadataSize`.

CHANGELOG_BEGIN
- [Scala Bindings] Rename a field in the ``LedgerClientConfiguration``
  to ``maxInboundMetadataSize``, to match the builder Netty channel
  builder. It was incorrectly named ``maxInboundMessageSize``, which is
  a different channel property that configures the maximum message size,
  not the header size.
CHANGELOG_END

* ledger-api-client: Introduce a `maxInboundMessageSize` config property.

We use this a lot; easier if it's in the configuration.

CHANGELOG_BEGIN
- [Scala Bindings] Replace the
  ``LedgerClientConfiguration.maxInboundMessageSize`` property with a
  new one that represents the maximum size of the response body.
CHANGELOG_END
2020-09-02 08:41:34 +00:00
Remy
89770cf1c1
Speedy: make the field names from SRecord immutable. (#7225)
CHANGELOG_BEGIN
CHANGELOG_END
2020-08-25 17:02:27 +02:00
Moritz Kiefer
d4d0419c64
Use TO_TEXT_CONTRACT_ID in Show instance of ContractId (#7153)
fixes #7114

This PR changes the Show instance of ContractId and flips the switch
on triggers and DAML Script to run in off-ledger mode.

It also adds a test that for DAML Script we actually get back the
correct contract id.

There is a bit of a design decision here in how we want to print
contract ids, so let me list the options I considered. $cid will stand
for the actual cid and all options are wrapped in markdown inline
code.

1. `"$cid"`. Indistinguishable from string. Suggests that there might
be an IsString instance for ContractId.
2. `<$cid>`. Matches the dummy `<contract-id>` but it’s not a dummy so
I don’t think matching that is benefitial.
3. `$cid`. Easy to spot (contract ids start with # and have no
spaces), clearly not a string but might look slightly weird.

changelog_begin

- [DAML Script/DAML Triggers] When using DAML-LF 1.dev, the `Show` instance of `ContractId` will now display the actual contract id instead of a dummy `<contract-id>` value. Note that this only applies to DAML Script and DAML Triggers not to ledger code.

changelog_end
2020-08-17 17:06:24 +02:00
Stephen Compall
0857c28874
turn on NonUnitStatements in trigger runner, service main code (#7079)
* turn on NonUnitStatements in trigger runner, service main code

* add some friendly discards

* add a not-so-friendly discard

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* one more discard to clarify an Await.ready's type

* explain unbind issue
2020-08-11 14:30:11 +00:00
Moritz Kiefer
39085493c8
Make ApplicationId in DAML Triggers configurable (#7075)
fixes #7030

This deliberately ignores the trigger service. The main reason for
setting the ApplicationId at the moment is authentication and this is
still very WIP in the trigger service, so I don’t think it makes sense
to add this in some form to the API until that has settled.

changelog_begin

- [DAML Trigger] You can now configure the application id via
  `--application-id` in `daml trigger`. This is primarily useful if
  you run with authentication.

changelog_end
2020-08-10 18:15:16 +02:00
Stephen Compall
c3e79878ff
remove unused definitions, params, args from ledger API Scala code (#6985)
* remove unused definitions, params, args from ledger API Scala code

CHANGELOG_BEGIN
- [Ledger API] withTimeProvider removed from CommandClient; this method
  has done nothing since the new ledger time model was introduced in
  1.0.0.  See `issue #6985 <https://github.com/digital-asset/daml/pull/6985>`__.
CHANGELOG_END

* percolate withTimeProvider and label removal elsewhere
2020-08-04 18:02:19 +00:00
Stephen Compall
4ba9ae4e2b
remove unused definitions, params, args from triggers Scala code (#6983)
CHANGELOG_BEGIN
CHANGELOG_END
2020-08-04 16:50:32 +00:00
Moritz Kiefer
5ceeb476c8
Remove duplicated tls config parsing from DAML Script/Triggers (#6947)
This was not only unnecessarily duplicated, it also had a bug where
`--crt` behaved like `--pem` instead of setting the cert chain.

I didn’t add new tests since it seems like the wrong place to test
config parsing of a library. We do have tests for TLS in general for
both DAML Script and DAML Triggers.

changelog_begin
changelog_end
2020-07-31 18:25:18 +02:00
Gary Verhaegen
8176fb0c8d
fix the the typo (#6723)
```
s/the the /the /
```

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-14 16:55:33 +00:00
Moritz Kiefer
02c59d4f2a
Revert ANF changes and add a testcase for evaluation order (#6645)
* Revert ANF changes and add a testcase for evaluation order

After careful consideration, we decided that the change in evaluation
order that was accidentally introduced by the ANF changes should be
considered a breaking change or arguably even a bug and should not
land in 1.3.0.

Therefore, this PR reverts the following commits:

1. 353d0da6f7
2. a45b51042f
3. 04c7b2af7f
4. a624dd7242
5. b3aab72cee

Other PRs mostly had trivial merge conflicts that I resolved. The two
most interesting ones here are probably

1. https://github.com/digital-asset/daml/pull/6576 which was easy to
   resolve and the change to return SEValue instead of SExpr is still
   nice and useful even if we do not need the guarantees.
2. it https://github.com/digital-asset/daml/pull/6542 which required
   some changes since the constructors changed. If you want to review
   those changes in detail (they are pretty straightforward so not too
   important), it’s probably easiest to check out this PR and run
   ```
   git diff 2cd2a8f2a8
   daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Compiler.scala
   ```
   to see the diff to the parent commit of the first commit that
   introduced ANF.

changelog_begin
changelog_end
2020-07-08 12:40:12 +02:00
Stephen Compall
4cd419623a
replace traverseU and sequenceU with traverse and sequence (#6594)
* replace traverseU and sequenceU with traverse and sequence

- with -Ypartial-unification on, the extra Unapply typeclass lookup is
  unnecessary

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* limit imports; we only need *> and void
2020-07-07 15:01:58 +00:00
nickchapman-da
b3b30ae71d
Speedy issue 6573 (#6576)
* address issue 6573

changelog_begin
changelog_end

* fmt

* push switch from SExpr to SValue to callers of the trigger service
2020-07-02 13:15:00 +01:00
nickchapman-da
353d0da6f7
Speedy ANF (#6440)
* ANF transformation in Speedy.

The idea behind this PR is to transform speedy expressions into a simpler form where all non-atomic sub-expressions are made explicit by the introduction of let-forms. In particular, for the function-application form. These simpler forms allow the execution engine to take advantage of the atomic assumption, and often removes many additional execution steps. In particular the pushing of continuations to allow execution to continue after a compound expression has been reduced to a value.

changelog_begin
changelog_end

* improve comment

* inline functions relocateA/L

* remove comment about scalafmt

* remove commented out alterative def for transformLet1

* improve code by adding incr methods to DepthA/E

* remove (n == 0) special case in trackBindings

* clarify comment further

* improve validate/go to not consume stack for deeply right-nested let-expressions

* address comments from Remy: be private; use final case case; etc

* rename to unsafeCompilationPipeline

* add back some trailing commas

* remove commented-out debug line

* improve comment

* remove dev/debug code in compilationPipeline

* remove commented out code in SEAppGeneral.execute

* undo unrelated code improvement in SValue.scala

* fix compile. object Anf cannot be private
2020-06-30 20:52:44 +00:00
Remy
1b1b4eab2c
Speedy: clean machine builder name (#6427)
* Address comment martin made in #6368

* changelog

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-19 14:58:13 +02:00
Remy
5a9e7ebc7c
Speedy: refactor Machine builders (#6368)
In this PR we cleanup the constructor for the speedy Machine.

* We remove the `case`  keyword since `Machine` is a stateful class,
* We replace the pre-existing builders with
  + one generic builder `Machine.apply`,
  + scenario specific builder,

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-18 15:39:55 +02:00