daml
daml copied to clipboard
queryInterfaceContractId doesn't' run upgrades
Running queryInterfaceContractId on a daml contract does not perform upgrades on the contract before computing it's view.
i.e. a participant with V1 and V2 package, V1 contract instance of interface
Calling queryInterfaceContractId on that contract gives the V1 instance view, rather than V2, despite package preference.
Daml script queries the ACS for interface views, and gives this back. The ledger-api currently uses the interface view definition from the contract version it was created with, whereas we might expect it to choose an instance according to package resolution - to discuss with Tudor. Consider alternative of computing the view at creation time, and now allowing to change with upgrades - similarly to signatories, such that re-computation would ensure it doesn't change.
Leaning towards package map
This will mean that querying will need a way to override the package map, as command submission does.
Fixed in 2x by @paulbrauner-da by preventing view changes
For reference, he fix PR in 2.x: https://github.com/digital-asset/daml/pull/19857