Commit Graph

397 Commits

Author SHA1 Message Date
Remy
4cb3ea5c7c
Ledger: clean up contract id seeding (#5260)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-30 10:13:42 +02:00
Remy
1b37f6c482
DAML-LF: redesign absolute contract ids (#5207)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 19:07:42 +01:00
Remy
20218e4175
DAML-LF: restrict length of parties (#5237)
CHANGELOG_BEGIN
* [DAML-LF]. *Breaking* Restrict length of parties
CHANGELOG_END
2020-03-27 14:52:43 +01:00
Gary Verhaegen
1872c668a5
replace DAML Authors with DA in copyright headers (#5228)
Change requested by Manoj.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 01:26:10 +01:00
Gary Verhaegen
9f3900d870
pin copyright headers (#5227)
When files should be immutable, they should also be protected from the
copyright headers script.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-26 23:30:23 +01:00
Andreas Herrmann
f0929f2d04
Consistently replace zip by bazel_tools zipper (#5215)
* sdk-release-tarball: zip is unused

* daml-lf/archive: Use bazel_tools zipper

@bazel_tools//tools/zip:zipper avoids timestamps and sources of
indeterminism when creating an archive, so that the result is
reproducible.

CHANGELOG_BEGIN
CHANGELOG_END

* Remove unused @zip_dev_env

zip is fully replaced by @bazel_tools//tools/zip:zipper.

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-03-26 17:38:03 +01:00
Ognjen Maric
f7aa2a3db0
Add keys with maintainers to Fetch nodes (#5186)
Add keys with maintainers to Fetch nodes

The new field is populated by the interpreter whenever the fetched
contract has a key. Used for contract key reinterpretation in Canton.

CHANGELOG_BEGIN

- [DAML-LF] Add keys with maintainers to Fetch nodes in transactions.

CHANGELOG_END
2020-03-26 14:07:17 +01:00
Remy
9880f3d7c2
Engine: Change type of ExerciseCommand contractId (#5182)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-26 10:44:24 +01:00
Stephen Compall
8d2c13cf43
generating GenMaps for testing (#5115)
* building a GenMap generator

* move Party Order to accessible place; test whether Name Equal is still in use

* add Order instance for SortedLookupList

* switch to Map for genMap's Inj; more Order instances

* remove all Order from TypedValueGenerators

* Revert "add Order instance for SortedLookupList"

This reverts commit 03a59a8249.

* moving the Equal instance means scenario-interpreter no longer direct-deps scalaz

* add a test using TypedValueGenerators GenMap

* remove Party Order

* refmt bazel

* remove stray import

* followup dep change to moving the Equal[Name] instance

* add changelog

CHANGELOG_BEGIN
CHANGELOG_END

* Name equal instance appears to be no longer used, but keeping anyway
2020-03-25 10:28:06 -04:00
Robert Autenrieth
3f597aae16
New ledger time (#5100)
* Tighten result type

Command execution can't result in a sequencer error

* New helper method for extracting used contracts

* New error clause

* Add a DAO query for the maximum time of contracts

* Implement algorithm for finding ledger time

CHANGELOG_BEGIN
CHANGELOG_END

* fixup ledgerTimeHelper

* Use new ledger time algorithm

* Mark LET/MRT as deprecated

CHANGELOG_BEGIN
- [Ledger API] DAML ledgers have switched to a new ledger time model.
  The ledger_effective_time and maximum_record_time fields of command submission are deprecated,
  the ledger time of transactions is instead set automatically by the ledger API server.
  Ledger time is no longer strictly monotonically increasing, but only follows causal monotonicity:
  ledger time of transactions is greater than or equal to the ledger time of any used contract.
  See `#4345 <https://github.com/digital-asset/daml/issues/4345>`__.
CHANGELOG_END

* Add ledger time skew check

* Remove command updater

LET/MRT are now deprecated, this class is now useless

* Remove old time model validator

* Switch to new time model check: kvutils

* Switch to new time model check: in-memory ledger

* Switch to new time model check: SqlLedger

* Use initial ledger config

* Ignore user provided LET

* Use TimeProvider in submission services

* Use deduplication_time in daml-script runner

- Also remove unnecessary command completion output of CommandTracker.
- Remove usage of maximum record time in CommandTracker.

* Use arbitrary default value for deduplication time

* Use built-in Instant ordering

* Remove obsolete test

* Remove obsolete test: CommandStaticTimeIT

* Refactor test: TransactionMRTCompliance

* Disable test: CommandTrackerFlow timeout

* thread maxDeduplicationTime through to CommandTracker

* Improve test

* Refactor command client configuration

* Deduplication time should always use UTC

* Add missing method in TimedIndexService after rebase

* Put more details into the deduplication error response.

* Use system time for command dedup submittedAt.

* Use explicit UTC time source in command validator

* Revert CommandTracker[Flow] to previous completion-recovering-behavior

* Adapt scala client command config to new config params

Co-authored-by: Gerolf Seitz <gerolf.seitz@digitalasset.com>
2020-03-25 09:28:56 +01:00
Moritz Kiefer
2b47f6994d
Switch default DAML-LF target to 1.8 (#5127)
changelog_begin

- [DAML Compiler] The default output DAML-LF target version is now
  1.8. You can target 1.7 by specifying ``--target=1.7`` in the
  ``build-options`` field in your ``daml.yaml``.

changelog_end

Fix daml2ts tests
2020-03-24 11:02:13 +01:00
Remy
8fb86b7133
Engine: create type for immutable byte array (#5140)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-24 09:04:52 +01:00
Remy
2dd9c50631
DAML-LF: contract id spec (#5106)
* DAML-LF: contract id spec

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-23 18:05:48 +01:00
Gerolf Seitz
f9fb888cc4
Allow for predictable contractIDs and transactionIDs (#5112)
- New seeding type "Static" that uses a fixed seed for generating new seeds.
This is only used in Sandbox and Sandbox-next.

- Remove the fuzzing for submission time in Engine.scala

- DAML-on-SQL: Create new log entry IDs from a provided SeedService.
This allows for generating deterministic transaction IDs in
Sandbox-Next.

Fixes #5107

CHANGELOG_BEGIN
[Sandbox] Add contract-id-seeding=static to allow for predictable contract IDs. This is useful for documentation,
to be able to refer to a specific contract ID instead of having to write "note down the contract ID you see on the screen. we will use it later."
[DAML-on-SQL] Derive the next log entry ID using the provided SeedService. This allows us to also deterministically create transactionIds in static time mode together with `--contract-id-seeding=static`. This should only be used for demos or documentation.
CHANGELOG_END
2020-03-23 10:55:40 +01:00
Stephen Compall
f2b068f0b5
remove List and TextMap support from the JSON query language (#5099)
* remove List and TextMap support from the JSON query language

CHANGELOG_BEGIN
- [JSON API - Experimental] Removed support for maps and lists from the query language.
  See `issue #4855 <https://github.com/digital-asset/daml/issues/4855>`_.
CHANGELOG_END

* GenMap won't be supported in general, remove FIXME

- thanks @leo-da

* more documentation on unsupported query types

- as suggested by @hurryabit; thanks
2020-03-20 16:22:22 -04:00
Remy
1216fd1a6f
Engine: fix missing usage of Enum Svalue rank (#5083)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-19 14:27:13 +01:00
nickchapman-da
d81caa9568
rework daml_compile bazel rule (#5070)
Avoiding `damlc compile/package` commands (which we would like to deprecate), and replace with plain `damlc build` together with a post dar->dalf extraction step in the couple of places where we actually want the .dalf for testing.

changelog_begin
changelog_end
2020-03-18 23:06:55 +00:00
Remy
3cbba8a444
Engine: Use enum and variant svalues' enum and variant s rank (#5068)
CHANGELOG_BEGIN
CHANGELOG_END

We use the rank recently introduced in the enum and variant svalues for:
* pattern matchin
* value hashCode
* value ordering (so the oredering match the DAML-LF spec)
* value equality
2020-03-18 20:44:17 +01:00
Remy
c2070170b3
Engine: add rank to Enum and Variant SValue (#5048)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-18 14:37:44 +01:00
Remy
eae3844ed9
Engine: Replace SResultMissingDefinition by SResultNeedPackage (#5039)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-17 19:25:57 +01:00
Remy
6e535e6c42
DAM-LF minor fixes relative to GenMap (#5028)
Here we fix some minor issue relatives to GenMap.

In particular:
    * validity of keys are checked when GenMap is created.
    * interface test
    * outdated comments
2020-03-17 11:00:33 +01:00
Remy
04196597a7
forbid non-generic comparison in 1.dev (#5020)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-16 17:25:43 +00:00
Remy
da79d89cc8
DAML-LF fix semantics of GenMap insert, lookup, and delete (#5024)
to follow the DAML-LF spec

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-16 16:39:14 +00:00
Remy
ac8554eddd
Engine: drop old internal comparsion builtin (#4990)
* Engine: drop old internal comparison builtin

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-16 15:15:32 +01:00
Remy
1c26f63fad
DAML-LF: GenMap Spec (#4981)
* DAML-LF: GenMap Spec

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-16 13:09:44 +01:00
Remy
c76e0bc1e0
DAML-LF add support for generic comparison in archive (#4983)
* DAML-LF: add generic comparison to archive
2020-03-13 20:13:13 +01:00
Gary Verhaegen
364262a7f6
saner scalafmt target (#4985)
The current behaviour of our scalafmt checks compares for changes with
origin/master, which means it is dependent on the state of the local git
repository. This makes it non-reproducible.

Added to the fact that the master branch is not currently green as per
our scalafmt rules, this makes it impossible to rebuild older commits,
which in turn could interfere with our release process.

This PR does two things:

1. Fix our codebase to agree with our formatting rules.
2. Add a flag to `fmt.sh` to enable scalafmt's diff behaviour, and
   change the default to a full scan.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-13 17:37:13 +01:00
Remy
277883e4d5
DAML-LF: base GenMap on SortedMap (#4893)
Change underlying implementation of GenMap from insertion order Map to sorted Map

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-13 11:10:38 +01:00
Remy
65e988b778
[DAML-LF] specification for generic comparison. (#4942)
* [DAML-LF] specification for generic comparison.

+ update generic equality

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-12 22:07:13 +01:00
Remy
198973f23b
DAML-LF: introduce HexString to represents base16 array encoding (#4952)
* DAML-LF: introduce the string type HexString that represents base16 array encoding

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-12 22:04:36 +01:00
Stefano Baghino
1bf1a8e8e9
Add diff function between Relations (#4962)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-12 14:41:22 +01:00
Remy
bdb6179405
[DAML-LF] add submission time for contract ids seeding (#4776)
* [DAML-LF] add submission time for contract ids seeding

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-11 12:17:22 +01:00
Stefano Baghino
6f59832e45
Add lazy flattening function to Relation (#4922)
* Add lazy flattening function to Relation

CHANGELOG_BEGIN
CHANGELOG_END

* Restrict tests to non-empty relations and address https://github.com/digital-asset/daml/pull/4922#pullrequestreview-372050511
2020-03-10 17:39:45 +00:00
Remy
047495b2af
[DAML-LF] define an ordering on values (#4808)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-09 13:51:22 +01:00
Stefano Baghino
e3c9f363bd
Avoid some unnecessary work when encoding a transaction (#4890)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-09 11:02:25 +00:00
mergify[bot]
6b851229b8
Refactor extraction of events from transaction (#4781)
* Refactor extraction of events from transaction

Closes #1909

CHANGELOG_BEGIN
CHANGELOG_END

* Remove unnecessary filtering

* Fix disclosure rule for flat transaction

* Refactor and split collection and filtering

* Replace transaction filtration with blinding info

* Move transient contract remover in transaction conversion

* Remove dangling file

* Simplify transient contract filtering

* Further refinements

* Simplify transaction tree event extraction

* Move newRoots up the file for consistency and readability

* Remove collect from GenTransaction, replace with custom iterator

* Address https://github.com/digital-asset/daml/pull/4781#discussion_r388167562

* Switch to a strict collect method

* Replaced direct access to map with contains
2020-03-05 18:06:05 +00:00
Remy
267671c340
[engine] track usage of getTime (#4790)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-04 10:17:55 +01:00
fabiotudone-da
85a10e5113
Ensure NodeInfo derived properties informeesOfNode and requireAuthorizers always return (#4554)
Fail with a more explanatory message if `Fetch.actingParties` is `None`

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-04 08:18:05 +01:00
Gerolf Seitz
536e793a44
Don't return witnessed contracts in ActiveContractsService (#4791)
The change to `EventFilter` and to the query in `JdbcLedgerDao` are
"duplicate work", but we need the change in EventFilter for the
InMemoryLedger, and the change in JdbcLedgerDao so that we avoid
fetching a contract that anyway would be discarded later.

CHANGELOG_BEGIN
[Sandbox]: Witnessed contracts for which a party is not a stakeholder
are no longer returned in the active contract stream.
CHANGELOG_END

Fixes #3254.
2020-03-03 16:29:55 +01:00
Remy
bb0d3f24cb
[engine] refactor transaction's usedPackages (#4793)
* [engine] refactor transaction's usedPackages

* Address Gerolf's comment

* changelog

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-03 13:59:40 +00:00
Moritz Kiefer
ad0336d3a5
Freeze DAML-LF 1.8 proto (#4788)
* Freeze DAML-LF 1.8 proto

This is a copy of the 1.dev proto with the following changes that
overall remove all references to 1.dev:

* Change the versions and the reference to the spec.
* Remove `dev` from version history at the top.
* Remove `GENMAP` and corresponding primitives.
* Remove general equality `EQUAL` and the comments that the
  type-specific equality primitives are only available in < 1.dev
* Remove experimental text primitives.

changelog_begin
changelog_end

* windows is very bad

* bump windows hashes
2020-03-03 14:21:00 +01:00
Moritz Kiefer
d68d3eb74a
Freeze DAML-LF 1.8 (#4770)
* Freeze DAML-LF 1.8

Two minor points that I did not mention in the previous PR:

We also include the renaming of structural records to `struct` and the
renaming of `Map` to `TextMap`.

There are some minor changes around the LF encoder tests which need to
be able to emit package metadata properly so I’ve added it to the
parser. Sorry for not splitting that out.

Following the process used for the DAML-LF 1.7 release, this does not
yet include the frozen proto file.

changelog_begin

- [DAML-LF] Release DAML-LF 1.8:

  * Rename structural records to ``Struct``. Note that
    structural records are not exposed in DAML.
  * Rename ``Map`` to ``TextMap``.
  * Add type synonyms. Note that type synonyms are not serializable.
  * Add package metadata, i.e., package names and versions.

  Note that the default output of ``damlc`` is stil DAML-LF 1.7. You
  can produce DAML-LF 1.8 by passing ``--target=1.8``.

changelog_end

* Update encoder

* Update java codegen tests

* Update comment in scala codegen

* Handle TSynApp in interface reader

* Bump lf_stable_version to 1.7

* Fix kvutils tests
2020-03-02 18:29:26 +01:00
Remy
e7ee8143cb
[kvutils] use new contract id scheme (#4741)
* Make kvutils work with the new contract id scheme

CHANGELOG_BEGIN
- [KVUtils] uses random contract id. Contract ids are made of 65 hexa decimal characters.
CHANGELOG_END

Co-authored-by: Jussi Mäki <jussi.maki@digitalasset.com>
2020-03-02 17:50:38 +01:00
Moritz Kiefer
501aa9e89e
Prepare DAML-LF 1.8 release (#4769)
We will only include type synonyms and package metadata (which are
used for Cross-SDK model upgrades). Everything else stays in 1.dev for
now.

changelog_begin
changelog_end
2020-03-02 14:23:07 +00:00
Moritz Kiefer
040d343b8c
Document package metadata in LF spec (#4764)
* Document package metadata in LF spec

changelog_begin
changelog_end

* remove space
2020-03-02 11:32:36 +00:00
Shayne Fletcher
66dd112960
Remove pragma 'daml 1.2' (#4702)
changelog_begin
- The pragma 'daml 1.2' is now optional.
changelog_end
2020-02-26 13:17:45 -05:00
Stefano Baghino
540f3625b0
Ensure DarReader prevents zip bombs (#4703)
* Ensure DarReader prevents zip bombs

CHANGELOG_BEGIN
[DAML-LF] The DarReader has a 1GB hard cap on ZIP archive entry size to prevent zip bombs
CHANGELOG_END

* Properly test UniversalArchiveReader, make it prevent bombs, break away memory heavy tests

* Exclude the zip bomb detection test from running on Mac CI nodes
2020-02-26 13:09:58 +01:00
Moritz Kiefer
8d81399c0f
Add an experimental DAML script REPL (#4660)
As mentioned in the title, this is still very experimental and needs
more work before we want to advertise it. However, the code is in a
somewhat reasonable shape, there are tests and I think even in the
current state it is already useful. Also this PR is already getting
very large so I don’t want to hold off much longer before merging this.

It is included in the SDK but hidden from `damlc --help` and `daml
--help` until the most pressing issues are addressed (primarily around
making sure that it doesn’t just shut down if you have a type error
and better error messages in general).

changelog_begin
changelog_end
2020-02-24 11:06:27 +01:00
Remy
0321a1bb32
[Engine] push absolute contract ids inside the evaluation (#4652)
* [Engine] push absolute contract inside the evaluation
* Remove discriminator fom relative contract id

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-21 20:21:35 +01:00
Moritz Kiefer
c68dd19ade
Decode and validate package metadata in Scala (#4653)
This adds the code for decoding and validating package metadata
that is now emitted by damlc.

changelog_begin
changelog_end
2020-02-21 18:20:42 +00:00