* 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>
* Expand type synonyms lazily
We really only need to expand type synonyms in two cases:
1. When pattern matching e.g. to check that a projection on a struct
really happens on a struct. In this case we can first check if we
have a struct in which case we don’t need to expand anything. If we
don’t, we can expand afterwards.
2. When checking two types for alphaequivalence. This PR goes for the
simplest solution: First check alphaequivalence without expanding
anything treating type synonyms nominally. Then if that fails
expand everything and check again. We could be more clever and
interleave expansion with checking for alphaequivalence but this
seems to give us most of the performance benefits while keeping the
logic very simple.
On my local laptop this speeds up typechecking of the full DAR from
380ms to 176ms so roughly a 2x improvement.
For comparison: The Daml-LF 1.7 DAR which still relies on nonminal
typechecking of typeclasses everywhere takes 110ms. So we are still
leaving something on the table here but we’re much closer.
I think this also gets us to the point where speedy compilation is
slower than typechecking but I need to verify that again.
changelog_begin
changelog_end
* Apply suggestions from code review
Co-authored-by: Remy <remy.haemmerle@daml.com>
* fix biuld
changelog_begin
changelog_end
Co-authored-by: Remy <remy.haemmerle@daml.com>
* Test authorization within Exercise choice.
CHANGELOG_BEGIN
CHANGELOG_END
* fix build following rebase
* 4x shouldBe a Right
* test for exercise within exercise
* implicit Name.assertFromString
* def --> val. massive speedup!
* be more private
* implicit Identifier creation
* use implicit for Party and ChoiceName creation
* comment test purpose
* delete stray text; fix build
* Typecheck nested LF type applications more efficiently
This improves performance typechecking in the Scala LF typechecker by
matching on nested foralls & type applications which allows us to
check them with only a single substitution as opposed to the previous
state of doing one for each type application.
This is about a 25% improvement on typechecking performance of
GHC.Classes from 200ms to 150ms.
changelog_begin
changelog_end
* interfaces: Do some TODOs
- Add uniqueness check between fixed choices and virtual choices in
haskell decoder.
- Encode interface methods and fixed choices in scala encoder.
- ExprIterable for interfaces.
changelog_begin
changelog_end
* scalafmt
* [Self-service error codes] Refactored for Canton integration
* Introduces ErrorCodeLoggingContext which is used to abstract away the logging tech stack
CHANGELOG_BEGIN
CHANGELOG_END
* Moved all error definitions in //ledger/error
* Formatting
* Docs and remove of implicit conversion to DamlErrorCodeLoggingContext
* Fix compilation issues
* Fix tests
* Addressed Pawel's review comments
* Addressed Robert's review comments
* interfaces: introduce TemplateOrInterface class in stdlib
The template typeclass is to strong for many applications. The new
constraint `TemplateOrInterface` only contains the methods to convert
contract IDs and choices.
CHANGELOG_BEGIN
CHANGELOG_END
* ghc-lib update, interface script tests
* pinned stackage on unix
* added missing implementation in preprocessor
* added test
* fixing tests
* remove Iface type
* pinned stackage windows
* make sure createAndExercise is not called on interfaces
* LF: clarify compilation of choice Body.
This is a purely cosmetic choice.
We move up the intro of the choice arg binder to make it clear it
affect the compilation of every expression in the body of a choices (
namely controllers, observers, and update expression).
CHANGELOG_BEGIN
CHANGELOG_END
* formatting
- enable NonUnitStatements, and find a useless statement.
- add missing `final`s,
- replace `{ ... }` by `( ... )` for one statement anonymous function
- drop useless `new` for case class.
- replace `sealed class X { ... object Y extend X` by
`class X private[Z] { ... val Y = new X` to avoid unecessary class
alocation.
- move invariant check inside the body of some case class instead of
the companion object.
- other cosmetic changes.
CHANGELOG_BEGIN
CHANGELOG_END
* interface methods: Scala Typechecker
Part of #11006.
I tried to match the behavior of the Haskell typechecker.
changelog_begin
changelog_end
* scalafmt
* Fix type
* interface methods: Scala AST
Part of #11006
This PR takes care of the Scala AST and decoder.
It leaves the encoder, type checker, and speedy for later.
changelog_begin
changelog_end
* scalafmt
* AstRewriter
* interface methods: Speedy
Part of #11006
changelog_begin
changelog_end
* scalafmt
* Remove InterfaceMethods test
* Update daml-lf/archive/src/main/scala/com/digitalasset/daml/lf/archive/DecodeV1.scala
Co-authored-by: Remy <remy.haemmerle@daml.com>
Co-authored-by: Remy <remy.haemmerle@daml.com>
* interface methods: Scala AST
Part of #11006
This PR takes care of the Scala AST and decoder.
It leaves the encoder, type checker, and speedy for later.
changelog_begin
changelog_end
* scalafmt
* AstRewriter
* Add NonUnitStatements warning in daml-lf/transaction & fix using discard or similar.
CHANGELOG_BEGIN
CHANGELOG_END
* address comment
* prefer parens to braces for single statement map/foreach bodies
* interface methods: Add protobuf
Adds protobuf definitions for interface methods and calling them.
Encoders/decoders just ignore the extra stuff or error out.
Part of #10810 (maybe)
changelog_begin
changelog_end
* Update issue numbers where appropriate
* update stable protos
(Also: generalize type of `enrichTransaction` to work for _submitted_ and _committed_ transactions & adapt existing callers)
This change paves the way to remove the `transactionNormalization` flag, and always normalize transactions coming out of the engine.
CHANGELOG_BEGIN
CHANGELOG_END
1st attempt. Causes package recompilation (bad!).
CHANGELOG_BEGIN
CHANGELOG_END
fix build
Change ValueEnricher interface to work without passing an Engine
ValueEnricher has optional preprocessor
simplify new interface to ValueEnricher: caller passes translateValue function
Part of #10810
- Implemented ToInterface, FromInterface in speedy
- Added a test that exercises and fetches an interface
- Fixed a bug in SBUChoiceInterface
Hey, interfaces work now!
changelog_begin
changelog_end
fixes#10977
Turns out assertions are good unless they’re wrong …
This only affects scenarios, the engine never looks at the callback.
changelog_begin
changelog_end
* ifaces: name collision, typecheck fetch/exercise
This adds name collision detection and adds typechecking for
fetch/exercising of interface instances.
CHANGELOG_BEGIN
CHANGELOG_END
* turn on exercises in InterfaceDesugared test case
* Update compiler/daml-lf-tools/src/DA/Daml/LF/TypeChecker/NameCollision.hs
Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>