Skip to content

Commit

Permalink
update canton to 3.0.0-snapshot.100000000.20240312.12829.0.v3f22ca35 (#…
Browse files Browse the repository at this point in the history
…18727)

* update canton to 3.0.0-snapshot.100000000.20240312.12829.0.v3f22ca35

tell-slack: canton

* fix for DACH-NY/canton#1755

* Patch to fix upgrade typecheck failures

* fix

* Enable disableUpgradeValidation in daml-script UpgradesIT

---------

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
Co-authored-by: Remy Haemmerle <Remy.Haemmerle@daml.com>
Co-authored-by: Carl Pulley <carl.pulley@digitalasset.com>
Co-authored-by: Moisés Ackerman <moises.ackerman@digitalasset.com>
  • Loading branch information
5 people authored Mar 14, 2024
1 parent 7cdc5be commit dcfe645
Show file tree
Hide file tree
Showing 104 changed files with 318 additions and 917 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import com.daml.ledger.api.v2.admin.user_management_service.{
RevokeUserRightsRequest,
RevokeUserRightsResponse,
Right as UserRight,
UpdateUserIdentityProviderRequest,
UpdateUserIdentityProviderResponse,
UpdateUserIdentityProviderIdRequest,
UpdateUserIdentityProviderIdResponse,
UpdateUserRequest,
UpdateUserResponse,
User,
Expand Down Expand Up @@ -275,27 +275,27 @@ object LedgerApiCommands {
sourceIdentityProviderId: String,
targetIdentityProviderId: String,
) extends BaseCommand[
UpdatePartyIdentityProviderRequest,
UpdatePartyIdentityProviderResponse,
UpdatePartyIdentityProviderIdRequest,
UpdatePartyIdentityProviderIdResponse,
Unit,
] {

override def submitRequest(
service: PartyManagementServiceStub,
request: UpdatePartyIdentityProviderRequest,
): Future[UpdatePartyIdentityProviderResponse] =
request: UpdatePartyIdentityProviderIdRequest,
): Future[UpdatePartyIdentityProviderIdResponse] =
service.updatePartyIdentityProviderId(request)

override def createRequest(): Either[String, UpdatePartyIdentityProviderRequest] = Right(
UpdatePartyIdentityProviderRequest(
override def createRequest(): Either[String, UpdatePartyIdentityProviderIdRequest] = Right(
UpdatePartyIdentityProviderIdRequest(
party = party.toProtoPrimitive,
sourceIdentityProviderId = sourceIdentityProviderId,
targetIdentityProviderId = targetIdentityProviderId,
)
)

override def handleResponse(
response: UpdatePartyIdentityProviderResponse
response: UpdatePartyIdentityProviderIdResponse
): Either[String, Unit] = Right(())

}
Expand Down Expand Up @@ -550,27 +550,27 @@ object LedgerApiCommands {
sourceIdentityProviderId: String,
targetIdentityProviderId: String,
) extends BaseCommand[
UpdateUserIdentityProviderRequest,
UpdateUserIdentityProviderResponse,
UpdateUserIdentityProviderIdRequest,
UpdateUserIdentityProviderIdResponse,
Unit,
] {

override def submitRequest(
service: UserManagementServiceStub,
request: UpdateUserIdentityProviderRequest,
): Future[UpdateUserIdentityProviderResponse] =
request: UpdateUserIdentityProviderIdRequest,
): Future[UpdateUserIdentityProviderIdResponse] =
service.updateUserIdentityProviderId(request)

override def createRequest(): Either[String, UpdateUserIdentityProviderRequest] = Right(
UpdateUserIdentityProviderRequest(
override def createRequest(): Either[String, UpdateUserIdentityProviderIdRequest] = Right(
UpdateUserIdentityProviderIdRequest(
userId = id,
sourceIdentityProviderId = sourceIdentityProviderId,
targetIdentityProviderId = targetIdentityProviderId,
)
)

override def handleResponse(
response: UpdateUserIdentityProviderResponse
response: UpdateUserIdentityProviderIdResponse
): Either[String, Unit] = Right(())

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ trait BaseLedgerApiAdministration extends NoTracing {
partyIds: Set[PartyId],
completeAfter: Int,
beginOffset: ParticipantOffset = new ParticipantOffset().withBoundary(
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BEGIN
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BOUNDARY_BEGIN
),
endOffset: Option[ParticipantOffset] = None,
verbose: Boolean = true,
Expand Down Expand Up @@ -181,7 +181,7 @@ trait BaseLedgerApiAdministration extends NoTracing {
filter: TransactionFilterProto,
completeAfter: Int,
beginOffset: ParticipantOffset = new ParticipantOffset().withBoundary(
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BEGIN
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BOUNDARY_BEGIN
),
endOffset: Option[ParticipantOffset] = None,
verbose: Boolean = true,
Expand Down Expand Up @@ -211,7 +211,7 @@ trait BaseLedgerApiAdministration extends NoTracing {
observer: StreamObserver[UpdateTreeWrapper],
filter: TransactionFilterProto,
beginOffset: ParticipantOffset = new ParticipantOffset().withBoundary(
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BEGIN
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BOUNDARY_BEGIN
),
endOffset: Option[ParticipantOffset] = None,
verbose: Boolean = true,
Expand Down Expand Up @@ -244,7 +244,7 @@ trait BaseLedgerApiAdministration extends NoTracing {
partyIds: Set[PartyId],
completeAfter: Int,
beginOffset: ParticipantOffset = new ParticipantOffset().withBoundary(
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BEGIN
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BOUNDARY_BEGIN
),
endOffset: Option[ParticipantOffset] = None,
verbose: Boolean = true,
Expand Down Expand Up @@ -274,7 +274,7 @@ trait BaseLedgerApiAdministration extends NoTracing {
filter: TransactionFilterProto,
completeAfter: Int,
beginOffset: ParticipantOffset = new ParticipantOffset().withBoundary(
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BEGIN
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BOUNDARY_BEGIN
),
endOffset: Option[ParticipantOffset] = None,
verbose: Boolean = true,
Expand Down Expand Up @@ -302,7 +302,7 @@ trait BaseLedgerApiAdministration extends NoTracing {
observer: StreamObserver[UpdateWrapper],
filter: TransactionFilterProto,
beginOffset: ParticipantOffset = new ParticipantOffset().withBoundary(
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BEGIN
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BOUNDARY_BEGIN
),
endOffset: Option[ParticipantOffset] = None,
verbose: Boolean = true,
Expand Down Expand Up @@ -1277,15 +1277,15 @@ trait BaseLedgerApiAdministration extends NoTracing {
"""This function connects to the command completion stream and passes command completions to `observer` until
|the stream is completed.
|Only completions for parties in `parties` will be returned.
|The returned completions start at `beginOffset` (default: `PARTICIPANT_BEGIN`).
|The returned completions start at `beginOffset` (default: `PARTICIPANT_BOUNDARY_BEGIN`).
|If the participant has been pruned via `pruning.prune` and if `beginOffset` is lower than the pruning offset,
|this command fails with a `NOT_FOUND` error."""
)
def subscribe(
observer: StreamObserver[CompletionWrapper],
parties: Seq[PartyId],
beginOffset: ParticipantOffset = new ParticipantOffset().withBoundary(
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BEGIN
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BOUNDARY_BEGIN
),
applicationId: String = applicationId,
): AutoCloseable = {
Expand Down Expand Up @@ -1971,7 +1971,7 @@ trait BaseLedgerApiAdministration extends NoTracing {
partyIds: Set[PartyId],
completeAfter: Int,
beginOffset: ParticipantOffset = new ParticipantOffset().withBoundary(
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BEGIN
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BOUNDARY_BEGIN
),
endOffset: Option[ParticipantOffset] = None,
verbose: Boolean = true,
Expand Down Expand Up @@ -2011,7 +2011,7 @@ trait BaseLedgerApiAdministration extends NoTracing {
partyIds: Set[PartyId],
completeAfter: Int,
beginOffset: ParticipantOffset = new ParticipantOffset().withBoundary(
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BEGIN
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BOUNDARY_BEGIN
),
endOffset: Option[ParticipantOffset] = None,
verbose: Boolean = true,
Expand Down Expand Up @@ -2051,7 +2051,7 @@ trait BaseLedgerApiAdministration extends NoTracing {
filter: TransactionFilter,
completeAfter: Int,
beginOffset: ParticipantOffset = new ParticipantOffset().withBoundary(
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BEGIN
ParticipantOffset.ParticipantBoundary.PARTICIPANT_BOUNDARY_BEGIN
),
endOffset: Option[ParticipantOffset] = None,
verbose: Boolean = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package com.digitalasset.canton.crypto.provider.tink
import cats.syntax.either.*
import com.digitalasset.canton.crypto.*
import com.digitalasset.canton.crypto.provider.jce.JceSecurityProvider
import com.digitalasset.canton.crypto.provider.tink.TinkKeyFormat.serializeHandle
import com.digitalasset.canton.serialization.ProtoConverter
import com.google.crypto.tink.aead.AeadKeyTemplates
import com.google.crypto.tink.hybrid.HybridKeyTemplates
Expand Down Expand Up @@ -36,7 +35,7 @@ class TinkJavaConverter extends JavaKeyConverter {
for {
// No other way to access the public key directly than going via protobuf
keysetProto <- ProtoConverter
.protoParser(tinkproto.Keyset.parseFrom)(serializeHandle(keysetHandle))
.protoParser(tinkproto.Keyset.parseFrom)(TinkKeyFormat.serializeHandle(keysetHandle))
.leftMap(err =>
JavaKeyConversionError.InvalidKey(s"Failed to parser tink keyset proto: $err")
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import com.daml.lf.value.Value
import com.daml.nonempty.{NonEmpty, NonEmptyUtil}
import com.digitalasset.canton.config.RequireTypes.{Port, RefinedNumeric}
import com.digitalasset.canton.ledger.api.DeduplicationPeriod
import com.digitalasset.canton.ledger.offset
import com.digitalasset.canton.ledger.participant.state.v2.ChangeId
import com.digitalasset.canton.ledger.{configuration, offset}
import com.digitalasset.canton.protocol.*
import com.digitalasset.canton.topology.UniqueIdentifier
import com.digitalasset.canton.tracing.{TraceContext, W3CTraceContext}
Expand Down Expand Up @@ -154,8 +154,9 @@ trait PrettyInstances {
implicit def prettyLedgerString: Pretty[Ref.LedgerString] = prettyOfString(id => id: String)

implicit val prettyLedgerBoundary: Pretty[ParticipantBoundary] = {
case ParticipantBoundary.PARTICIPANT_BEGIN => Tree.Literal("PARTICIPANT_BEGIN")
case ParticipantBoundary.PARTICIPANT_END => Tree.Literal("PARTICIPANT_END")
case ParticipantBoundary.PARTICIPANT_BOUNDARY_BEGIN =>
Tree.Literal("PARTICIPANT_BOUNDARY_BEGIN")
case ParticipantBoundary.PARTICIPANT_BOUNDARY_END => Tree.Literal("PARTICIPANT_BOUNDARY_END")
case ParticipantBoundary.Unrecognized(value) => Tree.Literal(s"Unrecognized($value)")
}

Expand Down Expand Up @@ -259,18 +260,6 @@ trait PrettyInstances {
param("hash", _.hash.toHexString.readableHash),
)

implicit def prettyLedgerTimeModel: Pretty[configuration.LedgerTimeModel] = prettyOfClass(
param("avgTransactionLatency", _.avgTransactionLatency),
param("minSkew", _.minSkew),
param("maxSkew", _.maxSkew),
)

implicit def prettyLedgerConfiguration: Pretty[configuration.Configuration] = prettyOfClass(
param("generation", _.generation),
param("maxDeduplicationDuration", _.maxDeduplicationDuration),
param("timeModel", _.timeModel),
)

implicit def prettyV2DeduplicationPeriod: Pretty[DeduplicationPeriod] =
prettyOfString {
case deduplicationDuration: DeduplicationPeriod.DeduplicationDuration =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import com.daml.lf.data.{IdString, Ref, Time}
import com.daml.lf.transaction.{ContractStateMachine, Versioned}
import com.daml.lf.value.Value
import com.digitalasset.canton.data.{Counter, CounterCompanion}
import com.digitalasset.canton.ledger.configuration
import com.digitalasset.canton.serialization.DeterministicEncoding.encodeLong
import com.google.protobuf.ByteString

Expand Down Expand Up @@ -41,10 +40,6 @@ package object canton {
type LedgerApplicationId = Ref.ApplicationId
val LedgerApplicationId: Ref.ApplicationId.type = Ref.ApplicationId

// Ledger configuration
type LedgerConfiguration = configuration.Configuration
val LedgerConfiguration: configuration.Configuration.type = configuration.Configuration

// Ledger transaction id
type LedgerTransactionId = Ref.TransactionId
val LedgerTransactionId: Ref.TransactionId.type = Ref.TransactionId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public static Command fromProtoCommand(CommandsOuterClass.Command command) {
return CreateCommand.fromProto(command.getCreate());
case EXERCISE:
return ExerciseCommand.fromProto(command.getExercise());
case CREATEANDEXERCISE:
case CREATE_AND_EXERCISE:
return CreateAndExerciseCommand.fromProto(command.getCreateAndExercise());
case EXERCISEBYKEY:
case EXERCISE_BY_KEY:
return ExerciseByKeyCommand.fromProto(command.getExerciseByKey());
case COMMAND_NOT_SET:
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public final class GetPackageStatusResponse {

// Clone of the PackageServiceOuterClass.PackageStatus enumeration
public enum PackageStatus {
UNKNOWN(0),
REGISTERED(1),
PACKAGE_STATUS_UNSPECIFIED(0),
PACKAGE_STATUS_REGISTERED(1),
UNRECOGNIZED(-1),
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ public static ParticipantOffset fromProto(
return new Absolute(ParticipantOffset.getAbsolute());
case BOUNDARY:
switch (ParticipantOffset.getBoundary()) {
case PARTICIPANT_BEGIN:
case PARTICIPANT_BOUNDARY_BEGIN:
return ParticipantBegin.instance;
case PARTICIPANT_END:
case PARTICIPANT_BOUNDARY_END:
return ParticipantEnd.instance;
case UNRECOGNIZED:
default:
Expand All @@ -95,12 +95,14 @@ public final ParticipantOffsetOuterClass.ParticipantOffset toProto() {
if (this instanceof ParticipantBegin) {
return ParticipantOffsetOuterClass.ParticipantOffset.newBuilder()
.setBoundary(
ParticipantOffsetOuterClass.ParticipantOffset.ParticipantBoundary.PARTICIPANT_BEGIN)
ParticipantOffsetOuterClass.ParticipantOffset.ParticipantBoundary
.PARTICIPANT_BOUNDARY_BEGIN)
.build();
} else if (this instanceof ParticipantEnd) {
return ParticipantOffsetOuterClass.ParticipantOffset.newBuilder()
.setBoundary(
ParticipantOffsetOuterClass.ParticipantOffset.ParticipantBoundary.PARTICIPANT_END)
ParticipantOffsetOuterClass.ParticipantOffset.ParticipantBoundary
.PARTICIPANT_BOUNDARY_END)
.build();
} else if (this instanceof Absolute) {
Absolute absolute = (Absolute) this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ public String toString() {
public static ParticipantPermission fromProto(
StateServiceOuterClass.ParticipantPermission permission) {
switch (permission.getNumber()) {
case StateServiceOuterClass.ParticipantPermission.Submission_VALUE:
case StateServiceOuterClass.ParticipantPermission.PARTICIPANT_PERMISSION_SUBMISSION_VALUE:
return Submission.instance;
case StateServiceOuterClass.ParticipantPermission.Confirmation_VALUE:
case StateServiceOuterClass.ParticipantPermission.PARTICIPANT_PERMISSION_CONFIRMATION_VALUE:
return Confirmation.instance;
case StateServiceOuterClass.ParticipantPermission.Observation_VALUE:
case StateServiceOuterClass.ParticipantPermission.PARTICIPANT_PERMISSION_OBSERVATION_VALUE:
return Observation.instance;
default:
throw new ParticipantPermissionUnrecognized(permission);
Expand All @@ -68,11 +68,11 @@ public static ParticipantPermission fromProto(

public final StateServiceOuterClass.ParticipantPermission toProto() {
if (this instanceof Submission) {
return StateServiceOuterClass.ParticipantPermission.Submission;
return StateServiceOuterClass.ParticipantPermission.PARTICIPANT_PERMISSION_SUBMISSION;
} else if (this instanceof Confirmation) {
return StateServiceOuterClass.ParticipantPermission.Confirmation;
return StateServiceOuterClass.ParticipantPermission.PARTICIPANT_PERMISSION_CONFIRMATION;
} else if (this instanceof Observation) {
return StateServiceOuterClass.ParticipantPermission.Observation;
return StateServiceOuterClass.ParticipantPermission.PARTICIPANT_PERMISSION_OBSERVATION;
} else {
throw new ParticipantPermissionUnknown(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,7 @@ public interface DefinedDataType<T> {
/** Produce the encoded form. */
Value toValue();

// To avoid breaking code generated by old code-generators that link against updated java-bindings
// we provide a default implementation. Calling toJson will fail but old code-gen won't use it.
// TODO(i15641) Remove this once we can expect users of codegen to have caught up.
default JsonLfEncoder jsonEncoder() {
throw new UnsupportedOperationException(
"no jsonEncoder implementation was provided for "
+ this.getClass()
+ ". Does the SDK version you are using for codegen match your version of the"
+ " java-bindings library?");
}
JsonLfEncoder jsonEncoder();

default String toJson() {
return this.jsonEncoder().intoString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,9 @@ object Generators {
domainAlias <- Arbitrary.arbString.arbitrary
domainId <- Arbitrary.arbString.arbitrary
permission <- Gen.oneOf(
v2.StateServiceOuterClass.ParticipantPermission.Submission,
v2.StateServiceOuterClass.ParticipantPermission.Confirmation,
v2.StateServiceOuterClass.ParticipantPermission.Observation,
v2.StateServiceOuterClass.ParticipantPermission.PARTICIPANT_PERMISSION_SUBMISSION,
v2.StateServiceOuterClass.ParticipantPermission.PARTICIPANT_PERMISSION_CONFIRMATION,
v2.StateServiceOuterClass.ParticipantPermission.PARTICIPANT_PERMISSION_OBSERVATION,
)
} yield v2.StateServiceOuterClass.GetConnectedDomainsResponse.ConnectedDomain
.newBuilder()
Expand All @@ -532,10 +532,10 @@ object Generators {
(b: OffsetProto.Builder) => b.setAbsolute(absolute)
),
Gen.const((b: OffsetProto.Builder) =>
b.setBoundary(OffsetProto.ParticipantBoundary.PARTICIPANT_BEGIN)
b.setBoundary(OffsetProto.ParticipantBoundary.PARTICIPANT_BOUNDARY_BEGIN)
),
Gen.const((b: OffsetProto.Builder) =>
b.setBoundary(OffsetProto.ParticipantBoundary.PARTICIPANT_END)
b.setBoundary(OffsetProto.ParticipantBoundary.PARTICIPANT_BOUNDARY_END)
),
)
} yield OffsetProto
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sdk-version: 3.0.0-snapshot.20240307.12859.0.v66d83e43
sdk-version: 3.0.0-snapshot.20240312.12878.0.v540a7460
build-options:
- --target=2.1
name: CantonExamples
Expand Down
Loading

0 comments on commit dcfe645

Please sign in to comment.