Semantics of `version` and `name` in in `daml.yaml` in relation to Smart Contract Upgrading

Two questions on how package attributes defined in daml.yaml have an impact on package selection at runtime. These are both in the context of the new Smart Contract Upgrade feature from 2.9.x.

  • Does the ledger use an ordering over version (as defined in daml.yaml) to identify which of two packages is newer or older? (Does the Daml tooling in general use any ordering over version.yaml?)
  • With the ledger API now able to accept and produce package names rather than package ID’s, is there a standard convention in use to avoid collisions between different organizations making packages with the same basename. (I’m thinking something like Java’s naming scheme that incorporates domain names, etc.)

Yes, the ledger recognizes an ordering on versions

Specifically:

The participant looks up versions v_prev and v_next of p in its package database, such that v_prev is the greatest version of p smaller than v, and v_next is the smallest version of p greater than v.

The above is in the context of compatibility checks, but the ordering is also significant when submitting commands:

By default, the participant resolves a package-name to the package-id pertaining to the highest package version uploaded