Commit Graph

683 Commits

Author SHA1 Message Date
mziolekda
2533965c8d
Add config parameter for custom scopes in http-json (#17727)
* Add config parameter for custom scopes in http-json

* fix daml-script

* Add tests

* fixes from code review
2023-11-21 14:07:11 +01:00
Raphael Speyer
97c04f6f4c
JSON API: switch to a keystore-based config for HTTPS (#17839) 2023-11-20 21:02:57 +11:00
Remy
420b8c52ad
Mark gatling dependencies as deprecated (#17820)
This changes guarantees akka does not appear in maven_install_2.13.json

    we add a new maven depo deprecated_maven
    we add gatling to deprecated_maven
    we reactive gatling-utils and http-json-perf
    we move gatling-utils in ledger-service/http-json-perf/ (we do not want new component to use gatling)
2023-11-15 18:22:54 +00:00
mziolekda
b81ee69abe
disentangle ledger api (#17831)
* make testing-utils independent of ledger-api

* remove dead files

* move non ledger-api stuff to libs-scala
2023-11-14 22:44:10 +01:00
Marton Nagy
6933514df5
Switch from Akka to Pekko (#17814)
* Automated renames by bash script

This commit is exclusively contains changes by the bash script.
For the bash script is present at the pull request.

* Manual pekko migration changes

* adapt fully qualified name references
* adapt pekko package declarations
* adapt bazel files with dependency changes
* adapt canton pekko lib shade_rule
* adapt logger configuration declarations
* pin maven dependencies
* revert incorrect changes by script to compatibility module

Workarounds for further TODOs:
* disable http-json-perf and libs-scala/gatling-utils modules to maintain clean pekko dependencies (without akka)
* disable GraphQLSchemaSpec test (sangria library needs to be upgraded)

* Formatting
2023-11-13 23:22:22 +00:00
Raphael Speyer
454159e445
http-json-perf: simplify BUILD file and remove dep on akka Uri type (#17804)
* simplify BUILD file and remove dep on akka Uri type

* put scalacopts back

---------

Co-authored-by: = <=>
2023-11-13 09:10:40 +01:00
Marton Nagy
78cc750714
Scala upgrade to 2.13.11 (#17803) 2023-11-13 09:05:39 +01:00
Raphael Speyer
c19f52ce38
remove build dependency on akka from http-json-perf tests (#17798)
In doing so, we disable the automatic production of the extra reports from gatling results.
These can be re-enabled in future if they're considered valuable.
2023-11-10 21:38:35 +11:00
Remy
6ef062dac9
Revert "Nmarton/pekko rebased (#17789)" (#17796)
This reverts commit d310692d1b.

@remyhaemmerle-da messed up and merged the PR too fast.
2023-11-09 21:23:18 +00:00
Marton Nagy
d310692d1b
Nmarton/pekko rebased (#17789)
* Scala upgrade to 2.13.11
* Switch from akka to pekko
* Also disable gatling based libs to start from a clean stage
2023-11-09 18:17:33 +01:00
Paul Brauner
313b789731
Bump netty and grpc-netty (#17770)
* pin dependencies to json and add missing dep

* fix cyclic dep

* remove unused dep

* add missing dep to //ledger-api/testing-utils:testing-utils

* remove unused dep in //ledger/ledger-api-auth:ledger-api-auth

* remove more unused deps

* more dep fixes

* yet more dep fixing

* more fixing..

* more of the same

* hopefully the last deps to fix

* Bump the version of protobuf and fix everything that depends on it. Took shortcuts that I need to fix in a next commit, but would like to run the CI on this now that it compiles

* don't error out in the grpc-haskell patch

* remove obsolete patch

* patch absl to compile on mingw

* Add a patch to recognize the compiler

* Define _DNS_SD_LIBDISPATCH for macOS gRPC

* bump netty_tcnative_version according to https://github.com/grpc/grpc-java/blob/master/SECURITY.md#netty

* pin maven deps

* Fix macos linking errors 'dyld[xxx]: missing symbol called'

* Skip Darwin frameworks in package-app.sh

* pin stackage packages

* pin stackage windows deps

* use the netty version agreed on

* bump the windows global cache to try and debug the upb issue

* restart the CI after timeout

* clean up

* disable failing tests for now

* comment out unused code

* reset the windows machine name to 'default'

---------

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2023-11-07 19:35:50 +01:00
azure-pipelines[bot]
9ea0c3089f
update canton to fd561690 (#17754)
* update canton to fd561690

CHANGELOG_BEGIN
CHANGELOG_END

* Disable explicit setting of explicit disclosure

---------

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
Co-authored-by: Tudor Voicu <tudor.voicu@digitalasset.com>
2023-11-06 11:05:44 +00:00
Samuel Williams
637ff67ea0
Upgrades testing via daml-script (#17610)
* Implement vetDar and unvetDar
Blocked by canton not returning uploaded dars

* Upgrades testing infra/IT

* Fix HttpServiceTestFixture

* Fix some tests

* Fix cantonRunner for windows

* Add delay after vet actions so topology transactions can land

* Implement invalid data upgrades tests

* Add temporary internal setContractUpgradingEnabled flag to daml-script

* Switch to setProvidePackageId

* Write choice and multi-participant tests

* Formatting

* Remove unused import

* Address reviews

* Update errors

* Fix canton runner for windows

* Address review comments

* Add new proto to artifacts

* avoid pushing canton admin proto as maven artifact (#17742)

---------

Co-authored-by: Remy <remy.haemmerle@daml.com>
2023-11-03 14:10:15 +00:00
tudor-da
445a037c3e
Adapt JSON API server to the new explicit disclosure Ledger API interface (#17684)
* Adapt JSON API write path to the new explicit disclosure Ledger API interface

* Address review comments

* Switch to vanilla Base64 for createdEventBlob instead of Base64Url

* update TypeScript bindings of DisclosedContract to use the createdEventBlob field instead of payload, payloadBlob and metadata, and short-circuit a test which depends on canton populating the createdEventBlob field

* get TypeScript integration tests to use transaction service to get created_event_blob data

---------

Co-authored-by: = <=>
2023-11-02 12:35:03 +00:00
mziolekda
25ae8d2281
Explicit disclosure based on blobs only (#17606)
* Explicit disclosure based on blobs only

* cosmetic changes

* Changes post-review

* remove buf check suppression

* Silence deprecation warnings

* more silencing of deprecation warnings

* Changes after recent round of reveiews
2023-10-23 13:47:30 +00:00
Raphael Speyer
86519d526a
Postgres testing: explicitly configure database ordering to be non-linguistic (#16748)
This makes for reasonable sorting and ordering behaviour that should be the same across platforms.
2023-10-17 15:13:38 +11:00
Raphael Speyer
ff8316320a
LT-2: add https support to JSON API (#17516)
JSON API will be served from an HTTPS endpoint if the config includes a `server.https` section.

Note https://digitalasset.atlassian.net/browse/LT-37 to enable the unit test on windows and mac systems.
2023-10-17 13:10:30 +11:00
Remy
623f305e9c
Move canton directory to let place for code drop (#17506) 2023-09-29 14:37:01 +00:00
Raphael Speyer
6e1f59de3a
JSON API: add test for websocket close (#17463)
Using `java.net.http.WebSocket` seemed like the simplest interface to be able to verify the closed status from the outside of the system. We looked into akka's `WSProbe::expectCompletion` but wiring that up would have required building our own `WebSocketService` and all its dependencies.
2023-09-22 11:00:57 +10:00
Iggy
91af9023e7
FIX: Propagate client-side termination of websockets to infinite substreams (#17398)
Fixes termination of WebSocket streams when the client sends a close-frame. The problem was that upstream completion (i.e. termination on the client-side of WebSocket streams) does not propagate to infinitely-running substreams. This PR propagates the upstream completion explicitly to all substreams using a kill-switch.
2023-09-14 19:59:46 +10:00
Paul Brauner
a5cd445d3b
Introduce LF2 major version (#17348)
- Introduces a new major version, "2", in the daml_lf proto
- Adds new major versions to the compiler and the engine
- Updates all code that assumes only one major version
- Updates all code that assumes only one dev version
2023-09-13 10:01:42 +02:00
Paul Brauner
818bb1e6e8
Clean up some bazel rules (#17359)
* Fix a probable typo in //daml-fl/encoder/testing-dar-*

* apply TODOs in bazel files

* remove obsolete comments in bazel files

* use 'default' instead of 'latest' for targets relying on 'latest' in order to ensure interfaces are supported
2023-09-06 08:25:58 +02:00
Moisés Ackerman
6ae0e0111e
Upgrade to Bazel 5 (again) (#17319)
* Update to rules_haskell v0.16
* Update comments re bazel patches
* clean up bazel overrides
* Upgrade to Bazel 5.2.0
* Remove '--distinct_host_configuration=false'
* Update buildifier to 6.3.2
* Suffix macos and ubuntu caches with yyyymm
* bump windows cache to v14
* [REVERTME] bump linux/macos/darwin timeout to 4h
2023-09-01 15:15:36 +02:00
Samuel Williams
9179b2e7d0
Jar licensing (#17299)
* Add _distribute.jar target with correct license
Use it everywhere

* Fixes from review

* Change NOTICES to NOTICES.txt for consistency
2023-08-22 15:56:29 +01:00
Raphael Speyer
47d21fe717
JSON API: add PruningTest and make it pass (#17167)
If the ledger has been pruned more recently that the last cached copy, then attempting to fetch the changes since that last offset will fail, rending the relevant template(s) unqueryable. This PR detects that condition, clears the cache for the relevant template and queries again, which will refresh the cache with a fresh copy of the ACS for that template, and serve the query from that.

I also made some usability tweaks around running canton-ee tests, to help improve the dev experience for failures I came across while trying to run them. Specifically
* Use `--config=canton-ee` to opt into the tests which require canton-ee
* When downloading that EE from artifactory, provide better diagnostics if the required auth isn't set up.
2023-07-27 09:12:22 +10:00
Remy
235abfa8ed
Revert "[LF] make Timestamp parsing consistent accross Java versions (#17053)" (#17170)
This reverts commit db7a5b3653.
2023-07-24 16:11:00 +00:00
Remy
db7a5b3653
[LF] make Timestamp parsing consistent accross Java versions (#17053)
* [LF] make Timestamp parsing consistent between Java 11 and Java 17

Between Java 11 and Java 17 there is one bug fix on Instant.parse
that expands the range of values that can be parsed into an
Instant. See https://bugs.openjdk.org/browse/JDK-8166138

Daml-LF happened to uses Instant.parse to parse a string into a
Daml-LF timestamp and we observe a different behavior when running
Daml on Java 11 and Java 17

additionally make explicit that conversion form java Instant and
string may drop nanoseconds, i.e. we create a lenient version that may
drop the significant nanoseconds (legacy or) and a strict
version that reject instant/string that cannot be converted without
loss of precision.
2023-07-20 16:18:01 +02:00
Raphael Speyer
c6dc7db512
JSON API: enable running tests which prune the ledger (#17046)
* Pruning needs to be retried, with artificial activity added, until the safe-offset has advanced far enough for it to succeed.
* The "max deduplication duration" needs to be dropped, otherwise pruning cannot be done for at least the default of 168h.
* The "reconciliation interval" needs to be lowered. This is a dynamic config, so we set it via a bootstrap script. The change is not effected immediately, but asynchronously some time after startup. Lowering this enables the safe-offset to catch up faster.
* We need to ensure the relevant tests are only enabled when testing against an Enterprise edition of Canton.

Contributes to https://digitalasset.atlassian.net/browse/LT-17
2023-07-19 09:49:24 +10:00
Remy
9e0493cc1a
add support for Canton EE available to JSON API (#17034)
Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2023-06-29 09:03:32 +00:00
Erwin Ramirez
bba554481b
Add json api endpoint refresh cache (#16987)
* added new end point to refresh the cache

* formatting

* returning old logic

* added logic to update the cache with a specific offset provided in the body

* formatting

* addressed comments

* formatting

* formatting

* formatting

* Return unit instead of List for processing refresh

* last changes on logic

* formatting

* simplify conversion

* comments addressed
2023-06-23 19:49:34 +10:00
Raphael Speyer
640a12610d
JSON API: Avoid populating both "result" and "errors" in response (#16967)
According to current documentation, only one of these may be set, but we can currently return both.

Also in this case we currently return a status code of 501, which is not one of the documented status codes. This PR switches that to 500 instead.

https://docs.daml.com/json-api/index.html#http-status-codes
2023-06-13 18:56:56 +10:00
Erwin Ramirez
fb6a564bb4
updated README.md http-json-perf (#16955) 2023-06-08 11:45:10 +10:00
Raphael Speyer
1f351b418e
JSON API: fix benchmarks and avoid excessive iterations (#16963)
* reduce fork count, measurement and warmup iterations, and extra parameters which had a multiplicative effect on total work done
* fix db connection setup - the combination of annotations and inheritance meant it was trying to setup the trial twice, causing Postgres benchmarks to fail
* log when an error occurs during test setup
* add logback resources to the benchmarks, to enable configuration of logging, and avoid dumping all the debug logs by default

With these changes, on my 20 core 64G linux laptop, the benchmarks now all run in under 6 mins.
Without this change, it took over 9 hours in total and none of the Postgres benchmarks were successful.
2023-06-07 08:09:24 +10:00
Erwin Ramirez
cfc499fbb6
Addition metrics on update cache (#16930)
* added cache update to metrics

* formatting

* added extra logs as commented

* added logs and metrics on query request failure/ success

* comments addressed

* further comments addressed

* formatting
2023-06-02 17:37:47 +10:00
peterkvokacka-da
6c3f997499
LT-25 publish JSON-API HikariCP metrics (#16921)
* JSON-API: publish HikariCP metrics

* formatting

* address review comment
2023-05-30 11:47:22 +10:00
Erwin Ramirez
dfeec9c423
Improvements logs json api (#16924)
* updated logback json to allow env to set the root log level with default info
Added logs on iteration to ledger when updating the query-storage cache

* formatting scala code

* comments addressed

* removed unneeded variable

* formatting

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

Co-authored-by: Raphael Speyer <raphael.speyer@digitalasset.com>

* remove debug block

---------

Co-authored-by: Raphael Speyer <raphael.speyer@digitalasset.com>
2023-05-30 11:04:55 +10:00
Raphael Speyer
8fe0d7ed5c
JSON API: Add some tests around the size limits of field names that are supported by querying. (#16925)
The tests are not comprehensive.
We demonstrate that if the Oracle payload index is on, the names of fields with type Int may not exceed 251 chars.
For other configurations, Int and Text fields can have a name with lengths of at least 512 chars.

Also updated the naming and explanation of the guards which disable some tests when using Oracle with JSON index.
2023-05-27 09:33:40 +10:00
Raphael Speyer
b53effd6e0
JSON API: fix empty string comparisons on Oracle (#16892)
Oracle conflates empty strings with NULL, which breaks comparison operations against empty strings.

This change makes Oracle-backed queries have the behaviour you'd expect when comparing empty strings, in line with what we see on Postgres and in-memory backed queries.

We had to take a bit of care to ensure it worked irrespective of whether the JSON index was enabled.

Fixes https://digitalasset.atlassian.net/browse/LT-24
2023-05-24 13:47:23 +10:00
mziolekda
06abd5c649
Clean up ledger dependencies (#16894)
* remove sandbox-on-x project

update bazel readme

update release artifacts

comment out last remaining SoX test

remove ledger-runner-common

remove participant-state-kv-errors

remove recovering-indexer-integration-tests

remove participant-integration-api

update doc pages

cleanup ledger-api-auth usage

remove participant-state

fix build

fix build

clean up ledger-api-common part I

clean up ledger-api-comon part II

clean up ledger-api-common part III

remove ledger/metrics

clean up ledger-api-health and ledger-api-domain

* remove ledger-configuration ad ledger-offset

* remove ledger-grpc and clean up participant-local-store

* reshuffle few more classes

* format
2023-05-23 13:44:17 +00:00
Raphael Speyer
9c2e7c28f9
JSON API: increase size of the multiple-observers test (#16884)
to 1000 observers x 185 chars.
2023-05-23 18:26:30 +10:00
mziolekda
95cc249ddd
Remove sandbox on x (#16890)
* remove sandbox-on-x project

* update bazel readme

* update release artifacts

* comment out last remaining SoX test

* remove ledger-runner-common

* remove participant-state-kv-errors

* remove recovering-indexer-integration-tests

* remove participant-integration-api

* update doc pages

* cleanup ledger-api-auth usage

* remove participant-state

* fix build

* fix build
2023-05-23 09:25:54 +02:00
Remy
81272e313d
Move com.daml.caching in libs-scala (#16868) 2023-05-22 15:32:53 +00:00
Raphael Speyer
50b2c59572
Make template id lookup concurrency-safe. (#16883) 2023-05-18 14:55:12 -04:00
Remy
a863d69d34
Move CatonFixture in its own bazel module (#16824) 2023-05-10 23:15:26 +00:00
Samuel Williams
537447d92c
Json Api tests to canton (#16782)
Co-authored-by: Remy <remy.haemmerle@daml.com>
2023-05-10 16:01:39 +01:00
Raphael Speyer
7a82b02b38
JSON API: Oracle: Pass string as a literal when querying json payload if index is enabled (#16717)
Previously, when using an Oracle-based ACS cache, JSON queries such as
```
 {
 ...
 "query": {
    "si_detail": {
      "si_input_no": {
        "%gt": "foo"
      }
    }
  }
}
```

were resulting in SQL queries containing 
```
JSON_EXISTS(payload, '$."si_detail"."si_input_no"?(@ > $X)' PASSING ? AS X)
```

which works when the payload json index is disabled, but when the index is enabled it results in an error.

We can avoid this by passing in the literal value rather than using a query parameter when the index is enabled, e.g.

```
JSON_EXISTS(payload, '$."si_detail"."si_input_no"?(@ > $X)' PASSING 'foo' AS X)
```

Fixes https://github.com/digital-asset/daml/issues/15006

And contributes towards https://digitalasset.atlassian.net/browse/LT-14
2023-04-21 17:01:23 +10:00
Gary Verhaegen
f8050f1f18
Add license file (#16697)
See [DAML-358] for details.

[DAML-358]: https://digitalasset.atlassian.net/browse/DAML-358
2023-04-17 11:33:04 +00:00
Raymond Roestenburg (Actually RayRoestenburg)
e9912f3138
Fix for warning in logback output, if can’t be inside appender. (#16687) 2023-04-13 07:49:10 +02:00
Raphael Speyer
ef732d7e63
Fix SQL used to build view in Oracle to handle larger number of observers. (#16683)
When the `observers` list was too long, we were getting an `ORA-40478: output value too large (maximum 4000)` error from Oracle.

This was being hit when the `contract_stakeholders` view was being updated. An intermediate part of the expression which updates the view was being defaulted to a type which didn't allow larger values. Adding an explicit type fixes the problem.

- Added test which could reproduce the previous failure. 
- Moved `randomTextN` to be accessible to the new test.

Fixes https://digitalasset.atlassian.net/browse/LT-11
2023-04-13 09:45:08 +10:00
Stephen Compall
15ee6823f4
test payloadBlob and multiple disclosed contracts in JSON API exercise, create-and-exercise (#16635)
* restore transaction fetch from #16529 497b195043

* add a view so we can ask for blobs

* perform the extra disclosure and check its response text

* remove a layer we won't use

* include token; test passes with user management

* rename to reflect multiple contracts
2023-04-06 10:59:00 -04:00