Commit Graph

7023 Commits

Author SHA1 Message Date
Moritz Kiefer
87a1198318
Publish nameof library (#9798)
* Publish nameof library

changelog_begin
changelog_end

* Fix version suffix on builtins

changelog_begin
changelog_end
2021-05-26 09:58:02 +00:00
Sofia Faro
7a7b5fee76
Add a data-dependencies test for stdlib exceptions. (#9799)
* Add a data-dependencies test for stdlib exceptions.

changelog_begin
changelog_end

* fix test and run damlc test
2021-05-26 10:04:43 +01:00
Moritz Kiefer
575bf04303
Address navigator security vulnerability (#9789)
changelog_begin
changelog_end
2021-05-26 10:50:32 +02:00
Moritz Kiefer
77e6fd6aa9
Bump rules_nodejs to 3.5.1 (#9796)
Just cleaning up the mess I produced with the 3.5.0 upgrade (or more
like moving the mess into rules_nodejs).

changelog_begin
changelog_end
2021-05-26 10:35:18 +02:00
Sofia Faro
4e9c86ccd0
Fix a typo in LF spec normalization section. (#9797)
changelog_begin
changelog_end
2021-05-26 08:19:45 +01:00
Sofia Faro
d024efeffc
Add a section on transaction normalization in the LF spec. (#9788)
Note that it only has rules for normalizing `create` and `exercise`, but that's because the LF spec only has `create` and `exercise` actions for now.

changelog_begin
changelog_end
2021-05-26 07:45:54 +01:00
nickchapman-da
2710fad0e1
Normalize rollback nodes when a transaction is constructed (#9712)
* Normalize rollbacks: first draft

CHANGELOG_BEGIN
CHANGELOG_END

NormalizeRollbackSpec, WIP

WIP2

adapt to asVersionedTransaction

first stab at traversal for normalize-rollbacks... implement normalization rule #1

adapt existing testcase for rollback normalization rule #1

pluralize spec filename

temp disable rollback normalization

methodically test normalization rule #1

lots more tests

spec: check all 3 norm conditions

cleanup test/Shape code a bit

implement normalization rules #2 and #3 (using canonical types) and enable tests

add some comments and some 8020 todo markers

* add 2 more testcases from Sofia

* ensure tx produced when normalizing rollbacks has increasing node-ids when listed in pre-order

* enable rollback normalization in interpreter

* manage state functionaly for the created tx (counter & node-map)

* un-nest sub defs from normalizeTx (we can because we removed the mutable state)

* rename: force* --> push*

* introduce CPS for push functions

* introduce trampolines for push functions to be stack safe

* one more bounce

* ensure generated node-ids start from 0

* test that transaction node-ids start from 0

* add commets about pass1/2; move makeRoll (part of pass 1) earlier in file

* intro CPS for pass-1 over original tx

* intro trampolines for pass-1. everything is stack safe now

* clarify comment

* remove make stack-safe todo

* be more private

* factorize/share Trampoline implementation with previous implementation in speedy.Anf

* prefer Vector over List, for better algorithmic complexity

* make Trampoline private to lf
2021-05-25 17:00:31 +00:00
Gary Verhaegen
646c956457
new windows signing (#9786)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-25 16:23:17 +02:00
Moritz Kiefer
cae429237e
Upgrade rules-nodes to version 3.5.0 (#9635)
* Upgrade rules-nodes to version 3.4.2

No particularly strong reason for doing that. I just like staying up2date.

changelog_begin
changelog_end

* Patch Windows

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2021-05-25 16:04:39 +02:00
Robin Krom
a336363020
ghc-lib: update (#9742)
* ghc-lib: update

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-25 15:52:39 +02:00
Remy
8ef93611fa
Scenario: Test ArithemticError (#9757)
Two integration-type tests:

- An uncaught arithmetic error
- A caught arithmetic error

This is part of #8020

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-25 14:43:27 +02:00
Stephen Compall
ad529e9a8b
http-json-perf: querying larger ACSes with different data patterns (#9530)
* new perf test module LargeAcs to shift many-contract creation to Daml-side

* using MakeIouRange to make blocks of (more or less constant) Ious

* syntax and bad variable quasiquoting

* ACS data distribution plans

* run with 100k contracts, same template, 1% observer frequency

* use CanAssert instead of CanAbort

* query under proper alternative jwt

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* make sure the database accurately represents the ACS
2021-05-25 08:23:31 -04:00
Moritz Kiefer
0b24655742
Fix archive calls in ExceptionsIT (#9787)
thanks to @oliverse-da for catching this.

changelog_begin
changelog_end
2021-05-25 13:58:31 +02:00
Sofia Faro
abb7142072
Update LF spec for exceptions. (#9784)
* Update LF spec for exceptions.

The changes here are:

* Removing the built-in exception types
* Changing the result in the operational semantics to include both an "exception thrown" case and a "fatal error" case.
* Cleaning up the semantics of create/exercise/etc and try/catch.

Not included in this PR is anything to do with built-in arithmetic exceptions. There's room to add it in the future (as a value of AnyException type), but I would do it in a follow-up PR.

changelog_begin
changelog_end

* finish renaming Throw cases

* Update type ordering for AnyException.
2021-05-25 10:33:44 +00:00
Sofia Faro
d2089796b2
Make succ/pred throw an ArithmeticError on overflow. (#9783)
* Make succ/pred throw an ArithmeticError on overflow.

Part of #8020.

This is the only remaining case in daml-prim & daml-stdlib where it seems correct to me to throw a different exception type rather than `GeneralError`.

changelog_begin
changelog_end

* Fix Enum
2021-05-25 10:11:50 +01:00
Sofia Faro
cd2ed07a50
Rename ContractError to PreconditionFailed (#9782)
* Rename ContractError to PreconditionFailed

Part of #8020

changelog_begin
changelog_end

* Packaging.hs mistake
2021-05-25 10:11:37 +01:00
Moritz Kiefer
1b428be7d2
Add ledger API test tool tests for rollback projections (#9778)
* Add ledger API test tool tests for rollback projections

This adds 3 tests for projections under rollback nodes.

The first one is relatively clear hopefully and tests divulgence.

The other two are a bit more intricate. For both of those we can also
not test too much via the ledger API since we don’t actually get
access to rollback nodes. However, it still seems useful to at least
exercise those code paths and make sure they don’t do anything
horribbly wrong.

The second test tests the normalization rules from
https://github.com/digital-asset/daml/blob/main/docs/source/concepts/ledger-model/ledger-exceptions.rst#privacy

The last one tests a more complex structure with deeply nested
rollback nodes and different informees.

changelog_begin
changelog_end

* Update ledger/test-common/src/main/daml/semantic/Exceptions.daml

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2021-05-25 08:53:43 +02:00
Gary Verhaegen
fb6f72c81d
debug signtool on main (#9780)
I don't know what's going on. I was hoping I could try to debug from
PRs, but that doesn't seem to work.

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-24 13:26:41 +00:00
azure-pipelines[bot]
459de1c74d
update NOTICES file (#9781)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-05-22 10:34:05 +02:00
Gary Verhaegen
61293c3ec4
maybe fix azuresigntool invocation (#9779)
🤷

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-21 17:01:27 +00:00
Robert Autenrieth
66b8f19407
DPP-406 split append only migration (#9777)
* Rename migrations

* Split the append-only migration

changelog_begin
changelog_end
2021-05-21 16:36:19 +02:00
Gary Verhaegen
45bca6e68b
test_windows_signing: install for u (#9776)
Turns out "`--global`" means "for this user".

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-21 15:49:31 +02:00
Victor Peter Rouven Müller
ed36caa99a
Make use of nameOf for naming telemetry traces in participant-integration-api (#9762)
* Make use of nameOf for naming telemetry traces in participant-integration-api

changelog_begin
changelog_end

* Add copyright header to Telemetry.scala

* Add a simple nameof macro lib which has one function to return the fqn of the current method

* Make use of the new nameof lib within the repo to shorten the code further

* Remove old dependency on nameof macro

* Readd lines which have been accidentally removed
2021-05-21 12:34:55 +00:00
Marton Nagy
6f20d78056
Makes sandbox-classic compression configurable (#9770)
* Adds configuration parameter and wiring
* Only append only schema is supported (for mutating schema it has no effect)

changelog_begin
changelog_end
2021-05-21 12:12:20 +00:00
Gary Verhaegen
b8afa02e12
test_windows_signing: add quotes (#9773)
Otherwise Bash interprets the baskslashes and it's not a path anymore.

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-21 11:12:09 +00:00
Gary Verhaegen
4af6608185
fix signing machine (#9772)
Turns out PowerShell is not Bash. Who knew? 🤷

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-21 12:36:56 +02:00
Gary Verhaegen
5717356a42
fix test_windows_signing job name (#9771)
😢

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-21 10:33:25 +00:00
Remy
5855a9941f
LF: Drop CONTRACT_ERROR (#9754)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-21 09:12:29 +00:00
Gary Verhaegen
f5c5b634eb
prepare for EV Windows signing (#9758)
Setting up a non-disruptive way to test out EV signing of our Windows
artifacts.

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-21 10:46:45 +02:00
Moritz Kiefer
88c83ec476
Mark //daml-assistant/daml-helper:test-deployment as flaky (#9769)
Fails a bit too often to waste people’s time with restarts.

changelog_begin
changelog_end
2021-05-21 09:57:19 +02:00
Andreas Herrmann
fa0815bc11
Example export (#9756)
* Pretty print daml.yaml in Daml ledger export

changelog_begin
changelog_end

* Use dynamic port in example-export generation

* Add daml.yaml to Daml ledger export golden test

* Sort data-dependencies for reproducibility

* Replace hashes in data-dependencies with a placeholder

To avoid test failure when any of these change.

* normalize data-dependencies path in scala client

So that the bazel build action is more reproducible itself.

* Fix Scala 2.12 build

* Factor out deleteRecursively

changelog_begin
changelog_end

* Generate ledger export in temp-dir

Build actions are not sandboxed in Windows. The ledger export will also
created a directory `deps` to store all the DALFs in. On Windows this
directory may persist across Bazel builds and may cause errors due to
attempts to overwrite an existing directory.

To avoid these issues the ledger export is generated into a temporary
directory and only the wanted files are moved to the expected output
locations in the bazel execroot afterwards.

* Close source

* Use replace instead of replaceFirst

The latter matches regex pattern instead of just substring matching
which fails with Windows paths due to `\` being interpreted as an escape
character.

* Normalize Windows \ to Unix /

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-05-21 09:36:25 +02:00
azure-pipelines[bot]
3b33397bfe
update NOTICES file (#9767)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-05-21 07:13:07 +00:00
Moritz Kiefer
4f97a4da8e
Avoid test log collisions across platforms (#9763)
Currently they overwrite each other which is clearly not helpful.

changelog_begin
changelog_end
2021-05-21 09:11:16 +02:00
Moritz Kiefer
6f631da09d
Use munit for diffs in ledger-api-test-tool (#9765)
As everyone knows that has worked on the ledger API test tool, diffx
makes compilation very very slow (>150s for TransactionServiceIT).

As some people (myself included) know, trying to get diffx to not be
slow is also a giant nightmare (have fun debugging mutually recursive
implicits derived by Scala macros)

So this PR takes a different approach:

Drop diffx completely and replace it by munit. This leads to slightly
different diffs but I think they’re close enough and importantly munit
involves absolutely no macros for those diffs so compilation takes 5s
for TransactionServiceIT.

changelog_begin
changelog_end
2021-05-21 08:40:17 +02:00
Brian Healey
92568eb2fe
Make hikari connection pool timeout configurable (#9750)
* 2 seconds rather than 250ms for default hikari connection pool timeout

CHANGELOG_BEGIN
[jdbc ledger] increase default hikari connection pool timeout to 2s from 250ms
CHANGELOG_END

* extract hikari connection timeout configuration

* default of 250ms

* read hikari connection timeout default from config rather than hardcoding for sandbox next

* remove unused import
2021-05-20 17:51:30 -04:00
Marton Nagy
38cb8b4d3a
Fix flaky CMConcurrentSetConflicting conformance test (#9766)
By relaxing the assertion to two possible GRPC error codes.
Also adds dependency of libs-scala/grpc-utils to test suites.

changelog_begin
changelog_end
2021-05-20 20:57:27 +00:00
Robert Autenrieth
d2bce1628e
DPP-335 Implement data migration for the append-only schema (#9481)
* Implement data migration

changelog_begin
changelog_end

* Rename migration

* Update test

* Move the append-only migrations

* Enable data migration test

* Fixup after script rename

* Check append-only migration hashes

* Add missing comments

* Simplify query

* Add vacuum migration

* Rename unknown workflow id

* Only use head migration script

* Rename history table

* Fix comments

* Align previous schema change after rebase

changelog_begin
changelog_end

Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com>
2021-05-20 21:33:18 +02:00
Sofia Faro
765d7e3f53
Throw ContractError in template precondition field (#9760)
* Throw ContractError in template precondition field

changelog_begin
changelog_end

* s/pre-condition/precondition/where relevant
2021-05-20 19:10:25 +00:00
Moritz Kiefer
f5a03b3af6
Stop leaking Sdk installations from assistant integration tests (#9751)
Each of these installations is about 1gb so it’s not that unlikely
that this plays a significant factor in our out of disk space errors.

Although I think we cleanup partially so I’m not sure how large the
part of the SDK installation is that gets leftover.

changelog_begin
changelog_end
2021-05-20 20:20:12 +02:00
Remy
a2775605d8
LF: change format of ArithmeticError message (#9761)
in order to follow LF conventional syntax.

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-20 20:10:31 +02:00
Moritz Kiefer
90180eb87f
Make sure we don’t start leaking directories in compat tests (#9759)
As evidenced by this change, we don’t actually need the safeguard
here. i think this was just copied over from the main workspace where
we did leak installations. I’d like to know when we start leaking
installations here in the future so this PR removes the catch.

changelog_begin
changelog_end
2021-05-20 13:59:11 +00:00
Victor Peter Rouven Müller
beb2d138f2
Add cli option & system property to enable json only logging for http json service (#9725)
changelog_begin
- [Ledger HTTP Json Service] Logging output can now be in JSON either via providing the cli option `--log-encoder json` or via setting the env var `LOG_FORMAT_JSON=true`
changelog_end
2021-05-20 13:28:34 +00:00
Moritz Kiefer
3827f82a7a
Fix consumedBy in rollback nodes for scenario service (#9746)
changelog_begin
changelog_end
2021-05-20 12:07:13 +00:00
Sofia Faro
2ba5ca7ca2
Make DA.Assert throw AssertionFailed instead of GeneralError (#9747)
* Make DA.Assert throw AssertionFailed instead of GeneralError

changelog_begin

- [Daml Standard Library] `assert`, `(===)`, and other assertion functions (see DA.Assert) now use a new `CanAssert` typeclass constraint instead of `CanAbort`, in preparation for exceptions support.

changelog_end

* Add CanAssert instances for Script and Trigger.

* buildifier-fix

* update script test runner output

* Fix flag and add tests.

* update script test runner again
2021-05-20 12:01:50 +00:00
Moritz Kiefer
b9c36c9a5b
Disable per commit windows compat tests (#9755)
* Disable per commit windows compat tests

Windows version of #9370 to further reduce queues until we either get
more nodes or find another solution. We still test everything in the
daily run.

changelog_begin
changelog_end

* remove success check for skipped windows compat

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2021-05-20 10:37:59 +00:00
Miklos
b1ca310866
ledger: Damlification of Scala files (#9667)
* Damlification of Scala files (primarily comments and strings).

* Corrected a typo.
CHANGELOG_BEGIN
CHANGELOG_END

* Fixed build.

* Fixed test case for acronyms.

* Reformatted.
2021-05-20 10:21:04 +00:00
Marton Nagy
40cf26fb8c
Log improvements for parallel indexer (#9752)
changelog_begin
changelog_end
2021-05-20 11:15:46 +02:00
Miklos
3bf6531e3c
ledger-service, navigator: Damlification of Scala files (#9669)
* Damlification of Scala files (primarily comments and strings).

* Comment tidying.
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-20 09:14:13 +00:00
Marton Nagy
f947c02c74
Extend ConfigManagementServiceIT with tests on generation checking (#9753)
changelog_begin
changelog_end
2021-05-20 09:11:32 +00:00
Miklos
f5c84a2aa4
Daml-LF: Damlification of Scala/Haskell files (#9666)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-20 09:52:33 +02:00