Skip to content

Commit 1f2db05

Browse files
[main] Update 2025-04-08.23 (#310)
Reference commit: 793e625a78 Co-authored-by: Canton <canton@digitalasset.com>
1 parent c7a3aeb commit 1f2db05

File tree

523 files changed

+49448
-3151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

523 files changed

+49448
-3151
lines changed

UNRELEASED.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@
33
Canton CANTON_VERSION has been released on RELEASE_DATE. You can download the Daml Open Source edition from the Daml Connect [Github Release Section](https://github.com/digital-asset/daml/releases/tag/vCANTON_VERSION). The Enterprise edition is available on [Artifactory](https://digitalasset.jfrog.io/artifactory/canton-enterprise/canton-enterprise-CANTON_VERSION.zip).
44
Please also consult the [full documentation of this release](https://docs.daml.com/CANTON_VERSION/canton/about.html).
55

6+
## Until 2025-04-08 (Exclusive)
7+
- Json API: http response status codes are based on the corresponding gRPC errors where applicable.
8+
- Json API: `/v2/users` and `/v2/parties` now support paging
9+
- Json API: Updated openapi.yaml to correctly represent Timestamps as strings in the JSON API schema
10+
- The package vetting ledger-effective-time boundaries change to validFrom being inclusive and validUntil being exclusive
11+
whereas previously validFrom was exclusive and validUntil was inclusive.
12+
13+
### Ledger API topology transaction to represent addition for (party, participant)
14+
- The ParticipantAuthorizationAdded message was added to express the inception of a party in a participant.
15+
- The TopologyEvent message was extended to include the ParticipantAuthorizationAdded.
16+
- The lapi_events_party_to_participant table was extended by one column the participant_permission_type which holds the
17+
state of the participant authorization (Added, Changed, Revoked)
18+
- The JSON api and the java bindings have changed accordingly to accommodate the changes.
19+
20+
21+
## Until 2025-04-05 (Exclusive)
22+
### Breaking: New External Signing Hashing Scheme
23+
**BREAKING CHANGE**
24+
The hashing algorithm for externally signed transactions has been changed in a minor but backward-incompatible way.
25+
26+
- There is a new `interfaceId` field in the `Fetch` node of the transaction that now is part of the hash.
27+
- The hashing scheme version (now being V2) is now part of the hash
28+
29+
See the [hashing algorithm documentation](https://docs.digitalasset-staging.com/build/3.3/explanations/external-signing/external_signing_hashing_algorithm#fetch) for the updated version.
30+
The hash provided as part of the `PrepareSubmissionResponse` is updated to the new algorithm as well.
31+
This updated algorithm is supported under a new `V2` hashing scheme version.
32+
Support for `V1` has been dropped and will not be supported in Canton 3.3 onward.
33+
This is relevant for applications that re-compute the hash client-side.
34+
Such applications must update their implementation in order to use the interactive submission service on Canton 3.3.
35+
636
## Until 2025-04-04 (Exclusive)
737
### ACS Export and Import
838
The ACS export and import now use an ACS snapshot containing LAPI active contracts, as opposed to the Canton internal
@@ -40,6 +70,13 @@ implementation).
4070
its method to `ActiveContactOld#fromFile`
4171
- Renamed the current `import_acs_from_file` repair macro to `import_acs_old_from_file`. And deprecation of
4272
`import_acs_old_from_file`.
73+
- Authorization service configuration of the ledger api and admin api is validated. No two services can define
74+
the same target scope or audience.
75+
- Ledger API will now give the `DAML_FAILURE` error instead of the `UNHANDLED_EXCEPTION` error when exceptions are
76+
thrown from daml.
77+
- Details: This new error structure includes an `error_id` in the `ErrorInfoDetail` metadata, of the form
78+
`UNHANDLED_EXCEPTION/Module.Name:ExceptionName` for legacy exceptions, and fully user defined for `failWithStatus`
79+
exceptions. Please migrate to `failWithStatus` over daml exceptions before Daml 3.4.
4380

4481
## Until 2025-03-27 (Exclusive)
4582
### Reassignment Batching
@@ -50,6 +87,18 @@ implementation).
5087
- UnassignedEvent messages now additionally contain an offset and a node_id.
5188
- For the detailed list of changed Ledger API proto messages please see docs-open/src/sphinx/reference/lapi-migration-guide.rst
5289

90+
## Until 2025-03-26 (Exclusive)
91+
- Added GetUpdateByOffset and GetUpdateById rpc methods in the ledger api that extend and will replace the existing
92+
GetTransactionByOffset and GetTransactionById so that one will be able to look up an update by its offset or id.
93+
- Towards this, the GetUpdateByOffsetRequest and GetUpdateByIdRequest messages were added. Both contain the update
94+
format to shape the update in its final form. Look at docs-open/src/sphinx/reference/lapi-migration-guide.rst on how
95+
use the added messages over the GetTransactionByOffsetRequest and GetTransactionByIdRequest.
96+
- The GetUpdateResponse is the response of both methods that contains the update which can be one of:
97+
- a transaction
98+
- a reassignment
99+
- a topology transaction
100+
- The java bindings and json api were also extended to include the above changes.
101+
53102
## Until 2025-03-25 (Exclusive)
54103
- `_recordId` removed from Daml records in Json API
55104
- Removed `default-close-delay` from `ws-config` (websocket config) in `http-service` configuration (close delay is no longer necessary).

base/errors/src/main/scala/com/digitalasset/base/error/Alarm.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ trait BaseAlarm extends BaseError {
2424
super.context ++ BaseError.extractContext(this)
2525

2626
/** Report the alarm to the logger. */
27-
def report()(implicit logger: ContextualizedErrorLogger): Unit = logWithContext()
27+
def report()(implicit logger: BaseErrorLogger): Unit = logWithContext()
2828

2929
/** Reports the alarm to the logger.
3030
*
3131
* @return
3232
* this alarm
3333
*/
34-
def reported()(implicit logger: ContextualizedErrorLogger): this.type = {
34+
def reported()(implicit logger: BaseErrorLogger): this.type = {
3535
report()
3636
this
3737
}
3838

39-
def asGrpcError(implicit logger: ContextualizedErrorLogger): StatusRuntimeException =
39+
def asGrpcError(implicit logger: BaseErrorLogger): StatusRuntimeException =
4040
ErrorCode.asGrpcError(this)(logger)
4141
}
4242

base/errors/src/main/scala/com/digitalasset/base/error/BaseError.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ trait BaseError extends LocationMixin {
5050
def resources: Seq[(ErrorResource, String)] = Seq()
5151

5252
def logWithContext(extra: Map[String, String] = Map())(implicit
53-
contextualizedErrorLogger: ContextualizedErrorLogger
53+
contextualizedErrorLogger: BaseErrorLogger
5454
): Unit =
5555
contextualizedErrorLogger.logError(this, extra)
5656

@@ -68,7 +68,7 @@ trait BaseError extends LocationMixin {
6868
def definiteAnswerO: Option[Boolean] = None
6969

7070
def rpcStatus()(implicit
71-
loggingContext: ContextualizedErrorLogger
71+
loggingContext: BaseErrorLogger
7272
): com.google.rpc.status.Status =
7373
ProtoStatus.fromJavaProto(ErrorCode.asGrpcStatus(this))
7474

base/errors/src/main/scala/com/digitalasset/base/error/NoLogging.scala renamed to base/errors/src/main/scala/com/digitalasset/base/error/BaseErrorLogger.scala

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,25 @@
33

44
package com.digitalasset.base.error
55

6-
object NoLogging extends NoLogging(properties = Map.empty, correlationId = None, traceId = None) {}
6+
trait BaseErrorLogger {
7+
def logError(err: BaseError, extra: Map[String, String]): Unit
8+
def correlationId: Option[String]
9+
def traceId: Option[String]
10+
def properties: Map[String, String]
711

8-
class NoLogging(
12+
// Error construction warnings/errors
13+
def warn(message: String): Unit
14+
def error(message: String, throwable: Throwable): Unit
15+
}
16+
object NoBaseLogging
17+
extends NoBaseLogging(properties = Map.empty, correlationId = None, traceId = None) {}
18+
19+
class NoBaseLogging(
920
val properties: Map[String, String],
1021
val correlationId: Option[String],
1122
val traceId: Option[String] = None,
12-
) extends ContextualizedErrorLogger {
23+
) extends BaseErrorLogger {
1324
override def logError(err: BaseError, extra: Map[String, String]): Unit = ()
14-
override def info(message: String): Unit = ()
15-
override def info(message: String, throwable: Throwable): Unit = ()
1625
override def warn(message: String): Unit = ()
17-
override def warn(message: String, throwable: Throwable): Unit = ()
18-
override def error(message: String): Unit = ()
1926
override def error(message: String, throwable: Throwable): Unit = ()
20-
21-
override def withContext[A](context: Map[String, String])(body: => A): A = body
2227
}

base/errors/src/main/scala/com/digitalasset/base/error/ContextualizedErrorLogger.scala

Lines changed: 0 additions & 35 deletions
This file was deleted.

base/errors/src/main/scala/com/digitalasset/base/error/DamlError.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ abstract class ContextualizedDamlError(
1212
extraContext: Map[String, Any] = Map(),
1313
)(implicit
1414
override val code: ErrorCode,
15-
val logger: ContextualizedErrorLogger,
15+
val logger: BaseErrorLogger,
1616
) extends BaseError
1717
with RpcError
1818
with LogOnCreation {
1919

2020
// Automatically log the error on generation
2121
override def logOnCreation: Boolean = true
2222

23+
def logError(): Unit = logWithContext()(logger)
24+
2325
def asGrpcStatus: Status =
2426
ErrorCode.asGrpcStatus(this)(logger)
2527

@@ -44,7 +46,7 @@ class DamlErrorWithDefiniteAnswer(
4446
extraContext: Map[String, Any] = Map(),
4547
)(implicit
4648
override val code: ErrorCode,
47-
loggingContext: ContextualizedErrorLogger,
49+
loggingContext: BaseErrorLogger,
4850
) extends ContextualizedDamlError(
4951
cause = cause,
5052
throwableO = throwableO,

base/errors/src/main/scala/com/digitalasset/base/error/ErrorCode.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ object ErrorCode {
146146
val MaxErrorContentBytes = 4096
147147

148148
def asGrpcError(err: BaseError)(implicit
149-
loggingContext: ContextualizedErrorLogger
149+
loggingContext: BaseErrorLogger
150150
): StatusRuntimeException = {
151151
val status = asGrpcStatus(err)(loggingContext)
152152
// Builder methods for metadata are not exposed, so going route via creating an exception
@@ -160,11 +160,11 @@ object ErrorCode {
160160
}
161161
}
162162

163-
def asGrpcStatus(err: BaseError)(implicit loggingContext: ContextualizedErrorLogger): Status =
163+
def asGrpcStatus(err: BaseError)(implicit loggingContext: BaseErrorLogger): Status =
164164
asGrpcStatus(err, MaxErrorContentBytes)
165165

166166
private[error] def asGrpcStatus(err: BaseError, maxSerializedErrorSize: Int)(implicit
167-
loggingContext: ContextualizedErrorLogger
167+
loggingContext: BaseErrorLogger
168168
): Status =
169169
try
170170
SerializableErrorCodeComponents(

base/errors/src/main/scala/com/digitalasset/base/error/ErrorResource.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ object ErrorResource {
1717
lazy val ContractKey: ErrorResource = ErrorResource("CONTRACT_KEY")
1818
lazy val ContractArg: ErrorResource = ErrorResource("CONTRACT_ARG")
1919
lazy val TransactionId: ErrorResource = ErrorResource("TRANSACTION_ID")
20+
lazy val UpdateId: ErrorResource = ErrorResource("UPDATE_ID")
2021
lazy val DalfPackage: ErrorResource = ErrorResource("PACKAGE")
2122
lazy val TemplateId: ErrorResource = ErrorResource("TEMPLATE_ID")
2223
lazy val InterfaceId: ErrorResource = ErrorResource("INTERFACE_ID")
@@ -61,6 +62,7 @@ object ErrorResource {
6162
SynchronizerId,
6263
TemplateId,
6364
TransactionId,
65+
UpdateId,
6466
User,
6567
)
6668

base/errors/src/main/scala/com/digitalasset/base/error/LogOnCreation.scala

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,9 @@ package com.digitalasset.base.error
55

66
/** Trait to log on creation */
77
trait LogOnCreation {
8-
9-
self: BaseError =>
10-
11-
implicit def logger: ContextualizedErrorLogger
12-
138
def logOnCreation: Boolean = true
14-
15-
def logError(): Unit = logWithContext()(logger)
16-
9+
def logError(): Unit
1710
if (logOnCreation) {
1811
logError()
1912
}
20-
2113
}

base/errors/src/main/scala/com/digitalasset/base/error/SerializableErrorComponents.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ object SerializableErrorCodeComponents {
3333

3434
def apply(
3535
errorCode: ErrorCode,
36-
loggingContext: ContextualizedErrorLogger,
36+
loggingContext: BaseErrorLogger,
3737
rawTraceId: Option[String],
3838
rawCorrelationId: Option[String],
3939
// Next parameters are by-name to avoid unnecessary computation if the error is security sensitive
@@ -68,7 +68,7 @@ object SerializableErrorCodeComponents {
6868
private[error] def validateTraceIdAndCorrelationId(
6969
rawTraceId: Option[String],
7070
rawCorrelationId: Option[String],
71-
)(implicit loggingContext: ContextualizedErrorLogger) = {
71+
)(implicit loggingContext: BaseErrorLogger) = {
7272
val traceId = rawTraceId.map(tId =>
7373
truncateString(
7474
tId,
@@ -105,7 +105,7 @@ private[error] final case class SecuritySensitiveErrorCodeComponents(
105105
grpcStatusCode: Option[Code],
106106
traceId: Option[String],
107107
correlationId: Option[String],
108-
)(logger: ContextualizedErrorLogger)
108+
)(logger: BaseErrorLogger)
109109
extends SerializableErrorCodeComponents {
110110

111111
override def toStatusProto(maxSizeBytes: Int): com.google.rpc.Status =
@@ -140,7 +140,7 @@ private[error] final case class NonSecuritySensitiveErrorCodeComponents(
140140
errorResources: Seq[(ErrorResource, String)],
141141
contextMap: Map[String, String],
142142
retryableInfo: Option[FiniteDuration],
143-
)(loggingContext: ContextualizedErrorLogger)
143+
)(loggingContext: BaseErrorLogger)
144144
extends SerializableErrorCodeComponents {
145145

146146
/** Truncates and serializes the self-service error components into a [[com.google.rpc.Status]].

0 commit comments

Comments
 (0)