digital-asset / daml

The Daml smart contract language
https://www.digitalasset.com/developers
797 stars 199 forks source link

queryInterfaceContractId doesn't' run upgrades #19607

Open samuel-williams-da opened 2 months ago

samuel-williams-da commented 2 months ago

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 commented 1 month ago

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 commented 1 month ago

Leaning towards package map

samuel-williams-da commented 1 month ago

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