Commit Graph

2909 Commits

Author SHA1 Message Date
Marton Nagy
6d27505010
Drop gRPC server side custom codegen (#15763)
* Drop gRPC server side custom codegen

[CHANGELOG_BEGIN]
[CHANGELOG_END]

* Do not generate maven jar for ledger-api-akka and more cleanup

* Extract by-name source evaluation outside synchronized

* Addressed Martino's review comment

Co-authored-by: Tudor Voicu <tudor.voicu@digitalasset.com>
2022-12-12 08:35:56 +01:00
pbatko-da
fe92e52da7
[DPP-1327] Efficient Oracle ETQ data migration (#15843)
Previous version of etq_array_diff function proved to be vastly inefficient on a synthetic data set
resulting in "SQL Error: ORA-04036: PGA memory used by the instance exceeds PGA_AGGREGATE_LIMIT" error
after many minutes of processing. PGA_AGGREGATE_LIMIT was set to 2GB in that testing setup.

This new implementation of etq_array_diff completed the migration successfully in 03min 34s
which is comparable with the data migration for PostgreSQL. No evidence for excessive consumption
of memory was found ('select * from V$PGASTAT;').
2022-12-09 11:03:06 +00:00
Sergey Kisel
e880f26b36
Identity Provider Management exposed via API [DPP-1334] (#15774) 2022-12-09 10:25:14 +01:00
pbatko-da
89d571a87b
[DPP-1327] Data migration and ingestion for new transactions related tables (#15703) 2022-12-08 13:56:26 +00:00
Nicu Reut
644009feac
Fix async gauges usages by returning only the value [PLEN-61] (#15793) 2022-12-06 09:26:05 +01:00
pbatko-da
a2e9901c38
[DPP-1356] Fix not logging some exceptions from streaming endpoints (B) (#15765)
changelog_begin:
Ledger API:
Previously non-error-code exceptions coming from streaming endpoints but thrown outside of Akka streams were not logged, and reported to clients with gRPC status UNKNOWN. Now they are logged on the server side and reported to clients as errors with LEDGER_API_INTERNAL_ERROR error code
changelog_end
2022-12-05 12:27:37 +00:00
pbatko-da
d2ca14e972
[DPP-1327] Restore transaction_id indexes on PG that were accidentally removed (#15769) 2022-12-05 11:50:13 +01:00
Claudio Bley
48b9bb0aa8
Replace duplicate Security properties (#15777)
- `Authenticity` instead `Authentication`
- `Privacy` instead `Confidentiality`
2022-12-05 10:44:11 +00:00
tudor-da
b4b1f6c7d9
Engine outputs interpreted disclosed contract metadata [DPP-1323] (#15751)
* Engine outputs interpreted disclosed contract metadata

* Addressed Remy's review comments
2022-12-04 20:11:53 +01:00
Sergey Kisel
1c6f6a748b
IdentityProviderId support for the persistence layer of user/party management [DPP-1332] (#15716) 2022-12-02 16:12:04 +01:00
pbatko-da
695d680bd0
Temporary fix for a flaky benchtool test (#15761) 2022-12-01 16:28:11 +01:00
pbatko-da
a3985d697c
[DPP-1327] Add new tables for efficient transaction queries (without data migration) (#15701) 2022-12-01 16:18:27 +01:00
Matthias Schmalz
eb59830a7b
Added a flag checkAuthorization to EngineConfig that allows clients to disable the authorization checks (for security testing). (#15748)
Generalized `object CheckAuthorization` to `trait AuthorizationChecker` which now gets injected into `PartialTransaction`.
2022-12-01 12:05:10 +00:00
Luc Bourlier
2e98f29189
Adds description to the HTTP and gRPC endpoint metrics [PLEN-40] (#15711)
* Adds description to the HTTP and gRPC endpoint metrics

CHANGELOG_BEGIN
CHANGELOG_END

* Apply suggestions from code review

* added missing descriptions for gRPC metrics

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2022-11-30 14:04:53 +01:00
pbatko-da
78d44246ac
[DPP-1327] Speeding up completions streaming (#15696)
Changes:
1. Swap the DB index order to facilitate filtration by application ids
2. Filter parties in JVM
3. Fetch results from the DB in a paged fashion
2022-11-30 10:30:04 +00:00
Claudio Bley
e766f91338
Generate CSV file from all test evidences for ledger client components (#15372)
* Add new security categories

* Use test-security framework for OAuth2 middleware

* Regenerate `security-evidence.md`

* Explicitely exit the test-evidence generator

* Use test-security framework for HTTP JSON

* Regenerate `security-evidence.md`

* Add //ledger-service/http-json:integration-tests-lib to evidence generator

* Skip maven artefacts on the classpath

The checker framework artefact (`checker-2.5.4.jar`) causes an `IllegalAccessError` when included in the runpath:
```
Exception in thread "main" java.lang.IllegalAccessError: class com.sun.tools.javac.code.Scope$ImportScope$ImportEntry cannot access its superclass com.sun.tools.javac.code.Scope$Entry (com.sun.tools.javac.code.Scope$ImportScope$ImportEntry is in unnamed module of loader java.net.URLClassLoader @31000e60; com.sun.tools.javac.code.Scope$Entry is in module jdk.compiler of loader app)
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
	at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:550)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:458)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:452)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:451)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at org.scalatest.tools.SuiteDiscoveryHelper$.isDiscoverableSuite(SuiteDiscoveryHelper.scala:204)
	at org.scalatest.tools.SuiteDiscoveryHelper$.processClassName(SuiteDiscoveryHelper.scala:243)
	at org.scalatest.tools.SuiteDiscoveryHelper$.$anonfun$processFileNames$1(SuiteDiscoveryHelper.scala:279)
	at scala.collection.Iterator$$anon$9.next(Iterator.scala:577)
	at scala.collection.Iterator$$anon$6.hasNext(Iterator.scala:474)
	at scala.collection.Iterator$$anon$9.hasNext(Iterator.scala:576)
	at scala.collection.immutable.List.prependedAll(List.scala:152)
	at scala.collection.immutable.List$.from(List.scala:684)
	at scala.collection.immutable.List$.from(List.scala:681)
	at scala.collection.IterableFactory$Delegate.from(Factory.scala:288)
	at scala.collection.immutable.Iterable$.from(Iterable.scala:35)
	at scala.collection.immutable.Iterable$.from(Iterable.scala:32)
	at scala.collection.IterableFactory$Delegate.from(Factory.scala:288)
	at scala.collection.IterableOnceExtensionMethods$.toIterable$extension(IterableOnce.scala:178)
	at org.scalatest.tools.SuiteDiscoveryHelper$.processFileNames(SuiteDiscoveryHelper.scala:285)
	at org.scalatest.tools.SuiteDiscoveryHelper$.$anonfun$discoverSuiteNames$1(SuiteDiscoveryHelper.scala:132)
	at scala.collection.immutable.List.map(List.scala:250)
```

* Regenerate `security-evidence.md`

* Convert remaining TEST_EVIDENCE stanzas of HTTP JSON

* Regenerate `security-evidence.md`

* Use test-security framework for HTTP JSON

* Regenerate `security-evidence.md`

* Print warning when a test suite could not be loaded

* Fix typo

* Use test-security framework for HTTP JSON

* Read files in tests lazily

The test-evidence generator tool needs to instantiate scalatest test suites in order
to access the tagged tests and collect relavant test entries.

* Use test-security framework for HTTP JSON

* Regenerate `security-evidence.md`

* Regenerate `security-evidence.md`

* Use test-security framework for HTTP JSON

* Regenerate `security-evidence.md`

* Use test-security framework for HTTP JSON

* Regenerate `security-evidence.md`

* Use test-security framework for HTTP JSON

* Regenerate `security-evidence.md`

* Use test-security framework for trigger service

* Use structural type to call `in` and `ignore` for different classes

* Remove Authentication category from EvidenceSecurity tool

There are no TEST_EVIDENCE annotations anymore.

* Add required trigger-runner-lib


* Import `scala.language.reflectiveCalls` where it is needed

* Remove left-over comments

* Add `test_evidence_binary` scala binary rule

This rule is a customized `scala_binary` rule which also accepts a `tests` attr and
generates a runpath file which is later consumed by scalatest to detect the relevant
scalatest test suites.

* Process test suites, add transitive deps

* Support nested tests_suites in `test_evidence_binary`

* Remove debug print's

* Add missing dependencies to test-evidence:generator

* Abort if test suites cannot be loaded

* Cleanup

* Reinstate scalacopts in http-json

* Reword the test description to not drop information

* Fix typo

* Explicitly exit the JVM on exceptions

This is required since non-daemon threads also prevent JVM shutdown when an exception was thrown.

* Format test-evidence/BUILD.bazel

* Resolve file paths lazily

This avoids a `NullPointerException` on Windows where Runfiles.rlocation returns `null`.

* Document new Security properties

* Print target directory and file name

* Clarify test descriptions

* Replace duplicate Security properties

Co-authored-by: Stephen Compall <stephen.compall@daml.com>Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2022-11-29 12:35:22 +01:00
pbatko-da
8b7978fe44
[DPP-1327] Migration tests for upcoming ETQ changes and support for Oracle (#15694) 2022-11-28 13:54:43 +01:00
tudor-da
330c772850
Read driver_metadata for transaction trees as well (#15702)
* Read driver_metadata for transaction trees as well

changelog_begin
changelog_end

* Test contract metadata in StorageBackendTestsTransactionStreamsEvents
2022-11-25 20:56:07 +01:00
pbatko-da
d3ed3c8118
[DPP-1327] Put SoX's default config under version control (#15671) 2022-11-25 12:48:34 +00:00
Oliver Seeliger
da67ee7066
LedgerClient admin pruning hook (#15679)
CHANGELOG_BEGIN
CHANGELOG_END
2022-11-24 20:35:33 +01:00
Sergey Kisel
7760ec9fb3
IdentityProviderConfig persistence layer [DPP-1331] (#15634) 2022-11-24 13:32:42 +01:00
mziolekda
a02c30440a
remove deprecated warnings everywhere [DPP-1281] (#15661)
* remove deprecated warnings in /ledger

* update generated documentation
2022-11-24 12:05:08 +00:00
mziolekda
9a12bb8b67
Add ability to override the service pool size [DPP-1306] (#15653)
* Add ability to override the service pool size

* don't set the value in the reference.conf
2022-11-24 11:09:54 +01:00
mziolekda
9cee266479
Move jwt library to libs-scala (#15674) 2022-11-24 11:08:56 +01:00
Sergey Kisel
adabba574f
Support of the transaction rollback in case of Either.Left (#15655) 2022-11-23 19:27:31 +00:00
Luc Bourlier
ffc31ce371
Tweak on HTTP metrics (#15641)
Alignment with the gRPC metrics.

CHANGELOG_BEGIN
CHANGELOG_END
2022-11-23 09:37:41 +01:00
mziolekda
eed43036e8
Fix non exhaustive matches in /ledger [DPP-1281] (#15608)
* Fix non exhaustive matches in /ledger

* eliminate the use of nowarn

* fixes post review
2022-11-22 19:18:06 +01:00
Sergey Kisel
0db050457d
Removed potentially unused classes (#15622) 2022-11-22 18:25:19 +01:00
Remy
8358aab22c
[Ledger-API] Stricter version of the ValueValidate (#15650)
that does not strip trailling 0 when validating Numeric
2022-11-22 17:45:14 +01:00
Nicu Reut
0553f6866b
Add important points scaladoc for metrics [PLEN-49] (#15627) 2022-11-22 14:44:29 +01:00
Ratko Veprek
32b45966ad
Unified error category malicious or faulty with security alert (#15649)
Before this change, we had two error categories that were meant for the same purpose: malicious or faulty and security alert. Now, they have been merged together. As malicious or faulty was misunderstood and sometimes used instead of "SystemInternalAssumptionViolation", we've dropped that term.

Related to canton 10981
2022-11-22 14:05:06 +01:00
Nicu Reut
44a555b3a7
Add explicit buckets for payload size histograms [PLEN-45] (#15615) 2022-11-22 12:57:28 +00:00
mziolekda
9f0affea4a
fix Xlint:eta-zero warnings (#15607) 2022-11-21 11:45:46 +01:00
Sergey Kisel
218a6a8ae7
Fix cached user management tests to take into account cached implementation (#15633) 2022-11-20 11:36:56 +01:00
Remy
bef0f15d70
[LF] make qualified choice name a LF concept (#15599) 2022-11-17 22:44:18 +00:00
Remy
3dee676cbb
[LF] making LF 1.15 stable (#15614) 2022-11-17 23:30:11 +01:00
azure-pipelines[bot]
c1ffefaaed
bump canton to 20221116 (#15605)
Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
Co-authored-by: Remy Haemmerle <Remy.Haemmerle@daml.com>
2022-11-17 15:05:11 +00:00
Nicu Reut
525831c4db
Fix flaky gRPC server metrics test (#15612) 2022-11-17 15:12:08 +01:00
Oliver Seeliger
936594f523
Deduplication flake: allow inflight-request error (#15609)
In rare situations a canton participant returns a SUBMISSION_ALREADY_IN_FLIGHT
error instead of DUPLICATE_COMMAND due to a possible race condition between
publishing the TransactionAccepted read service update and updating internal
in-flight transactions. Particularly in Oracle runs this can result in a
subsequence "duplicate" command to still be considered in-flight.

Extended the tests to also accept the "in-flight" error code.

Changelog_begin
Changelog_end
2022-11-17 11:13:51 +01:00
Nicu Reut
253150e6e2
Change OpenTelemetry timer unit to seconds [PLEN-44] (#15585) 2022-11-17 09:52:24 +00:00
Marton Nagy
4f4cd910da
Open up ChoiceCoder for usage in another repo (#15592)
[CHANGELOG_BEGIN]
[CHANGELOG_END]
2022-11-16 13:24:59 +01:00
Luc Bourlier
e24ce7ab4f
Adds labels to the Akka HTTP metrics [PLEN-12] (#15436)
* Adds labels to the Akka HTTP metrics

CHANGELOG_BEGIN
CHANGELOG_END

* code improvements

* A bit of headroom for the latency tests
2022-11-16 11:08:45 +01:00
atriantafyllos-da
5ddd0646c4
Removed http_json_api metrics from ledger metrics [DPP-1307]. (#15552)
changelog_begin
changelog_end
2022-11-15 14:56:41 +01:00
Nicu Reut
b1edee94f8
Add gRPC server interceptor with golden metrics to all gRPC services [PLEN-10] (#15477) 2022-11-15 09:50:21 +01:00
Nicu Reut
5b958ae9b7
Use the testing metrics instead of opentelemetry testing sdk [PLEN-43] (#15555) 2022-11-14 13:15:21 +00:00
Simon Maxen
a10ffa819c
Default memory based rate limiting to off (#15546) 2022-11-14 12:48:33 +00:00
mziolekda
60ab087e71
Fix copy pasta in ErrorCategory (#15543)
* Fix copy pasta in ErrorCategory

* update documentation
2022-11-14 08:39:57 +01:00
tudor-da
bd36919e75
Index and server driver_metadata (#15478)
* Create support in Sandbox-on-x with mock contract driver metadata
* Assert driver metadata in conformance tests

changelog_begin
changelog_end

run-full-compat: true
2022-11-11 09:55:34 +01:00
Nicu Reut
7ce5d05f2a
Add grpc server interceptor with golden metrics [PLEN-9] (#15447) 2022-11-10 17:50:41 +00:00
Moritz Kiefer
c7be81f0c4
Fix error handling in time service (#15521)
updateTime can return an error and the code correctly tried to turn
that into invalidArgument and logged it. However, the Either returned
by that then got completely discarded and the overall request
succeeded which definitely seems like a bug.

I added a test and verified that it fails withotu this change.

The code seems fairly messy. There are a few reasons for that:

1. We use Future[Either[…]] and we treat failures in the Either
   differently from future failures. I'm not quite convinced that
   makes sense but for this PR I didn’t want to introduce unrelated
   changed.
2. Future[Either[…]] without some form of EitherT is inherently messy
   but afaik you don’t use cats here so I kept it like this.
2022-11-10 11:40:25 +00:00