Skip to content

[PoC] TokenRules stay on app-sync#1719

Draft
jarekr-da wants to merge 100 commits into
wiktor/multisync-examplefrom
jarekr/multisync-example_correction1_alternative
Draft

[PoC] TokenRules stay on app-sync#1719
jarekr-da wants to merge 100 commits into
wiktor/multisync-examplefrom
jarekr/multisync-example_correction1_alternative

Conversation

@jarekr-da
Copy link
Copy Markdown
Contributor

No description provided.

Improvement: added multi-sync logic + new scenario script 15-multi-sync-trade.ts
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Improvement: added uploading of DARs for Token and Trading App
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Improvement: added discovery of AmuletRules and creation of TokenRules and Trading App contracts (the latter two seem not to work yet)
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Improvement: added TokenRules, Token contract, Amulet Contract and Trade Contract creation
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Improvement: added Allocations for Amulet (Alice) and Token (Bob) and execising of Settle Choice for Trade
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Improvement: added Creation of Amulet for Bob and Token for Alice Contracts after exercising Trade. Also moved Bob party, Token Rules and Token Contracts to app synchronizer
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Improvement: added final step for reassignment of Token Contract from global synchornizer to app synchronizer
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Improvement: removed reassignment of Token contracts during exercising of the Trade_Settle Contract and TransferFactory_Transfer
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Improvement: lowered the debug logging
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Improvement: refactoring
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Refactoring: added parallelization of some steps in scenario, added some more logging
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Fix: fix of multi-sync for CI
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Fix: CI fix for tests + alternative approach for local testing
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Fix: CI fix for tests
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Improvement: added popup openining for approveTransaction() in wallet-gateway.ts
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Fix: CI Fix
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Fix: fix for CI build
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Viktor-Kalashnykov-da and others added 27 commits May 5, 2026 14:13
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
…rsion 3.4.11

Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
…DARs from the repository after upgrading of splice to version 0.6,1

Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
…DarNamespace.upload() function

Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
…tion or class'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Signed-off-by: Viktor-Kalashnykov-da <viktor.kalashnykov@digitalasset.com>
…tion or class'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Signed-off-by: Viktor-Kalashnykov-da <viktor.kalashnykov@digitalasset.com>
…tion or class'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Signed-off-by: Viktor-Kalashnykov-da <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
…act and added reassignment of Alice Tokens to App Sync after Trade settlement

Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
…tion or class'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Signed-off-by: Viktor-Kalashnykov-da <viktor.kalashnykov@digitalasset.com>
Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
- Remove reassignBobContractsToGlobal (step 6c): Bob mints Token on
  app-synchronizer and Canton automatically reassigns to global when the
  allocation is prescribed there.
- Remove party.ts utility: use SDK's party.external.create().sign().execute()
  directly for registering parties on additional synchronizers.
- Add skipExistenceCheck option to SDK's SignedPartyCreationService.execute()
  to allow re-registering an existing party on a new synchronizer.

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>
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>
Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
…fTransfer choice

Introduces a custom test-token package mirroring splice-test-token-v1 but
adding a Token_SelfTransfer choice on Token itself. Because the input Token
already carries the admin signature, both output Tokens are authorized via
the input's signatories, so no TokenRules contract is involved in the
transaction.

This lets TokenRules stay on its current synchronizer (no manual reassign,
no disclosed-contract gymnastics) while owners self-transfer holdings on
any synchronizer. Canton auto-reassigns the holder's Token to the target
synchronizer as part of the command.

- New DAML package docs/.../15-multi-sync/daml/splice-test-token-self-transfer-v1
  (daml.yaml, SelfTransferTokenV1.daml, prebuilt DAR + utils dependency DAR).
- _setup.ts: upload + vet the new DAR (P1+P2 on both synchronizers, P3 on global).
- _trade_ops.ts: switch TEST_TOKEN_PREFIX to the new package and rewrite
  selfTransferToken (Bob) and aliceSelfTransferToApp to exercise
  Token_SelfTransfer directly on Token, with no disclosed contracts.
- index.ts: re-enable Bob's self-transfer step.

Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
Option B: avoid moving TokenRules between synchronizers by removing
the executor observer from TokenAllocation and adding a direct
Token_Allocate choice on Token (no TokenRules involvement).

- SelfTransferTokenV1.daml: drop executor observer from TokenAllocation;
  add Token_Allocate choice (controller=owner) that creates the
  TokenAllocation directly with optional remainder Token.
- _trade_ops.ts: allocateTokenForBob uses Token_Allocate on Bob's Token
  on app-synchronizer, then solo-reassigns the TokenAllocation to global.
  settleOtcTrade discloses the TokenAllocation contract instead of
  relying on observer informee-ship.
- index.ts: remove Bob's pre-settlement self-transfer (Bob's Token
  never leaves app-synchronizer).
- daml.yaml: bump version to 1.0.1; rebuild DAR; update _setup.ts path.

Result: TokenRules and Bob's Token stay on app-synchronizer for the
entire flow; only the TokenAllocation moves app -> global for settlement.

Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
Base automatically changed from jarekrmultisync-example_correction1 to wiktor/multisync-example May 8, 2026 08:39
@Viktor-Kalashnykov-da Viktor-Kalashnykov-da force-pushed the wiktor/multisync-example branch 2 times, most recently from 1ff15ed to 81f734a Compare May 11, 2026 13:41
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.

2 participants