Commit Graph

111 Commits

Author SHA1 Message Date
Simon Maxen
6a1e3afb71
Switch rate limiting to using self service error codes [DPP-1000] (#14216)
* Switch rate limiting to using self service error codes

changelog_begin
Rate limiting updated to use self service error codes.
changelog_end
2022-06-21 16:49:22 +01:00
Remy
2d5094160e
[Engine] clean key uniqueness mode (#14194)
This is a follow up of #14175 and #14176.  

Basically
-  we kill the `On` mode which is not used anymore.
- we factorize the visibility check.
- we rename `LocalContractNotVisible` into `ContractNotVisible`

CHANGELOG_BEGIN
CHANGELOG_END
2022-06-16 12:04:45 +00:00
Hubert Slojewski
281de9ac2e
Publish daml-lf encoder, parser and error-test-lib [KVL-1424] (#13730) 2022-04-29 13:59:19 +02:00
Nicu Reut
a792de39a5
Update scalafmt to 3.5.1. (#13584)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-28 09:57:04 +00:00
Hubert Slojewski
35b68962e8
Remove remaining kvutils dependencies [KVL-1245] (#13695)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-26 13:42:18 +02:00
Robin Krom
fcd3b6622b
ifaces:support exercising by required interface (#13554)
* ifaces:support exercising by required interface

This adds support to exercise an interface choice on a contract ID,
where the interface is required by one of the implemented interfaces of
the contract template.

Fixes #13434.

CHANGELOG_BEGIN
CHANGELOG_END

* some improvements based on review

* added a test plus a bugfix

* Update daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/PhaseOne.scala

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

* 2 more interface tests for the command preprocessor

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2022-04-12 18:15:29 +00:00
Matthias Schmalz
c21a135d4f
Changed log level of PARTICIPANT_BACKPRESSURE to INFO. (#13555)
(Otherwise, an excessive rate of incoming commands will flood the log file with backpressure warnings.)

CHANGELOG_BEGIN
CHANGELOG_END
2022-04-12 09:49:55 +02:00
davidrichards-da
ef55141788
Added clarity around security risk errors (#13407)
* Adding section to error codes page and updating descriptions

CHANGELOG_BEGIN
CHANGELOG_END
Added a section in the error codes page and improved description to errors

* Removing the multi-line descriptions

* Changing the added sentence

swapping 'due to security reasons' 'for security reasons'

* Updated formatting

Ran the fmt.sh script to give me the correct formatting.

* Updating the generated error codes

CHANGELOG_BEGIN
CHANGELOG_END
Updating the generated error codes
2022-03-30 15:50:00 +01:00
pbatko-da
c6a0275f6e
[Error codes] Fill in missing contexts that were lost where reflection based context population was removed [DPP-606] (#13264)
And rename error arguments that haven't been in camel case yet.

changelog_begin
changelog_end
2022-03-16 15:07:24 +01:00
pbatko-da
b63fdc7031
[Error codes] Increase visibility of formatContextAsString (#13304)
changelog_begin
changelog_end
2022-03-16 13:26:57 +01:00
pbatko-da
e0965709fe
[Error codes] Remove .asGrpcStatusFromContext and .asGrpcErrorFromContext from BaseError trait [DPP-606] (#13262)
changelog_begin
changelog_end
2022-03-16 09:30:07 +01:00
pbatko-da
c7266dd60c
Remove ErrorCauseExport + some file renames [DPP-606] (#13259)
changelog_begin
changelog_end
2022-03-15 12:51:32 +01:00
pbatko-da
ee6a5f9e0e
Handle misc error codes todos. [DPP-606] (#13248)
changelog_begin
changelog_end
2022-03-14 17:16:31 +01:00
pbatko-da
e69343dfb3
[Error codes] Reorganize error groups file structure for better readability and easier modification. [DPP-606] (#13263)
changelog_begin
changelog_end
2022-03-14 15:13:26 +01:00
pbatko-da
92e3e9e2df
Add unit tests for ErrorCode [DPP-799] (#13236)
changelog_begin
changelog_end
2022-03-14 12:38:23 +01:00
pbatko-da
a8c0984d9b
[User management] Make use of UM error group in the docs (#13260)
changelog_begin
changelog_end
2022-03-14 12:09:48 +01:00
pbatko-da
a27fa0c95a
[Error codes] Move and test logging value string serializer [DPP-606] (#13261)
changelog_begin
changelog_end
2022-03-14 12:09:10 +01:00
pbatko-da
f210ee933c
Add missing context in PackageServiceError (#13258)
changelog_begin
changelog_end
2022-03-11 13:20:59 +01:00
pbatko-da
d891a9a9c2
[Error codes] Use scala.deprecated instead of a custom annotation [DPP-776] (#13163)
changelog_begin
changelog_end
2022-03-10 14:10:52 +01:00
pbatko-da
2ac30b21f5
Remove conformance mode from com.daml.error.definitions.RejectionGenerators (#13218)
changelog_begin
changelog_end
2022-03-10 12:15:32 +01:00
pbatko-da
fbb3ba55c2
Simplify implementations of BaseError trait [DPP-606] (#13185)
1. Remove `BaseError.Impl`, `LoggingTransactionErrorImpl` and `LoggingPackageServiceError` 
and instead provide more direct `DamlError` and `DamlErrorWithDefiniteAnswer`.


2. Remove custom implementation of `TransactionError.rpcStatus` and instead provide simpler one in `DamlErr.r.rpcStatus` (which works by first calling `code.asGrpcStatus` and then converting the result to `com.google.rpc.status.Status`).

3. Remove `GrpcStatus.toProto` and instead use `DamlError.rpcStatus`.

4. Use `asGrpcStatus` and `asGrpcError`  instead of `asGrpcStatusFromContext` and `asGrpcErrorFromContext` where possible.


changelog_begin
changelog_end
2022-03-10 12:12:14 +01:00
pbatko-da
df2cb4a1fd
[Error codes doc] Put generated source files of error inventories under version control [DPP-606][DPP-777] (#13181)
And add a check (a unit test) that the generated files are up-to-date with what can be generated.
If the check fails then one will need to run `./docs/scripts/gen-error-docs-src.sh` and commit the changes.

changelog_begin
changelog_end
2022-03-10 12:06:58 +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
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
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
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
pbatko-da
c7c211e4df
Remove most of ErrorFactories [DPP-606] (#13146)
changelog_begin
changelog_end
2022-03-07 16:15:21 +01:00
pbatko-da
15aa300fba
Use DamlContextualizedErrorLogger.forTesting (#13137)
changelog_begin
changelog_end
2022-03-04 12:24:08 +01: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
56306eb387
[User management] More race condition tests. Simplifications in the backend. (#13140)
changelog_begin
changelog_end
2022-03-03 22:48:11 +01:00
pbatko-da
a84c2cd68f
Add tests and use ErrorDetails.matches (#13139)
changelog_begin
changelog_end
2022-03-03 09:33:37 +01:00
pbatko-da
a4f9dd79c6
[User management] Add race conditions test-tool tests for CreateUser and GrantUserRights [DPP-847] (#12983)
changelog_begin
changelog_end
2022-02-22 17:36:06 +01:00
Remy
380dfa3502
LF: Add cause to internal error (#12965)
When an internal error is due to an unexpected exception, we wrap the
exception into the InternalError.

CHANGELOG_BEGIN
CHANGELOG_END
2022-02-16 11:06:10 +00:00
Kamil Bozek
dfd38186fe
Remove pre-1.18 error codes [DPP-773] (#12841)
* Remove legacy error codes

CHANGELOG_BEGIN
CHANGELOG_END

* Remove ValidatorFixture

* Removed redundant helper function

* Remove redundant object

* Rebased.

run-full-compat: true

* Rebased.

run-full-compat: true
2022-02-15 15:28:36 +01:00
tudor-da
dd6dab6e6b
[Sandbox-on-X] Address various TODOs (#12823)
* Removed no-action TODOs

changelog_begin
changelog_end

* Assert self-service error codes in SequenceSpec

* Move InternallyInconsistentKeys and InternallyDuplicateKeys to LedgerApiErrors.WriteServiceRejections

* Restructured ledger bridge metrics
* Buffers before each processing stage

* Do not log the failure stacktrace on ledgerId lookup

* Addressed review comments

* Buffer size before prepare submission is 128
2022-02-11 17:03:41 +00:00
pbatko-da
7137b46543
[User management] Use pagination for listing users [DPP-840] (#12610)
CHANGELOG_BEGIN
Ledger API Specification: UserManagementService.ListUsers is now using pagination
CHANGELOG_END
2022-02-03 20:32:50 +01:00
tudor-da
716cc22ac9
Deduplication offset period errors handled in Sandbox-on-X [DPP-872] (#12652)
* Deduplication offset period errors handled in Sandbox-on-X
* InternalUnsupportedOperation error category

changelog_begin
changelog_end

* Apply suggestions from code review

Co-authored-by: Simon Meier <meiersi-da@users.noreply.github.com>

* Addressed review comments

* Apply suggestions from code review

Co-authored-by: Simon Meier <meiersi-da@users.noreply.github.com>

Co-authored-by: Simon Meier <meiersi-da@users.noreply.github.com>
2022-02-01 10:32:38 +00:00
nicu-da
c1afabe653
[participant-state] Add earliest_offset metadata to pruned data error [kvl-1270] (#12546) 2022-01-31 16:54:24 +00:00
pbatko-da
c72c27c967
[User management] Terminate ongoing streams when user state has changed [DPP-830] (#12437)
CHANGELOG_BEGIN
Ledger API Specification: When using user management based authorization streams will now get aborted on authenticated user's rights change.
CHANGELOG_END
2022-01-28 16:44:39 +01:00
tudor-da
cfa8d30491
[Sandbox-on-X] Ledger-side in-memory command deduplication [DPP-872] (#12596)
* [Sandbox-on-X] Ledger-side in-memory command deduplication

changelog_begin
changelog_end

* Enirched SequenceSpec test

* Participant-side deduplication compatibility tests exclusions

* Fix LedgerConfigurationServiceIT

* Disable command deduplication tests for SoX without conflict checking

* Remove redundant max-dedup-seconds bridge config

* Default max deduplication time 5 minutes

* Deduplication queue length metrics

* Add back removed ledger config test in SequenceSpec
2022-01-28 11:42:25 +00:00
pbatko-da
4ec336dd6a
[User management] Enforce 1k user rights limit [DPP-833] (#12558)
CHANGELOG_BEGIN
Ledger API Specification: Maximum number of user rights per user is now limited to 1000 and is added to UserManagementFeature in VersionService. getLedgerApiVersion endpoint.
CHANGELOG_END
2022-01-27 22:12:34 +01:00
tudor-da
3e16e5ec98
Handle ledger bridge Queue errors (#12510)
changelog_begin
changelog_end
2022-01-26 18:48:00 +00:00
pbatko-da
42d86acd06
[User management] Disabling user management in auth when user management feature is disabled [DPP-827] (#12503)
CHANGELOG_BEGIN
CHANGELOG_END
2022-01-25 09:55:37 +01:00
Stefano Baghino
aec3390904
Replace silencer plugin with built-in warning configuration (#12543)
Since Scala 2.13.2, Scala introduced built-in support to
manage warnings in a more granular fashion, thus making
the silencer plugin we are currently using no longer
strictly useful. Removing compiler plugins also removes
friction from migrating to Scala 3 in the future. As a
cherry on top, the built-in warning configuration also
allows to check whether a `@nowarn` actually does
anything, allowing us to proactively remove unused
warnings should the need arise.

[Here][1] is s a blog post by the Scala team about it.

Warnings have been either solved or preserved if useful,
trying to minimize the scope (keeping it at the single
expression scope if possible). In particular, all
remaining usages of the Scala Collection API compatibility
module have been removed.

Using the silencer plugin also apparently hid a few
remaining usages of compatibility libraries that were used
as part of the transition from Scala 2.12 to Scala 2.13
that are no longer needed. Removing those warnings
highlighted those.

changelog_begin
changelog_end

[1]: https://www.scala-lang.org/2021/01/12/configuring-and-suppressing-warnings.html
2022-01-24 15:01:35 +00:00
mziolekda
954bc5e0d4
Remove the reset service from sandbox-classic and sandbox [DPP-804] (#12448)
* Remove the reset service from sandbox-classic and sandbox

CHANGELOG_BEGIN
Reset service has been removed from the sandbox-classic, sandbox and daml-on-sql
CHANGELOG_END

* format it
2022-01-19 09:18:14 +01:00
pbatko-da
4fe6e53b9d
[User management] Persistence with caching (#12344)
Adding
 - `PersistentUserManagementStore` and `CachedUserManagementStore`,
 - `UserManagementStorageBackendTemplate` and sql migrations,
 - CLI flags: `--user-management-max-cache-size` and `--user-management-cache-expiry`;
 And wiring `PersistentUserManagementStore` where before we had `InMemoryUserManagementStore`.
2022-01-18 15:59:22 +01:00
Simon Meier
62b61c0d51
ledger api auth: polish error messages (#12350)
* ledger api auth: polish error messages

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-11 18:16:59 +00:00
Gary Verhaegen
d2e2c21684
update copyright headers (#12240)
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.

I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 16:36:51 +00:00
Andreas Lochbihler
9a931854b2
add docs for command dedup (#11928)
CHANGELOG_BEGIN
Documentation on the new command deduplication mechanism
CHANGELOG_END
2021-12-14 09:36:32 +01:00
Simon Meier
f223528bfb
Implement PoC of user management for Ledger API server (fix #12014) (#12063)
CHANGELOG_BEGIN
- [User Management]: add support for managing participant node users and authenticating
  requests as these users using standard JWT tokens.
CHANGELOG_END

Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com>
Co-authored-by: Adriaan Moors <90182053+adriaanm-da@users.noreply.github.com>
2021-12-13 17:58:30 +01:00