Fixes#28.
CHANGELOG_BEGIN
[Sandbox] DAML trace logs (trace, traceRaw, traceId) are now logged via the regular logging system (slf4j+logback) at interpretation time via the logger ``daml.tracelog`` at DEBUG level.
CHANGELOG_END
* Move most of the remaining serializable types to stable LF packages
The only serializable types left in DAML stdlib after this PR are the
following:
- DA.Upgrade:MetaEquiv
- DA.Random:Minstd
- DA.Next.Set:Set
- DA.Next.Map:Map
- DA.Generics:MetaSel0
- DA.Generics:MetaData0
- DA.Generics:DecidedStrictness
- DA.Generics:SourceStrictness
- DA.Generics:SourceUnpackedness
- DA.Generics:Associativity
- DA.Generics:Infix0
- DA.Generics:Fixity
- DA.Generics:K1
- DA.Generics:Par1
- DA.Generics:U1
- DA.Internal.Prelude:Optional
Ignoring the Generics stuff which isn’t very urgent imho and the
Upgrade stuff which is probably going to change significantly anyway,
this leaves us with the weird Random module, the wrappers around
TextMap which will go away anyway and DA.Internal.Prelude:Optional
which shouldn’t exist in the first place (I’ll address that in a
separate PR).
CHANGELOG_BEGIN
- [DAML Compiler] Move more types from daml-stdlib to standalone LF
packages. The module names for the types have also changed
slightly. This only matters over the Ledger API when you specify the
module name explicitly. In DAML you should continue to use the
existing module names.
- The types from ``DA.Semigroup` are now in a separate package under
``DA.Semigroup.Types``
- The types from ``DA.Monoid` are now in a separate package under
``DA.Monoid.Types``
- The types from ``DA.Time` are now in a separate package under
``DA.Time.Types``
- The types from ``DA.Validation` are now in a separate package
under ``DA.Validation.Types``
- The types from ``DA.Logic` are now in a separate package under
``DA.Logic.Types``
- The types from `DA.Date` are now in a separate package under
`DA.Date.Types`.
- The `Down` type from `DA.Internal.Prelude` is now in a separate
package under `DA.Internal.Down`.
CHANGELOG_end
* Fix serializability of RelTime
* fix daml-docs
* Fix tests
* Change variant json encoding,
adding integration test
* Add DamlLfTypeLookup dependencies
* Add MetadataReader
* Add test WIP
* Add serialize test cases
* Add serialize test cases, WIP
* Test for variant encoding decoding
* Solving merge conflicts
* Updating roundtrip test
* Minor cleanup
* Addressing code review comments
Add JsonVariant custom matcher
* Update specification
* Update link
* Add test case, WIP
* Add proper template key resolution
* Got rid of choice record ID resolution, resolving choice type and key type
* Fixing logging
* Add Contract Key decoding tests
* cleanup
* cleanup
* Update JSON variant encoding tests
* Add more contract key JSON decoding tests
* Fix variant JSON encoding
* Change value predicate to support new variant encoding
* Change value predicate to support new variant encoding
* Add lookup by contract key test case
where contract key contains variant and record
Add `requiredResource` to bazel utils
CHANGELOG_BEGIN
- [JSON API - Experimental] Change variant JSON encoding. The new format is ``{ tag: data-constructor, value: argument }``.
For example, if we have: ``data Foo = Bar Int | Baz``, these are all valid JSON encodings for values of type Foo:
- ``{"tag": "Bar", "value": 42}``
- ``{"tag": "Baz", "value": {}}``
See #3622
- [JSON API - Experimental] Fix ``/contracts/lookup` find by contract key.
- [JSON API - Experimental] Fix ``/command/exercise`` to support any LF type as a choice argument.
See #3390
CHANGELOG_END
* minor cleanup
* Fix copy/paste
* Renaming
* Got rid of DAML LF identifier resolution
resolving DAML LF Type based on command type
* Address code review comments, thanks @S11001001
* Address code review comments, thanks @S11001001
Do not include any error handling here; this partial function should
only match the successful case, JsonVariant.
* Address code review comments, thanks @S11001001
comment
* Address code review comments, thanks @S11001001
using `JsonVariant` for variant encoding/decoding
* Address code review comments, thanks @S11001001
replace `find` and `map` chain with collectFirst
* Update docs/source/json-api/lf-value-specification.rst
Co-Authored-By: Stephen Compall <stephen.compall@daml.com>
Co-authored-by: Stephen Compall <scompall@nocandysw.com>
* runtime-filtering-only-style enum for ValueAddend
- the alternative is a coproduct of singleton types, which would be more
like the other ValueAddend combinators, but done differently here as
an experiment
* test an enum case for lf-value-json
* drop Nones from records when JSON-encoding
* elide some needless conversions in ApiCodecCompressed
* record with visible Inj
- seems to be running up against scala/scala#5075
* use new 3rdparty lib reference
* construct record types field-by-field
- works around scala/scala#5075
* switch to record style for records' Inj
- suggested by @leo-da
* include some samples to experiment with record
* record parsing
* RecordVa doesn't benefit from kind-projector
* scalafmt
* make RecordVa details private; only intended API is public
* Arbitrary and Shrink record support
* rename RecordVa#Inj to HRec, to accommodate variants in same cons structure
* use record testing in lf-value-json
* add complex record type
* add complex record value and test it
* more documentation for RecordVa
* Table-ify prior record tests
* start adding variant support
* scalacheck support for variants
* more scalacheck support for variants
* variant examples
* example of using align for records
* test variant roundtrip
* test variant in record
* add sample tests for the JSON format of records and variants
* rename record-specific functions in RecordVa
* rename RecordVa to RecVarSpec
* Move Any wrappers and Archive to stable packages
There are no actual API or functionality changes in this PR but the
logic for locating the stable packages has slightly changed since the
Any wrappers package only makes sense for LF 1.7. To address this, we
simply filter out stable packages for newer LF versions since it
doesn’t make sense to depend on those anyway.
CHANGELOG_BEGIN
- [DAML Compiler] Move ``Archive`` type to a separate DALF.
CHANGELOG_END
* More comments
* Fix java codegen tests
* fix more tests
* Force cache reset on Windows
* Revert "Force cache reset on Windows"
This reverts commit 9f2b7d70b2.
* daml-lf: second version of type synonym spec
* cosmetic changes
* more fixes
* make special application for type synonymes
* Update daml-lf/spec/daml-lf-1.rst
Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>
* make type synonym different from type constructor
* typos
* scala codegen: add GenMap support
* scala-codegen: use InsertOrdMap as underlying of Generic Map binding
* Address Stephen's comments
* make TextMap a strict subtype of immutable.Map to avoid overlap with GenMap
Otherwise, attempted GenMap encodings like
`Value.encode(InsertOrdMap("foo" -> "bar"))` (and any contract
containing such a structure) are either ambiguous or, worse, yield the
wrong result.
* ensure better return types for InsertOrdMap and similar wrappers' operations
* if is an expression
* adapt various primitive encodings to newtype TextMap
* easy cleanups of the TextMapApi
* proper alias for deprecated Map
* update deprecation releases
* Revert "proper alias for deprecated Map"
This reverts commit e85aa85b960c4bf5c4f9624896183ec6e2182bba.
* remove useless invisible deprecated notice
* add generic map tests for scala codegen
* please restart CI
* Move all datatypes out of daml-prim
This moves the remaining two modules DA.Types and GHC.Tuple to
separate LF packages with stable identifiers.
The only data types remaining are the ones for typeclasses which will
disappear once we move this to type synonyms.
CHANGELOG_BEGIN
- [DAML Compiler] The modules DA.Types and GHC.Tuple from daml-prim
have been moved to separate packages.
CHANGELOG_END
* Fix codegen tests
* Fix DarReader test
* Fix kvutils tests
* Fix jdbcdao tests
* Fix hs ledger bindings tests
* Sandbox: Remove streaming connections
The separate database connection pool for streaming connections
was only used for the active contracts stream. However, a single
db connection was being occupied until the last active contract was
streamed over the Ledger API to the client. This effectively means
that only ever 2 concurrent active contract streams could exist.
No need to say that this is bad design.
The following changes happened:
- remove the db connection pool for streaming connections
- replace the streaming mechanism for active contracts with
the already existing pagination mechanism in JdbcLedgerDao
- change the pagination mechanism to actually use database level
limit and offset instead of doing the pagination "client side"
- configure the HikariDataSource with the metric registry
CHANGELOG_BEGIN
- [Sandbox] Improve loading of active contracts for the Sandbox SQL backend.
CHANGELOG_END
* Extract PaginatingAsyncStream from JdbcLedgerDao for testing
* Reset metrics registry before each test
This is a first step towards making sure that the package ids for
types defined in daml-prim and daml-stdlib don’t change. This PR
mostly adds all the necessary infrastructure for that and moves
GHC.Types and GHC.Prim to make sure it works.
Until data-dependencies are really solid and we have verified that we
no longer have performance issues with an increasing number of Haskell
packages, we still include the source files in daml-prim and then just
rewrite the references.
We will also need to add tests that these packages really have stable
ids but I’ll leave that for separate PRs since this doesn’t make that
much sense anyway until all of the types have moved to stable
packages.
CHANGELOG_BEGIN
- [DAML Compiler] The modules GHC.Prim and GHC.Types from daml-prim
have been moved to separate packages.
CHANGELOG_END
* Track used packages during whole of engine submit
- Introduce MutableCompiledPackages interface
- Add TrackingCompiledPackages that tracks fetched packages
- Make used packages in transaction optional to distinguish between
missing dependencies and empty set of dependencies.
* Reimplement package dependency tracking
- Compute direct dependencies of a package during decoding
- Compute transitive dependencies of a package when adding a package
to engine.
- Annotate the resulting transaction with package dependencies
in Engine.submit.
* Create Ast.Package with proper direct deps in scenario service
While we don't have use for direct dependencies of a package in
scenario service (only Engine.submit needs it), it's better to be
accurate.
This of course overapproximates the direct dependencies.
* Compile a each new package once in ConcurrentCompiledPackages
* Include type synonyms in LF abstract syntax
* Use T instead of S for synonyms
Following a suggestion from @remyhaemmerle-da, we avoid having to
adapt all rules to synonyms by simply reusing the definition of type
constructors.
* Start moving all the jars into a single jar.
* Fold navigator into daml-sdk jar
* include sandbox
* Remove unnecessary compileDeps.
CHANGELOG_BEGIN
- [DAML SDK] Reduced the size of the DAML SDK by about
60% uncompressed, 70% compressed, by deduplicating Scala
dependencies.
CHANGELOG_END
* update copyright header
* buildifier fix
CHANGELOG_BEGIN
[DAM-LF Interface Reader]: **Rename** ``PrimTypeMap`` to ``PrimTypeTextMap`` and ``PrimType.Map`` to ``PrimType.TextMap``
CHANGELOG_END
* Add specification for type synonyms in DAML-LF
* Fix identifiers for type synonyms
* Use S for type synonyms
* Address review comments
* Split up TyTypeSynonym and DefTypeSynonym
* daml-lf: rename Map to TextMap in archive proto
+ in Scala/haskell AST
* a bit more renamming
* Update compiler/daml-lf-tools/src/DA/Daml/LF/TypeChecker/Serializability.hs
Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>
* fix test
* Apply suggestions from code review
Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>
* Update compiler/daml-lf-ast/src/DA/Daml/LF/Ast/Base.hs
Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>