Skip to content

refactor(wallet-sdk): remove default synchronizer auto-selection#1740

Draft
jarekr-da wants to merge 13 commits into
wiktor/multisync-examplefrom
jarekr/sdk_synchronizers
Draft

refactor(wallet-sdk): remove default synchronizer auto-selection#1740
jarekr-da wants to merge 13 commits into
wiktor/multisync-examplefrom
jarekr/sdk_synchronizers

Conversation

@jarekr-da

@jarekr-da jarekr-da commented May 13, 2026

Copy link
Copy Markdown
Contributor
  1. No automatic selection of synchonizer in wallet sdk code - if synchronizer is not explicitly provided by caller - we rely on canon ledger choice of synchronizer. There is no extra logic of choosing synchonizer in wallet sdk
  2. All tests run against multi-sync setup
  3. Some tests code changed to explicitly set synchronizer

@jarekr-da jarekr-da changed the title All tests use multi-sync Removed default synchronizer Id May 18, 2026
@jarekr-da jarekr-da changed the title Removed default synchronizer Id Removed default synchronizer May 18, 2026
@jarekr-da jarekr-da force-pushed the jarekr/sdk_synchronizers branch from 97545e9 to 3ae7ca0 Compare May 20, 2026 13:51
@jarekr-da jarekr-da force-pushed the wiktor/multisync-example branch from 563df2d to 98dfc85 Compare May 20, 2026 17:18
@jarekr-da jarekr-da force-pushed the jarekr/sdk_synchronizers branch from 3ae7ca0 to a84acce Compare June 8, 2026 10:45
@jarekr-da jarekr-da self-assigned this Jun 9, 2026
jarekr-da added 12 commits June 9, 2026 11:31
Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
…licitly

- Remove SDKContext.defaultSynchronizerId / globalSynchronizerId and the
  associated startup API call (GET /v2/state/connected-synchronizers)
- LedgerClient.getSynchronizerId() now prefers the synchronizer aliased
  'global' over the arbitrary first entry (still used by wallet-gateway)
- internal.submit() and internal.prepare() omit synchronizerId when not
  given so canton routes by the contracts involved (ledger-api default)
- Callers that wrap ledger-API calls pass synchronizerId through as-is
  using conditional spread to satisfy exactOptionalPropertyTypes
- Amulet operations that embed synchronizerId in DAML choice args or
  disclosed contracts (traffic.buy/status, featuredApp.grant,
  preapproval.renew, external party allocation) throw a clear error when
  the caller does not supply it — canton cannot choose it for those

Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
- Delete getSynchronizerId() from LedgerClient — auto-selecting a
  synchronizer is no longer the SDK's responsibility
- wallet-gateway callers now use network.synchronizerId / this.synchronizerId
  directly; throw with a clear message when not configured
- Internal party allocation uses conditional spread so synchronizerId is
  absent from the POST /v2/parties body when not set (exactOptionalPropertyTypes)

Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
…y.external.create()

Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
…) and sub-scripts

Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
… internally

The SDK now decides everything with regard to synchronizers.
- Remove State.globalSynchronizerId() from the public API
- Add internal resolveGlobalSynchronizerId(ledgerProvider) helper used
  by SDK operations that need the global synchronizer (traffic, preapproval,
  featuredApp.grant, party.external.create/allocate, mergeDelegation)
- Remove findGlobalSynchronizer() from ExternalPartyNamespace (duplicate logic)
- Remove synchronizerId param from TrafficNamespace.status/buy,
  PreapprovalNamespace.renew, GrantFeaturedAppRightsOptions,
  and MergeDelegationNamespace.setup/approve/execute
- Drop getGlobalSynchronizerId() helper from example utils/index.ts
- Update all example scripts to stop passing synchronizerId to SDK calls
- 15-multi-sync/_setup.ts retains explicit synchronizer lookup (appropriate:
  it is test setup that needs both global + app IDs by alias)

Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
…ample

Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
…ample

- Remove resolveGlobalSynchronizerId from state/client.js (deleted module)
- Use ctx.commonCtx.defaultSynchronizerId in preapproval, traffic, mergeDelegation
- Restore additionalSynchronizerIds support in signed.ts from target branch
- Restore 15-multi-sync example scripts from target branch

Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
…vide synchronizerId

The SDK no longer resolves a default synchronizerId internally. Callers pass synchronizerId explicitly (or leave it empty so Canton decides). Synchronizer-selection logic moves into the example scripts via getGlobalSynchronizerId. Updates the gateway to throw when a network has no synchronizerId configured and adds the missing messageSignature event stub to the extension dApp controller.

Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
@jarekr-da jarekr-da force-pushed the jarekr/sdk_synchronizers branch from a84acce to fa21b86 Compare June 9, 2026 13:12
…doc snippets

The wallet SDK no longer auto-selects a synchronizer, so the snippet setup resolves the global synchronizer once and passes synchronizerId to party.external.create and amulet.traffic.status across the affected snippets.

Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
@jarekr-da jarekr-da changed the title Removed default synchronizer refactor(wallet-sdk): remove default synchronizer auto-selection Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant