Commit Graph

1452 Commits

Author SHA1 Message Date
Carl Pulley
6ed88105bb
Refactor and simplification of Transaction#processNodes
* fixes #14183

CHANGELOG_BEGIN

- [DAML Studio] Refactor and simplification of Transaction#processNodes to avoid need for custom state during processing. Refactor of Transaction#processTransaction to make processing workflow more transparent and easier to unit test. See https://github.com/digital-asset/daml/issues/14183 for details.

CHANGELOG_END
2022-06-28 13:49:41 +02:00
Moisés Ackerman
0d1ef10472
Retroactive Implements - Scala side (#14130)
* Add CoImplements to daml-lf AST

* Add AstSpec case for duplicate co-implements in interface

* Add placeholders for CoImplements in daml-lf validation

* Handle CoImplements in daml-lf iterators

* Handle CoImplements in daml-lf scala decoder

* Test DefInterface components in DecodeV1Spec

* Handle CoImplements in daml-lf (testing) parser

* Handle CoImplements in daml-lf (testing) encoder

changelog_begin
changelog_end
2022-06-23 17:13:38 +00:00
Remy
2ddd744a91
[Engine] fix and test #14175 (#14206)
follow up of #14175

this is part of #14171

CHANGELOG_BEGIN
CHANEGELOG_END
2022-06-16 22:45:50 +02:00
Stephen Compall
707c3e1a52
accept standard hlists as record/variant specs (#14167)
* link to #14189

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Raymond Roestenburg <98821776+ray-roestenburg-da@users.noreply.github.com>
2022-06-16 15:05:50 +00:00
Remy
2d5094160e
[Engine] clean key uniqueness mode (#14194)
This is a follow up of #14175 and #14176.  

Basically
-  we kill the `On` mode which is not used anymore.
- we factorize the visibility check.
- we rename `LocalContractNotVisible` into `ContractNotVisible`

CHANGELOG_BEGIN
CHANGELOG_END
2022-06-16 12:04:45 +00:00
Moisés Ackerman
78cc57b243
Add failing daml-test-file (#14176)
fix #14171

CHANGELOG_BEGIN

* [Bugfix] fix failing by-key ops after roll-backed archive and create
  See https://github.com/digital-asset/daml/issues/14171

CHANGELOG_END
2022-06-15 20:00:04 +00:00
nickchapman-da
b023bebfda
Track locally created contracts correctly through rollback. (#14163)
changelog_begin
changelog_end

temp mod to get build

 make sure to maintain localContractSet

engine test for: ExerciseAfterRollbackCreate

fix ContractStateMachineSpec testcases and add new case

rebase and fix build failure

fix test (and comment)

fix evaluation order test fails: revert the failure back to be the expected ContractNotActive, instead of ContractNotFound

improve new test (creates in try are rolled back) to check the DamlException thrown

remove ptx.localContracts. instead use ptx.contractState.locallyCreated

improve test name

un-inline ActiveLedgerState.consume

Set() --> Set.empty

add comments for new components of ContractStateMachine

combine checks: consumedBy / inactive

improve comments, doc and test-evidence
2022-06-15 15:09:37 +00:00
Moritz Kiefer
4357310bad
Improve docs on ContractStateMachine (#14185)
* Improve docs on ContractStateMachine

Based on Matthias suggestions.

changelog_begin
changelog_end
2022-06-15 16:50:23 +02:00
Remy
7a4fc9f5fe
Engine: systematic check of visibility for by-key operations (#14175)
instead of only for local contract

CHANGELOG_BEGIN
CHANGELOG_END
2022-06-15 15:15:45 +02:00
Carl Pulley
7d76460ee8
DAML Studio Activeness checks
* fixes #13835

CHANGELOG_BEGIN
  - [Daml Studio] Fix a bug where some contracts were considered inactive even though their consumption was under a rollback. See https://github.com/digital-asset/daml/issues/13835 for details
CHANGELOG_END
2022-06-15 11:35:18 +01:00
Moritz Kiefer
d233bfa4b4
Add missing activeness check when reading from globalKeyInputs (#14080)
* Add missing activeness check when reading from globalKeyInputs

changelog_begin

- Engine. Fix lookup by key. See issue Lookup archived contracts may succeed when combined with rollback exceptions #14107 for more details.

changelog_end
2022-06-13 19:27:08 +00:00
Moritz Kiefer
3b0cbf4c73
Handle nested rollbacks in inactiveContracts properly (#14161)
changelog_begin
changelog_end
2022-06-13 15:45:31 +00:00
Moritz Kiefer
b451edbc66
Add PoC implementation of interface views to Daml Engine (#14116)
changelog_begin
changelog_end
2022-06-09 13:46:27 +02:00
Stephen Compall
1d20cbf887
hide unresolved/resolved states in lf/interface library (#14115)
CHANGELOG_BEGIN
CHANGELOG_END
2022-06-08 13:44:56 +00:00
Sergey Kisel
1d8f195438
Sandbox Classic Removal in Tests (#13934)
CHANGELOG_BEGING
CHANGELOG_END
2022-06-07 19:54:52 +00:00
Andreas Lochbihler
2ac54ce1f4
add advance to contract state machine (#14077)
CHANGELOG_BEGIN
CHANGELOG_END
2022-06-07 12:09:58 +02:00
Moisés Ackerman
ee394702b8
Add CoImplements to DefInterface in protobuf (#14053)
* Update docstring for TemplateImplements.tpiMethods
    * The change happend on https://github.com/digital-asset/daml/pull/13142

* Add CoImplements to DefInterface in protobuf
    * Also adds encoding/decoding logic in the haskell side

* Part of https://github.com/digital-asset/daml/issues/14047

changelog_begin
changelog_end
2022-06-03 16:05:18 +00:00
Remy
ae8f50dbb8
LF: drop inheretedChoices from Implements (#14068)
part of #13653

CHANGELOG_BEGIN
CHANGELOG_END
2022-06-02 18:48:54 +00:00
Robin Krom
3ff8c1055e
disclosures: fix buildDiscTable (#14071)
* disclosures: fix buildDiscTable

This removes the pattern match on the template id for the argument
record in buildDiscTable. The arguments don't contain the template id
any longer.

CHANGELOG_BEGIN
CHANGELOG_END

* Update daml-lf/engine/src/main/scala/com/digitalasset/daml/lf/engine/Engine.scala

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2022-06-02 14:56:06 +00:00
Remy
09034a265d
ScenarioRunner: move the building of the speedy machine (#14024)
CHANGELOG_BEGIN
CHANGELOG_END
2022-06-02 16:40:48 +02:00
Remy
f2888f52ec
LF: update governance (#14065)
CHANGELOG_BEGIN
CHANGELOG_END
2022-06-02 16:20:59 +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
Stephen Compall
4caba375e5
in daml-lf/interface, resolve choices directly from DefInterface (#14057)
CHANGELOG_BEGIN
CHANGELOG_END
2022-06-02 12:19:08 +00:00
Andreas Lochbihler
4cfffec87a
Extract a contract state machine for transaction interpretation and validation (#14044)
CHANGELOG_BEGIN
CHANGELOG_END
2022-06-02 09:39:37 +00:00
Marton Nagy
f5a2539d6f
Add globalKeyMapping to WriteService [DPP-1067] (#14026)
The field globalKeyMapping is recently added to
lf.transaction.Transaction.Metadata, and which is
computed by the Engine.
This field might be needed for processing by WriteService
implementors.
This PR adds this to the WriteService.

changelog_begin
Global contract key mapping is added to WriteService.
changelog_end
2022-06-01 10:08:18 +02:00
Stephen Compall
96a6fe62e4
choice name overloading in lf/interface (#13938)
* introduce TemplateChoices to mediate template choice resolution
* if any resolutions fail in EnvironmentInterface, discard the template's resolution
* if any resolutions fail in Interface, discard the remaining unresolved

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-31 08:41:48 -04:00
Remy
62877ab78b
LF: Cleanup Fetches (#13804)
- Rename fetch to fetch_template
- Rename misnamed fetch_by_interface to fetch_interface
- Drop dead fetch_by_interface

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-30 18:55:41 +02:00
Sergey Kisel
168f943ff0
Revise the config to use a hierarchical structure [DPP-1029] (#13629)
* Revise the config to use a hierarchical structure [DPP-1029]

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-30 18:02:53 +02:00
Remy
365fa11b10
PartialTransaction: make clear domain of keys is subset of globalKeyInputs (#14015)
CHANGELOG_BEGIN
CHANGELOG_END
2022-05-30 15:27:31 +00:00
Moritz Kiefer
3f20361cf8
Drop duplicatedContractKeys (#13999)
Not used by anyone anymore and broken under exceptions.

changelog_begin
changelog_end
2022-05-27 12:51:54 +00:00
Remy
12a488f6a4
LF: Expose the keys requested during interpretation (#13983)
CHANGELOG_BEGIN
CHANGELOG_END
2022-05-25 19:03:35 +02:00
Remy
d3264236ba
Interface: drop collision check between inherited choice name (#13939)
CHANGELOG_BEGIN
CHANGELOG_END
2022-05-24 17:53:18 +02:00
Stephen Compall
b307cd8406
remove some contract-ID generality from TypedValueGenerators (#13957)
* move where ContractId arbitrary instance passes into ValueAddend
* adjust ValueAddend users to deal with moved Arbitrary instance

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-24 06:28:34 -04:00
Robin Krom
29f79fc756
disclosures: support in engine (#13896)
* disclosures: support in engine

This adds support for contract disclosures in the engine.

Fixes #13863.

CHANGELOG_BEGIN
CHANGELOG_END

* move VersionedContractInstance to Value

* normalization/typechecking

* Update daml-lf/engine/src/main/scala/com/digitalasset/daml/lf/engine/Error.scala

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

* Update daml-lf/engine/src/main/scala/com/digitalasset/daml/lf/engine/preprocessing/CommandPreprocessor.scala

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

* Update daml-lf/engine/src/main/scala/com/digitalasset/daml/lf/engine/preprocessing/CommandPreprocessor.scala

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

* remove processImmArray

* throw exception in foldl

* check for duplicate contract keys in disclosures

* added issue for removal of empty disclosure assertion

* format

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Remy <remy.haemmerle@daml.com>
2022-05-23 16:13:46 +02:00
Remy
ea0d101913
Interface: Rename fixedChoice to choice (#13883)
CHANGELOG_BEGIN
CHANGELOG_END
2022-05-17 12:03:53 +02:00
Remy
6f6a3052a1
Repurpose templateId in ExerciseCommand and add interfaceId in ExerciseEvent (#13660)
part of #13653

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-16 15:30:07 +00:00
Remy
78642f2d4b
Speedy: Factorize interface exercise with or without guards (#13803)
CHANGELOG_BEGIN
CHANGELOG_END
2022-05-10 11:56:19 +02:00
Remy
7894fa33a7
Speedy: Delete dead code (#13809)
CHANGELOG_BEGIN
CHANGELOG_END
2022-05-06 16:34:34 +02:00
nickchapman-da
0c368aafdc
always typecheck the rhs of let expressions (#13779)
* always typecheck the rhs of let expressions

changelog_begin
changelog_end

* update security evidence

* test for new parer syntax: let _ = ...
2022-05-03 15:16:11 +00:00
nickchapman-da
804a399115
Tests for stack-safety of type-checking (#13729)
* Tests for stack-safety of type-checking

changelog_begin
changelog_end

* remove testcases app[123]of3

* typecheck returns Option[ValidationError]

* remove LARGE testset, which only has non-overflow because of ill-typed examples causing early exit

* ensure all test examples are well-typed

* fix TODO issue links
2022-05-03 08:59:12 +01:00
Moisés Ackerman
61cb257225
Make disclosure explicit in Daml Studio tree view (#13735)
changelog_begin
* Daml Studio: transaction tree view now differentiates between disclosed and divulged contracts
changelog_end
2022-05-02 09:18:46 +02:00
Hubert Slojewski
281de9ac2e
Publish daml-lf encoder, parser and error-test-lib [KVL-1424] (#13730) 2022-04-29 13:59:19 +02:00
Hubert Slojewski
968ca24b17
Remove kvutils buf configuration and other leftovers [KVL-1427] (#13732)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-28 16:00:23 +02:00
Nicu Reut
a792de39a5
Update scalafmt to 3.5.1. (#13584)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-28 09:57:04 +00:00
nickchapman-da
30f83bae46
Small cleanup to the bazel testing setup for daml-lf/interpreter and daml-lf/validation (#13716)
changelog_begin
changelog_end
2022-04-27 13:27:17 +01:00
nickchapman-da
aeda7159cf
clarify entry points to type checking code (#13697)
changelog_begin
changelog_end
2022-04-26 15:34:38 +01:00
Remy
0be64a8dd0
LF: Structure stable packages (#13682)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-26 12:47:06 +00:00
Remy
79af226966
LF: Add a convenient companion object for ArrayList (#13684)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-26 12:36:36 +02:00
Hubert Slojewski
0e9326f857
Publish daml-lf/snapshot proto [KVL-1245] (#13679)
* Publish daml-lf/snapshot proto [KVL-1245]

CHANGELOG_BEGIN
CHANGELOG_END

* fix snapshot_proto bazel target

Co-authored-by: Remy Haemmerle <Remy.Haemmerle@daml.com>
2022-04-26 07:59:12 +02:00
Remy
3be994c4e8
LF: introduce interfaceId field in Exercise node (#13643)
.. to track where the choice is defined.

part of #13653

CHANGELOG_BEGIN
CHANGELOG_END
2022-04-21 13:19:25 +00:00