Commit Graph

9638 Commits

Author SHA1 Message Date
Rafael Guglielmetti
f24a39d2df
Use Canton 2.1.0-SNAPSHOT (20220328) for conformance tests (#13446)
CHANGELOG_BEGIN
CHANGELOG_END
2022-03-29 17:55:21 +02:00
Stefano Baghino
9d6eecaa4f
Refactoring codegen (#13439)
* Remove unused `name` field from `InterfaceTreeBuilder`, inline builder construction

* Remove unused `Traverse` instance for `TypeDeclOrTemplateWrapper`

* Remove unneccessary type parameter from `TypeDeclOrTemplateWrapper`

* Remove some unnecessary copies `.toList`

* Remove `TypeDeclOrTemplateWrapper`, use `Either` directly as a wrapper

* Use `bimap` instead of explicitly wrapping and unwrapping the `Either`

* Remove unnecessary type `Mode`

* Remove unnecessary type parameter from `WriteParams`

* Remove unnecessary binding

* Pull `OrderedDependencies` out of `Graph`

* Move computation of relevant packages to `codegen-common`

* Move `templateCount` from `LFUtil` into `CodeGen`

* Comment the purpose of `TransitiveClosure`

* Pull the variance cache out of `LFUtil`

`LFUtil`'s purpose is that of limiting passing around certain
values. While the purpose is questionable, the variance cache did
not need to access any of those values and it's quite easy to
move to a separate class where the purpose and the scope are clearer.

* Make `DependencyGraph` work directly on type declarations

* Add constructor for a collection of interfaces to `EnvironmentInterfaces`

* Factor the error message from `cyclicDependencies` out of `DependencyGraph`

changelog_begin
changelog_end
2022-03-29 16:29:22 +02:00
Remy
dfee9dfaf8
Fix Transaction.Metadata used_packages field computation for interface (#13441)
fixes #13437

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-29 14:20:04 +00:00
Andreas Lochbihler
af288a6bce
Move the public methods on NonEmpty to companion object (#13415)
Now the signatures of those methods refer to the type synonyms defined in the package object rather than to the abstract type members of the class.
This makes sure that IntelliJ will find the implict classes for NonEmpty and NonEmptyF.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-29 14:52:41 +02:00
Robin Krom
b2e7981b73
ifaces:evaluation order tests for fetch by iface (#13443)
This adds evaluation order tests for fetch_interface in the daml-lf
execution.

Part of #12697.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-29 11:19:34 +00:00
Victor Peter Rouven Müller
cc06073333
Java bindings/interface support (#13366)
* WIP

* First working version of java codegen daml interface support

* Update language-support/java/codegen/BUILD.bazel

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

* Fix compile errors

* Simplify code massivly, enjoy less duplication

changelog_begin

- The Java codegen now has basic support for daml interface definitions. Converting a contract id of a template implementing an interface to a contract id of the interface is possible and both executing interface choices is possible on the contract id of the interface and implementing template.

changelog_end

* Rename the test file to reflect it is a test file & enhance the inner test name & extend it further

* Fix test

* Refactor parts of TemplateClass.scala into multiple files

* Format that files!

* Minimize duplication further

* Remove unused comment

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

* Update language-support/java/codegen/src/main/scala/com/digitalasset/daml/lf/codegen/CodeGenRunner.scala

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

* Further refactoring and renaming of the TemplateClassSpec to ContractIdClassBuilderSpec

* Fix formatting

* Add interface docs

* Remove unnecessary code generation of the Contract class for interface types

* Use less bool flags and more good function names :)

* Fix build

Co-authored-by: Remy <remy.haemmerle@daml.com>
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2022-03-29 12:38:00 +02:00
Sergey Kisel
e724befcfd
Fix duplicate artifact id check (#13420)
CHANGELOG_BEGIN
CHANGELOG_END
2022-03-29 12:35:17 +02:00
azure-pipelines[bot]
0f38fe547a
update NOTICES file (#13438)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-03-29 11:48:59 +02:00
Sergey Kisel
66c37badce
Moving Scala sources to correct path so sources are published correctly. (#13435)
CHANGELOG_BEGIN
CHANGELOG_END
2022-03-28 18:58:06 +02:00
Robin Krom
609cd12392
interface evaluation tests (#13432)
* ifaces: more evaluation order tests

This adds more evaluation order tests for the execution of daml-lf
during exercise_interface.

Part of #12697.

CHANGELOG_BEGIN
CHANGELOG_END

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

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

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

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

Co-authored-by: Remy <remy.haemmerle@daml.com>
2022-03-28 14:24:04 +00:00
Robin Krom
537cfdb11b
ifaces:additional interface evaluation order tests (#13425)
This adds additional interface daml-lf evaluation order tests.

Part of #12697.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-28 13:08:08 +02:00
azure-pipelines[bot]
8bc8c2e980
update NOTICES file (#13429)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-03-28 11:45:53 +02:00
Remy
4a4833817a
Add a temporary lenient Replay Exercise Command (#13426)
To give some more time to Canto to handle properly the strict
versions.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-25 20:00:00 +01:00
Gary Verhaegen
1658b3b31a
try to improve release docs (#13422)
Specifically, try to slightly reorganize it in terms of what people are
trying to achieve, rather than what type of release they ultimatly need
to create.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-25 18:02:51 +01:00
Moisés Ackerman
b47fa3ba92
interface conversion primitives test cases (#13416)
* Add LF ParsersSpec cases for conversion primitives

* Add LF TypingSpec cases for conversion primitives

* Add LF DecodeV1Spec cases for conversion primitives

* Add LF EncodeV1Spec cases for conversion primitives

* update security-evidence.md

* Add missing cases in daml-lf encoder

* Add missing cases in EncodeV1Spec

* Add InterfaceMod in DamlLfEncoderTest

changelog_begin
changelog_end
2022-03-25 16:08:31 +00:00
Robin Krom
a43d7c5e1f
ifaces: new evaluation order tests (#13419)
This adds a new evaluation order test for the execution of daml-lf for
interfaces.

This is part of #12697.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-25 14:09:59 +00:00
Robin Krom
3a4939d3d5
ifaces: one more evaluation order test (#13400)
This adds another evaluation order test for the execution of daml-lf for
interfaces.

This is part of #12697.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-25 13:40:25 +01:00
Sofia Faro
8582b04861
ifaces: Add semantics for 'exercise_interface' in the LF spec (#13404)
* ifaces: Add exercise interface semantics to spec

This is based on the semantics of 'exercise'.

Closes #11349 (for now). Also fixes a small bug in the semantics of 'exercise'.

changelog_begin
changelog_end

* Uniformize exercise syntax
2022-03-25 11:37:43 +00:00
Remy
6aa2dd5f1b
LF: Remove unecessary logic to pull package dependencies (#13344)
in the preprocessor and the validation, since, The compiler is already doing that.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-25 11:47:59 +01:00
azure-pipelines[bot]
accb14d6d0
update NOTICES file (#13408)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-03-25 11:42:59 +01:00
nickchapman-da
df1e738180
fix quadratic complexity for closure conversion of a multi-let (#13385)
changelog_begin
changelog_end
2022-03-25 10:28:49 +00:00
Moisés Ackerman
f9f1611d46
Unsafe interface conversion primitives (#13391)
* Add unsafeFromInterface method to HasFromInterface class

* Use unsafeFromInterface instead of fromInterface + experimental primitive

* Drop THROW_WRONGLY_TYPED_CONTRACT experimental primitive

* Add UnsafeFrom{,Required}Interface LF primitives

* Add convertPrim cases for UnsafeFrom{,Required}Interface

* Add InterfaceGuarded tests for WronglyTypedContract cases

changelog_begin
changelog_end

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2022-03-25 10:07:14 +00:00
tudor-da
3fac74f9e2
Release 1.18.2 RC (#13393)
changelog_begin
changelog_end
2022-03-25 06:47:39 +01:00
Stephen Compall
467b8fbbe7
shorter Value expressions in json-api tests (#13358)
* template ID variables
* remove duplicate function

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-24 15:51:55 +00:00
Sergey Kisel
d329db0ee7
Transaction Privacy test evidence [DPP-966] (#13395)
* Transaction Privacy test evidence [DPP-966]

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-24 15:45:23 +00:00
Sofia Faro
3646ec2358
interfaces: Add unsafe conversion to LF spec (#13399)
changelog_begin
changelog_end
2022-03-24 15:22:39 +00:00
Gary Verhaegen
a994288f96
damlc visual docs: remove <> (#13398)
These characters have a special meaning in Bash, so it's better to avoid
them as placeholders.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-24 15:07:39 +00:00
Robin Krom
ff333c8f07
ifaces: evaluation order tests for exercise/fetch (#13396)
This add a first test for evaluation order of exercise_interface and
fetch_interface. More tests will come in the following PR's.

This is part of #12697.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-24 15:49:01 +01:00
Hubert Slojewski
92bf78e2b6
Change misleading messages (#13388)
CHANGELOG_BEGIN
CHANGELOG_END
2022-03-24 13:19:38 +01:00
Robert Autenrieth
f4363b3c41
DPP-906 Move conditional evaluations from SQL to JVM (#13212)
* Factor out offset comparison

... and move special treatment for offset begin to JVM code

changelog_begin
changelog_end

* wip
2022-03-24 11:23:17 +01:00
Sergey Kisel
e4cac30c92
Test evidence support for Ledger API tests [DPP-965] (#13387)
* Test evidence support for Ledger API tests [DPP-965]

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-24 11:17:59 +01:00
Moisés Ackerman
a88079e41a
Interface reference docs, cont. (#13378)
changelog_begin
changelog_end
2022-03-23 18:33:03 +01:00
Sergey Kisel
b5c3b9460b
Publish test evidence generator library (#13389)
changelog_begin
changelog_end
2022-03-23 17:24:14 +00:00
Sergey Kisel
55ca1af7e3
PublicServiceCallAuthTests security test evidence [DPP-961] (#13363)
changelog_begin
changelog_end
2022-03-23 17:37:19 +01:00
Stefano Baghino
d1feab0796
Address review comments on documentation improvements (#13386)
* Address review comments on documentation improvements

Address https://github.com/digital-asset/daml/pull/13381#pullrequestreview-918754656

changelog_begin
changelog_end

* Address https://github.com/digital-asset/daml/pull/13381#discussion_r833249949

* Address https://github.com/digital-asset/daml/pull/13381#discussion_r833253079

* Address https://github.com/digital-asset/daml/pull/13381#discussion_r833254062
2022-03-23 10:57:08 -04:00
azure-pipelines[bot]
c6cd84b882
rotate release duty after 2022-03-23 (#13374)
@victormueller-da is taking care of [testing](https://github.com/digital-asset/daml/blob/main/release/RELEASE.md) today's release, so they get pushed back to the end of the line.

Please do not merge this before the release is fully tested.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-03-23 12:45:46 +00:00
Remy
fe25205098
LF: cleanup snapshot replay + add minimal doc (#13360)
CHANGELOG_BEGIN
CHANGELOG_END
2022-03-23 13:37:40 +01:00
Sergey Kisel
fe654eba21
Change ownership of test-evidence library (#13380)
CHANGELOG_BEGIN
CHANGELOG_END
2022-03-23 13:32:55 +01:00
Gary Verhaegen
d0f372cbdb
retry 2.0.1 snapshot (#13373)
I have no idea why this should work, but I don't know what else to try
at this point.

cc @tudor-da

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-23 13:11:28 +01:00
Stefano Baghino
30acaaea77
Document how to connect HTTP JSON API Service to an HA participant (#13381)
* Document how to connect HTTP JSON API Service to an HA participant

Fixes https://github.com/digital-asset/daml/issues/13369

changelog_begin
changelog_end

* Add dummy Canton docs ref for `high-availability`
2022-03-23 13:05:15 +01:00
Moisés Ackerman
1185eb32bc
Preserve inherited choice info in daml test coverage report (#13354)
* Preserve inherited choice info in 'daml test' coverage report

changelog_begin
changelog_end
2022-03-23 12:28:04 +01:00
Stefano Baghino
50fd93c250
Address remaining issues about CVE-2021-44906 (#13382)
Addresses https://github.com/digital-asset/daml/security/dependabot/28
Addresses https://github.com/digital-asset/daml/security/dependabot/24

changelog_begin
changelog_end
2022-03-23 11:06:31 +00:00
Stefano Baghino
98a62622e8
Address open security advisories (#13377)
Address CVE-2022-24771
Address CVE-2022-24772
Address CVE-2022-24773

changelog_begin
changelog_end
2022-03-23 11:05:20 +01:00
Moisés Ackerman
9f6c1757bc
Interface reference docs (#13337)
* Prefix contract keys and exceptions reference docs with 'Reference:' to match siblings

* Interface reference docs: syntax

* Interface reference docs: functions

changelog_begin
changelog_end
2022-03-23 10:43:39 +01:00
Stefano Baghino
9fef07a02a
Address CVE-2021-44906 (#13376)
changelog_begin
changelog_end
2022-03-23 09:27:15 +00:00
Stefano Baghino
50f0c568f4
Remove unneccesary generality from Scala codegen (#13372)
changelog_begin
changelog_end

Addresses https://github.com/digital-asset/daml/pull/13367#discussion_r832251452
2022-03-23 09:07:53 +00:00
Stefano Baghino
587d9abfc3
Standardize package for JVM codegen (#13370)
The Scala codegen code lives under `com.daml.codegen` but the common
library and the Java codegen both live under `com.daml.lf.codegen`.

In order to share code while preserving package private access of
certain facilities (i.e. `DependencyGraph`) the package needs to
be standardized. I chose to go the Java way mostly to reduce noise
on work currently on its way on the Java codegen (#13366).

Contributes towards https://github.com/digital-asset/daml/issues/13324

changelog_begin
changelog_end
2022-03-23 09:03:35 +01:00
Robin Krom
d10f678518
ifaces: tests for by_interface in transactions (#13365)
We add tests to check that by_interface fields are set for interface
transactions. We also extend the scenario service to show the
by_interface fields in the pretty printed transactions.

Fixes #13333

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-22 19:53:49 +00:00
tudor-da
61941673a3
2.0.1 RC release (#13371)
changelog_begin
changelog_end
2022-03-22 19:55:15 +01:00
Victor Peter Rouven Müller
dcd726e113
Add security evidence to the simple trigger tests (#13231)
changelog_begin
changelog_end
2022-03-22 17:01:35 +00:00