-
Notifications
You must be signed in to change notification settings - Fork 32
feat: reenabled multisync localnet #1629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
c4c8669
7ef2d0b
6c7a65c
40429d2
9239e02
97788e1
2bdb50a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| // Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| bootstrap.synchronizer( | ||
| synchronizerName = "app-synchronizer", | ||
| sequencers = Seq(`app-sequencer`), | ||
| mediators = Seq(`app-mediator`), | ||
| synchronizerOwners = Seq(`app-sequencer`), | ||
| synchronizerThreshold = 1, | ||
| staticSynchronizerParameters = StaticSynchronizerParameters.defaultsWithoutKMS(ProtocolVersion.latest), | ||
| ) | ||
|
|
||
| // Connect app-provider to the new synchronizer. | ||
| // Note: app-user is intentionally NOT connected to app-synchronizer so that | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that something that you intend to rectify? Ultimately, app-user should be connected to both |
||
| // the SDK (which picks connectedSynchronizers[0]) always selects global-domain. | ||
| `app-provider`.synchronizers.connect_local(`app-sequencer`, "app-synchronizer") | ||
|
|
||
| // Wait for app-provider to be active on app-synchronizer | ||
| utils.retry_until_true { | ||
| `app-provider`.synchronizers.active("app-synchronizer") | ||
| } | ||
|
|
||
| // Vet packages on app-synchronizer for app-provider. | ||
| // The Splice app already uploaded DARs and vetted them on global-domain. | ||
| // We replicate the vetting from the authorized store to app-synchronizer | ||
| // so that the synchronizer is fully functional. | ||
| val appSyncId = `app-provider`.synchronizers.list_connected() | ||
| .find(_.synchronizerAlias.unwrap == "app-synchronizer") | ||
| .getOrElse(throw new RuntimeException("app-synchronizer not found in connected synchronizers")) | ||
| .synchronizerId | ||
|
|
||
| for (participant <- Seq(`app-provider`)) { | ||
| val vettedFromAuthorized = participant.topology.vetted_packages | ||
| .list(store = Some(TopologyStoreId.Authorized), filterParticipant = participant.id.filterString) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should rather be the global-synchronizer instead of Authorized store |
||
| .flatMap(_.item.packages) | ||
|
|
||
| if (vettedFromAuthorized.nonEmpty) { | ||
| logger.info(s"Vetting ${vettedFromAuthorized.size} packages on app-synchronizer for ${participant.name}") | ||
| participant.topology.vetted_packages.propose_delta( | ||
| participant = participant.id, | ||
| store = appSyncId, | ||
| adds = vettedFromAuthorized.toSeq, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| // Wait for vetting topology to propagate | ||
| utils.retry_until_true { | ||
| val providerVetted = `app-provider`.topology.vetted_packages | ||
| .list(store = Some(appSyncId), filterParticipant = `app-provider`.id.filterString) | ||
| providerVetted.nonEmpty && providerVetted.head.item.packages.nonEmpty | ||
| } | ||
|
|
||
| logger.info("app-synchronizer bootstrap with package vetting completed successfully") | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you create and move these into canton/multi-sync instead ? the script folder is specifically for our scriptings and not for bootstrapping