Commit Graph

9744 Commits

Author SHA1 Message Date
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
Stefano Baghino
f4580aeeff
Move DependencyGraph from //language-support/scala/codegen to //language-support/codegen-common/ (#13367)
Move `DependencyGraph` from `//language-support/scala/codegen` to `//language-support/codegen-common/`

changelog_begin
changelog_end

The idea is that of re-using `DependencyGraph` for the Java codegen.

Builds on top of https://github.com/digital-asset/daml/pull/13361 and
contributes towards https://github.com/digital-asset/daml/issues/13324.
2022-03-22 12:36:46 -04:00
nickchapman-da
6a869fc7a3
remove speedy compilation validate phase (phase4) (#13353)
changelog_begin
changelog_end
2022-03-22 14:56:40 +00:00
Sergey Kisel
1543dd2bb4
Generator for test evidence using ScalaTest framework [DPP-962] (#13345)
* Generator for test evidence using ScalaTest framework [DPP-962]

changelog_begin
changelog_end
2022-03-22 15:50:54 +01:00
Stefano Baghino
452d37c6a1
Refactor Scala codegen: simplify by removing unnecessary abstractions (#13361)
* Refactor Scala codegen

changelog_begin
changelog_end

* Remove unnecessary abstractions

`DependencyGraph` and `LFUtil` both had an abstract superclass of
which they were the only implementation. Removing this unneccesary
layer of abstraction allows to avoid jumping between the superclass
and its concrete implementation to make sense of the overall meaning
of the code. Removing this layer also allows to find and remove
dead code and unused parameters.

* Throw away dead code around `BaseNode` and remove the unnecessary abstraction

* Throw away unused code

* Fix typo: unsopported -> unsupported

* Remove incorrect capitalization of type definitions

Before the refactoring, both `Util` and `LFUtil` had an implementation
of `toTypeDef` which were mostly matching, apart from the fact that
one capitalized its output while the other didn't. Apparently, I used
the wrong version and this broke existing code.
2022-03-22 13:39:13 +01:00
tudor-da
ed585780f0
Fix mutable state cache updates synchronization (#13325)
* Implemented race conditions test for mutable contract state cache upload

changelog_begin
[Ledger API] A race condition bug is fixed in the Ledger API mutable contract state cache.
The bug allowed the cache to become corrupted with stale references when the Ledger API
was subjected to concurrent submissions racing to update/fetch the same contract key.
The stale references were causing the Ledger API to erroneously reject submissions in
certain corner-cases.
changelog_end

* Pull cache indexes to StateCache
* Passes the test

* Fixing StateCacheSpec and MutabelCacheBackedContractStoreSpec
* Added invalidate test to ConcurrentCacheCachingSpecBase

* Address Marton's review comments

* Do not log a warn on negative contract lookups

* Update cache outside the source restart
2022-03-22 13:09:25 +01:00
Sergey Kisel
9eeacdca94
Library for test evidence [DPP-959] (#13319)
* Test library for test evidence to annotate scala and ledger api tests. [DPP-959]

changelog_begin
changelog_end
2022-03-22 11:02:34 +01:00
azure-pipelines[bot]
171670197b
update NOTICES file (#13359)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-03-22 10:46:54 +01:00
nickchapman-da
53c4447152
add stack-safety tests for wide expressions (#13347)
* add stack-safety tests for wide expressions

changelog_begin
changelog_end

* add links to quadratic issue
2022-03-22 08:44:38 +00:00
tudor-da
49e950dc59
Validated package uploads on SandboxServer startup (#13340)
* Validated package uploads on SandboxServer startup

changelog_begin
changelog_end

* Addressed Martino's review comments
2022-03-21 21:39:51 +01:00
Stephen Compall
2dd248cd68
move nonempty code to new nonempty library (#13350)
- new nonempty artifact, separate from scala-utils
- com.daml.scalautil.nonempty is now com.daml.nonempty

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-21 17:14:17 +00:00
Victor Peter Rouven Müller
1d2c01d2ca
Fix main build (#13352)
just runs the formatter again which fixes the diff in security-evidence.md

changelog_begin
changelog_end
2022-03-21 15:41:10 +00:00
Victor Peter Rouven Müller
8e6493b02a
Add security evidence about the failure tests from the json api (#13229)
changelog_begin
changelog_end
2022-03-21 15:58:59 +01:00
Victor Peter Rouven Müller
47ca2cb953
Add security evidence annotations to the integration tests of the json api (#13225)
changelog_begin
changelog_end
2022-03-21 15:58:23 +01:00
Victor Peter Rouven Müller
31366b939c
Add test evidence annotation to unit test of the json api (#13219)
changelog_begin
changelog_end
2022-03-21 15:57:59 +01:00
Victor Peter Rouven Müller
bfd69b0bee
Test that we return a 404 when requesting information about non-existing packages (#13346)
changelog_begin

- [HTTP-JSON] If information about a package is requested that doesn't exist on the ledger you will now get a 404 instead of a 500 as response.

changelog_end
2022-03-21 15:57:32 +01:00
Remy
f7d1901a5c
LF: split Command into ApiCommand and ReplayCommand (#13323)
CHANGELOG_BEGIN
CHANGELOG_END
2022-03-21 14:07:41 +01:00
Moisés Ackerman
b800fdc99a
expand buildLfPackageGraph docstring (#13343)
changelog_begin
changelog_end
2022-03-21 13:29:59 +01:00
Remy
6c2dc2d508
Move Replay from KV to LF land (#13243)
* Move Replay from KV to LF land

+ base it on submission entries instead of ledger export

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-21 13:03:10 +01:00
azure-pipelines[bot]
8438b57542
rotate release duty after 2022-03-16 (#13302)
@remyhaemmerle-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-21 13:01:44 +01:00
azure-pipelines[bot]
2500dd7cd8
update NOTICES file (#13342)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-03-21 11:07:45 +01:00
Stephen Compall
d37a63f56e
interface choices in json-api (#13301)
This expands the domain of the exercise endpoint to accept interface IDs
instead of template IDs when exercising by contract ID. The argument is
still [compatibly] called templateId; interface IDs are accepted nowhere
else.

CHANGELOG_BEGIN
- [JSON API] Supports interface choices, including exercise by contract
  ID accompanied by an interface ID.
  See `issue #13301 <https://github.com/digital-asset/daml/pull/13301>`__.
CHANGELOG_END
2022-03-18 17:47:30 +00:00
Moisés Ackerman
2971949913
Allow dependencies that depend on data-deps (#13205)
Previously, all dependencies were installed first in a single step, and then
the data-dependencies were installed according to the dependency graph. 
This failed for dependencies with data-dependencies since those are processed later.

This was achieved by installing _all_ dependencies and data-dependencies according to the
dependency graph. Additionally, to ensure that the instance-rewriting behavior is preserved, 
the dependency graph is extended with edges from each data-dependency to the subset of 
dependencies without data-dependencies.

[instance rewriting behaviour: the class instances from data-dependencies are rewritten 
to refer to a matching class definition from a dependency when such a class definition exists.
]

* Add edges from each data-dependency to all dependencies without data-dependencies

* Generate stub sources inside for loop

* Update PackageMap manually

* Make PackageNode a sum type

* Add TODO for replacing recachePkgDb

* Tests

    * Generalize 'data-dependencies + exposed-modules' test with QuickCheck

    * Add test for building a project where a dependency has a data-dependency

    * Add test for building a project where a dependency has a data-dependency which is a plain dependency of the main project

    * Add test for building a project where a dependency has a data-dependency which is not a dependency of any kind of the main project

changelog_begin
changelog_end
2022-03-18 16:10:29 +01:00
Stefano Baghino
0b662a77bd
Fix typo in HTTP JSON API Service docs (#13331)
Addresses https://github.com/digital-asset/daml/pull/13330/files#r829985080

changelog_begin
changelog_end
2022-03-18 15:29:46 +01:00
nickchapman-da
5cce3e8891
prefer scalaz type tagging over case-classes to avoid allocation (#13328)
* prefer scalaz type tagging to case-classes to avoid allocation

changelog_begin
changelog_end

* remove snake case
2022-03-18 13:53:01 +00:00
Stefano Baghino
a4abb4ef9e
Remove mentions of the token for package retrieval (#13330)
It has been removed some time ago.

changelog_begin
changelog_end
2022-03-18 12:53:30 +00:00
nickchapman-da
9b90a909cb
reduce trampoline bouncing in ANF transform (#13318)
* explore less bouncing; convert every: Bounce -> yesBounce/noBounce

changelog_begin
changelog_end

* remove noBounce; yesBounce -> Bounce (with curly braces)

* multi args list for better layout

* use shadow variable naming more consistently

* reduce unnecessary polymorphism

* reinstate 2x Bounce in atomizeExps which are necessary

* avoid 2x linear args.size

* avoid pointless conversion to/from Array

* move definition of Res to correct place

* remove 2x comments to type param A which has been removed

* inline 2x unnecessary val defs
2022-03-18 11:05:57 +00:00
Robin Krom
b14e4aeacd
ifaces: tests for by_interface nodes in transactions (#13321)
This adds tests for decode . encode = id in the transaction
encoder/decoders.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-18 11:34:45 +01:00
nickchapman-da
6a103dfa83
remove duplicate list of testcases (#13327)
changelog_begin
changelog_end
2022-03-18 10:27:39 +00:00
azure-pipelines[bot]
3199d6d1b4
update NOTICES file (#13326)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-03-18 09:49:15 +01:00
Remy
1118a7fb58
Minor fix in RELEASE.md (#13315)
CHANGELOG_BEGIN
CHANGELOG_END
2022-03-17 18:56:03 +01:00
Sofia Faro
79715ad32d
interfaces: Drop the typerep, raise WronglyTypedContract (#13314)
* Drop the typerep in interface desugaring.

GHC PR: https://github.com/digital-asset/ghc/pull/110

Fixes https://github.com/digital-asset/daml/issues/13275 and https://github.com/digital-asset/daml/issues/13283

changelog_begin
changelog_end

* compile ghc-lib

* update bazel-haskell-deps

* update InterfaceTypeRepCheck test

* scalafmt

* update compile.yml

* update bazel-haskell-deps last time
2022-03-17 16:12:46 +00:00
Sofia Faro
4ee7240dff
Mark create-daml-app test as flaky. (#13317)
* Mark create-daml-app test as flaky.

changelog_begin
changelog_end

* buildifier-fix
2022-03-17 13:05:09 +00:00
nickchapman-da
042d60a51f
Complete stack-safety fixes for speedy ANF transform (#13312)
* enable Anf stack-safety tests for EUpdate cases

* fix stack-safety for closures in Anf transform

* fix stack-safety for try-catch handling in Anf transform

* add missing testcases for scope-exercise/prevernt-catch ANF stack-safety, and fix the overflow

changelog_begin
changelog_end
2022-03-17 09:59:53 +00:00
pbatko-da
f1949b44f5
Update """'tools.dade-exec-nix-tool' not found""" section in BAZEL.md (#13269)
changelog_begin
changelog_end
2022-03-16 23:26:10 +01:00
Robin Krom
f7a73c5a87
ifaces: more tests for requires (#13309)
This adds tests for circular and non-closed requires in interfaces on
the daml-lf side.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-16 18:15:26 +01:00
Stefano Baghino
caa8025788
Reduce noise when building //daml-lf/encoder:testing-dar-* (#13313)
changelog_begin
changelog_end

Adding Logback to the runtime dependencies allows to avoid having
logging noise when building this due to the missing logger implementation.

Before:

```
> bazel build //daml-lf/encoder:testing-dar-1.12
INFO: Invocation ID: fd46d196-8780-4b3a-9c23-41501a4668d2
INFO: Analyzed target //daml-lf/encoder:testing-dar-1.12 (1 packages loaded, 27 targets configured).
INFO: Found 1 target...
INFO: From Executing genrule //daml-lf/encoder:testing-dar-1.12:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Target //daml-lf/encoder:testing-dar-1.12 up-to-date:
  bazel-bin/daml-lf/encoder/test-1.12.dar
INFO: Elapsed time: 0.365s, Critical Path: 0.01s
INFO: 5 processes: 1 remote cache hit, 4 internal.
INFO: Build completed successfully, 5 total actions
```

After:

```
> bazel build //daml-lf/encoder:testing-dar-1.12
INFO: Invocation ID: d79a9df8-8243-49db-bd67-56a4f53ca746
INFO: Analyzed target //daml-lf/encoder:testing-dar-1.12 (1 packages loaded, 27 targets configured).
INFO: Found 1 target...
Target //daml-lf/encoder:testing-dar-1.12 up-to-date:
  bazel-bin/daml-lf/encoder/test-1.12.dar
INFO: Elapsed time: 0.332s, Critical Path: 0.01s
INFO: 5 processes: 1 remote cache hit, 4 internal.
INFO: Build completed successfully, 5 total actions
```

Notice the lack of SLF4J warnings.

See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2022-03-16 16:24:16 +00:00
Stefano Baghino
1c33a824c6
Remove dead code from Java codegen (#13311)
I found this while having a look at reproducing #13308.

changelog_begin
changelog_end
2022-03-16 16:23:42 +00:00
Stefano Baghino
0a92bd7431
Fix binary for Coursier (#13310)
The binary should be called `cs`, the full `coursier` name causes the following error

```
/path/to/digital-asset/daml/dev-env/bin/../lib/dade-common: line 143: /nix/store/hsbnxsgqhaxavqdwmqyvcdp3ng22gvaf-coursier-2.0.16/bin/coursier: No such file or directory
```

changelog_begin
changelog_end
2022-03-16 15:30:07 +01:00
pbatko-da
35c5812703
[Error codes] Update docstring for com.daml.ledger.participant.state.v2.PruningResult.NotPruned [DPP-861] (#13305)
changelog_begin
changelog_end
2022-03-16 15:07:42 +01:00
pbatko-da
c6a0275f6e
[Error codes] Fill in missing contexts that were lost where reflection based context population was removed [DPP-606] (#13264)
And rename error arguments that haven't been in camel case yet.

changelog_begin
changelog_end
2022-03-16 15:07:24 +01:00
pbatko-da
3f0ded9274
Remove ErrorFactories [DPP-606] (#13285)
changelog_begin
changelog_end
2022-03-16 14:00:30 +01:00
pbatko-da
b63fdc7031
[Error codes] Increase visibility of formatContextAsString (#13304)
changelog_begin
changelog_end
2022-03-16 13:26:57 +01:00
azure-pipelines[bot]
5bd58a907f
update NOTICES file (#13303) 2022-03-16 08:12:02 -04:00
Robin Krom
93c53da3df
requires checks (#13300)
* interfaces: tests for requires typing

We add tests for the correct typing of the interface requires field.

CHANGELOG_BEGIN
CHANGELOG_END

* security evidence
2022-03-16 12:05:30 +00:00