Commit Graph

554 Commits

Author SHA1 Message Date
Remy
68c8a364da
Add package name to transaction (#17997)
this advances the state of #17995
2023-12-08 08:55:05 +01:00
Simon Maxen
935b351f74
Enable shared keys for vDev (#17946) 2023-12-05 13:48:06 +00:00
Paul Brauner
9dbb53e97e
introduce lf_version_default_or_latest in bazel and use it everywhere were I had replaced the implicit default version with 'latest' (#17930) 2023-11-29 15:53:53 +01:00
Paul Brauner
a572eeabf8
Replace 2.dev with 2.1 everywhere in the engine (#17878)
* re-enable v2 tests temporarily

* replace 2.dev with 2.1 where it makese sense

* replace more 2.dev with 2.1

* Re-disable the long V2 tests
2023-11-23 10:17:54 +00:00
Paul Brauner
2b28e59017
Introduce LF 2.1 (#17865) 2023-11-23 08:59:14 +01:00
Paul Brauner
890dee12bf
Tie right-to-left evaluation order to LF v2 (#17811)
* Tie right-to-left evaluation order to LF v2

* fix typo
2023-11-14 10:34:31 +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
ac2250712f
"[LF] drop transaction version < 14 (#17690) 2023-11-08 08:54:38 +01:00
Remy
851ac87015
fix typo "sey" in a message error (#17764)
Co-authored-by: Meriam Lachkar <meriam.lachkar@digitalasset.com>
2023-11-07 20:55:23 +01:00
Remy
a83a84b326
Add support for explicit disclosure in daml script 3 (#17723) 2023-11-07 15:46:20 +00:00
Remy
dfeb788e8b
[Upgrade] make exercise upgradabale (#17752) 2023-11-07 15:27:16 +00:00
Simon Maxen
ae5e9feda9
Allow for the construction of shared GlobalKeys.
* Revert "Add SharedGlobalKey"

This reverts commit 6592cb7bd5.

* Adding shared flag to GlobalKey

* Remove shared flag from GlobalKey

* Support old and new grcp error parsing

* Add tests for hashContractKey
2023-11-06 20:00:38 +00:00
Gary Verhaegen
fb73ab1614
Pass iterationsBetweenInterruptions config to Speedy (#17725)
Co-authored-by: Christian Grigis <christian.grigis@digitalasset.com>
2023-11-01 15:25:36 +00:00
Remy
8cfe4c01a3
Check qualified name when upgrading a contract (#17662) 2023-10-31 09:53:17 +01:00
Simon Maxen
6592cb7bd5
Add SharedGlobalKey (#17650)
* Add SharedGlobalKey

* Update with review comments

* Add temporary canton compatibility
2023-10-26 14:31:36 +01:00
Remy
422b6934d6
[Speedy] improve upgrade failure error message (#17634) 2023-10-25 15:16:11 +00:00
Samuel Williams
14f9f58dcf
Add support for querying upgraded contracts to daml-script (#17629) 2023-10-23 17:24:56 +01:00
Remy
9575b72a01
[Engine] allow (up/down)grade in create command (#17451)
This PR provides a basic API for ledger client to create contracts with down/up-grade support.
One can send a create Command where the payload contains

-  (upgrade path) less fields than requires by the package definition (as long as the missing fields are optional), in such case the engine assume those fields are None
-  (downgrade path) more fields than requires by the package definition (additional field should be node), in such case the engine drop those fields.

Here are some restrictions we assume for this first step:

 - For the sake of simplicity, we forbid field reordering when upgrade is enable
 - The package of explicit disclosed contract is required
 - we ignore package ID complelty inside value (probably not what we want in final version)
2023-10-19 18:02:02 +00:00
Paul Brauner
f4ee00361e
Make LF v2 non backwards-compatible with LF v1 in the compiler (#17492)
* initial commit

* split gen-stable-packages-v_i into two targets

* rename compatibleWith to canDependOn

* update damlc integration tests annotation to allow for 2.x

* use the right package ID for preconditionFailed when compiling to V2

* fuse stable-packages-v1 and stable-packages-v2 into one single filegroup

* Fix DA.Daml.LF.Ast.Tests

* remove leftover 'undefined' in Version.hs

* progress on fixing DataDependencies.hs

* fix Cross-SDK typeclasses test for 2.dev

* Fix the 'Typeclasses and instances' data dependency test

* Update comment

* fix //compiler/damlc/tests:packaging

* Add TODO

* parameterize the machine by the langage version, hardcode v1 in script v2, v2 in script v2, v1 in exports

* get EngineTests to pass

* fix more tests

* fix canton integration tests

* formatting

* fix more tests

* fix transactionversiontest

* fix exceptiontest

* Fix ValueEnricherSpec

* Fix EngineInfoTest

* fix PartialTransactionSpec

* fix upgragetest

* fix TransactionSnapshot

* Fix ContractKeySpec

* Fix ReinterpretTest

* fix InterfaceViewSpec

* fix InterfacesTest

* fix stable package v1 names

* fix validate.sh tests

* formatting

* Fix ChoiceAuthorityTest

* fix explicit disclosure test

* Fix SpeedyTest

* formatting

* Fix integration test

* fix data dependency tests

* fix package vetting count, increased due to metadata being added

* Redact stable package IDs in error messages in order for the ExceptionSemantics test to work for both v1 and v2

* cleanup

* fix Daml2ScriptTestRunner

* fix JsonApiIT and daml-script golden tests

* fix daml3-script runner test

* enable v2 for all integration tests

* formatting

* fix NodeSeedsTest

* fix since-lf annotations

* add comments, improve consistency

* stop hardcoding V1 in runPureExpr and runPureSExpr

* formatting

* remove harcoding of LFv1 in ConcurrentCompiledPackages.apply

* Parameterize Compiler.Config.Default with major language version

* remove global parser implicit and default package ID and language version
2023-10-11 11:40:17 +02:00
Remy
176c8505b9
[Speedy] Move back contract cache in speedy (#17523)
For reference, this undoes some of the changes from #17171.
2023-10-06 10:04:09 +02:00
Remy
4a8fcd4098
[Speedy] Test node seeds are maintained properly in aborted rollback (#17524)
Test for the bug DACH-NY/canton#14712 fixed in #16422

This is adapted from a minimal example designed by @simonmaxen-da to reproduce the bug.
2023-10-05 17:47:01 +02:00
Moisés Ackerman
e6bf01717f
Remove more internal uses of Scenario (#17375)
* daml-lf-test.sh no longer takes damlc argument

* Split //daml-lf/tests:BasicTests into engine and integration tests

* Remove unused //daml-lf/engine:Optional

* Convert //daml-lf/tests:AuthorizedDivulgence into integration test

* Convert //daml-lf/tests:DontDiscloseNonConsumingExercisesToObservers into integration test

* Convert //daml-lf/tests:ConjunctionChoices into integration test

* Convert //daml-lf/tests:ContractKeys into integration test LFContractKeys

* Move //daml-lf/tests:AuthTests to //daml-lf/engine:AuthTests

* Split //daml-lf/tests:LargeTransaction into ledger and non-ledger tests

* Remove scenarios in //language-support/java/codegen:ledger-tests-model

* Remove unused scenarios in //test-common:src/main/daml/model/Test.daml

* Remove 'enable_scenarios' param in da_scala_dar_resources_library

* Remove 'enable_scenarios' param in damlc_compile_test

* Remove '--enable-scenarios=yes in //compiler/damlc/tests:deterministic

* Convert /daml-lf/tests/scenario/dev/experimental to integration test

* Convert /daml-lf/tests/scenario/dev/interfaces to integration test

* Convert /daml-lf/tests/scenario/stable/big-numeric to integration test

* Convert /daml-lf/tests/scenario/stable/contract-key-through-exercises to integration test

* Convert /daml-lf/tests/scenario/stable/contract-keys to integration test

* Convert /daml-lf/tests/scenario/stable/divulge-iou to integration test

* Convert /daml-lf/tests/scenario/stable/embed-abort to integration test

* Convert /daml-lf/tests/scenario/stable/eval-agreement to integration test

* Convert /daml-lf/tests/scenario/stable/exception-auth to integration test

* Convert /daml-lf/tests/scenario/stable/gen-map to integration test

* Convert /daml-lf/tests/scenario/stable/many-fields to integration test

* Convert /daml-lf/tests/scenario/stable/mustfailcommit to integration test

* Convert /daml-lf/tests/scenario/stable/mustfailinterpretation to integration test

* Convert /daml-lf/tests/scenario/stable/mustfails to integration test

* Convert /daml-lf/tests/scenario/stable/no-contract-ids-in-keys to integration test

* Convert /daml-lf/tests/scenario/stable/pass-time to integration test

* Convert /daml-lf/tests/scenario/stable/pattern-matching to integration test

* Convert /daml-lf/tests/scenario/stable/timeout to integration test

* Remove scaffolding for daml-lf/tests/scenario

* Remove unused 'enable-scenarios' flags

* Remove unused daml-lf/tests/daml-lf-test.sh

* Remove unused daml-lf/tests/scala-test-limited-stack.sh

* Remove comments about deprecated flag 'DontDivulgeContractIdsInCreateArguments' in AuthorizedDivulgence integration test

* Add 'create' in LfStableTimeout:testScriptLoop

* add TODO for nesting limits test in LfStableMustFails

* Move LfStableMustFails expected ledger files into subdir
2023-09-28 16:29:46 +01: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
nickchapman-da
0cac8c29a3
[engine] call: ResultNeedUpgradeVerification (#17360) 2023-09-07 10:18:41 +01:00
Simon Maxen
2d3ac27383
Revert "Add ResultNeedCreate (#17243)" (#17321)
This reverts commit 7ba1e6754c.
2023-08-31 11:18:14 +01:00
Simon Maxen
8b92c9294b
Document ResultNeedUpgradeVerification differences between submission and reinterpretation (#17277) 2023-08-30 14:04:18 +01:00
Paul Brauner
7585f72d7a
Add flag-protected right-to-left evaluation (#17253)
Right-to-left evaluation allows for a faster and simpler interpreter, but is incompatible with the semantics of Daml 2.x. Adding it behind a flag so we can switch to it in Daml 3.0.

See PR #17253 for ample details.
2023-08-15 13:10:44 +00:00
nickchapman-da
4b60e35a5d
[engine] Restructure contract caching (#17171) 2023-08-09 16:09:13 +00:00
Simon Maxen
7ba1e6754c
Add ResultNeedCreate (#17243) 2023-08-07 17:51:53 +01:00
nickchapman-da
3e846d96ac
Final wiring of enable-contract-upgrading feature flag (#17179) 2023-07-26 13:40:53 +00:00
Samuel Williams
aecf70c900
Implement TrySubmit in daml3-script (#17043)
Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
Co-authored-by: Remy Haemmerle <Remy.Haemmerle@daml.com>
2023-07-25 18:22:31 +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
nickchapman-da
42d5810bfe
Extend engine Result type with: ResultNeedUpgradeVerification (#17160) 2023-07-20 15:53:42 +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
nickchapman-da
9fddcb956c
Thread enableContractUpgrading through engine. (#17139) 2023-07-20 12:54:45 +00:00
Simon Maxen
2b931bff7c
Add placeholder flag for contract upgrading (#17126)
* Add placeholder flag for contract upgrading

* SKIP_DEV_CANTON_TESTS=true

* Remove devMode

---------

Co-authored-by: Nick Chapman <nick.chapman@digitalasset.com>
2023-07-18 09:16:58 +00:00
Remy
e04dfb5fa1
[LF] cleanup Result#consume (#17125) 2023-07-13 17:12:02 +02:00
nickchapman-da
8a3a7d20f9
[engine] improve speedy record value representation (#17054) 2023-06-30 15:25:50 +00:00
Remy
8e1bfb31f8
remove dead engine option (#17017)
forgotten in #12464
2023-06-19 15:18:45 +02:00
Remy
dd98cbec76
[LF] Cleanup API for disclosed contract (#16920) 2023-05-31 14:39:53 +02:00
Simon Maxen
761071f215
Tree transaction building (#16912)
* With test transaction building refactor
2023-05-26 14:03:09 +01:00
Matthias Schmalz
6d82c6bf00
Removing securityTestLayer from test evidence (#16843)
The securityTestLayer property used to be defined on a per test suite basis. The value may vary from test case to test case. Therefore, it is not always possible to assign a correct value. Removing the property to resolve this problem.

CHANGELOG_BEGIN
CHANGELOG_END
2023-05-10 10:04:49 +00:00
nickchapman-da
353c6d903d
cleanup code for consortium design #1 -- withAuthority (#16708) 2023-04-19 11:12:36 +01:00
nickchapman-da
8ad44f5fbc
kill Node.Authority with fire (#16524) 2023-04-18 14:16:44 +01:00
nickchapman-da
ac68bdf416
[engine] kill Daml withAuthority / LF WITH_AUTHORITY (#16548) 2023-04-17 16:50:10 +01:00
nickchapman-da
859d69b1a5
[engine] make authorizers field explicit in Node.Exercise (#16541)
* make authorizers field explicit in TX Node.Exercise

* use Option for exe-node choiceAuthorizers field, to be explicit about when old/default behaviour occurs
2023-04-06 13:05:44 +01:00
Matthias Schmalz
b967ef3e6d
Revised ScalaDocs of DAML engine to make security relevant assumptions explicit (#16555)
CHANGE_LOG_BEGIN
CHANGE_LOG_END
2023-03-21 16:01:20 +00:00
Remy
b26484da11
[Disclosures] Validate hash of disclosed contracts (#16470) 2023-03-16 10:19:54 +00:00