Commit Graph

212 Commits

Author SHA1 Message Date
Remy
daa3f87f00
Propagate PackageRef to submit (#18041) 2023-12-20 12:11:36 +01:00
Remy
c20215028c
Introduce PackageRef (#18023)
this advance the state of #17995

We propagate in ApiCommand and fix preprocessing
2023-12-15 11:45:08 +00:00
Remy
96f16df3c0
remove script/trigger/cantonFixture deps on scala-bindings (#17954)
Basically we remove the dependency of different components on "//language-support/scala/bindings" by:

- replacing com.daml.ledger.api.refinements.ApiTypes.Party by com.daml.lf.data.Ref.Party
- replacing com.daml.ledger.api.refinements.ApiTypes.ApplicationId by Option[com.daml.lf.data.Ref.ApplicationId] (here we use option as ApiTypes.ApplicationId allows empty string while Ref.ApplicationId does not).
- adding rounding logic for timestamp in com.daml.lf.data.Time.Timestamp and use it instead of the one from com.daml.api.util.TimestampConversion

Note we did not clean daml-sript export as it have never pass the alpha stage and will be dropped with the 3.x fork.
2023-12-05 15:08:09 +00:00
Remy
fae0a18def
[LF] limit length of package name (#17903) 2023-11-25 07:37:11 +01:00
Marton Nagy
78cc750714
Scala upgrade to 2.13.11 (#17803) 2023-11-13 09:05:39 +01:00
Remy
6ef062dac9
Revert "Nmarton/pekko rebased (#17789)" (#17796)
This reverts commit d310692d1b.

@remyhaemmerle-da messed up and merged the PR too fast.
2023-11-09 21:23:18 +00:00
Marton Nagy
d310692d1b
Nmarton/pekko rebased (#17789)
* Scala upgrade to 2.13.11
* Switch from akka to pekko
* Also disable gatling based libs to start from a clean stage
2023-11-09 18:17:33 +01:00
Remy
de97121cf2
linear time builder for order TreeSet (#17620) 2023-10-24 10:21:49 +02:00
Remy
fedcb1350b
Fix complexity of SMap deserialization (#17511) 2023-10-05 16:09:55 +00:00
Andreas Triantafyllos
44c0c51bb3
Refactor ledger/error (#17509) 2023-09-29 17:51:32 +02:00
Paul Brauner
a5cd445d3b
Introduce LF2 major version (#17348)
- Introduces a new major version, "2", in the daml_lf proto
- Adds new major versions to the compiler and the engine
- Updates all code that assumes only one major version
- Updates all code that assumes only one dev version
2023-09-13 10:01:42 +02:00
Remy
235abfa8ed
Revert "[LF] make Timestamp parsing consistent accross Java versions (#17053)" (#17170)
This reverts commit db7a5b3653.
2023-07-24 16:11:00 +00:00
Remy
db7a5b3653
[LF] make Timestamp parsing consistent accross Java versions (#17053)
* [LF] make Timestamp parsing consistent between Java 11 and Java 17

Between Java 11 and Java 17 there is one bug fix on Instant.parse
that expands the range of values that can be parsed into an
Instant. See https://bugs.openjdk.org/browse/JDK-8166138

Daml-LF happened to uses Instant.parse to parse a string into a
Daml-LF timestamp and we observe a different behavior when running
Daml on Java 11 and Java 17

additionally make explicit that conversion form java Instant and
string may drop nanoseconds, i.e. we create a lenient version that may
drop the significant nanoseconds (legacy or) and a strict
version that reject instant/string that cannot be converted without
loss of precision.
2023-07-20 16:18:01 +02:00
Remy
b26484da11
[Disclosures] Validate hash of disclosed contracts (#16470) 2023-03-16 10:19:54 +00:00
Remy
e6faddb750
Kill com.daml.lf.data.LawlessTraversals (#16516) 2023-03-10 13:34:14 +00:00
Gary Verhaegen
151e12b81a
bump copyright (#16002)
This is the result of:

- Updating `./COPY` to say `2023`.
- Running `./dev-env/bin/dade-copyright-headers update .`
2023-01-04 18:21:15 +01:00
Stefano Baghino
18ed316827
Accept uppercase English alphabet letters in user IDs (#15832)
* Accept uppercase English alphabet letters in user IDs

changelog_begin
Accept uppercase English alphabet letters in user IDs
changelog_end

* Fix title case in docs change

Co-authored-by: Sergey Kisel <98825453+skisel-da@users.noreply.github.com>

Co-authored-by: Sergey Kisel <98825453+skisel-da@users.noreply.github.com>
2022-12-08 16:44:54 +00:00
mziolekda
fd8439144a
fix eta-expansion and nullary method warnings [DPP-1281] (#15689)
* Fix flake jwt leeway test

* fix eta-expansion warnings

* fix nullary method errors

* Revert "Fix flake jwt leeway test"

This reverts commit 5e2fed648b.

* format
2022-11-24 12:28:41 +00:00
Remy
bef0f15d70
[LF] make qualified choice name a LF concept (#15599) 2022-11-17 22:44:18 +00:00
Remy
eb6b3cc13e
[LF] reactivate test for //daml-lf/data (#15598)
Those have been deactivated by mistake.
2022-11-16 16:51:46 +00:00
Remy
49f4d2979e
[LF] strengthen compilation flags (#15481) 2022-11-09 14:12:04 +01:00
Remy
0bba409d0e
[LF] Make ApiCommand.Exercise work directly with type constructor (#15360)
CHANGELOG_BEGIN
CHANGELOG_END
2022-10-26 18:13:38 +00:00
Remy
48abfeb9dc
LF: distinguish template Id from interface Id in exercise command (#14755)
preliminary work for #14747

CHANGELOG_BEGIN
CHANGELOG_END
2022-08-19 14:00:40 +02:00
Remy
4ac224b518
LF: Move TemplateOrInterface form language package to data package (#14748)
to be able to use it without direct dependence to language package.

CHANGELOG_BEGIN
CHANGELOG_END
2022-08-18 16:20:18 +02:00
Remy
1cbc21e719
[LF] Cleanup Relation data structure (#14471)
CHANGELOG_BEGIN
CHANGELOG_END
2022-07-21 13:03:29 +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
Nicu Reut
a792de39a5
Update scalafmt to 3.5.1. (#13584)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-28 09:57:04 +00:00
Remy
99a2f4384d
LF: Factorize language.Reference with validation.Context (#13608)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-20 11:57:16 +02:00
Gary Verhaegen
3416192735
fix typo in error message (#13594)
CHANGELOG_BEGIN

- The error message for invalid numerical conversion has been corrected:
  "loss of precision" instead of "lost of precision".

CHANGELOG_END
2022-04-14 09:17:50 +00:00
Sergey Kisel
a4f4300502
Naming and logging improvements [DPP-956] (#13270)
* Naming and logging improvements [DPP-956]

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-15 09:40:39 +01:00
Sergey Kisel
9a27edd656
Improve MessageDigest and Mac instance creation to solve lock contention [DPP-956] (#13221)
* Improve MessageDigest and Mac instance creation to solve lock contention problem [DPP-956]

changelog_begin
Scalability bottleneck in regard to hashing has been fixed in multiple places.
changelog_end
2022-03-09 22:15:32 +01:00
Remy
380dfa3502
LF: Add cause to internal error (#12965)
When an internal error is due to an unexpected exception, we wrap the
exception into the InternalError.

CHANGELOG_BEGIN
CHANGELOG_END
2022-02-16 11:06:10 +00:00
Remy
ab758fac71
LF: kill some old deprecated definitions (#12815)
CHANGELOG_BEGIN
CHANGELOG_END
2022-02-08 15:35:50 +00:00
Victor Peter Rouven Müller
aa45f48798
Upgrade to Scala 2.13.8 (#12506)
* Upgrade to Scala 2.13.8

changelog_begin
changelog_end

* Update hash for scala in nixpkgs

* update more hashes for scala upgrade

* Fix most warnings etc.

* Fix remaining errors etc.

* Fix formatting

* Resolve last errors hopefully

* Fix ledger api common build file

* Combine imports & revert accidental change that broke the CI run

* Rename exporting vals to scriptExport & minimize diff

* Remove more wrong changes

* moved warning around
2022-02-03 09:05:31 +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
Simon Meier
89d95e6d6c
user management: allow ':' in user ids (#12531)
Fixes #12520

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-21 15:39:42 +00:00
Simon Meier
6dd0eb774e
ledger api server: support auth0 usernames (#12308)
* ledger api: support Auth0 user names in user management

See the `IdString.UserId` and `IdString.ApplicationId` comments wrt the
character classes being introduced.

Many thanks to @cocreature for helping with deciding on the exact
restrictions of user-ids.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-10 12:58:43 +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
Remy
7ecc12645e
LF: make Struct lookup logarithmic (#12170)
CHANGELOG_BEGIN
CHANGELOG_END
2021-12-16 16:48:45 +00:00
Remy
39ee326a51
LF: Drop wrong toArraySeq method from ImmArray. (#12163)
The method is not correctly implement, as it should slice the
underlying array before returning it. Since it is not possible to
implement it in constant time, we simply drop it, in favor in other
conversion.

CHANGELOG_BEGIN
CHANGELOG_END
2021-12-16 10:18:52 +00:00
Simon Meier
ef4ae931d1
Add Ledger API scala client for user management (#12000)
scala bindings: add client for user management API

CHANGELOG_BEGIN
- [Scala bindings] add methods to call the user management API
CHANGELOG_END
2021-12-07 13:36:05 +01:00
Remy
1bb2fc28a3
LF: Simplify transaction versionning for interface (#11744)
We revert #11626, and just change the way transaction version is
computed:

- As before, Node version is calculated from the
  package of the template ID action.

- Transaction version is the max of the version of all the nodes,
   instead of the root nodes.

CHANGELOG_BEGIN
CHANGELOG_END
2021-11-18 22:46:46 +01:00
Moritz Kiefer
ac573551e7
Drop Scala 2.12 compatibility layer from //daml-lf/data (#11758)
* Drop Scala 2.12 compatibility layer from //daml-lf/data

changelog_begin
changelog_end

* Update daml-lf/data/src/main/scala/com/digitalasset/daml/lf/data/ImmArray.scala

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

* drop dependency on compat libraries

changelog_begin
changelog_end

Co-authored-by: Remy <remy.haemmerle@daml.com>
2021-11-18 17:34:06 +01:00
Andreas Herrmann
39a38d3a37
Update to Java 11 (#11512)
* Update to Java 11

changelog_begin
changelog_end

* Fix RoundingMode deprecation warnings

* Fix dep-ann warning

* Integer constructor

* JavaX annotation dependency

* javax.xml.bind was removed in Java 11

Using Guava as a replacement, since it is already a project dependency.

* JDK 11 no longer has a separate JRE tree

* Remove unused jdk_nix import

* remove now redundant jdk11_nix

* Java 8 --> 9 increased Instant.now() precision

See https://bugs.openjdk.java.net/browse/JDK-8068730

The precision of `Instant.now()` increased between Java 8 and Java 9.
On Linux and MacOS this doesn't seem to be a problem, as the precision
still seems to be at micro seconds. However, on Windows this now causes
errors of the following form:
```
java.lang.IllegalArgumentException: Conversion of Instant
2021-11-05T13:58:56.726875100Z to microsecond granularity would result
in loss of precision.
```
Suggesting that it now offers sub-microsecond precision.

`TimestampConversion.instantToMicros` had a check to fail if the
conversion lead to a loss of precision. In the specific failing test
case this is not a concern, so this adds a `roundInstantToMicros`
variant that avoids this kind of error.

* TMP round timestamps

* Revert "TMP round timestamps"

This reverts commit af8e261278.

* Skip versions before 1.6.0 in migration tests

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-11-18 14:48:37 +00:00
Moritz Kiefer
c8ace8b1cf
Factor kind projector target into a variable (#11759)
Seems nicer than trying to format a string everywhere

changelog_begin
changelog_end
2021-11-18 09:51:43 +01:00
Remy
15b925a116
LF: Compute transaction version as the maximum of the children (#11626)
fixes #11377

CHANGELOG_BEGIN
CHANGELOG_END
2021-11-12 17:00:07 +01:00
Stephen Compall
b87acab897
foldLeft, foldRight, other Foldable specializations (#11592)
* FoldableContravariant, a mapping for Foldable instances

* use FoldableContravariant to specialize several ImmArraySeq, NonEmpty methods

* folding specializations for ImmArray

* a few docs for FoldableContravariant

* specializations for FrontStack

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END
2021-11-09 22:24:26 +00:00
nicu-da
570160b718
Add LoggingValue instance for Time.Timestamp (#11444)
CHANGELOG_BEGIN
[daml LF] - Add LoggingValue instance for Time.Timestamp
CHANGELOG_END
2021-10-28 07:01:04 -07:00
Robert Autenrieth
3587eb84a2
Use Timestamp instead of Instant (#11356)
changelog_begin
changelog_end
2021-10-26 16:30:10 +02:00
pbatko-da
c928f0e560
[Short] Typo (#11400)
CHANGELOG_BEGIN
CHANGELOG_END
2021-10-26 12:28:43 +02:00