Commit Graph

7041 Commits

Author SHA1 Message Date
daravep
a166e79aca
Added maxlength information to id string (#9826)
Before this change, when converting a string which exceeds the max
length, the application return the error "too long" without saying what
the bounds are, requiring a user to lookup the bounds in code. Now, the
user gets the actual length that is enforced as part of the error
message.

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-28 08:30:19 +02:00
tudor-da
63bc0d1a96
EventsBuffer implementation for in-memory fan-out for Ledger API serving (#9775)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-28 08:23:34 +02:00
Remy
0c12259c04
Speedy: Use SAny instead of SAnyException to reperesent AnyExcpetion (#9819)
This PR simplifies the internal of Speedy by factorizing SAny and
SAnyException. By side effect we also get the comparison of LF
AnyException values that was not implemented before.

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-27 23:43:26 +00:00
daravep
6caa61c9d4
participant-state: rejection reason abstractions (#9764)
Before this change, any write-service was restricted to the predefined
set of rejection reasons which couldn't capture the complex canton
rejection reasons.
In order to open up the path for a redesign, I've migrated the current
rejection reasons into a V0 version and opened the abstract class for
customized implementations. I've also added a temporary method to tunnel
synchronous rejections through the ledger api server.

CHANGELOG_BEGIN
- Participant-state: Introduced versioned form of rejection reason
CHANGELOG_END
2021-05-27 19:06:36 +02:00
Samir Talwar
63c471fa79
Upgrade protobuf-java and scalapb. [KVL-938] (#9713)
* Upgrade protobuf-java and scalapb.

CHANGELOG_BEGIN
CHANGELOG_END

* Bazel: Generate ScalaPB classes without `unknownFields`.

This is very annoying because it means that extractors need an extra
`_` for no good reason. It also breaks Circe's automatic derivation.

Including unknown fields is the default behavior in Protocol Buffers for
Java now, and we'll probably have to reckon with it at some point, but
let's kick that can down the road a little.

* Upgrade protobuf-java to 3.17.1.

This is identical to 3.17.0, but let's track it anyway.

* Bazel: Move ScalaPB versions into their own file.

They don't need to go into the generated one.
2021-05-27 13:41:28 +00:00
Kamil Bożek
f177c1a6e4
ledger-api-bench-tool - Moved classes to individual files [DPP-401] (#9803)
* Move ledger-api-bench-tool classes to individual files

CHANGELOG_BEGIN
CHANGELOG_END

* Moved MaxDelay to a separate file
2021-05-27 12:12:40 +02:00
Remy
a3b10dc6f9
LF: fix parser (#9809)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-27 11:57:49 +02:00
azure-pipelines[bot]
9f55da813f
update NOTICES file (#9812)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-05-27 11:37:10 +02:00
azure-pipelines[bot]
6846dbfaf8
update compat versions for 1.14.0-snapshot.20210526.7024.0.aedb9a82 (#9806)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-05-27 09:56:25 +02:00
Remy
1f021b25c6
LF: Drop Builtin Exceptions completly (#9790)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-26 19:30:44 +02:00
azure-pipelines[bot]
ea5b710d7d
rotate release duty after 1.14.0-snapshot.20210525.7017.0.2710fad0 (#9795)
@aherrmann-da is taking care of 1.14.0-snapshot.20210525.7017.0.2710fad0 (#9794), so they get pushed back to the end of the line.

Please do not merge this before #9794.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-05-26 18:23:33 +02:00
Moritz Kiefer
0c7b149068
Add reference docs for exceptions (#9807)
* Add reference docs for exceptions

Not that these are reference-style docs so they are deliberately brief
and don’t focus on usecases. I’ll add a section to the Daml intro for
that in a separate PR.

changelog_begin
changelog_end

* Apply suggestions from code review

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

* review comments

changelog_begin
changelog_end

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2021-05-26 16:17:31 +00:00
Remy
6b67ba06f2
LF: SBAnyExceptionMessage queries for unknown packages. (#9804)
* LF: SBAnyExceptionMessage queries for unknown packages.

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-26 16:43:58 +02:00
Sofia Faro
fdab1e68d7
Parallelize daml-assistant integration tests. (#9802)
* Parallelize daml-assistant integration tests.

This mainly involves avoiding changing the working directory or the environment while inside tests.

AFAIK the daml start tests can't be parallelized without starting up a sandbox instance each time, which seems bad. These tests could be separated from the rest...

The magic number "2" was picked via experimentation:

```
1 threads -> 306 s
2 threads -> 199 s
3 threads -> 198 s
4 threads -> 195 s
```

changelog_begin
changelog_end

* buildifier-fix
2021-05-26 13:05:39 +00:00
Robert Autenrieth
2e9c56e52c
DPP-393 Activate JdbcLedgerDao suite for the append-only schema (#9793)
* Fix missing microseconds

* More lenient error string matching

* Fix typo

* Fix ledger time tests

Previously, the computed blinding info
did not contain any divulgence, which lead to
no divulgence events being stored.

* Implement JdbcLedgerDao tests for the append-only schema

changelog_begin
changelog_end

* Apply review comment
2021-05-26 14:32:45 +02:00
Andreas Herrmann
274fcaee10
release 1.14.0-snapshot.20210525.7017.0.2710fad0 (#9801)
changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-05-26 13:55:43 +02:00
Kamil Bożek
3241ad6a41
ledger-api-bench-tool - updated metrics reporting model [DPP-400] (#9749)
* Simplified metrics names

* Metrics returning domain values instead of formatted strings

* Always returning metric Value objects with possibly optional contents

* Use the new metric Value classes

* Remove the old metric reporting mechanism

* CHANGELOG_BEGIN
CHANGELOG_END

* Fixed 2.12 build

* Removed random generators from metric tests

* Fixed 2.12 build

* Improved readability of the size metric calculation

* Minor change

* `ledger-api-bench-tool`: max consumption delay SLO [DPP-400] (#9785)

* ServiceLevelObjective trait

* Added copyright to a new file

* A model for combining metrics and objectives in type families

* Mechanism for returning metric violation information

* Return error code when SLOs violated

* Use type parameter for the result of transaction service methods

* max-delay command line parameter for the max delay SLO

* Logging violated objectives in the final report

* Simplified size rate metric value

* CHANGELOG_BEGIN
- [Integration Kit] - ledger-api-bench-tool - new parameter max-delay for specifying the service-level objective for max delay
CHANGELOG_END

* Fixed tests

* Simplified MetricsManager.Message trait

* Fixed build errors

* Changed objectives violated message

* Removed DelayObjective trait

* Comments improvement

* Ordering for MaxDelay.Value

* Removed redundant method from the ServiceLevelObjective trait
2021-05-26 13:16:57 +02:00
Andreas Herrmann
aedb9a823b
Daml ledger export test - normalize SDK version (#9800)
changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-05-26 10:08:37 +00:00
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