Commit Graph

647 Commits

Author SHA1 Message Date
Moisés Ackerman
c1f7a87572
Add feature flag for scenarios (off in LFv2) (#17927)
* Add feature flag for scenarios (off in LFv2)

* whitespace

* Use rule for old-proj-2.1.dar
2023-11-29 17:01:44 +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
mziolekda
2533965c8d
Add config parameter for custom scopes in http-json (#17727)
* Add config parameter for custom scopes in http-json

* fix daml-script

* Add tests

* fixes from code review
2023-11-21 14:07:11 +01:00
Remy
ff7b5c7d51
[Daml-Script] minimal support for explicit disclosure (#17818)
Co-authored-by: Samuel Williams <samuel.williams@digitalasset.com>
2023-11-17 11:30:08 +01:00
mziolekda
8e0b71bb15
clean up test common (#17846)
* move stuff around inside test-common

* move timeout stuff to lapitt, where it is used

* move logging stuff to ledger/error

* move StreamConsumer to libs-scala/grpc-test-utils

* remove dead usages of test-common

* move SimpleHttpServer to a dedicated lib

* format

* final cleanup of the test-common

* add new libraries to maven
2023-11-15 22:36:03 +00:00
Samuel Williams
f9308520e4
Added assertions that failing tests do fail (#17833)
* Added assertions that failing tests do fail

* failing -> broken
2023-11-15 14:04:25 +00:00
mziolekda
b81ee69abe
disentangle ledger api (#17831)
* make testing-utils independent of ledger-api

* remove dead files

* move non ledger-api stuff to libs-scala
2023-11-14 22:44:10 +01:00
Samuel Williams
6d7543d84c
Add ensure clause check whenever contractInfo is needed (#17822)
* Add ensure clause check whenever contractInfo is needed

* Update comment

* Avoid double precondition on create

* Update evaluation order test with new precondition calls

* Update security evidence
2023-11-14 16:16:21 +00:00
Paul Brauner
751423d5a7
Disable v2 integration tests for now (#17813)
* disable v2 integration tests

* remove unused import
2023-11-14 12:08:22 +00:00
Marton Nagy
6933514df5
Switch from Akka to Pekko (#17814)
* Automated renames by bash script

This commit is exclusively contains changes by the bash script.
For the bash script is present at the pull request.

* Manual pekko migration changes

* adapt fully qualified name references
* adapt pekko package declarations
* adapt bazel files with dependency changes
* adapt canton pekko lib shade_rule
* adapt logger configuration declarations
* pin maven dependencies
* revert incorrect changes by script to compatibility module

Workarounds for further TODOs:
* disable http-json-perf and libs-scala/gatling-utils modules to maintain clean pekko dependencies (without akka)
* disable GraphQLSchemaSpec test (sangria library needs to be upgraded)

* Formatting
2023-11-13 23:22:22 +00:00
Samuel Williams
0e574dbd29
Further upgrades tests (#17735)
* Further upgrades tests

* Add ticket to TODO
2023-11-13 09:05:02 +00:00
Marton Nagy
78cc750714
Scala upgrade to 2.13.11 (#17803) 2023-11-13 09:05:39 +01:00
Paul Brauner
7d1521eeca
Port daml repl to LF2 (#17750)
* add an lf-major-version flag to the repl service and pass it from the haskell client

* test LF2 in the daml-repl tests

* formatting

* formatting

* remove obsolete TODO

* fix //compiler/damlc/tests:repl

* port repl-functests to LF v2

* do not assume that LFV2 => dev

* address Moises' comments
2023-11-10 18:17:48 +00: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
Moisés Ackerman
495c0a0192
Fix daml3-script query question timeouts (#17792)
* Add failing test

* Add failing daml3-script+grpc test

* ScriptF:parse expects 'QueryACS' instead of 'Query' for 'query' question
2023-11-09 17:12:09 +01:00
Samuel Williams
d1f46a3e23
Implement tryCommands for internal testing (#17715) 2023-11-09 12:35:41 +00:00
Simon Maxen
ba34290e23
Inject language version lookup into gRPC error parsing (#17767) 2023-11-08 14:49:53 +00: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
Remy
6af384a840
make changing default scalacopts a bit nicer (#17751) 2023-11-03 15:16:00 +00:00
Samuel Williams
637ff67ea0
Upgrades testing via daml-script (#17610)
* Implement vetDar and unvetDar
Blocked by canton not returning uploaded dars

* Upgrades testing infra/IT

* Fix HttpServiceTestFixture

* Fix some tests

* Fix cantonRunner for windows

* Add delay after vet actions so topology transactions can land

* Implement invalid data upgrades tests

* Add temporary internal setContractUpgradingEnabled flag to daml-script

* Switch to setProvidePackageId

* Write choice and multi-participant tests

* Formatting

* Remove unused import

* Address reviews

* Update errors

* Fix canton runner for windows

* Address review comments

* Add new proto to artifacts

* avoid pushing canton admin proto as maven artifact (#17742)

---------

Co-authored-by: Remy <remy.haemmerle@daml.com>
2023-11-03 14:10:15 +00:00
Samuel Williams
05ba815dbd
Add temporary internal setContractUpgradingEnabled flag to daml-script (#17695)
* Add temporary internal setContractUpgradingEnabled flag to daml-script

* Switch to setProvidePackageId
2023-10-30 16:09:24 +00:00
Samuel Williams
c899320718
Support upgrades in daml-script submissions (#17676)
* Support upgrades in daml-script submissions

* Fix export client test
2023-10-30 09:21:03 +00: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
Moisés Ackerman
d5ec537cee
Daml.Script: Add trySubmit{,Multi}Concurrently (#17608)
* Update docs for SubmitError:TemplatePreconditionViolated

* Daml.Script: add 'trySubmit{,Multi}Concurrently'

* Make trySubmitConcurrently fully sequenced when using IdeLedger

* Add test cases for trySubmitConcurrently

* Test trySubmitConcurrently in Daml3ScriptTestRunnerDev

* Handle LOCAL_VERDICT_LOCKED_{CONTRACTS,KEYS} in gRPCi Ledger Client

* Move 'trySubmit{Multi}Concurrently' to 'Daml.Script.Questions.Submit.Internal'

* Apply review feedback

* Test 'trySubmitConcurrently' using AbstractScriptTest instead of DamlScriptTestRunner

* Apply review feedback: trySubmitConcurrently returns List instead of Seq
2023-10-25 12:12:43 +00:00
Remy
de97121cf2
linear time builder for order TreeSet (#17620) 2023-10-24 10:21:49 +02: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
Raphael Speyer
ff8316320a
LT-2: add https support to JSON API (#17516)
JSON API will be served from an HTTPS endpoint if the config includes a `server.https` section.

Note https://digitalasset.atlassian.net/browse/LT-37 to enable the unit test on windows and mac systems.
2023-10-17 13:10:30 +11: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
Paul Brauner
158cdd90d7
Fix the external name of daml3-script.dar to mention 2.dev (#17512)
* Fix the external name of daml3-script.dar to mention 2.dev

* make the compilation and distribution of daml3-script dars more future proof

* fix path in ci/copy-unix-release-artifacts.sh
2023-10-03 09:16:00 +00:00
Remy
623f305e9c
Move canton directory to let place for code drop (#17506) 2023-09-29 14:37:01 +00: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
Moisés Ackerman
6ae0e0111e
Upgrade to Bazel 5 (again) (#17319)
* Update to rules_haskell v0.16
* Update comments re bazel patches
* clean up bazel overrides
* Upgrade to Bazel 5.2.0
* Remove '--distinct_host_configuration=false'
* Update buildifier to 6.3.2
* Suffix macos and ubuntu caches with yyyymm
* bump windows cache to v14
* [REVERTME] bump linux/macos/darwin timeout to 4h
2023-09-01 15:15:36 +02:00
Remy
99f466d47b
[Script] Factorize out Generic Free Monad Runner (#17194) 2023-08-28 18:54:30 +02:00
Samuel Williams
1a771dcb13
Refactor daml-script cli interface to be unified (#17215)
* Refactor daml-script cli interface to be unified

* Add --upload-dar flag.

* Fix tests with new uploadDar flag

* Initial daml-script binary testing

* Tests for argument passing and failure behaviour

* add participant config and ide tests

* Add windows support to tests

* Fix missing tls error assertion

* Update changelogs
2023-08-24 15:58:32 +01:00
Samuel Williams
9179b2e7d0
Jar licensing (#17299)
* Add _distribute.jar target with correct license
Use it everywhere

* Fixes from review

* Change NOTICES to NOTICES.txt for consistency
2023-08-22 15:56:29 +01:00
Carl Pulley
195795537d
interpretation Error ValueNesting should not be in Dev (#17241) 2023-08-22 09:01:30 +01:00
Carl Pulley
38085a8787
Improve SubmitError show instance (#17216) 2023-08-10 11:05:07 +00:00
Remy
0918843090
[Script] Runner does not return the machine is using anymore (#17255) 2023-08-09 13:02:36 +00:00
dylant-da
5c31bc3f21
More fixes to ContractNotFound AdditionalInfo (#17211)
* Replace Text with AnyContractId in AdditionalInfo.templateIdentifier

Also, subsume ContractNotActive variant into AdditionalInfo

* lint

* rename contractIdentifier to something clearer

* remove ContractNotActive constructor, update indices

* add isNotActive for Daml3ScriptTrySubmit tests

* Use isNotActive on ContractNotFound instead of ContractNotActive

* Remove show instance for deleted ContractNotActive variant

* fix variant numbers for ContractNotFoundAdditionalInfo

* Expect different Daml3ScriptTrySubmit:contractNotActive per test ledger

* temp: swap expectations

* Disable cantonFixtureDebugMode check
2023-08-09 11:06:58 +01:00
Samuel Williams
34210007e7
Rename UserError and DevError (#17225)
* Rename UserError and DevError

* Update error docs

* Fix ledger test tool

* re-enable daml3scripttestrunnerdev
2023-08-09 09:09:15 +01:00
azure-pipelines[bot]
2f4b494fa5
bump canton to 2.8.0-snapshot.20230804.10940.0.ve26becd2 (#17236)
bump canton to 2.8.0-snapshot.20230804.10940.0.ve26becd2

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2023-08-06 13:32:51 +02:00
Samuel Williams
1ac239c342
Switch daml3 script question names to explicit (#17153)
* Switch daml3 script question names to explicit
added question versions

* Add TrySubmit command name
2023-07-28 14:53:10 +01:00
dylant-da
777779f363
Add additional debugging info to ContractNotFound where possible/allowed (#17183)
* Add additional debugging info to ContractNotFound where possible/allowed

* import foldMap

* add variants and conversion logic for structured ContractNotFound errors

* lint

* Add Identifier for template, document invariant in ContractNotFound

* Move ContractNotFoundAdditionalInfo to ContractNotFound.AdditionalInfo

* lint

* Don't export construtors for ContractNotFoundAdditionalInfo

* Test to make sure ContractNotFoundAdditionalInfo is hidden
2023-07-27 16:44:58 +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