Skip to content

Commit c42d0ed

Browse files
committed
Merge branch 'feature-cip-73' into dn/cip-0073-daml-weighted-validator-license
[ci] Signed-off-by: Simon Meier <[email protected]>
2 parents eede310 + 36e4c8b commit c42d0ed

File tree

189 files changed

+4588
-1474
lines changed

Some content is hidden

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

189 files changed

+4588
-1474
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ jobs:
165165
test_names_file: 'test-full-class-names.log'
166166
start_canton_options: -w
167167
# TODO(DACH-NY/canton-network-node#10912) Investigate why things got slower
168-
parallelism: 10
168+
parallelism: 11
169169
test_name: wall-clock-time
170170
with_gcp_creds: true
171171
skip_if_regex: "\\[bft\\]"

LATEST_RELEASE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.22
1+
0.4.23

apps/app/src/main/scala/org/lfdecentralizedtrust/splice/config/SpliceConfig.scala

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ object SpliceConfig {
420420

421421
implicit val upgradesConfig: ConfigReader[UpgradesConfig] = deriveReader[UpgradesConfig]
422422

423+
implicit val ingestionConfig: ConfigReader[IngestionConfig] = deriveReader[IngestionConfig]
423424
implicit val automationConfig: ConfigReader[AutomationConfig] =
424425
deriveReader[AutomationConfig]
425426
implicit val LedgerApiClientConfigReader: ConfigReader[LedgerApiClientConfig] =
@@ -688,13 +689,20 @@ object SpliceConfig {
688689
}
689690
implicit val migrateValidatorPartyConfigReader: ConfigReader[MigrateValidatorPartyConfig] =
690691
deriveReader[MigrateValidatorPartyConfig]
691-
implicit val participantPruningConfigReader: ConfigReader[ParticipantPruningConfig] =
692-
deriveReader[ParticipantPruningConfig]
692+
implicit val pruningConfigReader: ConfigReader[PruningConfig] =
693+
deriveReader[PruningConfig]
693694
implicit val validatorConfigReader: ConfigReader[ValidatorAppBackendConfig] =
694695
deriveReader[ValidatorAppBackendConfig].emap { conf =>
695696
val participantIdentifier =
696697
ValidatorCantonIdentifierConfig.resolvedNodeIdentifierConfig(conf).participant
697698
for {
699+
_ <- Either.cond(
700+
!(conf.domains.global.url.isDefined && conf.domains.global.sequencerNames.isDefined),
701+
(),
702+
ConfigValidationFailed(
703+
"Configuration error: `url` and `sequencerNames` cannot both be specified for the global domain."
704+
),
705+
)
698706
_ <- Either.cond(
699707
!conf.svValidator || conf.validatorPartyHint.isEmpty,
700708
(),
@@ -846,6 +854,7 @@ object SpliceConfig {
846854

847855
implicit val upgradesConfig: ConfigWriter[UpgradesConfig] = deriveWriter[UpgradesConfig]
848856

857+
implicit val ingestionConfig: ConfigWriter[IngestionConfig] = deriveWriter[IngestionConfig]
849858
implicit val automationConfig: ConfigWriter[AutomationConfig] =
850859
deriveWriter[AutomationConfig]
851860
implicit val LedgerApiClientConfigWriter: ConfigWriter[LedgerApiClientConfig] =
@@ -1022,8 +1031,8 @@ object SpliceConfig {
10221031
deriveWriter[TransferPreapprovalConfig]
10231032
implicit val migrateValidatorPartyConfigWriter: ConfigWriter[MigrateValidatorPartyConfig] =
10241033
deriveWriter[MigrateValidatorPartyConfig]
1025-
implicit val participantPruningConfigWriter: ConfigWriter[ParticipantPruningConfig] =
1026-
deriveWriter[ParticipantPruningConfig]
1034+
implicit val pruningConfigWriter: ConfigWriter[PruningConfig] =
1035+
deriveWriter[PruningConfig]
10271036
implicit val validatorConfigWriter: ConfigWriter[ValidatorAppBackendConfig] =
10281037
deriveWriter[ValidatorAppBackendConfig]
10291038
implicit val validatorClientConfigWriter: ConfigWriter[ValidatorAppClientConfig] =

apps/app/src/main/scala/org/lfdecentralizedtrust/splice/console/SpliceInstanceReference.scala

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -258,20 +258,20 @@ class ParticipantClientReference(
258258
val pkgs = this.ledger_api.packages.list()
259259
if (!pkgs.map(_.packageId).contains(hash)) {
260260
discard[String](this.dars.upload(path, vetAllPackages = false))
261-
val connected = this.synchronizers.list_connected()
262-
if (connected.isEmpty) {
263-
logger.error(s"Trying to vet $path on ${this.id} but not connected to any synchronizer")
264-
}
265-
connected.foreach { sync =>
266-
this.topology.vetted_packages.propose_delta(
267-
this.id,
268-
adds = dar.all
269-
.map(p => LfPackageId.assertFromString(p.getHash))
270-
.distinct
271-
.map(VettedPackage(_, None, None)),
272-
store = TopologyStoreId.Synchronizer(sync.synchronizerId),
273-
)
274-
}
261+
}
262+
val connected = this.synchronizers.list_connected()
263+
if (connected.isEmpty) {
264+
logger.error(s"Trying to vet $path on ${this.id} but not connected to any synchronizer")
265+
}
266+
connected.foreach { sync =>
267+
this.topology.vetted_packages.propose_delta(
268+
this.id,
269+
adds = dar.all
270+
.map(p => LfPackageId.assertFromString(p.getHash))
271+
.distinct
272+
.map(VettedPackage(_, None, None)),
273+
store = TopologyStoreId.Synchronizer(sync.synchronizerId),
274+
)
275275
}
276276
}
277277
}

apps/app/src/test/resources/include/participants.conf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ _participant_template {
7676
}
7777
# Default expiration used in tests
7878
max-token-lifetime = 30 days
79+
# Required for pruning
80+
admin-token-config.admin-claim=true
7981
}
8082

81-
admin-api.limits.pending {
83+
admin-api.limits.active {
8284
"com.digitalasset.canton.admin.participant.v30.ParticipantRepairService/ExportAcsOld": 1,
8385
"com.digitalasset.canton.admin.participant.v30.PartyManagementService/ExportAcsOld": 1,
8486
"com.digitalasset.canton.admin.participant.v30.ParticipantRepairService/ImportAcsOld": 1,

apps/app/src/test/resources/include/sequencers.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,20 @@ _sequencer_reference_template {
4848
# so that sequencer will not block other sequencers from pruning even there is lack of activities
4949
# ref: https://github.com/DACH-NY/canton/issues/16371#issuecomment-1885005687
5050
time-tracker.min-observation-duration = 10s
51-
public-api.limits.pending = {
51+
public-api.limits.active = {
5252
"com.digitalasset.canton.sequencer.api.v30.SequencerService/DownloadTopologyStateForInit" : 3,
5353
"com.digitalasset.canton.sequencer.api.v30.SequencerService/DownloadTopologyStateForInitHash" : 3,
5454
"com.digitalasset.canton.sequencer.api.v30.SequencerService/Subscribe" : 1000,
5555
}
56-
admin-api.limits.pending {
56+
admin-api.limits.active {
5757
"com.digitalasset.canton.topology.admin.v30.TopologyManagerReadService/GenesisState": 1,
5858
"com.digitalasset.canton.topology.admin.v30.TopologyManagerReadService/GenesisStateV2": 1,
5959
"com.digitalasset.canton.topology.admin.v30.TopologyManagerReadService/ExportTopologySnapshot": 1,
6060
"com.digitalasset.canton.topology.admin.v30.TopologyManagerReadService/ExportTopologySnapshotV2": 1,
6161
"com.digitalasset.canton.sequencer.admin.v30.SequencerAdministrationService/OnboardingState": 1,
6262
"com.digitalasset.canton.sequencer.admin.v30.SequencerAdministrationService/OnboardingStateV2": 1
6363
}
64-
admin-api.limits.pending {
64+
admin-api.limits.active {
6565
"com.digitalasset.canton.topology.admin.v30.TopologyManagerReadService/GenesisState": 1,
6666
"com.digitalasset.canton.topology.admin.v30.TopologyManagerReadService/GenesisStateV2": 1,
6767
"com.digitalasset.canton.topology.admin.v30.TopologyManagerReadService/ExportTopologySnapshot": 1,

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/plugins/UpdateHistorySanityCheckPlugin.scala

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import com.digitalasset.canton.data.CantonTimestamp
1818
import com.digitalasset.canton.integration.EnvironmentSetupPlugin
1919
import com.digitalasset.canton.logging.SuppressingLogger
2020
import com.digitalasset.canton.tracing.TraceContext
21+
import org.lfdecentralizedtrust.splice.codegen.java.splice.dsorules.DsoRules
2122
import org.lfdecentralizedtrust.splice.store.UpdateHistory.BackfillingState
2223
import org.scalatest.{Inspectors, LoneElement}
2324
import org.scalatest.concurrent.Eventually
@@ -76,9 +77,27 @@ class UpdateHistorySanityCheckPlugin(
7677
// This flag should have the same value on all scans
7778
if (initializedScans.exists(_.config.updateHistoryBackfillEnabled)) {
7879
initializedScans.foreach(waitUntilBackfillingComplete)
79-
compareHistories(initializedScans)
80+
val (founders, others) = initializedScans.partition(_.config.isFirstSv)
81+
val founder = founders.loneElement
82+
val dsoRules =
83+
DsoRules.fromJson(founder.getDsoInfo().dsoRules.contract.payload.noSpaces)
84+
val (scansInDsoRules, scansNotInDsoRules) = others.partition { otherScan =>
85+
val svPartyId = otherScan.getDsoInfo().svPartyId
86+
dsoRules.svs.containsKey(svPartyId)
87+
}
88+
scansNotInDsoRules.foreach { notInDso =>
89+
// the SV will not see transactions to the DSO, but will still see transactions involving itself,
90+
// so comparison of history & snapshots will be broken if something like this happens:
91+
// - U1: DSO-only
92+
// - U2: Involves SV
93+
// founder sees U1, U2 but otherScan only U2
94+
logger.info(
95+
s"The SV party of Scan ${notInDso.name} (partyId=${notInDso.getDsoInfo().svPartyId}) is not in DsoRules. Ignoring."
96+
)
97+
}
98+
compareHistories(founder, scansInDsoRules)
8099
if (!skipAcsSnapshotChecks) {
81-
compareSnapshots(initializedScans)
100+
compareSnapshots(founder, scansInDsoRules)
82101
}
83102
initializedScans.foreach(checkScanTxLogScript)
84103
} else {
@@ -126,10 +145,9 @@ class UpdateHistorySanityCheckPlugin(
126145
}
127146

128147
private def compareHistories(
129-
scans: Seq[ScanAppBackendReference]
148+
founder: ScanAppBackendReference,
149+
others: Seq[ScanAppBackendReference],
130150
): Unit = {
131-
val (founders, others) = scans.partition(_.config.isFirstSv)
132-
val founder = founders.loneElement
133151
val founderHistory = paginateHistory(founder, None, Chain.empty).toVector
134152
forAll(others) { otherScan =>
135153
withClue(s"Comparing ${otherScan.name} to ${founder.name}") {
@@ -266,9 +284,10 @@ class UpdateHistorySanityCheckPlugin(
266284
}
267285
}
268286

269-
private def compareSnapshots(scans: Seq[ScanAppBackendReference]) = {
270-
val (founders, others) = scans.partition(_.config.isFirstSv)
271-
val founder = founders.loneElement
287+
private def compareSnapshots(
288+
founder: ScanAppBackendReference,
289+
others: Seq[ScanAppBackendReference],
290+
) = {
272291
val founderSnapshots = getAllSnapshots(founder, CantonTimestamp.MaxValue, Nil)
273292
forAll(others) { otherScan =>
274293
withClue(s"Comparing ${otherScan.name} to ${founder.name}") {

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/DecentralizedSynchronizerMigrationIntegrationTest.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,11 @@ class DecentralizedSynchronizerMigrationIntegrationTest
435435
.getExternalPartyBalance(externalParty)
436436
.totalUnlockedCoin shouldBe "0.0000000000"
437437
walletClient.transferPreapprovalSend(externalParty, 40.0, UUID.randomUUID.toString)
438-
validatorBackend
439-
.getExternalPartyBalance(externalParty)
440-
.totalUnlockedCoin shouldBe "40.0000000000"
438+
eventually() {
439+
validatorBackend
440+
.getExternalPartyBalance(externalParty)
441+
.totalUnlockedCoin shouldBe "40.0000000000"
442+
}
441443
onboarding
442444
}
443445

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/DockerComposeValidatorFrontendIntegrationTest.scala

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,20 @@ class DockerComposeValidatorFrontendIntegrationTest
335335
withFrontEnd("frontend") { implicit webDriver =>
336336
val validatorUserPassword = sys.env(s"COMPOSE_VALIDATOR_WEB_UI_PASSWORD")
337337
eventuallySucceeds()(go to s"http://wallet.localhost")
338-
completeAuth0LoginWithAuthorization(
339-
"http://wallet.localhost",
340-
341-
validatorUserPassword,
342-
() => seleniumText(find(id("logged-in-user"))) should startWith(partyHint),
338+
339+
actAndCheck()(
340+
s"Validator login to wallet via auth0",
341+
completeAuth0LoginWithAuthorization(
342+
"http://wallet.localhost",
343+
344+
validatorUserPassword,
345+
() => seleniumText(find(id("logged-in-user"))) should startWith(partyHint),
346+
),
347+
)(
348+
"User is already logged in, and sees their balance",
349+
_ => userLoggedInAndHasBalance("da-ComposeValidator-1::", adminTap),
343350
)
344-
userLoggedInAndHasBalance("da-ComposeValidator-1::", adminTap)
351+
345352
completeAuth0LoginWithAuthorization(
346353
"http://ans.localhost",
347354

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/ManualStartIntegrationTest.scala

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import com.digitalasset.canton.topology.{
1515
SequencerId,
1616
UniqueIdentifier,
1717
}
18-
import org.lfdecentralizedtrust.splice.config.{ConfigTransforms, SpliceBackendConfig}
18+
import org.lfdecentralizedtrust.splice.config.{ConfigTransforms, PruningConfig, SpliceBackendConfig}
1919
import org.lfdecentralizedtrust.splice.console.AppBackendReference
2020
import org.lfdecentralizedtrust.splice.environment.*
2121
import org.lfdecentralizedtrust.splice.integration.EnvironmentDefinition
@@ -25,7 +25,6 @@ import org.lfdecentralizedtrust.splice.integration.tests.SpliceTests.{
2525
}
2626
import org.lfdecentralizedtrust.splice.sv.config.SvAppBackendConfig
2727
import org.lfdecentralizedtrust.splice.util.{StandaloneCanton, TriggerTestUtil, WalletTestUtil}
28-
import org.lfdecentralizedtrust.splice.validator.config.ParticipantPruningConfig
2928

3029
import java.util.UUID
3130
import scala.concurrent.duration.DurationInt
@@ -63,7 +62,7 @@ class ManualStartIntegrationTest
6362
aliceValidatorConfig.copy(
6463
domains = withoutExtraDomains,
6564
participantPruningSchedule = Some(
66-
ParticipantPruningConfig(
65+
PruningConfig(
6766
"0 0 * * * ?",
6867
PositiveDurationSeconds.tryFromDuration(1.hours),
6968
PositiveDurationSeconds.tryFromDuration(30.hours),
@@ -169,7 +168,9 @@ class ManualStartIntegrationTest
169168
)
170169
}
171170

172-
clue("SV1 and SV2 have configured amplification on the mediator sequencer connection") {
171+
clue(
172+
"SV1 and SV2 have configured amplification and pruning on the mediator sequencer connection"
173+
) {
173174
Seq(
174175
mediatorAdminConnection("sv1", sv1Backend.config),
175176
mediatorAdminConnection("sv2", sv2Backend.config),
@@ -182,6 +183,11 @@ class ManualStartIntegrationTest
182183
sequencerConnections.connections.size shouldBe 1
183184
sequencerConnections.sequencerTrustThreshold shouldBe PositiveInt.tryCreate(1)
184185
sequencerConnections.submissionRequestAmplification shouldBe SvAppBackendConfig.DefaultMediatorSequencerRequestAmplification
186+
mediatorConnection.getPruningSchedule().futureValue.value shouldBe PruningSchedule(
187+
"0 /10 * * * ?",
188+
PositiveDurationSeconds.ofMinutes(5),
189+
PositiveDurationSeconds.ofDays(30),
190+
)
185191
// otherwise we get log warnings
186192
mediatorConnection.close()
187193
}

0 commit comments

Comments
 (0)