Commit Graph

5462 Commits

Author SHA1 Message Date
Sofia Faro
fbb29de4b2
Force newtype constructor names to match type name. (#7467)
* Force newtype ctor name to match type name.

This PR fixes the record constructor check to include newtypes, which are represented as records in DAML-LF. The non-inclusion of all newtypes was an oversight. In addition, we add a regression test.

changelog_begin

- [DAML Compiler] bugfix: Newtype constructors must have the same
  name as the newtype itself, since newtypes are record types.

changelog_end

* Change error message on newtypes

* update a test
2020-09-23 15:36:18 +00:00
Marton Nagy
071f604d6d
Enables fetching scala library sources (#7464)
* Enables fetching scala library sources

Enables fetch_sources flag for fetching scala sources.
These sources can be used for manual linking scala library if sources are not resolved otherwise

CHANGELOG_BEGIN
CHANGELOG_END

* Apply suggestions from code review

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-09-23 15:13:06 +00:00
azure-pipelines[bot]
3e09e9b4d9
release 1.6.0-snapshot.20200922.5258.0.cd4a06db (#7462)
This PR has been created by a script, which is not very smart and does not have all the context. Please do double-check that the version prefix is correct before merging.

@S11001001 is in charge of this release.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-09-23 09:28:41 -04:00
Remy
ad587e2dfb
LF: implement hashing for GenMap (#7461)
This is used (in particular) for contract keys containning GenMaps.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-23 14:14:19 +02:00
Moritz Kiefer
cd4a06db95
Move script tests to scalatest (#7445)
There isn’t really any good reason to insist on client_server_test
here so this PR replaces all of that by scalatest and a few test
fixtures which gives us better assertion failures, allows us to run
individual tests, ….

fixes #7356

changelog_begin
changelog_end
2020-09-22 16:59:12 +02:00
Remy
c00b149ed8
LF Repl: cosmetic Cleanup (#7459)
+ Use directly compiler config instead of `devMode` and `profiling` flags
+ rename `fMap` into `chain`
+ minor changes

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-22 16:42:20 +02:00
Remy
f5694ee2ea
LF: Kill ValueStruct (#7457)
Struct is not serializable and therefore should not appear as Value.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-22 13:37:59 +02:00
Remy
a899e5e4e6
Speedy: Check language version as part of Speedy compilation. (#7440)
Additionnally
+ move allowedLanguageVersion inside compiler config
+ add missing catch error insde
  ConcurrentCompiledPackages#addPackageInternal
+ implement EngineConfig method to easily produce a Compiler.Config

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-22 12:43:48 +02:00
Remy
63be90c0fd
Engine: documents for Engine configuration (#7420)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-22 09:08:02 +02:00
Moritz Kiefer
566d3a21d1
Remove version header from vscode snippet (#7452)
changelog_begin
changelog_end
2020-09-21 16:59:47 +02:00
Remy
7df0feeb58
Speedy: remove wrong comments introduced as part of #7438. (#7450)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-21 16:09:43 +02:00
Remy
42dcac38f0
[LF] Drop some tests for deprecated LF versions (#7449)
Since #5321, LF versions < 1.6 are deprecated. 
This PR drops some tests for those deprecated versions.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-21 15:36:47 +02:00
Moritz Kiefer
ce3d5b0b44
Extend DAML Script migration guide (#7448)
* Extend DAML Script migration guide

This PR extends the DAML Script migration guide with a few things that
have been added recently or popped up during the migration of various
refapps.

fixes #7403

changelog_begin
changelog_end

* Apply suggestions from code review

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>

* Rename daml on sql to daml for postgresql

changelog_begin
changelog_end

* Update docs/source/daml-script/index.rst

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
2020-09-21 15:23:56 +02:00
Moritz Kiefer
7b6663b3c4
Address security vulnerability in navigator deps (#7446)
node-forge 0.9 has an issue so this PR bumps selfsigned which in turn
bumps the bound on node-forge and allows us to upgrade to 0.10

changelog_begin
changelog_end
2020-09-21 11:34:59 +00:00
Moritz Kiefer
720d2e1b61
Upgrade stack (#7444)
changelog_begin
changelog_end
2020-09-21 09:29:05 +00:00
Remy
e1f8d9c781
DAML-LF: utility to compute duplicated keys in a transaction. (#7409)
The Engine does not verify key duplication when construction a
transaction, this task is currently let to the ledger implementation.
This PR provides an utility function to compute the duplicated keys
in a transaction.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-21 09:18:47 +02:00
Remy
65f1a247d0
Bump test_sha in perf tests (#7441)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-18 18:30:39 +00:00
nickchapman-da
4e32fde001
Cleanup following interleave execution and authorization (#7437)
* remove failedTransactions field from ScenarioLedger.RichTransaction

changelog_begin
changelog_end

* remove Blinding.checkAuthorizationAndBlind; fixup callers to use Blinding.blind when blindningInfo is required

* rename/relocate: ScenarioLedger.CommitError.FailedAuthorizations --> SError.DamlEFailedAuthorization

* fix types to demonstate that at most one FailedAuthorization is detected/reported

* address small review comments
2020-09-18 19:05:19 +01:00
Remy
76ef4c861a
Speedy: group compiler parameters into a Config case class. (#7438)
* Speedy: group compiler parameters into a Config case class.

Speedy compiler is parametrized by several option flags.  Those flags
are passed through different calls (in particular in the instance of
`CompiledPackages`.

This PR group all this configuration parameters into a case class to
pass the option in a cleaner way.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-18 19:32:26 +02:00
Remy
71c19901fd
Ledger-API: Validate Dar before sending it to the ledger. (#7430)
This PR implements a part of the proposal from #7093.

Here packages are validated in the participant node before to be sent to the ledger.

CHANGELOG_BEGIN

- [Ledger-API] participant node validate Dar before uploading to the ledger.
   This may increase upload time significantly.

CHANGELOG_END
2020-09-18 17:26:22 +02:00
Gary Verhaegen
2a38d03250
protect GCS bucket items (#7439)
Yesterday, a certificate expiration triggered the `patch_bazel_windows`
job to run when it shouldn't, and it overrode an artifact we depend on.
This was build from the same sources, but the build is not reproducible
so we ended up with a hash mismatch.

As far as I know, there is no good reason for CI to ever delete or
overwrite anything from our GCS buckets, so I'm removing its rights to
do so.

As an added safety measure, this PR also enables versioning on all
non-cache buckets (GCS does not support versioning on buckets with an
expiration policy).

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-18 15:59:23 +02:00
Gary Verhaegen
29b876920e
ci/patch_bazel_windows: fail on curl failure (#7431)
At the moment, with the `curl` call comfortably nested inside an `if`
statement, `curl` failures are interpreted as simply going down the
`else` branch of the conditional. Hoisting it up to a separate variable
declaration makes the script fail on the curl call itself.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-18 15:57:21 +02:00
curiousleo-da
02124c40ed
rs-grpc-bridge-test-lib: remove unneeded deps (#7435)
changelog_begin
changelog_end
2020-09-18 13:25:05 +02:00
Remy
6aa6f9245b
Engine: make package validation option. (#7436)
This is part of #7399.

This enable skipping packages validation in the engine when they are
comming from a trusted source.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-18 12:58:59 +02:00
Leonid Shlyapnikov
0730102b99
JSON API Perf Test Runner Query Store Index Support (#7434)
* Postgresql setup for Gatling perf test

* Add JSON API `query-store-index` support

changelog_begin
changelog_end
2020-09-17 16:39:00 -04:00
Stephen Compall
1e28eb5bea
reorder some of the libs-scala artifacts (#7433)
- suggested by @SamirTalwar-DA in #7347; thanks

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-17 17:12:40 +00:00
nickchapman-da
96d704b25b
Perform authorization checks during execution and not as a separate post-execution phase. (#7400)
changelog_begin
changelog_end

Adapt test for small error message change. An improvement! Previously an internal message was shown. Make test flexible enough to pass for old & new message.

Adapt expected output file. Only change is the contract-ids for active-contracts when the test ends.

fix small test bugs in testcase where authorization is wrong

temp disabled 3 tests; needs investigation; see TODO markers

temp adapt 1 test for change in error message

temp disable 1 test. needs invesigation

undo accidentally commited change to .bazelrc

add copyright header to new file

remove testcase (badActorCheck2) which is no longer expected behaviour, when authorization occurs during execution

address comments: be mre private & other tiny changes

appease scala formatter

improve expected error message in KeyNotVisibleStakeholders testcase

fix authorization issues and re-enable the 3 failing tests in EngineTest which now pass

fix auth issue and re-enable ledger-test-tool test: WronglyTypedContractIdIT

fix compatibility

re-enable test in KVUtilsTransactionSpec.scala
2020-09-17 17:50:04 +01:00
Stephen Compall
a670e68c72
add 'alter' function to DA.Map (#7427)
* add 'alter' function to DA.Map

CHANGELOG_BEGIN
CHANGELOG_END

* swap arguments for alter

- suggested by @cocreature; thanks

* alter moved to stdlib, remove from trigger lib

* use markdown formatting for alter doc

- suggested by @sofiafaro-da; thanks

* fix code block formatting

- suggested by @sofiafaro-da; thanks
2020-09-17 16:46:37 +00:00
Moritz Kiefer
86f89d5026
Split ledger-on-memory Main into multiple files (#7428)
I’d like to use this in a test fixture so this PR splits up the main
and exposes an API that gives you back the resource without having to
import Main.

changelog_begin
changelog_end
2020-09-17 17:42:27 +02:00
Gary Verhaegen
8ea85d1393
update certificates (#7432)
Our old wildcard certificate has expired. @nycnewman has already updated
our configuration to use new ones; this is just updating the tf files to
match.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-17 17:36:35 +02:00
Stephen Compall
1926ddbe9d
avoid ACS linear contract ID lookups in Trigger library (#7425)
* add Ord (ContractId a) instance

* change inner list in activeContracts to map

* adapt Internal module to new map

* support rest of Trigger daml lib

* rename adjust to alter, its Data.Map name

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* distribute type arguments for ACS activeContracts

- suggested by @cocreature; thanks

* swap arguments for alter

- suggested by @cocreature; thanks

* reformat groupActiveContracts signature

- suggested by @cocreature; thanks
2020-09-17 15:31:03 +00:00
Stephen Compall
d48e9d251d
ExecutionContext[EC] phantom for control, Future[EC, A] (#7347)
* add phantom-tagged ExecutionContext and Future to scala-utils concurrent package

* many new operations for Futures

* Future, ExecutionContext combinators from porting ledger-on-sql

- picked from 546b84ab9cdf4de2d93ec5682bdee6cfd6b385f8

* move Future, ExecutionContext companions into normal package

* lots of new docs

* many new Future utilities

* working zipWith

* tests for ExecutionContext resolution, showing what will be picked under different scenarios

* even more tests for ExecutionContext resolution

* tests showing some well-typed and ill-typed Future combinator usage

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* missed scalafmt

* one more doc note

* split concurrent package to concurrent library

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-09-17 07:36:50 +00:00
azure-pipelines[bot]
0e31e33df3
update compat versions for 1.6.0-snapshot.20200915.5208.0.09014dc6 (#7417)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-09-17 08:19:46 +02:00
Gary Verhaegen
2e25dfdc82
reenable Windows cache (#7426)
All machines have been reset.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 23:54:35 +02:00
Gary Verhaegen
f98b92d7ba
reset Windows cache (#7423)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 22:38:40 +02:00
Leonid Shlyapnikov
d13e7aa184
JSON API daily perf test cron job (#7406)
* Add http-json-perf daily cron job

changelog_begin
changelog_end

* commenting out other jobs so we can manually test the new one

* commenting out other jobs so we can manually test the new one

* Fix the shell script

* Fixing the gs bucket, `gs://http-json bucket does not exist`

* uncomment the other jobs

* timestamp from git log

* get rid of DAR copying

* comment out the other jobs, so we can test it

* uncomment the other jobs
2020-09-16 13:02:02 -04:00
Gary Verhaegen
051b0b515e
remove mailchim popup code (#7424)
After discussion we have decided to introduce such popups through Google
Tag Manager, as the release schedule fo these sorts of JS tags does not
mesh well with the current release process of our docs site.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 16:28:38 +00:00
Gary Verhaegen
b9acc09a77
read access to data bucket for appr members (#7422)
We've been saving data there but not doing anything with it. Ideally
this data would be used by some sort of automated process, but in the
meantime (or while developing said processes), having at least some
people with read access can help.

This is a Standard Change requested by @cocreature.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 18:25:23 +02:00
Stefano Baghino
51cd79f47e
Improve release instructions (#7421)
* Improve release instructions

- Add more notes on Remmina and how to use ad-hoc machines
- Fix Windows quickstart testing after change to template

changelog_begin
changelog_end

* Fix typo

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-09-16 16:07:44 +00:00
Remy
23d8451b98
LF: Drop legacy engine configuration for Sandbox Classic. (#7415)
The migration script from #7344 ensures that there are no more values
in Sandbox Classic DB encoded with Value version < 6.  Hence, we do
not need anymore a special EngineConfig to maintain backward
compatibility of Sandbox classic DB.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 17:14:53 +02:00
Moritz Kiefer
b6673b6b4d
Add design doc for authentication in the trigger service (#7394)
* Add design doc for authentication in the trigger service

This is a draft of how I currently imagine authentication in the
trigger service to work. Since the authentication middleware has to be
pluggable in the end anyway we need public documentation in the end
anyway and I find this much easier to manage than a google doc outside
of the repo which just never sees updates.

changelog_begin
changelog_end

* Update triggers/service/authentication.md

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2020-09-16 15:57:26 +02:00
Leonid Shlyapnikov
fe63816431
Write report summary in text format (#7407)
* write summary.txt

changelog_begin
changelog_end

* make `Response time distribution` brackets configurable
2020-09-16 09:31:54 -04:00
Gary Verhaegen
9632a2fa43
fix check-changelog (#7419)
In #7386 I inadvertently removed the default value for the argument
`check-changelog.sh` takes. This did not break CI because CI always
passes the argument explicitly, but it did break local workflows for
some developers.

Apologies.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 13:19:37 +00:00
Stefano Baghino
ce6e3a709c
Fix code generation command for release testing (#7418)
* Fix code generation command for release testing

* Address https://github.com/digital-asset/daml/pull/7418#pullrequestreview-489587957

changelog_begin
changelog_end
2020-09-16 13:05:54 +00:00
anthonylusardi-da
54ad2adf06
Remove hubspot mailing list popup and replace with mailchimp (#7408)
* Remove hubspot mailing list popup and replace with mailchimp

* CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 09:01:23 -04:00
Gary Verhaegen
adc0b45f5f
faster docs preview (#7383)
There is generally little need to preview the PDF version of the docs.
Also, opening up the Python server on 0.0.0.0 (the default) triggers OS
warnings on macOS.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 14:12:59 +02:00
Remy
ddbb334ecb
Engine: add submitter arg to Engine#validate (#7405)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 13:47:21 +02:00
Remy
b8ebd1daf1
Sandbox: Migrate Pre SDK 1.0 values (#7344)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 13:23:54 +02:00
Gary Verhaegen
c94e7256bc
daml/ledger: close ws on stream close (#7404)
The notion of `close` on `Stream` seems a bit confused at the moment. As
the code stands (without this PR), if you register a listener for
`'close'` events, you get notified when the underlying WebSocket closes
(even though the stream will then try to open a new one and, if it
manages to reconnect, will keep sending `'change'` events), and you do
not get notified when the stream itself gets closed (by calling
`.close()` on it), because the code in `.close()` removes the listeners
before closing the WebSocket connection, and so also before trying to
send a message to `'close'` listeners.  Further, calling `.close()` also
does not seem to work as expected, or at least as I would expect: it
will remove all listeners and close the WebSocket connection, but then
it will immediately open it up again (provided that `reconnectThreshold`
milliseconds have elapsed since the WS was last opened), leaking an open
WebSocket connection.

As part of the same confusion, the current implementation also expects
`'close'` listeners on the stream to receive a WebSocket close event, i.e.
of the form `{code, reason}`.

This PR changes the behaviour such that listeners on the _stream_
`'close'` event:

* do not get notified if the WS connection drops but manages to
  reconnect.
* do get notified if the stream closes due to a connection error we
  cannot recover from, with a `4001` status code.
* do get notified if the stream is closed by calling the `.close()`
  method, with a `4000` status code.

This PR also changes the WS termination logic such that calling the
`.close()` method on the stream actually closes the underlying WebSocket
connection.

CHANGELOG_BEGIN

* JavaScript Client Libraries: fix a bug where, upon closing a stream,
  the underlying WebSocket connection may not be properly closed.

CHANGELOG_END
2020-09-16 12:55:11 +02:00
azure-pipelines[bot]
764b5b54a5
rotate release duty after 1.6.0-snapshot.20200915.5208.0.09014dc6 (#7411)
@stefanobaghino-da is taking care of 1.6.0-snapshot.20200915.5208.0.09014dc6 (#7410), so they get pushed back to the end of the line.

Please do not merge this before #7410.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-09-16 12:46:44 +02:00