Commit Graph

645 Commits

Author SHA1 Message Date
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
Stephen Compall
182d8a854a
allow disclosed contracts to be passed to create-and-exercise (#16611) 2023-03-31 00:07:23 +00:00
Stephen Compall
ddc4930f1a
explicit disclosure parameters for JSON API (#16529)
Adds a `disclosedContracts` optional list field to the `meta` argument
for `create`, `exercise` and `create-and-exercise` endpoints.

The argument is ignored in all cases but `exercise` (#16611 builds on
this PR to add `create-and-exercise` support). A single disclosed
contract looks more or less like follows:

    { 
      "contractId": "abcd", 
      "templateId": "Mod:Tmpl", 
      $argumentsJsonField, 
      "metadata": { 
        "createdAt": "2023-03-21T18:00:33.246813Z", 
        "contractKeyHash": "77656c6c2068656c6c6f", 
        "driverMetadata": "dGhlcmUgcmVhZGVy" 
      } 
    }

where `argumentsJsonField` may be either one of these, setting aside the
extra quotes added for these tests:

    "payload": {"owner": "Alice"}
    
    "payloadBlob": { 
      "typeUrl": "type.googleapis.com/com.daml.ledger.api.v1.Record", 
      "value": "Eg4KBW93bmVyEgVaA0JvYg==" 
    }

(Note that `typeUrl` is variable, not constant; use the actual blob's
`typeUrl` contents, **do not assume it is exactly the above example**.)

This PR uses base-64 for `payloadBlob.value` and
`metadata.driverMetadata`, and base-16 for `metadata.contractKeyHash`.
2023-03-30 20:41:36 +00:00
Brian Healey
b80dca2dd8
identity provider id awareness for party and user management apis through ledger client (#16632)
* identity provider id awareness for party and user management apis through ledger client

* none case for ObjectMetadata translation
2023-03-30 18:26:53 +00:00
Raphael Speyer
e5053bd4cc
Fix fetching contracts with Numerics in their keys. (#16605)
Switch to an LF converter which preserves the numeric's scale, allowing keys to match correctly.

Co-authored-by: = <=>
2023-03-27 11:06:10 +02:00
Nicu Reut
209e6ec947
Deprecate non-labeled metrics factories [PLEN-183] (#16441) 2023-03-15 11:09:16 +01:00
BryceStansfieldAt-da
b7bcbae2e0
more determinism in delete order (forward port of #16401) (#16471)
* Forward port of #16401

* specify arguments for delete in a fixed order

* disable backpressure transaction batching for Oracle update

* deterministic specification of offset update DMLs

* switch to updateMany for delete instead of `in` on Oracle

- suggested by @ray-roestenburg-da; thanks

* don't update ledger_offset table or start transaction stream if caught up to ledger end

* include tpid in delete order consideration

---------

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2023-03-08 10:32:21 -05:00
BryceStansfieldAt-da
27530a7132
log suppressed errors out-of-band (Forward Port of #16261) (#16472)
* forward port of: #16261 b718717dec

* [JSON API] Log errors suppressed during streaming of /v1/query and
  /v1/fetch results

---------

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2023-03-07 19:43:18 +00:00
Nicu Reut
7246a21520
Use labeled metrics for the CacheMetrics [PLEN-163][PLEN-167] (#16406) 2023-03-02 11:55:37 +01:00
mziolekda
d8d55ca412
upgrade to scala 2.13.10 (#16423)
* update build system to scala 2.13.10

* fix failing scala files

* format

* fix compatibility

* resolve conflict on maven_install_2.13.json
2023-02-28 23:21:53 +00:00
Nicu Reut
7e87912cd5
Add ability to configure histograms through the config files [PLEN-159] (#16387) 2023-02-28 10:50:26 +00:00
Nicu Reut
cc0db80b3a
Remove duplicate HTTP metrics replaced by the golden signal metrics [PLEN-117] (#16341) 2023-02-22 13:42:24 +01:00
mziolekda
1a3980bf89
Separate test-common from the rest of the ledger code (#16307)
* move files

* format

* wrong file

* fix conformance tests

* add readme

* fix compatibility tests

* fix haskell tests
2023-02-14 15:29:13 +00:00
mziolekda
d9974984fd
Remove circular dependency on the //ledger project caused by ledger-resources [DPP-1410] (#16295)
* remove circular dependency on the //ledger project caused by ledger-resources

* format
2023-02-13 08:38:44 +00:00
Nicu Reut
50701da79b
Use OpenTelemetry metrics for the non-repudiation modules [PLEN-106] (#16271) 2023-02-09 15:20:19 +00:00
Luc Bourlier
313aaad4a6
Common metrics reporter config format [PLEN-91] (#16213)
* Common metrics reporter config format

Fixed the config for metrics reporter for trigger service and oauth
middleware.
They are using a common config definition, as well as the JSON API
service.
The format matches the one used in canton configs.

CHANGELOG_BEGIN
CHANGELOG_END
2023-02-03 09:10:10 +01:00
Sergey Kisel
c04019de4e
Restrict the use of non-allocated party in User Mnmgt API for ParticipantAdmin [DPP-1385] (#16111) 2023-01-28 11:49:11 +01:00
Nicu Reut
a87412b68c
Introduce LabeledMetricsFactory trait to mark metrics factories that support labels [PLEN-98] (#16159) 2023-01-26 16:01:37 +00:00
Stephen Compall
81b4e17f00
reduce package service calls to avoid THREADPOOL_OVERLOADED errors (#16116)
* confirm that monadifying the package fetch still suppresses the error

* thread ExecutionContext from request

- makes the error less likely
- but still fairly easy to repro with 3 tabs

* experiment with setting executor

* explain that the cache isn't a cache

* random order, maybe

- #3090 mentions keeping the order as a goal; I don't see why we should,
  though

* random order with groups of 8

* embed the decoding

- this slows down the processing of a group, yielding somewhat less
  granular contention
- and also makes hits cost much less, at the cost of making granular
  contention more expensive

* reduce diff size before resolution

- this won't improve contention, but does nearly eliminate the cost of
  resolution for already-resolved packages, making hits nearly free
  (amortized)

* randomize groups instead

- while groups themselves can overlap with this arrangement, each
  costing ParallelLoadFactor granular contention, on average it seems to
  perform a little better due to groups never overlapping

* refactor StatusEnvelope to utils

* constant 250ms retry

* detect contention earlier and skip decode

* factor traverseFM
2023-01-26 10:18:13 -05:00
Luc Bourlier
e809344c00
Metrics for node status [PLEN-63] (#16052)
* Metrics for node status [PLEN-63]

CHANGELOG_BEGIN

* Node status metric: daml_health_status

CHANGELOG_END
2023-01-26 12:01:14 +01:00
Nicu Reut
fee45895d8
[metrics] Remove the API allowing us to read the state of a counter [PLEN-97] (#16141) 2023-01-26 09:05:56 +01:00
Nicu Reut
17596abd1b
Expose opentelemetry jvm metrics alongside dropwizard metrics [PLEN-67] (#16133) 2023-01-24 19:58:20 +01:00
atriantafyllos-da
a05de7d248
Upgrade toxiproxy-java, circe, spray-json, spray-json-derived-codecs versions. (#15949)
Upgraded toxiproxy-java, circe, spray-json and spray-json-derived-codecs.

changelog_begin
changelog_end
2023-01-24 17:05:57 +00:00
Nicu Reut
85eff2930f
Configure OpenTelemetry using the sdk [PLEN-68] (#16083) 2023-01-24 08:53:25 +01:00
Nicu Reut
758deffc4e
Decouple the metrics from the internals of the metrics libraries [PLEN-87] (#15954) 2023-01-10 12:15:19 +01:00
Gary Verhaegen
151e12b81a
bump copyright (#16002)
This is the result of:

- Updating `./COPY` to say `2023`.
- Running `./dev-env/bin/dade-copyright-headers update .`
2023-01-04 18:21:15 +01:00
Stephen Compall
18e624a0d8
NonEmpty for non-empty arguments to Queries methods (#12341)
* declare needed NonEmpty query lists and condition lists

* selectContractsMultiTemplate requires non-empty query list

* propagate nonempty query sets through ContractDao

* propagate some NE constraints from selectContractsMultiTemplate through WebSocketService

* HashSet no longer needed

* pass non-emptiness through dbQueries

* add NE-preserving groupMap and groupMap1

* validate that resolvedWithKey is nonempty
2022-12-21 21:06:34 +00:00
Claudio Bley
c64471c28d
Remove duplicate FailureTests classes (#15937)
These have been split up into separate files already, see #13290.
2022-12-20 09:21:45 +01:00
Stephen Compall
1f31d2dce2
use LF 1.15 instead of dev for interface-related bazel tests (#15923) 2022-12-19 13:40:45 -05:00
Stephen Compall
2893e26872
fix MAXIMUM_NUMBER_OF_STREAMS errors when doing many websocket queries (#15733)
* log more termination

From the timeout loop:

+ fmm-outer
+ fmm-inner
x ACS-before-tx
x tx-after-ACS

* spam eagerCancel=true and see what happens

From the timeout loop:

+ after-split
+ IDSS-outer
+ fmm-outer
+ contractsAndBoundary
+ tx-after-ACS
+ fmm-inner
+ GTSFP-outer
x ACS-before-tx

* passing acs-and-tx tests

* trying combinations of reverting eagerCancel settings

- setting eagerCancel = false in acsAndBoundary causes the ACS
  cancellation to fail (first test), but the tx cancellation still
  succeeds

- setting eagerCancel = false in project2 causes both the ACS and tx
  stream cancellation tests (first and third tests) to fail

- the offset broadcast in acsFollowingAndBoundary appears to be
  redundant with respect to cancellation, so we revert it in the
  interest of conservatism

* make test size small

* current measurement

Still fine after the refactoring of logTermination and removal of fmm-*.

+ GTSFP-outer
+ contractsAndBoundary
x IDSS-outer-2
+ after-split
+ tx-after-ACS
+ IDSS-outer-1
x ACS-before-tx

* set level of the logTermination messages to trace
2022-12-16 16:41:08 -05:00
Simon Maxen
d76603d137
Metering clarifications for Daml Hub [DPP-1314] (#15898)
* Add metering report JSON schema

* Add metering report JSON schema
* Remove metering-report-schema from proto exclusion list
* Add header to metering report validator
* Rename struct-json to struct-spray-json
* Add struct-circe-json

* Update with release comments
2022-12-16 10:46:32 +00:00
Sergey Kisel
a7a958a337
Simplification of errors within JWT, unit test (#15881) 2022-12-14 11:05:18 +01:00
Claudio Bley
2acf719338
Refine "component" of asset field (#15833)
* Add "component" to `SecurityTest` entry for AbstractWebsocketServiceIntegrationTest

* Add README to test-evidence explaining the convention for components
2022-12-13 10:15:00 +01:00
Chun Lok Ling
f23f5d02af
13355 removed proxy* methods from RouteSetup (#15458)
* WIP

* do it on getuesr first

* remove old getUesr

* createUser

* createUser

* user post paths

* user post paths

* WIP

* removed routesetup from UserManagement

* refactor parties and allocateParty

* remove proxyWithCommand

* refactor PackagesAndDars

* remove proxyWithoutCommand

* refactor  PackagesAndDars

* merge from main

* move UploadDarFile implementation back to package and dars
2022-12-12 14:38:24 +00:00
Claudio Bley
c7aaa19c6e
Add attack/happyPath and asset information (#15732) 2022-12-12 09:43:30 +00:00
Nicu Reut
25f1254120
Move the metrics API to the observability module [PLEN-35] (#15831) 2022-12-12 09:35:55 +00:00
Sergey Kisel
e880f26b36
Identity Provider Management exposed via API [DPP-1334] (#15774) 2022-12-09 10:25:14 +01:00
Stephen Compall
d14a6441e3
close the gap between scalac -Xlint and our global options (#15799)
* add -Xlint options requiring no changes

* add -Xlint:recurse-with-default

- very minor code changes

* factor http-json hj_scalacopts duplication

* use lf_scalacopts_stricter in libs-scala where NonUnitStatements was

* use hj_scalacopts in api-type-signature

* add nonlocal-return and nullary-unit to hj_scalacopts

* commented-out excluded options

* add unit-special globally

* check implicit-recursion for clients code
2022-12-07 16:08:33 +00:00
Claudio Bley
48b9bb0aa8
Replace duplicate Security properties (#15777)
- `Authenticity` instead `Authentication`
- `Privacy` instead `Confidentiality`
2022-12-05 10:44:11 +00:00