Commit Graph

4040 Commits

Author SHA1 Message Date
Moritz Kiefer
49e19ebed1
Make compat tests work on windows (#5732)
* Make compat tests work on windows

This required some changes to the daml_sdk rule since the read-only
installation by the assistant breaks Bazel completely. We could only
apply those changes on Windows but I think I prefer the consistency
across platforms here over trying to stay close to how the SDK is
installed on user machines given that the SDK installation is not
something we’ve had issues with.

I’ve excluded the postgresql tests for now. I don’t expect them to be
particularly hard to fix but I’ve already spent almost 2 days on this
and having some tests run on Windows seems like a clear improvement
over running no tests on Windows :)

changelog_begin
changelog_end

* Remove todo

changelog_begin
changelog_end
2020-04-28 16:06:36 +02:00
Miklos
d6c5a2532d
Add counting future metrics (#5743)
* Added counting metrics.

* Code tidying.
CHANGELOG_BEGIN
CHANGELOG_END

* Rename based on review suggestion.
2020-04-28 13:58:15 +00:00
Martin Huschenbett
ea50c329f2
DAML Exec Perf: Add simple benchmark for scenario interpreter (#5747)
We add a benchmark for running a sufficiently big scenario. This PR is
more about setting up the benchmarking infrastructure rather than the
actual benchmark itself.

This is part of https://github.com/digital-asset/daml/issues/5746.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-28 14:44:29 +02:00
Gary Verhaegen
cfae3df7fa
report compat status every day (#5744)
I believe the compatibility check is important enough, and should fail
rarely enough, that it is worth reporting even on success. This will
mean (once we support Windows) 3 messages a day, sent while presumably
nobody is working, so the disruption should be minimal.

The issue with reporting only on failures is that, if we don't
proactively check (which we do for the state of master for different
reasons, but would likely not keep doing for a job that doesn't block
PRs), we may get into a state where it is so broken that it doesn't even
report.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-28 12:30:45 +02:00
Gary Verhaegen
54d6782be3
drop v from release titles (#5742)
This is a minor, cosmetic change. Note that all our references to
releases are based on tags, and do not depend on the release title. This
is evidenced by the fairly random titles we used to have before the
title was set by CI, see e.g.
[0.13.35](https://github.com/digital-asset/daml/releases/tag/v0.13.53).

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-28 11:51:16 +02:00
mziolekda
bbd21605f5
add readme that details the usage of integrity check tool (#5685)
* add readme that details the usage of integrity check tool

* Apply suggestions from code review

Addressing review comments

Co-Authored-By: Samir Talwar <samir.talwar@digitalasset.com>

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-04-28 09:18:35 +02:00
Remy
bb111ea3cc
Engine: fix value transaltion. (#5716)
In the call back of `SBUFetch` when asking the ledger for a contract the translateValue may raise an exception.
However it is not safe as the engine cannot recover such error.

We create a new Control for the speedy machine, that handle safely the translation.

CHANGELOG_BEGIN
CANGELOG_END
2020-04-27 21:56:53 +02:00
Stephen Compall
00025a5337
reduce test count for Ordering tests (#5741)
* reduce test count for Ordering tests

CHANGELOG_BEGIN
CHANGELOG_END

* changed the wrong one in ValueSpec; preserves base order is redundant for primitives
2020-04-27 14:31:37 -04:00
Gary Verhaegen
b2fc953250
extend visual for exerciseByKey (#5739)
* extend visual for exerciseByKey

Fair warning: I have no idea what I'm doing here. Please review
carefully.

This commit extends the `daml damlc visual` command to draw a line for
exerciseByKey choices. This fixes #5726.

I have not been able to find any existing test for the visualizer. If
non exist, I think we should at least turn #5726 into a test case,
checking that the expected dot file gets generated. I suggest doing that
as a separate PR though.

If there is already a suite of tests, please point me to it and I'll
happily add one for this.

CHANGELOG_BEGIN
[Visualization] Fix a bug where `exerciseByKey` was not properly
recognized. See #5726.
CHANGELOG_END

* add test
2020-04-27 18:51:40 +02:00
Andreas Herrmann
effd05b894
Include daml ledger tests in compatibility tests (#5740)
* Copy daml ledger test to compatibility

Specifically:
- `daml-assistant/daml-helper/test/DA/Daml/Helper/Test/Deployment.hs`
- `libs-haskell/test-utils/DA/Test/Sandbox.hs`

* Adapt daml ledger test for compatibility

Avoid dependencies on the daml repository and make the SDK and platform
components configurable.

* Add test certificates to compatibility

Taken from `@daml//ledger/test-common/test-certificates`.

* Define daml_ledger_test

CHANGELOG_BEGIN
CHANGELOG_END

* Add note on keeping daml ledger tests in sync

* ./fmt.sh

* Strictly require --sdk-version flag

Tasty doesn't allow options without a default value, so we default to
`error` to enforce a value being set.

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-04-27 16:13:16 +00:00
Moritz Kiefer
d1db5c1c96
Set buffering of the docs cron job to LineBuffering (#5735)
I am hoping this will make the Azure output a bit more chatty. At the
moment, you don’t get any output until the job has finished which is a
bit annoying (although not really an issue).

changelog_begin
changelog_end
2020-04-27 15:29:08 +02:00
Gary Verhaegen
e344c6efa1
fix compatibility test (#5736)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-27 13:15:48 +00:00
Gary Verhaegen
7ceda5678a
run compatibility tests on macos (#5723)
This PR extends the existing Linux compatibility tests to run on macOS
too. Fixes #5692.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-04-27 14:55:16 +02:00
Andreas Lochbihler
172e913520
fix definition of actors for fetch in ledger model (#5734)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-27 13:39:36 +02:00
Andreas Herrmann
7b1dbddf15
Configure Bazel repository cache for build (#5733)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-04-27 10:10:21 +00:00
Gerolf Seitz
690092e066
Sandbox: Properly respect --log-level parameter (#5717)
In #5419 we set specific loggers to WARN or ERROR so that we avoid noisy
logging by default.  However, if the user specifies the --log-level CLI
param, not only the root logger, but also other loggers set in logback.xml
should log at that level.

CHANGELOG_BEGIN
[Sandbox] Properly respect the --log-level CLI parameter
CHANGELOG_END
2020-04-27 08:24:21 +02:00
Stephen Compall
d4086080ea
proper GenMap Gen with key Value order (#5526)
* add Order instances to various types in LF data, transaction

* define scope-dependent Order for Value; test compatibility with SValue order

* support Order in TypedValueGenerators

* generate properly-ordered ValueGenMaps in TypedValueGenerators

* factor genAddend and genAddendNoListMap

* test Value.orderInstance fidelity with well-typed Orders

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* shrink Maps for better debugging

* line up base List and GenMap orders with svalue

* unhandled cases in custom comparator for ApiValueToLfValueConverter tests

- hazards of not using match2

* adapt to PureCompiledPackages changes
2020-04-24 17:57:12 -04:00
Moritz Kiefer
350f7bb1e7
Fix optPow and errPow (#5722)
The last multiplication in both ended up being exponent * result
instead of base * result. I’ve renamed the variables since that makes
this trivial to spot and I’ve added a simple scenario that actually
tests this.

changelog_begin
changelog_end
2020-04-24 17:28:56 +02:00
Moritz Kiefer
0d1f21e4a2
Extend compatibility tests to test against HEAD (#5714)
fixes #5691

changelog_begin
changelog_end
2020-04-24 14:43:35 +02:00
Moritz Kiefer
7f2a950da0
Fix ./fmt.sh check (#5718)
* Fix ./fmt.sh check

We accidentally introduced hlint lints when we added the compatibility
workspace. The hlint code in ./fmt.sh correctly detects that there is
a hint but then exits with 0 since it uses the exit code from `echo`
rather than the one from `hlint`. The info that we printed with
`echo` didn’t actually make any sense so I added a new comment as to
why we run hlint here. This requires some setup changes so that the
compatibility workspace gets the same Haskell flags since otherwise
using the same hlint rules obviously does not make sense.

Fixes #5701

changelog_begin
changelog_end

* Update fmt.sh

Co-Authored-By: Samir Talwar <samir.talwar@digitalasset.com>

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-04-24 12:04:14 +00:00
Moritz Kiefer
bed6a2ed51
Include latest snapshot in compatibility tests (#5709)
changelog_begin
changelog_end
2020-04-24 12:21:28 +02:00
Moritz Kiefer
df16cf7094
Extend compatibility tests to DAML on SQL (#5705)
* Extend compatibility tests to DAML on SQL

This feels a bit hacky since the runfiles don’t work quite like I
would expect them to but it’s at least not more hacky than what we do
for the head-based tests we currently have.

Progress towards #5695

changelog_begin
changelog_end

* Fix runfiles with more bash

changelog_begin
changelog_end

* remove redundant port options

changelog_begin
changelog_end

* Create fewer sandbox targets

changelog_begin
changelog_end

* Apply suggestions from code review

Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>

* Fix runfiles snippet

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
2020-04-24 12:08:32 +02:00
Moritz Kiefer
f61aadc422
Add dade-assist step to compat cron job (#5712)
changelog_begin
changelog_end
2020-04-24 11:25:14 +02:00
Robert Autenrieth
49c6a20f0a
Remove duplicate ledger time field (#5698)
The duplicated information was not always in sync.

Fixes #5662

CHANGELOG_BEGIN
- [Sandbox] Fix an issue where the sandbox would sometimes reject transactions
  with a "INVALID_ARGUMENT: Disputed" error if either of
  ``min_ledger_time_rel`` or ``min_ledger_time_abs`` was set in the
  submission request.
CHANGELOG_END
2020-04-24 10:02:26 +02:00
Remy
0f75bf3fde
Scenario service: fails when trying to lookup not visible key (#5561)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-23 21:55:39 +02:00
Stefano Baghino
bed58c7e12
Avoid instantiating new implicit conversions for every query (#5706)
* Avoid instantiating new implicit conversion for every query

changelog_begin
changelog_end

* Make HashToStatement an object as well

* Address https://github.com/digital-asset/daml/pull/5706#discussion_r413896788
2020-04-23 16:55:58 +00:00
Moritz Kiefer
0e5aa4bebf
Remove -o config from PostgresAround (#5707)
We already specify those values in the config file.

changelog_begin
changelog_end
2020-04-23 16:08:37 +00:00
Moritz Kiefer
7063e30b76
Configure python toolchain via nixpkgs_python_configure (#5702)
changelog_begin
changelog_end
2020-04-23 17:30:32 +02:00
Sofia Faro
6047cca194
daml-docs: Generate Hoogle database with anchor table from generating docs. (#5704)
* Fix all DAML hoogle links.

This PR changes how the hoogle database is rendered in damldocs, so it has access to the mapping of anchors to URLs that is produced during rendering of rst docs. This way these will not get out of sync.

I also added an --output-anchor option in preparation for fixing external/cross-package references.

changelog_begin
changelog_end

* Update settings.json

undo accidental vscode settings change.

* Update README.md
2020-04-23 16:12:48 +01:00
Remy
15354c3256
DAML-LF: remove submitter is in maintainer check (#5611)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-23 16:10:39 +02:00
Moritz Kiefer
68b7dcfa1a
Setup codeowners for compatibility directory (#5703)
changelog_begin
changelog_end
2020-04-23 15:56:09 +02:00
Andreas Herrmann
c08672a300
Define a simple test matrix for SDK/platform tests (#5699)
* Abstract over SDK/platform client_server_test

* Define test-matrix using simple list comprehension

CHANGELOG_BEGIN
CHANGELOG_END

* copy right header

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-04-23 12:46:22 +00:00
Stefano Baghino
06d4451e8b
Fix hashing of keys in the new contract store (#5681)
* Fix hashing of keys in the new contract store

Use GlobalKey.hash instead of KeyHasher.hashKey

Fixes #5680

changelog_begin
changelog_end

* Fix order of fields in migration

* Fix migration naming

* Rename file according to class

* Fix hash of active contracts, not consumed ones
2020-04-23 14:24:37 +02:00
Gary Verhaegen
ec1a9326ea
fix daily-compat.yml (#5686)
For some reason the Azure Pipelines folks thought it was a good idea to
search for templates starting with the current YAML file's path. Other
steps (e.g. the bash script here) start from the root of the repo,
though.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-23 13:38:57 +02:00
Stefano Baghino
c66d89dab8
Fix flakiness of GroupContinuous test (#5696)
Fixes #5690

changelog_begin
changelog_end
2020-04-23 11:37:15 +00:00
Moritz Kiefer
7d36402412
Initial boilerplate for cross-version compatibility testing (#5665)
This is a first step towards testing cross-version
compatibility. It doesn’t actuall do much yet but hopefully it should
be easier to parallelize once we have the initial boilerplate in place
so ideally I’d like to address most missing things and issues in
separate PRs.

changelog_begin
changelog_end
2020-04-23 12:58:11 +02:00
Moritz Kiefer
85b5e66c55
Ignore compatibility directory (#5687)
changelog_begin
changelog_end
2020-04-23 10:33:38 +00:00
Samir Talwar
77af35f44e
ledger-on-sql: Name the RangeSource parameters more explicitly. (#5679)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-23 09:10:16 +00:00
Gary Verhaegen
644d4c7512
add empty daily CI run (#5675)
This is meant to be filled once we have a better idea of what exactly we
want to test. See #5665 for current thinking about it.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-23 10:36:20 +02:00
Gerolf Seitz
48fd1e47a0
kvutils: fix validation of false negative key lookups (#5608)
* Make the contract keys test fail if the transaction is not rejected by the committer

- First, this removes the assert statement in the DAML model, so that the
  transaction validation doesn't fail with a transaction abort.
- Second, the gRPC error message should contain Disputed. `InvalidLookup`
  should only be used in Sandbox Classic, but due to code sharing, the
  validation that triggers this error is also run for Sadbonx.

* Fix the key lookup in kvutils

The current way of transaction validation and key lookup does not work
in the following scenario:
- the transaction coming from the participant has a negative key lookup
- the contract key state is loaded, which points to a contract that has
  been created by another transaction since the command interpretation
  on the participant
- the contract state for the contractId inside the contract key state
  has not been loaded, therefore the visibility and activeness check in
  `ProcessTransactionSubmission.lookupKey` returns `None`, even though
  there is in fact a contract with such a key.

To mitigate this issue, the `lookupKey` function must not check
activeness or visibility. If the submitter is not allowed to load the
contract via a key lookup, the authorization check should catch that.
Any other situation that is inconsistent should result in a rejection of
the transaction.

A small side effect of this change is that the `lookupContract` function
might try to load a contract that wasn't loaded from the kv state
earlier. This only happens because we first rebuild the entire
transaction before we compare it to the original transaction.
Previously we threw an exception in this case, but this results in a rather
ugly abort of the reinterpretation of the transaction. Therefore the
`lookupContract` function just returns `None`. Eventually the
transaction will be rejected during validation of the nodes, because
the `LookupByKey` nodes will be different.
This would not happen if we reinterpreted the transaction lazily and
compared the nodes as soon as they are produced with the corresponding
node of the original transaction.

CHANGELOG_BEGIN
[kvutils] Fixed the validation of key lookups.
See issue `#5562 <https://github.com/digital-asset/daml/issues/5562>`__.
[Participant Server, Ledger API Test Tool] Use rejection reasons of the participant-state API instead of sandbox specific ones.
CHANGELOG_END

* Validate causal monotonicity of used contract keys

When using LookupByKey, the return contract isn't necessarily fetched or used
any other way. This means that we need an extra pass over all contract keys to
ensure that causal monotonicity is respected. To be able to do this,
there is now a new field `DamlContractKeyState.active_at`, which is set to the
same value `DamlTransactionEntry.ledger_effective_time`.
An additional check in `ProcessTransactionSubmission` uses this field to verify
causal monotonicity.
2020-04-23 09:44:39 +02:00
Remy
d90b03633e
Scenario service: optimize for common usecases of context update (#5666)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-22 22:06:53 +02:00
Shayne Fletcher
276bc712de
some windows information (#5677)
changelog_begin
changelog_end
2020-04-22 17:54:49 +00:00
Edward Newman
01c784659f
Minor changes to MacOS infra config (#5673) 2020-04-22 18:57:40 +02:00
Leonid Shlyapnikov
bab018b44e
Allow tokens with zero parties for pass-through endpoints (#5674)
changelog_begin
[JSON API]
Pass through endpoints do not require party specified in the JWT:
- ``/v1/parties``
- ``/v1/parties/allocate``
- ``/v1/packages``
See #5313.
changelog_end
2020-04-22 12:39:20 -04:00
Remy
7bdde70840
Speedy Compiler: clean up. (#5649)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-22 16:09:54 +02:00
Gary Verhaegen
5f9db11663
fix tell-slack-failed CI "function" (#5670)
And here I was, thinking our builds had gotten more stable as of late.

😢

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-22 15:21:04 +02:00
Sofia Faro
ab93435442
Split standard library docs up one page per module. (#5636)
* One module per page in stdlib docs.

changelog_begin

- [DAML Docs] The standard library docs have been split up per module.

changelog_end

* Adjust stdlib annotations

* Update compiler/damlc/daml-stdlib-src/DA/Generics.daml

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update compiler/damlc/base-rst-index-template.rst

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Move to daml/stdlib

* Update daml-doc tests

* Remove the Module prefix in the index/toctree

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-04-22 13:23:46 +01:00
Sofia Faro
0f8cb68ca2
Make a snapshot release (#5668)
changelog_begin
changelog_end
2020-04-22 13:07:58 +01:00
Stefano Baghino
234319db2e
Document required protobuf definitions for bindings (#5664)
* Document required protobuf definitions for bindings

changelog_begin
[Documentation] Documented required protobuf definitions to build custom bindings
changelog_end

* Address review comments

- remove out-of-date document on errors
- add README.md to tarball, address https://github.com/digital-asset/daml/pull/5664#discussion_r412803050
- remove unnecessary reference to reflection service, address https://github.com/digital-asset/daml/pull/5664#discussion_r412810629
2020-04-22 10:27:23 +00:00
Stefano Baghino
6391ee9f78
Show hidden navigator server CLI option (#5667)
Specifically, the option to adjust the gRPC maximum inbound message size.

changelog_begin
[Navigator] The CLI help message now shows how to adjust the gRPC
maximum inbound message size.
changelog_end
2020-04-22 12:02:12 +02:00