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)
It is important continuations of Engine Result does not throw exceptions, as we cannot ensure those are properly caught.
Until now, we have to carefully review the code we write never throws exceptions. However as the code in continuation grows, I think this is not possible to do it anymore. For this reason, this PR systematically caught any possible exception thrown during continuation evaluation, and delay the error reporting to the next Speedy iteration.
Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
* 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
* 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
* 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
* First stab at detecting double creates in the state machine
* Use subtyping to encode unions of errors instead of Either
* run formatter
* propagate duplicate contract ID error to clients
* remove redundant 'with TransactionError'
* also check fetches for double creation
* add test for create after fetch, found a bug!
* add one transaction test for create after fetch
* use sums instead of subtyping for classifying errors
* crash on double creation in SBuiltin rather than propagating the error as it should never happen
* remove unused parameter
* track all input contract IDs, not just fetches
* remove non-sensical test
* Fix the computation of input contract IDs
- 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
* Fix a probable typo in //daml-fl/encoder/testing-dar-*
* apply TODOs in bazel files
* remove obsolete comments in bazel files
* use 'default' instead of 'latest' for targets relying on 'latest' in order to ensure interfaces are supported
After this change, the buf tool sees the files under src/main/protobuf. Without this change, it only sees an empty directory and the diff is trivially empty.
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.
The core functions of the ANF transformation in Anf.scala handle 3 different types of continuations:
1. The "transformations" (called tx), that are an inherent aspect of any ANF transformation expressed in pseudo-CPS style for convenience.
2. The "continuations" (called k) that had been introduced to avoid stack oveflows.
3. The trampolines, that have also been introduced to avoid stack overflows.
This commit recognizes that types 2 and 3 are redundant and merges them into only type 3. It relies on the fact that trampolines are monadic, and so we switch from the hand-rolled trampolines to that of scala's std library since they already implement flatMap.