Skip to content

Commit

Permalink
update canton to 20240725.13780.v97d3c8b7 (#19678)
Browse files Browse the repository at this point in the history
tell-slack: canton

Co-authored-by: Azure Pipelines Daml Build <[email protected]>
  • Loading branch information
azure-pipelines[bot] and Azure Pipelines Daml Build authored Jul 29, 2024
1 parent 2fd6643 commit 801e0ef
Show file tree
Hide file tree
Showing 124 changed files with 1,765 additions and 2,222 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

syntax = "proto3";

package com.digitalasset.canton.admin.participant.v30;

import "google/protobuf/timestamp.proto";

message TransferId {
string source_domain = 1;
google.protobuf.Timestamp timestamp = 2;
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ import com.digitalasset.canton.admin.participant.v30.PartyNameManagementServiceG
import com.digitalasset.canton.admin.participant.v30.PingServiceGrpc.PingServiceStub
import com.digitalasset.canton.admin.participant.v30.PruningServiceGrpc.PruningServiceStub
import com.digitalasset.canton.admin.participant.v30.ResourceManagementServiceGrpc.ResourceManagementServiceStub
import com.digitalasset.canton.admin.participant.v30.TransferServiceGrpc.TransferServiceStub
import com.digitalasset.canton.admin.participant.v30.{ResourceLimits as _, *}
import com.digitalasset.canton.admin.pruning
import com.digitalasset.canton.admin.pruning.v30.{NoWaitCommitmentsSetup, WaitCommitmentsSetup}
import com.digitalasset.canton.config.RequireTypes.{NonNegativeInt, PositiveInt}
import com.digitalasset.canton.data.{CantonTimestamp, CantonTimestampSecond}
import com.digitalasset.canton.logging.TracedLogger
import com.digitalasset.canton.participant.admin.ResourceLimits
import com.digitalasset.canton.participant.admin.grpc.TransferSearchResult
import com.digitalasset.canton.participant.admin.traffic.TrafficStateAdmin
import com.digitalasset.canton.participant.domain.DomainConnectionConfig as CDomainConnectionConfig
import com.digitalasset.canton.participant.pruning.AcsCommitmentProcessor.{
Expand All @@ -48,7 +46,6 @@ import com.digitalasset.canton.protocol.messages.{AcsCommitment, CommitmentPerio
import com.digitalasset.canton.sequencing.SequencerConnectionValidation
import com.digitalasset.canton.sequencing.protocol.TrafficState
import com.digitalasset.canton.serialization.ProtoConverter
import com.digitalasset.canton.serialization.ProtoConverter.InstantConverter
import com.digitalasset.canton.time.PositiveSeconds
import com.digitalasset.canton.topology.{DomainId, ParticipantId, PartyId}
import com.digitalasset.canton.tracing.TraceContext
Expand Down Expand Up @@ -885,60 +882,6 @@ object ParticipantAdminCommands {
service.modifyDomain(request)

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

}

}

object Transfer {

abstract class Base[Req, Res, Ret] extends GrpcAdminCommand[Req, Res, Ret] {
override type Svc = TransferServiceStub

override def createService(channel: ManagedChannel): TransferServiceStub =
TransferServiceGrpc.stub(channel)
}

final case class TransferSearch(
targetDomain: DomainAlias,
sourceDomainFilter: Option[DomainAlias],
timestampFilter: Option[Instant],
submittingPartyFilter: Option[PartyId],
limit0: Int,
) extends Base[
AdminTransferSearchQuery,
AdminTransferSearchResponse,
Seq[TransferSearchResult],
] {

override def createRequest(): Either[String, AdminTransferSearchQuery] =
Right(
AdminTransferSearchQuery(
searchDomain = targetDomain.toProtoPrimitive,
filterOriginDomain = sourceDomainFilter.map(_.toProtoPrimitive).getOrElse(""),
filterTimestamp =
timestampFilter.map((value: Instant) => InstantConverter.toProtoPrimitive(value)),
filterSubmittingParty = submittingPartyFilter.fold("")(_.toLf),
limit = limit0.toLong,
)
)

override def submitRequest(
service: TransferServiceStub,
request: AdminTransferSearchQuery,
): Future[AdminTransferSearchResponse] =
service.transferSearch(request)

override def handleResponse(
response: AdminTransferSearchResponse
): Either[String, Seq[TransferSearchResult]] =
response match {
case AdminTransferSearchResponse(results) =>
results.traverse(TransferSearchResult.fromProtoV30).leftMap(_.toString)
}

override def timeoutType: TimeoutType = DefaultUnboundedTimeout

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,8 @@ object CantonConfig {
deriveEnumerationReader[PbkdfScheme]
lazy implicit val cryptoKeyFormatReader: ConfigReader[CryptoKeyFormat] =
deriveEnumerationReader[CryptoKeyFormat]
lazy implicit val encryptionSchemeConfigReader: ConfigReader[EncryptionSchemeConfig] =
deriveReader[EncryptionSchemeConfig]
implicit def cryptoSchemeConfig[S: ConfigReader: Order]: ConfigReader[CryptoSchemeConfig[S]] =
deriveReader[CryptoSchemeConfig[S]]
lazy implicit val communityCryptoReader: ConfigReader[CommunityCryptoConfig] =
Expand Down Expand Up @@ -1138,6 +1140,8 @@ object CantonConfig {
deriveEnumerationWriter[PbkdfScheme]
lazy implicit val cryptoKeyFormatWriter: ConfigWriter[CryptoKeyFormat] =
deriveEnumerationWriter[CryptoKeyFormat]
lazy implicit val encryptionSchemeConfigWriter: ConfigWriter[EncryptionSchemeConfig] =
deriveWriter[EncryptionSchemeConfig]
implicit def cryptoSchemeConfigWriter[S: ConfigWriter]: ConfigWriter[CryptoSchemeConfig[S]] =
deriveWriter[CryptoSchemeConfig[S]]
lazy implicit val communityCryptoWriter: ConfigWriter[CommunityCryptoConfig] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,12 @@ abstract class ParticipantReference(
override def health: ParticipantHealthAdministration =
new ParticipantHealthAdministration(this, consoleEnvironment, loggerFactory)

override def parties: ParticipantPartiesAdministrationGroup
@Help.Summary("Inspect and manage parties")
@Help.Group("Parties")
def parties: ParticipantPartiesAdministrationGroup = partiesGroup
// above command needs to be def such that `Help` works.
lazy private val partiesGroup =
new ParticipantPartiesAdministrationGroup(id, this, consoleEnvironment, loggerFactory)

private lazy val topology_ =
new TopologyAdministrationGroup(
Expand Down Expand Up @@ -604,14 +609,6 @@ class RemoteParticipantReference(environment: ConsoleEnvironment, override val n
extends ParticipantReference(environment, name)
with RemoteInstanceReference {

@Help.Summary("Inspect and manage parties")
@Help.Group("Parties")
override def parties: ParticipantPartiesAdministrationGroup = partiesGroup

// above command needs to be def such that `Help` works.
lazy private val partiesGroup =
new ParticipantPartiesAdministrationGroup(id, this, consoleEnvironment)

@Help.Summary("Return remote participant config")
def config: RemoteParticipantConfig =
consoleEnvironment.environment.config.remoteParticipantsByString(name)
Expand Down Expand Up @@ -673,15 +670,6 @@ class LocalParticipantReference(
/** secret, not publicly documented way to get the admin token */
def adminToken: Option[String] = underlying.map(_.adminToken.secret)

// TODO(#14048) these are "remote" groups. the normal participant node has "local" versions.
// but rather than keeping this, we should make local == remote and add local methods separately
@Help.Summary("Inspect and manage parties")
@Help.Group("Parties")
def parties: LocalParticipantPartiesAdministrationGroup = partiesGroup
// above command needs to be def such that `Help` works.
lazy private val partiesGroup =
new LocalParticipantPartiesAdministrationGroup(this, this, consoleEnvironment, loggerFactory)

private lazy val testing_ =
new LocalParticipantTestingGroup(this, consoleEnvironment, loggerFactory)
@Help.Summary("Commands used for development and testing", FeatureFlag.Testing)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ import com.digitalasset.canton.health.admin.data.ParticipantStatus
import com.digitalasset.canton.logging.{NamedLoggerFactory, NamedLogging, TracedLogger}
import com.digitalasset.canton.participant.ParticipantNode
import com.digitalasset.canton.participant.admin.ResourceLimits
import com.digitalasset.canton.participant.admin.grpc.TransferSearchResult
import com.digitalasset.canton.participant.admin.inspection.SyncStateInspection
import com.digitalasset.canton.participant.domain.DomainConnectionConfig
import com.digitalasset.canton.participant.pruning.AcsCommitmentProcessor.{
Expand Down Expand Up @@ -1725,36 +1724,6 @@ trait ParticipantAdministration extends FeatureFlagFilter {
} yield ()
}
}

}

@Help.Summary("Composability related functionality", FeatureFlag.Preview)
@Help.Group("Transfer")
object transfer extends Helpful {

@Help.Summary("Search the currently in-flight transfers", FeatureFlag.Testing)
@Help.Description(
"Returns all in-flight transfers with the given target domain that match the filters, but no more than the limit specifies."
)
def search(
targetDomain: DomainAlias,
filterSourceDomain: Option[DomainAlias],
filterTimestamp: Option[Instant],
filterSubmittingParty: Option[PartyId],
limit: PositiveInt = defaultLimit,
): Seq[TransferSearchResult] =
check(FeatureFlag.Preview)(consoleEnvironment.run {
adminCommand(
ParticipantAdminCommands.Transfer
.TransferSearch(
targetDomain,
filterSourceDomain,
filterTimestamp,
filterSubmittingParty,
limit.value,
)
)
})
}

@Help.Summary("Functionality for managing resources")
Expand Down
Loading

0 comments on commit 801e0ef

Please sign in to comment.