Commit Graph

9488 Commits

Author SHA1 Message Date
Sofia Faro
7bfd5e40c8
Fix a bug in AstRewriter (#13232)
And change the test that used AstRewriter to also serve as a regression
test. This bug has no impact on production code.

changelog_begin
changelog_end
2022-03-09 18:18:42 +00:00
Stephen Compall
1e562757fe
json-api failure tests with user tokens (#13113)
Refactors a bunch of AbstractHttpServiceIntegrationTestFuns and
elements of #12922's JWT function abstractions into a new
HttpFailureUserFixture, using that split to split the
FailureTests as well.

Fixes #13112.

* restore failure test porting from #12922
This reverts b4942defa4.

* move token-relevant utilities to http-json-testing lib

* replace custom actorsystem setup with AkkaBeforeAndAfter
- suggested by @ray-roestenburg-da; thanks

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Victor Peter Rouven Müller <mueller.vpr@gmail.com>
2022-03-09 18:15:49 +00:00
Gary Verhaegen
7f35d3dc27
update daml.com URLs (#13226)
Requested by Olivia Yu.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-09 18:15:40 +00:00
Stefano Baghino
00b7ad3803
Fix red main (#13224)
changelog_begin
changelog_end

The clash is between:
- https://github.com/digital-asset/daml/pull/13147
- https://github.com/digital-asset/daml/pull/12906

The latter changed the type of `ServerError` to only get `Throwable`s, the former used `ServerError`'s to wrap a string.
2022-03-09 17:09:51 +00:00
nickchapman-da
d6bb26a978
Fix stack-safety when processing function-args in ANF transform. (#13198)
changelog_begin
changelog_end
2022-03-09 16:01:43 +00:00
Simon Maxen
1d40c55177
Add metering report http endpoint [DPP-855] (#13147)
* Added metering report http endpoint

changelog_begin
Added metering report http endpoint
changelog_end

* Update with review comments
2022-03-09 14:59:08 +00:00
Moritz Kiefer
d36123bf03
Bump Canton startup timeout to 2min (#13222)
It looks like 1min is too small under load.

changelog_begin
changelog_end
2022-03-09 13:42:15 +00:00
Robin Krom
ca7efdabde
iface: tests: test DefInterface in daml-lf ast (#13220)
This adds tests for the DefInterface in Daml-lf.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-09 14:38:21 +01:00
Victor Peter Rouven Müller
6829881302
[JSON-API] Fix duplicate error logging & improve error logs messages (#12906)
* Fix duplicate error logging & improve error logs messages

changelog_begin

- [HTTP-JSON] Fix duplicate logging of errors & improved error messages slightly

changelog_end

* Simplify error handling code

* Use simple functions instead of overloading methods

* minimize diff
2022-03-09 12:43:26 +00:00
Sergey Kisel
512d869ecf
Make indexer benchmark independent of kvutils [DPP-946] (#13144)
*  Make indexer benchmark independent of kvutils [DPP-946]  (#13144)

changelog_begin
changelog_end
2022-03-09 13:24:25 +01:00
Moritz Kiefer
212bc9fdf3
Drop more controller can from the docs (#13215)
* Drop more controller can from the docs

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2022-03-09 11:35:54 +01:00
Moritz Kiefer
4e004e0a88
Replace scenario messages with script (#13207)
* Replace scenario messages with script

In theory we could try to be clever and print the "right" thing. In
practice, scenarios are almost dead so the complexity for that doesn’t
seem worth it.

fixes #13178

changelog_begin
changelog_end

* .
2022-03-09 11:35:37 +01:00
pbatko-da
98fbaae668
[Error codes] Stop using reflective 'BaseError.extractContext' to extract error's context (#13199)
changelog_begin
changelog_end
2022-03-09 10:52:11 +01:00
Moritz Kiefer
af855e5675
Speed up Daml repl startup (#13172)
* Speed up Daml repl startup

Daml repl startup is stupidly slow to the point where starting up and
executing 1+1 takes ~7s (piped to stdin so no typing included).

This PR speeds this up to ~4.5s. In addition to that, we also display
the repl process sooner and complete the last bit of setup while the
user is typing.

Specifically, we do the following:

1. Startup the JVM process in parallel with initializing our package
   db and only block on it once it’s started (and remove a stupid 1s
   sleep which doesn’t actually matter).
2. Load all packages in one go instead of one by one. This (roughly)
   matches how the script service works.
3. Only block on packages being loaded once we start running the
   script. Users can type before and we even typecheck their stuff
   before.

We could take this further and do even more in parallel with users
typing but this seems to strike a good balance between implementation
complexity, UX (if startup actually fails you get somewhat sensible
errors) & performance.

changelog_begin
changelog_end

* handle tls logs

changelog_begin
changelog_end

* Update compiler/damlc/daml-compiler/src/DA/Daml/Compiler/Repl.hs

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>

* s/terminateBarrier/exitBarrier/

changelog_begin
changelog_end

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2022-03-09 08:22:42 +00:00
azure-pipelines[bot]
f009ac1478
update NOTICES file (#13214)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-03-09 08:55:26 +01:00
Marton Nagy
f939299960
Add additional metric tracking cumulated Engine execution per interpretation (#13188)
changelog_begin
changelog_end
2022-03-09 07:24:38 +01:00
Moritz Kiefer
1f24348e21
Fix compat tests for 2.0.0 (#13187)
* Fix compat tests for 2.0.0

We also killed our automation by making the releases from the assembly repo.

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* allocate public party

changelog_begin
changelog_end
2022-03-08 18:23:30 +01:00
pbatko-da
877713edd3
Move validation error helpers out of ErrorFactories [DPP-606] (#13180)
changelog_begin
changelog_end
2022-03-08 17:15:26 +01:00
Gary Verhaegen
dfa648f585
hunt down DAML better (#13195)
Process:

- `git ls-files -z | xargs -0 -n 100 sed -i --follow-symlinks 's/DAML/Daml/g'`
- `git add -p`
- `git restore -p`
- Check there is no unstaged change left.

To review:

- Check for false positives by carefully reviewing the diff in this PR.
- Check for false negatives with `git grep DAML`.
- Quicker check for fals positives:

```
git grep DAML | grep -v migration | grep -v DAML_
```

Fixes #13190

Note: This is the "second half" of #13191, which failed to cover all the
remaining DAMLs because of:

```
$ git ls-files | grep "'"
compiler/damlc/tests/daml-test-files/MangledScenario'.daml
```

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-08 17:04:58 +01:00
Robin Krom
d130bd2516
ifaces: tests: check for iface defs in templates (#13194)
* ifaces: tests: check for iface defs in templates

This adds a test that will fail when an interface definition is present
in a module when daml-lf < 1.dev.

CHANGELOG_BEGIN
CHANGELOG_END

* Update daml-lf/archive/src/test/scala/com/digitalasset/daml/lf/archive/DecodeV1Spec.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

* Update daml-lf/archive/src/test/scala/com/digitalasset/daml/lf/archive/DecodeV1Spec.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

* Update daml-lf/archive/src/test/scala/com/digitalasset/daml/lf/archive/DecodeV1Spec.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

* remy's suggestions

Co-authored-by: Remy <remy.haemmerle@daml.com>
2022-03-08 14:44:46 +00:00
Robin Krom
be6bbc82b9
ifaces: tests: check for interface collisions in ast (#13196)
* ifaces: tests: check for interface collisions in ast

We add a test to check for interface name collisions in the daml-lf AST.

CHANGELOG_BEGIN
CHANGELOG_END

* Update daml-lf/language/src/test/scala/com/digitalasset/daml/lf/language/AstSpec.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

Co-authored-by: Remy <remy.haemmerle@daml.com>
2022-03-08 14:08:48 +00:00
pbatko-da
1c4b767295
Pattern match on each log level when logging errors (#13182)
changelog_begin
changelog_end
2022-03-08 15:01:10 +01:00
pbatko-da
bfe6320238
Reclassify TODO note regarding 'pruneUpToString <= ledgerEnd.value' check (#13183)
changelog_begin
changelog_end
2022-03-08 15:00:27 +01:00
Gary Verhaegen
961ca80b77
hunt down DAML (#13191)
Process:

- `git ls-files | xargs sed -i 's/DAML/Daml/g'`
- `git add -p`

To review:

- Check for false positives by carefully reviewing the diff in this PR.
- Check for false negatives with `git grep DAML`.

CHANGELOG_BEGIN
- Removed all traces of DAML. This may affect error messages and debug
  outputs.
CHANGELOG_END
2022-03-08 14:25:25 +01:00
Sofia Faro
85c4ea0b5c
LF spce: Make controller/observer errors fatal (#13192)
changelog_begin
changelog_end
2022-03-08 12:32:10 +00:00
pbatko-da
37c645333f
Use an error code when AkkaGrpc services get closed (#13175)
changelog_begin
Ledger API Specification: Streaming endpoints will use error code 'SERVER_IS_SHUTTING_DOWN' when the server
is being shut down, whereas before an exception without an error code was used.
Grpc status code in use remains 'UNAVAILABLE'.
changelog_end
2022-03-08 12:48:22 +01:00
Sofia Faro
190fd2487c
LF: Add interface preconditions to spec (#13173)
* LF: Add interface preconditions to spec.

Part of #11349

changelog_begin
changelog_end

* two should be True

* Incorporate remy suggestion
2022-03-08 10:11:54 +00:00
Simon Maxen
ecb5c1b7d4
Rename SqlExecutor to DbDispatcher (#13184)
changelog_begin
changelog_end

report health
2022-03-08 09:00:14 +00:00
azure-pipelines[bot]
5e8284003e
update NOTICES file (#13186)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2022-03-08 08:25:06 +00:00
Robin Krom
878754e9ac
interfaces: tests: no interfaces below 1.dev (#13179)
We add a check for the decoder that tests that implementations in
templates are only accepted in 1.dev.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-07 21:26:39 +00:00
Robin Krom
17e651c20a
release instructions: fix line numbers (#13162)
line numbers seem to have changed because of an added comment.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-07 21:48:57 +01:00
Moritz Kiefer
e44b6ef61f
Switch daml script multi-participant tests to Canton (#13171)
* Switch daml script multi-participant tests to Canton

ledger-on-memory is moving repos together with kvutils so this doesn’t
work anymore. Sandbox on X does not (yet) have multi-participant
support so this is our only option.

At a later point, we may want to switch back to sandbox on x once it
supports multiple participants.

changelog_begin
changelog_end

* more startup attempts

changelog_begin
changelog_end
2022-03-07 20:34:17 +01:00
Remy
d5471076ad
Speedy: Factorize fetch part between fetch by template and by itnerface (#13148)
CHANGELOG_BEGIN
CHANGELOG_END
2022-03-07 20:32:47 +01:00
Sergey Kisel
235254998f
Fix debug logging in ApiTransactionService (#13174)
* Fix debug logging in `ApiTransactionService`

changelog_begin
changelog_end

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2022-03-07 18:29:33 +01:00
nickchapman-da
9e71184582
Thorough stack-safety testing for all speedy compiler phases. (#13168)
changelog_begin
changelog_end
2022-03-07 15:53:35 +00:00
pbatko-da
c7c211e4df
Remove most of ErrorFactories [DPP-606] (#13146)
changelog_begin
changelog_end
2022-03-07 16:15:21 +01:00
Stewart Stewart
0a52e56ca1
Make http.domain a package (Fixes #11151) (#13164)
Use a package instead of object for organization so the namespace
remains open. Note that in Scala 3, the val/type aliases in this diff
can become export statements.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Stewart Stewart <stewart.stewart@digitalasset.com>
2022-03-07 09:44:31 -05:00
Victor Peter Rouven Müller
fdb5cdae0a
[JSON-API] Normalize token parsing & remove custom parsing code (#13161)
* Normalize token parsing & remove custom parsing code

changelog_begin

- [HTTP-JSON] custom claim tokens without ledger id are now correctly recognized as such and not as user tokens

changelog_end

* Add test to check that tokens without ledger id work correctly

* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/endpoints/UserManagement.scala

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/EndpointsCompanion.scala

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* Remove the overload of jwtForParties & change how the wihtoutNamespace JWT is constructed

* Remove unnecessary code line

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2022-03-07 13:35:37 +01:00
azure-pipelines[bot]
7ce81173c1
update NOTICES file (#13167)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2022-03-07 07:05:03 +00:00
tudor-da
1f1e50514b
Latency test implementation in LedgerApiBenchTool [DPP-947] (#13150)
* Latency test implementation in LedgerApiBenchTool

changelog_begin
changelog_end

* Addressed review comments
2022-03-04 18:53:10 +01:00
Gary Verhaegen
53557dd7de
shut down ElasticSearch (#13151)
The cluster shuts down about once every two weeks and takes a couple
hous to get back up. It's been off for a few days right now and as far
as I'm aware nobody noticed.

My personal assessment is that this is costing us more in maintenance
(not to mention running) costs than what we're getting out of it.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-04 17:14:15 +01:00
azure-pipelines[bot]
247ec1150e
rotate release duty after 2022-03-02 (#13119)
@robin-da is taking care of testing today's release, so they get pushed back to the end of the line.

Please do not merge this before the release is fully tested.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-03-04 14:29:03 +01:00
Gary Verhaegen
54dc19deb8
add release instructions to release notification (#13160)
Because we can't expect people to magically know where to find them.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-04 11:33:15 +00:00
pbatko-da
15aa300fba
Use DamlContextualizedErrorLogger.forTesting (#13137)
changelog_begin
changelog_end
2022-03-04 12:24:08 +01:00
Gary Verhaegen
0002b7ebae
guard nightly (#13158)
In some cases we may end up with the tip of the main branch built as a
split release manually. When Azure then tries to run it, the release
fails (typically on the upload to NPM step).

Normally, Azure is set to run this only once per commit, but that only
applies when the run is successful. So if it breaks in a reproducible
way (e.g. because the version already exists on NPM), Azure will keep
trying every day.

This PR adds a simple guard that makes the nightly build _not_ a release
commit if the reelease already exists, which should short-circuit most
of the jobs in the build and finish successfully.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-04 11:16:01 +00:00
azure-pipelines[bot]
2c50f9e75c
update NOTICES file (#13155)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2022-03-04 09:46:54 +00:00
pbatko-da
af27f5d926
Make ErrorFactories into an object in preparation for its removal. [DPP-606] (#13143)
changelog_begin
changelog_end
2022-03-04 09:35:38 +01:00
pbatko-da
e6db32719b
[User management] Rename --max-users-page-size flag to conform to established pattern [DPP-944] (#13130)
changelog_begin
changelog_end
2022-03-03 23:09:20 +01:00
pbatko-da
56306eb387
[User management] More race condition tests. Simplifications in the backend. (#13140)
changelog_begin
changelog_end
2022-03-03 22:48:11 +01:00
Remy
3e3fccacfd
LF: Make exceptions in choice's controller/obervser uncatchable (#13106)
fixes #13099

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-03 18:37:12 +01:00