Skip to content

Commit 300ab7e

Browse files
update canton to 20250120.12199.v6b20faba (#20615)
1 parent 1e848e2 commit 300ab7e

File tree

80 files changed

+760
-378
lines changed

Some content is hidden

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

80 files changed

+760
-378
lines changed

Diff for: sdk/canton/community/app-base/src/main/scala/com/digitalasset/canton/config/CantonConfig.scala

+8
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ final case class CantonParameters(
320320
retentionPeriodDefaults: RetentionPeriodDefaults = RetentionPeriodDefaults(),
321321
console: AmmoniteConsoleConfig = AmmoniteConsoleConfig(),
322322
exitOnFatalFailures: Boolean = true,
323+
startupMemoryCheckConfig: StartupMemoryCheckConfig = StartupMemoryCheckConfig.Warn,
323324
) {
324325
def getStartupParallelism(numThreads: Int): Int =
325326
startupParallelism.fold(numThreads)(_.value)
@@ -418,6 +419,7 @@ trait CantonConfig {
418419
general = CantonNodeParameterConverter.general(this, domainConfig),
419420
protocol = CantonNodeParameterConverter.protocol(this, domainConfig.init.domainParameters),
420421
maxBurstFactor = domainConfig.parameters.maxBurstFactor,
422+
dispatcherBatchSize = domainConfig.parameters.dispatcherBatchSize,
421423
)
422424
}
423425

@@ -542,6 +544,7 @@ private[config] object CantonNodeParameterConverter {
542544
parent.features.skipTopologyManagerSignatureValidation,
543545
parent.parameters.exitOnFatalFailures,
544546
node.parameters.watchdog,
547+
parent.parameters.startupMemoryCheckConfig,
545548
)
546549
}
547550

@@ -1011,6 +1014,8 @@ object CantonConfig {
10111014
deriveReader[BatchAggregatorConfig]
10121015
}
10131016

1017+
implicit val configReader: ConfigReader[StartupMemoryCheckConfig] =
1018+
deriveEnumerationReader[StartupMemoryCheckConfig]
10141019
lazy implicit val ammoniteConfigReader: ConfigReader[AmmoniteConsoleConfig] =
10151020
deriveReader[AmmoniteConsoleConfig]
10161021
lazy implicit val cantonParametersReader: ConfigReader[CantonParameters] =
@@ -1217,6 +1222,9 @@ object CantonConfig {
12171222
confidentialWriter[AuthServiceConfig.UnsafeJwtHmac256](
12181223
_.copy(secret = NonEmptyString.tryCreate("****"))
12191224
)
1225+
1226+
implicit val configWriter: ConfigWriter[StartupMemoryCheckConfig] =
1227+
deriveEnumerationWriter[StartupMemoryCheckConfig]
12201228
lazy implicit val authServiceConfigWildcardWriter
12211229
: ConfigWriter[AuthServiceConfig.Wildcard.type] =
12221230
deriveWriter[AuthServiceConfig.Wildcard.type]

Diff for: sdk/canton/community/app-base/src/main/scala/com/digitalasset/canton/console/commands/ParticipantAdministration.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@ trait ParticipantAdministration extends FeatureFlagFilter {
14631463
adminCommand(ParticipantAdminCommands.DomainConnectivity.ListConnectedDomains())
14641464
}
14651465

1466-
@Help.Summary("List the configured domains of this participant")
1466+
@Help.Summary("List the configured active domains of this participant")
14671467
def list_registered(): Seq[(DomainConnectionConfig, Boolean)] = consoleEnvironment.run {
14681468
adminCommand(ParticipantAdminCommands.DomainConnectivity.ListConfiguredDomains)
14691469
}

Diff for: sdk/canton/community/app-base/src/main/scala/com/digitalasset/canton/console/commands/TopologyAdministration.scala

+14-2
Original file line numberDiff line numberDiff line change
@@ -748,10 +748,11 @@ class TopologyAdministrationGroup(
748748
target.fingerprint,
749749
isRootDelegation,
750750
key.some,
751+
// no replace existing
751752
)
752753
.discard
753-
754754
renewNamespaceDelegations(TopologyChangeOp.Add, authorizeWith)
755+
// Note: this will remove the oldest one which is the one that existed before
755756
renewNamespaceDelegations(TopologyChangeOp.Remove, filterAuthorizedKey)
756757

757758
case IdentifierDelegation(identifier, target) =>
@@ -762,10 +763,12 @@ class TopologyAdministrationGroup(
762763
identifier,
763764
target.fingerprint,
764765
key.some,
766+
// no replace existing
765767
)
766768
.discard
767769

768770
renewIdentifierDelegation(TopologyChangeOp.Add, authorizeWith)
771+
// Note: this will remove the oldest one which is the one that existed before
769772
renewIdentifierDelegation(TopologyChangeOp.Remove, filterAuthorizedKey)
770773

771774
case OwnerToKeyMapping(owner, key) =>
@@ -777,10 +780,12 @@ class TopologyAdministrationGroup(
777780
key.fingerprint,
778781
key.purpose,
779782
nsKey.some,
783+
// no replace existing
780784
)
781785
.discard
782786

783787
renewOwnerToKeyMapping(TopologyChangeOp.Add, authorizeWith)
788+
// Note: this will remove the oldest one which is the one that existed before
784789
renewOwnerToKeyMapping(TopologyChangeOp.Remove, filterAuthorizedKey)
785790

786791
case signedClaim: SignedLegalIdentityClaim =>
@@ -797,10 +802,12 @@ class TopologyAdministrationGroup(
797802
permission,
798803
trustLevel,
799804
key.some,
805+
replaceExisting = false,
800806
)
801807
.discard
802808

803809
renewParticipantState(TopologyChangeOp.Add, authorizeWith)
810+
// Note: this will remove the oldest one which is the one that existed before
804811
renewParticipantState(TopologyChangeOp.Remove, filterAuthorizedKey)
805812

806813
case MediatorDomainState(side, domain, mediator) =>
@@ -812,10 +819,12 @@ class TopologyAdministrationGroup(
812819
mediator,
813820
side,
814821
key.some,
822+
replaceExisting = false,
815823
)
816824
.discard
817825

818826
renewMediatorState(TopologyChangeOp.Add, authorizeWith)
827+
// Note: this will remove the oldest one which is the one that existed before
819828
renewMediatorState(TopologyChangeOp.Remove, filterAuthorizedKey)
820829

821830
case PartyToParticipant(side, party, participant, permission) =>
@@ -828,10 +837,11 @@ class TopologyAdministrationGroup(
828837
side,
829838
permission,
830839
key.some,
840+
replaceExisting = false,
831841
)
832842
.discard
833-
834843
renewPartyToParticipant(TopologyChangeOp.Add, authorizeWith)
844+
// Note: this will remove the oldest one which is the one that existed before
835845
renewPartyToParticipant(TopologyChangeOp.Remove, filterAuthorizedKey)
836846

837847
case VettedPackages(participant, packageIds) =>
@@ -842,10 +852,12 @@ class TopologyAdministrationGroup(
842852
participant,
843853
packageIds,
844854
key.some,
855+
// no replace existing
845856
)
846857
.discard
847858

848859
renewVettedPackages(TopologyChangeOp.Add, authorizeWith)
860+
// Note: this will remove the oldest one which is the one that existed before
849861
renewVettedPackages(TopologyChangeOp.Remove, filterAuthorizedKey)
850862
}
851863

Diff for: sdk/canton/community/app/src/pack/config/domain.conf

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ canton.domains.mydomain {
3333
admin-api {
3434
address = ${?_shared.network.address}
3535
port = 10019
36-
port = ${?ADMIN_API_PORT}
36+
port = ${?DOMAIN_ADMIN_API_PORT}
3737
tls = ${?_shared.admin-api-mtls}
3838
}
3939

@@ -42,5 +42,6 @@ canton.domains.mydomain {
4242
monitoring.grpc-health-server {
4343
address = ${?_shared.network.address}
4444
port = 10013
45+
port = ${?DOMAIN_GRPC_HEALTH_SERVER_PORT}
4546
}
4647
}

Diff for: sdk/canton/community/app/src/pack/config/manager.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ canton.domain-managers.manager {
2525
admin-api {
2626
address = ${?_shared.network.address}
2727
port = 10052
28-
port = ${?ADMIN_API_PORT}
28+
port = ${?DOMAIN_ADMIN_API_PORT}
2929
tls = ${?_shared.admin-api-mtls}
3030
}
3131
}

Diff for: sdk/canton/community/app/src/pack/config/mediator.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ canton.mediators.mediator {
1818
admin-api {
1919
address = ${?_shared.network.address}
2020
port = 10042
21-
port = ${?ADMIN_API_PORT}
21+
port = ${?MEDIATOR_ADMIN_API_PORT}
2222
tls = ${?_shared.admin-api-mtls}
2323
}
2424

Diff for: sdk/canton/community/app/src/pack/config/monitoring/prometheus.conf

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ canton.monitoring.metrics {
44
type = prometheus
55
address = 0.0.0.0
66
// This will expose the prometheus metrics on port 9000
7-
port = 9000
7+
port = 9000
8+
port = ${?PROMETHEUS_PORT}
89
}]
910
}

Diff for: sdk/canton/community/app/src/pack/config/monitoring/tracing.conf

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ canton.monitoring.tracing.tracer.exporter = {
33
type = jaeger
44
address = 169.254.0.0
55
port = 14250
6+
port = ${?TRACING_PORT}
67
}

Diff for: sdk/canton/community/app/src/pack/config/participant.conf

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ canton.participants.participant {
6464
monitoring.grpc-health-server {
6565
address = ${?_shared.network.address}
6666
port = 10003
67+
port = ${?GRPC_HEALTH_SERVER_PORT}
6768
}
6869

6970
// Optionally include parameters defined in `misc/dev-protocol.conf`

Diff for: sdk/canton/community/app/src/pack/config/remote/domain.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ canton {
1616
address = localhost
1717
address = ${?REMOTE_ADDRESS}
1818
port = 10019
19-
port = ${?ADMIN_API_PORT}
19+
port = ${?DOMAIN_ADMIN_API_PORT}
2020
tls = ${?_shared.admin-api-client-mtls}
2121
}
2222
}

Diff for: sdk/canton/community/app/src/pack/config/remote/manager.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ canton {
99
address = localhost
1010
address = ${?REMOTE_ADDRESS}
1111
port = 10052
12-
port = ${?ADMIN_API_PORT}
12+
port = ${?DOMAIN_ADMIN_API_PORT}
1313
tls = ${?_shared.admin-api-client-mtls}
1414
}
1515
}

Diff for: sdk/canton/community/app/src/pack/config/remote/mediator.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ canton {
99
address = localhost
1010
address = ${?REMOTE_ADDRESS}
1111
port = 10042
12-
port = ${?ADMIN_API_PORT}
12+
port = ${?MEDIATOR_ADMIN_API_PORT}
1313
tls = ${?_shared.admin-api-client-mtls}
1414
}
1515
}

Diff for: sdk/canton/community/app/src/pack/config/remote/sequencer.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ canton {
1616
address = localhost
1717
address = ${?REMOTE_ADDRESS}
1818
port = 10039
19-
port = ${?ADMIN_API_PORT}
19+
port = ${?SEQUENCER_ADMIN_API_PORT}
2020
tls = ${?_shared.admin-api-client-mtls}
2121
}
2222
}

Diff for: sdk/canton/community/app/src/pack/config/sandbox.conf

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ canton {
3535
admin-api {
3636
address = localhost
3737
port = 10029
38+
port = ${?DOMAIN_ADMIN_API_PORT}
3839
}
3940
}
4041
}

Diff for: sdk/canton/community/app/src/pack/config/sequencer.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ canton.sequencers.sequencer {
3131
admin-api {
3232
address = ${?_shared.network.address}
3333
port = 10039
34-
port = ${?ADMIN_API_PORT}
34+
port = ${?SEQUENCER_ADMIN_API_PORT}
3535
tls = ${?_shared.admin-api-mtls}
3636
}
3737

Diff for: sdk/canton/community/app/src/test/scala/com/digitalasset/canton/config/CantonCommunityConfigTest.scala

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ class CantonCommunityConfigTest extends AnyWordSpec with BaseTest {
3939
config.portDescription shouldBe "mydomain:admin-api=5019,public-api=5018;participant1:admin-api=5012,ledger-api=5011;participant2:admin-api=5022,ledger-api=5021"
4040
}
4141

42+
"check startup memory checker config" in {
43+
config.parameters.startupMemoryCheckConfig shouldBe StartupMemoryCheckConfig.Warn
44+
}
45+
4246
}
4347

4448
"deprecated configs" should {

Diff for: sdk/canton/community/base/src/main/scala/com/digitalasset/canton/config/ProcessingTimeouts.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ object DefaultProcessingTimeouts {
7070

7171
val maxRetryInterval: NonNegativeDuration = NonNegativeDuration.tryFromDuration(10.seconds)
7272

73-
val verifyActive: NonNegativeDuration = NonNegativeDuration.tryFromDuration(30.seconds)
73+
val verifyActive: NonNegativeDuration = NonNegativeDuration.tryFromDuration(Duration.Inf)
7474

7575
val activeInit: NonNegativeDuration = NonNegativeDuration.tryFromDuration(1.minute)
7676

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package com.digitalasset.canton.config
5+
6+
sealed trait StartupMemoryCheckConfig
7+
8+
object StartupMemoryCheckConfig {
9+
final case object Warn extends StartupMemoryCheckConfig
10+
final case object Ignore extends StartupMemoryCheckConfig
11+
final case object Crash extends StartupMemoryCheckConfig
12+
}

Diff for: sdk/canton/community/base/src/main/scala/com/digitalasset/canton/crypto/store/CryptoPublicStore.scala

+8-18
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ trait CryptoPublicStore extends AutoCloseable {
2525
implicit val ec: ExecutionContext
2626

2727
// Cached values for public keys with names
28-
protected val signingKeyMap: TrieMap[Fingerprint, SigningPublicKeyWithName] = TrieMap.empty
29-
protected val encryptionKeyMap: TrieMap[Fingerprint, EncryptionPublicKeyWithName] = TrieMap.empty
28+
private val signingKeyMap: TrieMap[Fingerprint, SigningPublicKeyWithName] = TrieMap.empty
29+
private val encryptionKeyMap: TrieMap[Fingerprint, EncryptionPublicKeyWithName] = TrieMap.empty
3030

3131
// Write methods that the underlying store has to implement for the caching
3232
protected def writeSigningKey(key: SigningPublicKey, name: Option[KeyName])(implicit
@@ -53,7 +53,7 @@ trait CryptoPublicStore extends AutoCloseable {
5353
traceContext: TraceContext
5454
): EitherT[Future, CryptoPublicStoreError, Set[EncryptionPublicKeyWithName]]
5555

56-
def storePublicKey(publicKey: PublicKey, name: Option[KeyName])(implicit
56+
private[crypto] def storePublicKey(publicKey: PublicKey, name: Option[KeyName])(implicit
5757
traceContext: TraceContext
5858
): EitherT[Future, CryptoPublicStoreError, Unit] =
5959
(publicKey: @unchecked) match {
@@ -89,22 +89,12 @@ trait CryptoPublicStore extends AutoCloseable {
8989
): EitherT[Future, CryptoPublicStoreError, Option[SigningPublicKey]] =
9090
listSigningKeys.map(_.find(_.name.contains(keyName)).map(_.publicKey))
9191

92-
def findSigningKeyIdByFingerprint(fingerprint: Fingerprint)(implicit
93-
traceContext: TraceContext
94-
): EitherT[Future, CryptoPublicStoreError, Option[SigningPublicKey]] =
95-
listSigningKeys.map(_.find(_.publicKey.fingerprint == fingerprint).map(_.publicKey))
96-
9792
def findEncryptionKeyIdByName(keyName: KeyName)(implicit
9893
traceContext: TraceContext
9994
): EitherT[Future, CryptoPublicStoreError, Option[EncryptionPublicKey]] =
10095
listEncryptionKeys.map(_.find(_.name.contains(keyName)).map(_.publicKey))
10196

102-
def findEncryptionKeyIdByFingerprint(fingerprint: Fingerprint)(implicit
103-
traceContext: TraceContext
104-
): EitherT[Future, CryptoPublicStoreError, Option[EncryptionPublicKey]] =
105-
listEncryptionKeys.map(_.find(_.publicKey.fingerprint == fingerprint).map(_.publicKey))
106-
107-
def publicKeysWithName(implicit
97+
private[crypto] def publicKeysWithName(implicit
10898
traceContext: TraceContext
10999
): EitherT[Future, CryptoPublicStoreError, Set[PublicKeyWithName]] =
110100
for {
@@ -126,7 +116,7 @@ trait CryptoPublicStore extends AutoCloseable {
126116
): EitherT[Future, CryptoPublicStoreError, Set[SigningPublicKey]] =
127117
retrieveKeysAndUpdateCache(listSigningKeys, signingKeyMap)
128118

129-
def storeSigningKey(key: SigningPublicKey, name: Option[KeyName] = None)(implicit
119+
private[crypto] def storeSigningKey(key: SigningPublicKey, name: Option[KeyName] = None)(implicit
130120
traceContext: TraceContext
131121
): EitherT[Future, CryptoPublicStoreError, Unit] =
132122
writeSigningKey(key, name).map { _ =>
@@ -147,8 +137,8 @@ trait CryptoPublicStore extends AutoCloseable {
147137
): EitherT[Future, CryptoPublicStoreError, Set[EncryptionPublicKey]] =
148138
retrieveKeysAndUpdateCache(listEncryptionKeys, encryptionKeyMap)
149139

150-
def storeEncryptionKey(key: EncryptionPublicKey, name: Option[KeyName] = None)(implicit
151-
traceContext: TraceContext
140+
private[crypto] def storeEncryptionKey(key: EncryptionPublicKey, name: Option[KeyName] = None)(
141+
implicit traceContext: TraceContext
152142
): EitherT[Future, CryptoPublicStoreError, Unit] =
153143
writeEncryptionKey(key, name)
154144
.map { _ =>
@@ -175,7 +165,7 @@ trait CryptoPublicStore extends AutoCloseable {
175165
for {
176166
// we always rebuild the cache here just in case new keys have been added by another process
177167
// this should not be a problem since these operations to get all keys are infrequent and typically
178-
// typically the number of keys is not very large
168+
// the number of keys is not very large
179169
storedKeys <- keysFromDb
180170
_ = cache ++= storedKeys.map(k => k.publicKey.id -> k)
181171
} yield storedKeys.map(_.publicKey)

Diff for: sdk/canton/community/base/src/main/scala/com/digitalasset/canton/environment/CantonNodeParameters.scala

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import com.digitalasset.canton.config.{
99
LoggingConfig,
1010
ProcessingTimeout,
1111
QueryCostMonitoringConfig,
12+
StartupMemoryCheckConfig,
1213
WatchdogConfig,
1314
}
1415
import com.digitalasset.canton.sequencing.client.SequencerClientConfig
@@ -35,7 +36,9 @@ object CantonNodeParameters {
3536
def skipTopologyManagerSignatureValidation: Boolean
3637
def exitOnFatalFailures: Boolean
3738
def watchdog: Option[WatchdogConfig]
39+
def startupMemoryCheckConfig: StartupMemoryCheckConfig
3840
}
41+
3942
object General {
4043
final case class Impl(
4144
tracing: TracingConfig,
@@ -53,6 +56,7 @@ object CantonNodeParameters {
5356
skipTopologyManagerSignatureValidation: Boolean,
5457
exitOnFatalFailures: Boolean,
5558
watchdog: Option[WatchdogConfig],
59+
startupMemoryCheckConfig: StartupMemoryCheckConfig,
5660
) extends CantonNodeParameters.General
5761
}
5862
trait Protocol {
@@ -95,6 +99,8 @@ trait HasGeneralCantonNodeParameters extends CantonNodeParameters.General {
9599
general.skipTopologyManagerSignatureValidation
96100
override def exitOnFatalFailures: Boolean = general.exitOnFatalFailures
97101
override def watchdog: Option[WatchdogConfig] = general.watchdog
102+
103+
override def startupMemoryCheckConfig: StartupMemoryCheckConfig = general.startupMemoryCheckConfig
98104
}
99105

100106
trait HasProtocolCantonNodeParameters extends CantonNodeParameters.Protocol {

0 commit comments

Comments
 (0)