daml icon indicating copy to clipboard operation
daml copied to clipboard

queryInterfaceContractId doesn't' run upgrades

Open samuel-williams-da opened this issue 1 year ago • 3 comments

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.

samuel-williams-da avatar Jul 16 '24 13:07 samuel-williams-da

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.

samuel-williams-da avatar Jul 23 '24 15:07 samuel-williams-da

Leaning towards package map

samuel-williams-da avatar Jul 23 '24 15:07 samuel-williams-da

This will mean that querying will need a way to override the package map, as command submission does.

samuel-williams-da avatar Jul 23 '24 15:07 samuel-williams-da

Fixed in 2x by @paulbrauner-da by preventing view changes

samuel-williams-da avatar Sep 27 '24 08:09 samuel-williams-da

For reference, he fix PR in 2.x: https://github.com/digital-asset/daml/pull/19857

tudor-da avatar Jan 14 '25 20:01 tudor-da