Skip to content

Commit c362ba9

Browse files
Merge canton 3.4 into main
Merge canton 3.4 into main DACH-NY/canton-network-internal#2301
2 parents 2a7d4d7 + 2dbbab8 commit c362ba9

File tree

3,355 files changed

+255308
-96028
lines changed

Some content is hidden

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

3,355 files changed

+255308
-96028
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,23 @@ jobs:
168168
parallelism: 10
169169
test_name: wall-clock-time
170170
with_gcp_creds: true
171+
skip_if_regex: "\\[bft\\]"
172+
commit_sha: ${{ inputs.commit_sha }}
173+
daml_base_version: ${{ inputs.daml_base_version }}
174+
oss_only: ${{ inputs.oss_only }}
175+
secrets: inherit
176+
177+
scala_test_wall_clock_time_bft:
178+
uses: ./.github/workflows/build.scala_test.yml
179+
with:
180+
runs_on: self-hosted-k8s-x-large
181+
test_names_file: 'test-full-class-names.log'
182+
start_canton_options: -we
183+
parallelism: 10
184+
test_name: wall-clock-time-bft
185+
with_gcp_creds: true
186+
pre_sbt_cmd: "export SPLICE_USE_BFT_SEQUENCER=1"
187+
run_if_commit_tag: 'bft'
171188
commit_sha: ${{ inputs.commit_sha }}
172189
daml_base_version: ${{ inputs.daml_base_version }}
173190
oss_only: ${{ inputs.oss_only }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,4 @@ docs/src/deployment/observability/metrics_reference.rst
7676
# For Vagrant
7777
/.vagrant/
7878
/vagrant-nix-cache/
79+
lnav*work

MAINTENANCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Initial setup:
4747
1. Check out the [Canton **Open Source** repo](https://github.com/digital-asset/canton)
4848
2. Define the environment variable used in the commands below using `export PATH_TO_CANTON_OSS=<your-canton-oss-repo-path>`. This can be added to your private env vars.
4949

50-
Current Canton commit: `3ee44a6d0f252aa8c52a86ab368044265d025c2f`
50+
Current Canton commit: `79e645eb60ba378536a6d62cabbeab78d1be6c61`
5151

5252
1. Checkout the **current Canton commit listed above** in the Canton open source repo from above, so we can diff our current fork against this checkout.
5353
2. Change to your checkout of the Splice repo and execute the following steps:

VERSION

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

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

Lines changed: 125 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -375,42 +375,29 @@ object ConfigTransforms {
375375
.seq
376376
)
377377

378-
def updateAllSplitwellAppConfigs_(
379-
update: SplitwellAppTransform
378+
def updateAllSplitwellAppConfigs(
379+
update: (String, SplitwellAppBackendConfig) => SplitwellAppBackendConfig
380380
): ConfigTransform =
381381
_.focus(_.splitwellApps).modify(_.map { case (name, config) =>
382-
(name, update(config))
382+
(name, update(name.unwrap, config))
383383
})
384384

385-
def updateAllRemoteSplitwellAppConfigs_(
386-
update: RemoteSplitwellAppTransform
385+
def updateAllSplitwellAppConfigs_(
386+
update: SplitwellAppTransform
387+
): ConfigTransform =
388+
updateAllSplitwellAppConfigs((_, config) => update(config))
389+
390+
def updateAllRemoteSplitwellAppConfigs(
391+
update: (String, SplitwellAppClientConfig) => SplitwellAppClientConfig
387392
): ConfigTransform =
388393
_.focus(_.splitwellAppClients).modify(_.map { case (name, config) =>
389-
(name, update(config))
394+
(name, update(name.unwrap, config))
390395
})
391396

392-
def bumpCantonDomainPortsBy(bump: Int): ConfigTransform =
393-
bumpSvAppCantonDomainPortsBy(bump) compose bumpValidatorAppCantonDomainPortsBy(
394-
bump
395-
) compose bumpScanCantonDomainPortsBy(bump)
396-
397-
def bumpSvAppCantonDomainPortsBy(bump: Int): ConfigTransform = {
398-
updateAllSvAppConfigs_(
399-
_.focus(_.domains.global.url)
400-
.modify(_.map(bumpUrl(bump, _)))
401-
.focus(_.localSynchronizerNode)
402-
.modify(
403-
_.map(d =>
404-
d.copy(
405-
sequencer = d.sequencer
406-
.copy(
407-
externalPublicApiUrl = bumpUrl(bump, d.sequencer.externalPublicApiUrl)
408-
)
409-
)
410-
)
411-
)
412-
)
413-
}
397+
def updateAllRemoteSplitwellAppConfigs_(
398+
update: RemoteSplitwellAppTransform
399+
): ConfigTransform =
400+
updateAllRemoteSplitwellAppConfigs((_, config) => update(config))
414401

415402
def bumpScanCantonDomainPortsBy(bump: Int) = {
416403
updateAllScanAppConfigs_(
@@ -424,47 +411,57 @@ object ConfigTransforms {
424411
)
425412
}
426413

427-
def bumpValidatorAppCantonDomainPortsBy(bump: Int): ConfigTransform = {
428-
def bumpUrl(s: String): String = {
429-
val uri = Uri(s)
430-
uri.withPort(uri.effectivePort + bump).toString
431-
}
432-
def bumpOptionalUrl(o: Option[String]): Option[String] = {
433-
o.map(bumpUrl(_))
434-
}
435-
updateAllValidatorConfigs_(
436-
_.focus(_.domains.global.url)
437-
.modify(bumpOptionalUrl(_))
438-
.focus(_.domains.extra)
439-
.modify(_.map(d => d.copy(url = bumpUrl(d.url))))
440-
)
414+
def bumpOptionalUrl(o: Option[String], bump: Int): Option[String] = {
415+
o.map(bumpUrl(bump, _))
441416
}
442417

443-
def bumpCantonPortsBy(bump: Int): ConfigTransform = {
418+
def bumpCantonPortsBy(bump: Int, predicate: String => Boolean = _ => true): ConfigTransform = {
444419

445420
val transforms = Seq(
446-
updateAllSvAppConfigs_(
447-
_.focus(_.participantClient)
448-
.modify(portTransform(bump, _))
449-
.focus(_.localSynchronizerNode)
450-
.modify(_.map(portTransform(bump, _)))
421+
updateAllSvAppConfigs((name, conf) =>
422+
if (predicate(name))
423+
conf
424+
.focus(_.participantClient)
425+
.modify(portTransform(bump, _))
426+
.focus(_.domains.global.url)
427+
.modify(_.map(bumpUrl(bump, _)))
428+
.focus(_.localSynchronizerNode)
429+
.modify(_.map(portTransform(bump, _)))
430+
else conf
451431
),
452-
updateAllScanAppConfigs_(
453-
_.focus(_.participantClient)
454-
.modify(portTransform(bump, _))
455-
.focus(_.sequencerAdminClient)
456-
.modify(portTransform(bump, _))
457-
.focus(_.mediatorAdminClient)
458-
.modify(portTransform(bump, _))
459-
.focus(_.bftSequencers)
460-
.modify(_.map(_.focus(_.sequencerAdminClient).modify(portTransform(bump, _))))
432+
updateAllScanAppConfigs((name, conf) =>
433+
if (predicate(name))
434+
conf
435+
.focus(_.participantClient)
436+
.modify(portTransform(bump, _))
437+
.focus(_.sequencerAdminClient)
438+
.modify(portTransform(bump, _))
439+
.focus(_.mediatorAdminClient)
440+
.modify(portTransform(bump, _))
441+
.focus(_.bftSequencers)
442+
.modify(_.map(_.focus(_.sequencerAdminClient).modify(portTransform(bump, _))))
443+
else conf
461444
),
462-
updateAllValidatorConfigs_(
463-
_.focus(_.participantClient)
464-
.modify(portTransform(bump, _))
445+
updateAllValidatorConfigs((name, conf) =>
446+
if (predicate(name))
447+
conf
448+
.focus(_.participantClient)
449+
.modify(portTransform(bump, _))
450+
.focus(_.domains.global.url)
451+
.modify(bumpOptionalUrl(_, bump))
452+
.focus(_.domains.extra)
453+
.modify(_.map(d => d.copy(url = bumpUrl(bump, d.url))))
454+
else conf
455+
),
456+
updateAllSplitwellAppConfigs((name, conf) =>
457+
if (predicate(name))
458+
conf.focus(_.participantClient).modify(portTransform(bump, _))
459+
else conf
465460
),
466-
updateAllSplitwellAppConfigs_(
467-
_.focus(_.participantClient).modify(portTransform(bump, _))
461+
updateAllRemoteSplitwellAppConfigs((name, conf) =>
462+
if (predicate(name))
463+
conf.focus(_.participantClient).modify(portTransform(bump, _))
464+
else conf
468465
),
469466
)
470467

@@ -476,34 +473,27 @@ object ConfigTransforms {
476473
updateAllSvAppConfigs((name, config) => {
477474
if (svApps.contains(name)) {
478475
config
479-
.focus(_.participantClient)
480-
.modify(portTransform(bump, _))
481-
.focus(_.localSynchronizerNode)
482-
.modify(_.map(portTransform(bump, _)))
483476
.focus(_.adminApi)
484477
.modify(portTransform(bump, _))
485478
} else {
486479
config
487480
}
488-
})
481+
}) compose bumpSomeSvAppCantonPortsBy(bump, svApps)
489482
}
490483

491-
def bumpSomeSvAppCantonDomainPortsBy(bump: Int, svApps: Seq[String]): ConfigTransform = {
484+
def bumpSomeSvAppCantonPortsBy(bump: Int, svApps: Seq[String]): ConfigTransform = {
492485
updateAllSvAppConfigs((name, config) => {
493486
if (svApps.contains(name)) {
494487
config
495488
.focus(_.domains.global.url)
496489
.modify(_.map(bumpUrl(bump, _)))
490+
.focus(_.participantClient)
491+
.modify(portTransform(bump, _))
497492
.focus(_.localSynchronizerNode)
498-
.modify(
499-
_.map(d =>
500-
d.copy(
501-
sequencer = d.sequencer
502-
.copy(externalPublicApiUrl = bumpUrl(bump, d.sequencer.externalPublicApiUrl))
503-
)
504-
)
505-
)
506-
} else config
493+
.modify(_.map(portTransform(bump, _)))
494+
} else {
495+
config
496+
}
507497
})
508498
}
509499

@@ -562,10 +552,20 @@ object ConfigTransforms {
562552
updateAllScanAppConfigs((name, config) => {
563553
if (scanApps.contains(name)) {
564554
config
565-
.focus(_.participantClient)
566-
.modify(portTransform(bump, _))
567555
.focus(_.adminApi)
568556
.modify(portTransform(bump, _))
557+
} else {
558+
config
559+
}
560+
}) compose bumpSomeScanAppCantonPortsBy(bump, scanApps)
561+
}
562+
563+
def bumpSomeScanAppCantonPortsBy(bump: Int, scanApps: Seq[String]): ConfigTransform = {
564+
updateAllScanAppConfigs((name, config) => {
565+
if (scanApps.contains(name)) {
566+
config
567+
.focus(_.participantClient)
568+
.modify(portTransform(bump, _))
569569
.focus(_.sequencerAdminClient)
570570
.modify(portTransform(bump, _))
571571
.focus(_.mediatorAdminClient)
@@ -602,13 +602,23 @@ object ConfigTransforms {
602602
updateAllValidatorAppConfigs((name, config) => {
603603
if (validatorApps.contains(name)) {
604604
config
605-
.focus(_.participantClient)
606-
.modify(portTransform(bump, _))
607605
.focus(_.adminApi)
608606
.modify(portTransform(bump, _))
609607
} else {
610608
config
611609
}
610+
}) compose bumpSomeValidatorAppCantonPortsBy(bump, validatorApps)
611+
}
612+
613+
def bumpSomeValidatorAppCantonPortsBy(bump: Int, validatorApps: Seq[String]): ConfigTransform = {
614+
updateAllValidatorAppConfigs((name, config) => {
615+
if (validatorApps.contains(name)) {
616+
config
617+
.focus(_.participantClient)
618+
.modify(portTransform(bump, _))
619+
} else {
620+
config
621+
}
612622
})
613623
}
614624

@@ -672,31 +682,38 @@ object ConfigTransforms {
672682
transforms.foldLeft((c: SpliceConfig) => c)((f, tf) => f compose tf)
673683
}
674684

675-
def withBftSequencers(): ConfigTransform = {
676-
updateAllSvAppConfigs_(appConfig =>
677-
appConfig
678-
.focus(_.localSynchronizerNode)
679-
.modify(
680-
_.map(
681-
_.focus(_.sequencer).modify(
682-
_.copy(
683-
isBftSequencer = true
684-
)
685+
def withBftSequencer(config: SvAppBackendConfig): SvAppBackendConfig =
686+
config
687+
.focus(_.localSynchronizerNode)
688+
.modify(
689+
_.map(
690+
_.focus(_.sequencer).modify(
691+
_.copy(
692+
isBftSequencer = true
685693
)
686694
)
687695
)
688-
) compose {
689-
updateAllScanAppConfigs((scan, config) =>
690-
config.copy(
691-
bftSequencers = Seq(
692-
BftSequencerConfig(
693-
0,
694-
config.sequencerAdminClient,
695-
s"http://localhost:${5010 + Integer.parseInt(scan.stripPrefix("sv").take(1)) * 100}",
696-
)
697-
)
696+
)
697+
698+
def withBftSequencer(
699+
name: String,
700+
config: ScanAppBackendConfig,
701+
migrationId: Long = 0,
702+
basePort: Int = 5010,
703+
): ScanAppBackendConfig =
704+
config.copy(
705+
bftSequencers = Seq(
706+
BftSequencerConfig(
707+
migrationId,
708+
config.sequencerAdminClient,
709+
s"http://localhost:${basePort + Integer.parseInt(name.stripPrefix("sv").take(1)) * 100}",
698710
)
699711
)
712+
)
713+
714+
def withBftSequencers(): ConfigTransform = {
715+
updateAllSvAppConfigs_(withBftSequencer(_)) compose {
716+
updateAllScanAppConfigs((scan, config) => withBftSequencer(scan, config))
700717
}
701718
}
702719

@@ -744,6 +761,8 @@ object ConfigTransforms {
744761
.modify(portTransform(bump, _))
745762
.focus(_.internalApi)
746763
.modify(portTransform(bump, _))
764+
.focus(_.externalPublicApiUrl)
765+
.modify(bumpUrl(bump, _))
747766

748767
private def portTransform(bump: Int, c: SvMediatorConfig): SvMediatorConfig =
749768
c.focus(_.adminApi).modify(portTransform(bump, _))
@@ -816,16 +835,15 @@ object ConfigTransforms {
816835
})
817836

818837
def useDecentralizedSynchronizerSplitwell(): ConfigTransform =
819-
updateAllSplitwellAppConfigs_(c => {
820-
c.copy(
821-
domains = c.domains.copy(
822-
splitwell = SplitwellDomains(
838+
updateAllSplitwellAppConfigs_(
839+
_.focus(_.domains.splitwell)
840+
.replace(
841+
SplitwellDomains(
823842
SynchronizerConfig(SynchronizerAlias.tryCreate("global")),
824843
Seq.empty,
825844
)
826845
)
827-
)
828-
})
846+
) compose updateAllValidatorAppConfigs_(_.focus(_.domains.extra).replace(Seq.empty))
829847

830848
def modifyAllANStorageConfigs(
831849
storageConfigModifier: (

0 commit comments

Comments
 (0)