Skip to content

Commit 256b283

Browse files
[main] Update 2025-11-11.22 (#401)
Reference commit: 317923a2d8
1 parent c017cfd commit 256b283

File tree

201 files changed

+7280
-2132
lines changed

Some content is hidden

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

201 files changed

+7280
-2132
lines changed

UNRELEASED.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ Impacted commands:
6464
- `participant.parties.find_party_max_deactivation_offset`
6565
- `participant.parties.find_highest_offset_by_timestamp`
6666

67+
### Removal of automatic recomputation of contract ids upon ACS import
68+
The ability to recompute contract ids upon ACS import has been removed.
69+
6770
## Compatibility
6871

6972
The following Canton protocol and Ethereum sequencer contract versions are supported:

community-build.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ lazy val `community-admin-api` = CommunityProjects.`community-admin-api`
1212
lazy val `community-testing` = CommunityProjects.`community-testing`
1313
lazy val `community-integration-testing` = CommunityProjects.`community-integration-testing`
1414
lazy val `community-integration-testing-lib` = CommunityProjects.`community-integration-testing-lib`
15+
lazy val `daml-script-tests` = CommunityProjects.`daml-script-tests`
16+
lazy val microbench = CommunityProjects.microbench
1517
lazy val demo = CommunityProjects.demo
1618
lazy val blake2b = CommunityProjects.blake2b
1719
lazy val `slick-fork` = CommunityProjects.`slick-fork`

community/admin-api/src/main/protobuf/com/digitalasset/canton/admin/participant/v30/acs_import.proto

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ enum ContractImportMode {
3939
// Default enum value that indicates the ContractImportMode field was not explicitly set.
4040
// Requests with this value will fail validation and be rejected.
4141
CONTRACT_IMPORT_MODE_UNSPECIFIED = 0;
42-
// A contract is imported without validation or contract-id recomputation.
42+
// A contract is imported without validation.
4343
// This option is suitable for large imports when the participant operator is confident that all contracts
4444
// are valid for their associated representative package-id.
4545
CONTRACT_IMPORT_MODE_ACCEPT = 1;
@@ -48,6 +48,4 @@ enum ContractImportMode {
4848
//
4949
// This is the recommended option for most import scenarios.
5050
CONTRACT_IMPORT_MODE_VALIDATION = 2;
51-
// The contract is validated and its contract ID suffix is recomputed.
52-
CONTRACT_IMPORT_MODE_RECOMPUTATION = 3;
5351
}

community/admin-api/src/main/protobuf/com/digitalasset/canton/admin/participant/v30/participant_repair_service.proto

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,18 @@ message ImportAcsOldRequest {
171171
// The synchronizer id prefix to be used for the imported contracts
172172
// Optional, if not provided the service will generate a prefix
173173
string workflow_id_prefix = 2;
174+
174175
// If false, the service will fail if any contract ID suffix doesn't match the scheme
175176
// associated to the synchronizer where the contract is being assigned as a result of the import.
176177
// If true, any contract ID suffix will be recomputed to match the scheme associated to the synchronizer.
177178
// Recommended value is `false`
178-
bool allow_contract_id_suffix_recomputation = 3;
179+
reserved 3; // was allow_contract_id_suffix_recomputation, default behavior is false
179180
}
180181

181182
message ImportAcsOldResponse {
182183
option deprecated = true;
183184

184-
// Mapping from the old contract id to the new contract id
185-
map<string, string> contract_id_mapping = 1;
185+
reserved 1; // was map<string, string> contract_id_mapping
186186
}
187187

188188
message ExportAcsTargetSynchronizer {
@@ -267,9 +267,7 @@ message ImportAcsRequest {
267267
}
268268

269269
message ImportAcsResponse {
270-
// Maps old contract IDs to newly recomputed contract IDs iff the recomputation contract ID import mode has
271-
// been selected, empty otherwise.
272-
map<string, string> contract_id_mappings = 1;
270+
reserved 1; // was map<string, string> contract_id_mappings = 1;
273271
}
274272

275273
message PurgeDeactivatedSynchronizerRequest {

community/app-base/src/main/scala/com/digitalasset/canton/admin/api/client/commands/ParticipantAdminCommands.scala

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -783,11 +783,10 @@ object ParticipantAdminCommands {
783783
final case class ImportAcsOld(
784784
acsChunk: ByteString,
785785
workflowIdPrefix: String,
786-
allowContractIdSuffixRecomputation: Boolean,
787786
) extends GrpcAdminCommand[
788787
v30.ImportAcsOldRequest,
789788
v30.ImportAcsOldResponse,
790-
Map[LfContractId, LfContractId],
789+
Unit,
791790
] {
792791

793792
override type Svc = ParticipantRepairServiceStub
@@ -800,7 +799,6 @@ object ParticipantAdminCommands {
800799
v30.ImportAcsOldRequest(
801800
acsChunk,
802801
workflowIdPrefix,
803-
allowContractIdSuffixRecomputation,
804802
)
805803
)
806804

@@ -814,22 +812,13 @@ object ParticipantAdminCommands {
814812
v30.ImportAcsOldRequest(
815813
ByteString.copyFrom(bytes),
816814
workflowIdPrefix,
817-
allowContractIdSuffixRecomputation,
818815
),
819816
request.acsSnapshot,
820817
)
821818

822819
override protected def handleResponse(
823820
response: v30.ImportAcsOldResponse
824-
): Either[String, Map[LfContractId, LfContractId]] =
825-
response.contractIdMapping.toSeq
826-
.traverse { case (oldCid, newCid) =>
827-
for {
828-
oldCidParsed <- LfContractId.fromString(oldCid)
829-
newCidParsed <- LfContractId.fromString(newCid)
830-
} yield oldCidParsed -> newCidParsed
831-
}
832-
.map(_.toMap)
821+
): Either[String, Unit] = Right(())
833822
}
834823

835824
final case class ExportAcs(
@@ -893,7 +882,7 @@ object ParticipantAdminCommands {
893882
) extends GrpcAdminCommand[
894883
v30.ImportAcsRequest,
895884
v30.ImportAcsResponse,
896-
Map[LfContractId, LfContractId],
885+
Unit,
897886
] {
898887

899888
override type Svc = ParticipantRepairServiceStub
@@ -931,15 +920,7 @@ object ParticipantAdminCommands {
931920

932921
override protected def handleResponse(
933922
response: v30.ImportAcsResponse
934-
): Either[String, Map[LfContractId, LfContractId]] =
935-
response.contractIdMappings.toSeq
936-
.traverse { case (oldCid, newCid) =>
937-
for {
938-
oldCidParsed <- LfContractId.fromString(oldCid)
939-
newCidParsed <- LfContractId.fromString(newCid)
940-
} yield oldCidParsed -> newCidParsed
941-
}
942-
.map(_.toMap)
923+
): Either[String, Unit] = Right(())
943924
}
944925

945926
final case class PurgeContracts(

community/app-base/src/main/scala/com/digitalasset/canton/console/commands/ParticipantRepairAdministration.scala

Lines changed: 8 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -238,27 +238,9 @@ class ParticipantRepairAdministration(
238238
|
239239
|The contract IDs of the imported contracts will be checked ahead of starting the
240240
|process. If any contract ID doesn't match the contract ID scheme associated to the
241-
|synchronizer where the contract is assigned to, the whole import process will fail
242-
|depending on the value of `allowContractIdSuffixRecomputation`.
241+
|synchronizer where the contract is assigned to, the whole import process will fail.
243242
|
244-
|By default `allowContractIdSuffixRecomputation` is set to `false`. If set to `true`, any
245-
|contract ID that wouldn't pass the check above will be recomputed. Note that the
246-
|recomputation of contract IDs fails under the following circumstances:
247-
| - the contract salt used to compute the contract ID is missing
248-
| - the contract ID discriminator version is unknown
249-
|
250-
|Note that only the Canton-specific contract ID suffix will be recomputed. The
251-
|discriminator cannot be recomputed and will be left as is.
252-
|
253-
|The recomputation will not be performed on contract IDs referenced in the payload of some
254-
|imported contract but is missing from the import itself (this should mean that the
255-
|contract was archived, which makes recomputation unnecessary).
256-
|
257-
|If the import process succeeds, the mapping from the old contract IDs to the new contract
258-
|IDs will be returned. An empty map means that all contract IDs were valid and no contract
259-
|ID was recomputed.
260-
|
261-
|DEPRECATION NOTICE: A future release removes this command, use `export_acs` instead.
243+
|DEPRECATION NOTICE: A future release removes this command, use `import_acs` instead.
262244
"""
263245
)
264246
@deprecated(
@@ -268,15 +250,13 @@ class ParticipantRepairAdministration(
268250
def import_acs_old(
269251
inputFile: String = ParticipantRepairAdministration.ExportAcsDefaultFile,
270252
workflowIdPrefix: String = "",
271-
allowContractIdSuffixRecomputation: Boolean = false,
272-
): Map[LfContractId, LfContractId] =
253+
): Unit =
273254
check(FeatureFlag.Repair) {
274255
consoleEnvironment.run {
275256
runner.adminCommand(
276257
ParticipantAdminCommands.ParticipantRepairManagement.ImportAcsOld(
277258
ByteString.copyFrom(File(inputFile).loadBytes),
278259
if (workflowIdPrefix.nonEmpty) workflowIdPrefix else s"import-${UUID.randomUUID}",
279-
allowContractIdSuffixRecomputation = allowContractIdSuffixRecomputation,
280260
)
281261
)
282262
}
@@ -345,36 +325,20 @@ class ParticipantRepairAdministration(
345325
|where the contract is assigned to, the whole import process fails depending on the value
346326
|of `contractImportMode`.
347327
|
348-
|By default `contractImportMode` is set to `ContractImportMode.Validation`. If set to
349-
|`ContractImportMode.Recomputation`, any contract ID that wouldn't pass the check above
350-
|will be recomputed. Note that the recomputation of contract IDs fails under the following
351-
|circumstances:
352-
| - the contract salt used to compute the contract ID is missing
353-
| - the contract ID discriminator version is unknown
354-
|
355-
|Note that only the Canton-specific contract ID suffix will be recomputed. The
356-
|discriminator cannot be recomputed and will be left as is.
357-
|
358-
|The recomputation will not be performed on contract IDs referenced in the payload of some
359-
|imported contract but is missing from the import itself (this should mean that the
360-
|contract was archived, which makes recomputation unnecessary).
328+
|By default `contractImportMode` is set to `ContractImportMode.Validation`.
361329
|
362-
|Expert only: As validation or recomputation on contract IDs may lengthen the import
330+
|Expert only: As validation of contract IDs may lengthen the import
363331
|significantly, you have the option to simply accept the contract IDs as they are using
364332
|`ContractImportMode.Accept`.
365333
|
366-
|If the import process succeeds, the mapping from the old contract IDs to the new contract
367-
|IDs will be returned. An empty map means that all contract IDs were valid, or have been
368-
|accept as they are, and no contract ID was recomputed.
369-
|
370334
|The arguments are:
371335
|- importFilePath: The path denoting the file from where the ACS snapshot will be read.
372336
| Defaults to "canton-acs-export.gz" when undefined.
373337
|- workflowIdPrefix: Sets a custom prefix for the workflow ID to easily identify all
374338
| transactions generated by this import.
375339
| Defaults to "import-<random_UUID>" when unspecified.
376340
|- contractImportMode: Governs contract authentication processing on import. Options include
377-
| Validation (default), [Accept, Recomputation].
341+
| Validation (default), [Accept].
378342
|- representativePackageIdOverride: Defines override mappings for assigning
379343
| representative package IDs to contracts upon ACS import.
380344
|- excludedStakeholders: When defined, any contract that has one or more of these
@@ -388,7 +352,7 @@ class ParticipantRepairAdministration(
388352
representativePackageIdOverride: RepresentativePackageIdOverride =
389353
RepresentativePackageIdOverride.NoOverride,
390354
excludedStakeholders: Set[PartyId] = Set.empty,
391-
): Map[LfContractId, LfContractId] =
355+
): Unit =
392356
check(FeatureFlag.Repair) {
393357
consoleEnvironment.run {
394358
runner.adminCommand(
@@ -425,8 +389,7 @@ class ParticipantRepairAdministration(
425389
synchronizerId: SynchronizerId,
426390
protocolVersion: ProtocolVersion,
427391
contracts: Seq[RepairContract],
428-
allowContractIdSuffixRecomputation: Boolean = false,
429-
): Map[LfContractId, LfContractId] = {
392+
): Unit = {
430393

431394
val temporaryFile = File.newTemporaryFile(suffix = ".gz")
432395
val outputStream = temporaryFile.newGzipOutputStream()
@@ -456,7 +419,6 @@ class ParticipantRepairAdministration(
456419
ParticipantAdminCommands.ParticipantRepairManagement.ImportAcsOld(
457420
bytes,
458421
workflowIdPrefix = s"import-${UUID.randomUUID}",
459-
allowContractIdSuffixRecomputation = allowContractIdSuffixRecomputation,
460422
)
461423
)
462424
}

community/app-base/src/main/scala/com/digitalasset/canton/console/commands/PartiesAdministration.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ class ParticipantPartiesAdministrationGroup(
11721172
| transactions generated by this import.
11731173
| Defaults to "import-<random_UUID>" when unspecified.
11741174
|- contractImportMode: Governs contract authentication processing on import. Options include
1175-
| Validation (default), [Accept, Recomputation].
1175+
| Validation (default), [Accept].
11761176
|- representativePackageIdOverride: Defines override mappings for assigning
11771177
| representative package IDs to contracts upon ACS import.
11781178
| Defaults to NoOverride when undefined.

community/app-base/src/main/scala/com/digitalasset/canton/environment/CommunityEnvironmentFactory.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ package com.digitalasset.canton.environment
66
import com.digitalasset.canton.config.{CantonConfig, CommunityCantonEdition, TestingConfigInternal}
77
import com.digitalasset.canton.logging.NamedLoggerFactory
88
import com.digitalasset.canton.participant.CommunityParticipantNodeBootstrapFactory
9-
import com.digitalasset.canton.synchronizer.mediator.CommunityMediatorNodeBootstrapFactory
10-
import com.digitalasset.canton.synchronizer.sequencer.CommunitySequencerNodeBootstrapFactory
9+
import com.digitalasset.canton.synchronizer.mediator.MediatorNodeBootstrapFactoryImpl
10+
import com.digitalasset.canton.synchronizer.sequencer.SequencerNodeBootstrapFactoryImpl
1111

1212
object CommunityEnvironmentFactory extends EnvironmentFactory {
1313

@@ -21,8 +21,8 @@ object CommunityEnvironmentFactory extends EnvironmentFactory {
2121
CommunityCantonEdition,
2222
testingConfigInternal,
2323
CommunityParticipantNodeBootstrapFactory,
24-
CommunitySequencerNodeBootstrapFactory,
25-
CommunityMediatorNodeBootstrapFactory,
24+
SequencerNodeBootstrapFactoryImpl,
25+
MediatorNodeBootstrapFactoryImpl,
2626
loggerFactory,
2727
)
2828
}

community/app/src/test/scala/com/digitalasset/canton/integration/tests/AcsCommitmentMetricsIntegrationTest.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,13 +500,18 @@ trait AcsCommitmentMetricsIntegrationTest
500500
participant3.stop()
501501
val start = simClock.now
502502

503-
simClock.advance(interval.multipliedBy(2L))
503+
simClock.advance(
504+
interval
505+
.multipliedBy(2L)
506+
// Add one microsecond to avoid sequencing times that fall on interval boundaries
507+
.plusNanos(1000)
508+
)
504509
participant1.health.ping(participant1)
505510
participant1.testing.fetch_synchronizer_times()
506511
val end = simClock.now
507512

508513
eventually() {
509-
participant1.commitments.computed(daName, start.toInstant, end.toInstant).size shouldBe 4
514+
participant1.commitments.computed(daName, start.toInstant, end.toInstant) should have size 2
510515
}
511516

512517
logger.info(

0 commit comments

Comments
 (0)