Skip to content

[Draft] Auto reassignment fail#2046

Merged
jarekr-da merged 25 commits into
wiktor/multisync-examplefrom
jarekr/multisync-example_no_reassign
Jul 9, 2026
Merged

[Draft] Auto reassignment fail#2046
jarekr-da merged 25 commits into
wiktor/multisync-examplefrom
jarekr/multisync-example_no_reassign

Conversation

@jarekr-da

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
stakeholder, and indeed the _explicit_ `reassign` submitted by Bob always
worked. The blocker is the **`TokenRules` factory**, whose only stakeholder is
`admin`. With a **separate `TokenAdmin` party**, the submitter (Bob) is **not** a
stakeholder of `TokenRules`, so Canton refuses to reassign it automatically.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the unreassignability of the TokenRules is why I'm pushing for guidelines where the workflows tell the token standard registry what the target synchronizer is. See this conversation: #1622 (review)

For that to work cleanly we'll need a small amendment to the token standard off-ledger APIs. However, until then we can funnel the information in an additional field in the choiceArgument submitted to the factory endpoints; e.g. a top-level _targetSynchronizerId field, which you then parse in the TestTokenV1 registry handlers.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand this :-(
I tried to play around - but do not get how would this additional field help in fundamental problem, that contract cannot be reassigned automatically

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trick is that the TestTokenV1 registry maintains TokenRules contract on every synchronizer it supports and selects the right one based on the communicated target synchronizer. This guarantees that TokenRules contracts never need to be reassigned by the client submitting a token standard action.

jarekr-da added 14 commits June 23, 2026 13:14
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>
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>

@meiersi-da meiersi-da left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comment from my review to get context on what might be failing,

return {
appUserSdk,
appProviderSdk,
appAliceSdk,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

side question: why is this "app"AliceSdk? What is "app'y" about this? I'd have expected "aliceSdk".

@@ -46,18 +46,18 @@ export async function aliceSelfTransferToApp(

// The settled holding lands on the global synchronizer; move it to the
// app-synchronizer before self-transferring there (mirrors Bob's flow).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app-synchronizer vs testTokenSynchronizerId ... seems inconsistent...

Comment on lines 131 to 141
@@ -131,7 +140,18 @@ const testTokenAllocationDisclosed = {
synchronizerId: '',
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not match what we would expect to happen in reality. The trading app would be listening on their participant node to observe the allocation and use it only then. I'd suggest to implement the code here such that you wait for it to appear on the participant node used for the submission of the settlement.

@@ -152,20 +172,20 @@ try {
await bobSelfTransferToApp(setup, logger)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is that? Why do we have to wait for a self-transfer?

@@ -152,20 +172,20 @@ try {
await bobSelfTransferToApp(setup, logger)
logger.info('Contracts after settlement failure (compensation applied):')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this compensation?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not match what we'd expect to happen on a settlement failure. The default would be that the settlement venue tries again, and if they fail to do so, they would cancel the allocations that exist.

Comment on lines +117 to +118
aliceTokenNamespace,
bobTokenNamespace,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using these two SDK's feels wrong. It should be only the trading app that uses their access to their participant node to build the command!

@jarekr-da jarekr-da Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is only one sdk "handle" used (tradingAppSdk)
I see. xyzTokenNamespace are actually nod needed here

// allocation-v1 API (instead of hard-coding an empty context).
const testTokenExecCtx =
await tokenNamespaceAppProvider.allocation.context.execute({
const testTokenExecCtx = await bobTokenNamespace.allocation.context.execute(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here as well: use the tradingApp's SDK to fetch this information.

jarekr-da added 9 commits July 8, 2026 18:48
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>
Signed-off-by: jarekr-da <jaroslaw.ratajski@digitalasset.com>
@jarekr-da
jarekr-da marked this pull request as ready for review July 9, 2026 07:06
@jarekr-da
jarekr-da requested a review from a team as a code owner July 9, 2026 07:06
@jarekr-da
jarekr-da merged commit 1f73346 into wiktor/multisync-example Jul 9, 2026
3 checks passed
@jarekr-da
jarekr-da deleted the jarekr/multisync-example_no_reassign branch July 9, 2026 07:07
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