We think we’ve run into a multi-synchronizer issue that affects workflows relying on lookupByKey.
A contract can be reassigned independently of the Daml workflow operating on it. Once that happens, a workflow expecting to resolve that contract by key on its current synchronizer can break.
We wrote up our understanding below. Curious whether we’re misunderstanding anything, whether there is an existing pattern or mechanism we should be using, or whether it would make sense for reassignment policy to be expressible at the template level. For example, allowing a contract to opt out of reassignment or restrict the synchronizers to which it may be reassigned.
On Reassignment Risk
Reassigning a contract between synchronizers is different from an ordinary Daml state change. A participant hosting a stakeholder can initiate reassignment, provided it is a reassigning participant for that stakeholder, and observers are stakeholders.
The reassignment protocol includes confirmation by participants hosting the contract’s signatories, but no Daml choice executes and the template itself has no opportunity to approve or reject the move. As a result, the application cannot express an invariant such as “this contract must remain on this synchronizer” or “reassignment requires authorization from this party.”
There are limits on where a contract can be reassigned. Every stakeholder must be appropriately hosted across the source and target synchronizers, the required signatory confirmation topology must exist, and the contract package must be vetted on the target.
We rely on those constraints today by keeping our protocol parties and protocol packages on the private synchronizer only. That prevents our market contracts from being reassigned to the Global Synchronizer.
The concern is that this protection is an operational topology invariant rather than an application invariant. We have to maintain the correct hosting and package-vetting configuration across every participant indefinitely. A topology or vetting change can turn a reassignment that was previously impossible into one that the protocol permits, without any change to the Daml contract itself.