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
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
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
* 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
CHANGELOG_BEGIN
Ledger API Specification: When using user management based authorization streams will now get aborted on authenticated user's rights change.
CHANGELOG_END
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
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
* 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
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`.
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
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>
Changes:
1. Limit local table of contents depth in HTML view.
2. Move some subsections higher up in the hierarchy.
3. Move error categories inventory right before error codes inventory.
CHANGELOG_BEGIN
CHANGELOG_END
This is part of #11691
This PR allows to limits:
- the number of signatories,
- the number of observers,
- the number of controllers,
- the number of inputContracts,
CHANGELOG_BEGIN
CHANGELOG_END
Other changes:
- Fix ErrorCodeDocumentationGeneratorSpec not being in any bazel target.
- (partially) Fix inconsistent usage of deprecated, Deprecation and DeprecatedDocs annotation.
CHANGELOG_BEGIN
CHANGELOG_END
* [Self-service error codes] Do not return error code id in metadata
CHANGELOG_BEGIN
CHANGELOG_END
* Do not propagate definite_answer
* Additionally, remove redundant context info from error codes
* Fix tests
* Create IndexDbException as a specialization
* Used to globally define error codes returned by the persistence layer
that are logging
* Add a guard when exercising by interface.
This fixes part of #11703, when exercising an inherited choice by
interface and you know the template id, via the command preprocessor.
It does this by inserting a "guard" in between the interface fetch and
the exercise body. The guard is a function Interface -> Bool, which
is general enough to check the template id, without complicating too
much in speedy. And can be generalized in the future to check more,
like signatories, etc.
I added the guard as an optional argument to UExerciseByInterface.
This isn't hooked up to the protobuf AST yet (or Haskell side for
that matter) -- but I'll do it in the next PR! For now you can invoke
the guarded exercise via the command preprocessor, so I can enable the
approprate engine tests. (There's still some failing fetch tests left,
but I decided to leave this for later. Fetch can be a lot simpler than
guarded choices, since you always add a fetch node. No need for fancy
continuations.)
changelog_begin
changelog_end
* scalafmt
* Feedback and fix matches
* Update comments, we are always going to abort the transaction
* Raise WronglyTypedContract in SBGuardTemplateId.
* rebase and fix parser
* restore ANF
* scalafmt
changelog_begin
kvutils - For duplicate command rejections, the submission id of the already accepted transaction is returning as part of the gRPC metadata. The submission id will be included under the key `existing_submission_id`.
changelog_end
* Refactoring for Canton compatibility on PackageServiceErrors
* ErrorResource.all is public for accessibility from Canton
CHANGELOG_BEGIN
CHANGELOG_END
* Keep PackageServiceError object
I’ve kept the infrastructure for versioned_scala_deps around because
I’m optimistic and hope that eventually we’ll do another Scala upgrade.
changelog_begin
changelog_end
* Adapted migration guide to include changes from https://github.com/digital-asset/daml/pull/11686
CHANGELOG_BEGIN
CHANGELOG_END
* Enriched migration guide with Sandbox-classic changed gRPC error codes
* Added migration guide for error codes changed in KV committer
* Extract the KV and Sandbox-classic migration guides
* Hierarchical order of error codes docs
* Added back full grpc error code description to columns
* Using "gRPC status code" instead of "gRPC error code"
* Addressed review comments from Hubert
* Apply suggestions from code review
Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
* Addressed review comments
* Use 'Error codes' instead of 'Self-service error codes'
Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
* Republish error codes generator libraries
* Additionally, add kvutils to classpath for generating KVErrors docs
CHANGELOG_BEGIN
CHANGELOG_END
* Use a new annotation (DeprecatedDocs) instead of @deprecated
* Needed for adding descriptions to the error groups docs. Needed for allowing cross-compilation
to 2.12 and 2.13, not possible due to the reflections machinery of extracting
the message from @deprecated
* Use error validators in ApiPackageManagementService
CHANGELOG_BEGIN
CHANGELOG_END
* Exclude PackageManagementServiceIT from compatibility tests after 1.17
CHANGELOG_BEGIN
CHANGELOG_END
CHANGELOG_BEGIN
[ledger-api] - Return max_deduplication_duration as part of the metadata sent with the gRPC status for commands rejected because of invalid deduplication periods
CHANGELOG_END
* Render error deprecation in generated docs
CHANGELOG_BEGIN
CHANGELOG_END
* Build export-error-codes-json-app with Scala 2.13 only
* Generate docs only with Scala 2.13
* Generate daml-on-sql docs only with Scala 2.13
* Split the error codes JSON generator off from the error lib
* Build all docs only with Scala 2.13
CHANGELOG_BEGIN
[ledger-api] - Return FAILED_PRECONDITION gRPC status code, instead of INVALID_ARGUMENT, for an invalid command deduplication duration
CHANGELOG_END
* DbDispatcher handles transient and non-transient SQL exceptions with specific error codes
CHANGELOG_BEGIN
CHANGELOG_END
* Handle retries when verifying ledger id
* Addressed Pawel's comments
* Logging clean-up and small refactoring
* Exhaustive match against Oracle and PSQL exceptions
* KV: port V2 errors to self-service errors framework
CHANGELOG_BEGIN
CHANGELOG_END
* Fix ConversionsSpec compiling
* Use a valid ID for ValidationFailure
* Fix error details in Conversions
* Relax and simplify checks in KeyValueConsumptionSpec
* Fix formatting
* Fix definite answer in deduplication v2
* Try and make Scala 2.12 happy
* Fix typos in comments
* Use NOT_FOUND for unknown parties and provide them as resources
* Race (group) -> SubmissionRaces
* Don't deprecate resource exhausted (ABORTED) error
* Rename KVCompletionErrors group into KVErrors (ResourceExhausted can be synchronous)
* Remove unneeded braces
Co-authored-by: Hubert Slojewski <hubert.slojewski@digitalasset.com>
* Move toJsonString to where it's used
* Deprecate InvalidLedgerTime
* Embed deprecation comments into annotation
* Change deprecation messages so that they make more sense in the docs
* Move deprecated errors to a dedicated group as proposed by @tudor-da
Co-authored-by: Hubert Slojewski <hubert.slojewski@digitalasset.com>
* [DPP-417][DPP-613] Adopt self-service error codes ApiTransactionService
CHANGELOG_BEGIN
CHANGELOG_END
* TV review
* TV review
* Uses ErrorFactories
* Error loggers use enriched logging contexts
* Deleted ApiTransactionServiceSpec
* Add TODO wrt to CommandValidation.invalidArgument
* Adapt transactionNotFound error assertions in conformance tests
* ErrorFactories.invalidArgumentWasNotFound for handling invalid event ids
* Revert improvement to TransactionNotFound cause message since
Canton still outputs the old message and assertions fail.
Co-authored-by: Tudor Voicu <tudor.voicu@digitalasset.com>
* [Self-service error codes] Implement V2 in Authorizer
CHANGELOG_BEGIN
CHANGELOG_END
* Added unit test for authorize (non-streamed)
* Fix after rebase
* Do not expose the error codes switching mechanism to the Java bindings
* Adjust InternalAuthorizationError to be SystemInternalAssumptionViolated
* Parameter names in test
* Testing AuthorizationInterceptor with regard to returned error codes
* Do not use default error code version switchers at instance creation
* Addressed Pawel's review comments
* Using ErrorFactories for error dispatching
* Pass loggingContext to Authorizer where available
* Generic internal authorization error
Adding `Daml Documentation >> Building applications >> "Self-Service Error Codes (Experimental)` section in the HTML documentation.
The section is populated automatically with error code information retrieved from the classpath.
The process of generating documentation for error codes looks like this:
- first we find error codes information from the classpath,
- then we save it to a json file,
- then the json file is made available to a custom Sphinx extension,
- then the custom Sphinx extension generates documentation wherever we put a new custom Sphinx directive.
Try it out with
`./docs/scripts/live-preview.sh`
or
`./docs/scripts/preview.sh`
CHANGELOG_BEGIN
CHANGELOG_END
* Moved ErrorCodesVersionSwitcher to //ledger/error
CHANGELOG_BEGIN
CHANGELOG_END
* Rename ErrorCodeLoggingContext to ContextualizedErrorLogger
* Refactored ErrorFactories
* All error factories use ContextualizedErrorLogger for being able to dispatch self-service error codes.
* The ContextualizedErrorLogger is passed down from the dispatching Ledger API services.
* ErrorFactoriesSpec asserts both legacy (V1) and self-service error codes (V2).
* Adapted ApiSubmissionService
* Addressed Marcin's review comments
* [Self-service error codes] Refactored for Canton integration
* Introduces ErrorCodeLoggingContext which is used to abstract away the logging tech stack
CHANGELOG_BEGIN
CHANGELOG_END
* Moved all error definitions in //ledger/error
* Formatting
* Docs and remove of implicit conversion to DamlErrorCodeLoggingContext
* Fix compilation issues
* Fix tests
* Addressed Pawel's review comments
* Addressed Robert's review comments
* Extracted common error implementations
* ErrorGroups
* TransactionError hierarchy
* LedgerApiErrors
* PackageServiceError
* ProtoDeserializationError
* PruningServiceError
* SubmissionErrors
CHANGELOG_BEGIN
CHANGELOG_END
* Adapt extracted error groups and definitions to adhere to local tech stack:
* Use //ledger/error:error core API
* Use DAML SDK logging stack
* Manual rebase to latest changes from Canton
* Extracted RejectionGenerator from Canton
* Adapted RejectionGenerator
* Added //ledger/error:error to artifacts
* Pass correlationId to errors
* Pass parameters as implicits to shave some lines and improve readability
* Workaround for encountered Scala/JDK8 bug
* Addressed Ratko's review comments
* [Daml error codes API] Further implementations
* Implements ErrorCode.asGrpcError (and test)
* Error code logging now accepts correlation id and an extra context map
* Full error context is included into enriched logging context
CHANGELOG_BEGIN
CHANGELOG_END
* Fixed Scala 2.12 compilation issues
* [Ledger API error codes] ErrorCode interfaces and generator
* Implementation of annotation processor
* Implementation of DocItem generator
* Unit testing of the generator and error code logging
CHANGELOG_BEGIN
CHANGELOG_END
* Addressed review comments