Excellent question. The answer depends on your relationship to the contract and key, the Ledger’s consensus policies, and the Ledger’s topology. So the answer in general is “no”, but it’s “yes” when it matters.
Let’s first of all see how this can fail:
Alice is hosted on participant P and participant P is connected to two domains/partitions A and B.
- A contract C of type T with key K exists in A.
- A transaction TX1 is committed in A through which Alice witnesses the archival of C
- A transaction is TX2 committed on B through which Alice witnesses the creation of C’ of type T with key K
If the consensus algorithm in A and B is such that P’s confirmation is not needed for TX1, and P’s connection to A is slow, it could happen that P receives TX2 before TX1. You now get the
create before the
So when is it guaranteed that the archive comes before the create?
- If the
create are causality ordered in
Alice's projection. Eg if
Alice is a maintainer of K, or if
Alice witnesses a consuming choice on
C that creates
- If the create and archive happen on the same domain/partition, and that domain/partition give a total order to transactions. This applies in particular to all non-partitioned DAML ledgers currently in existence.
- If the
create happen in the same transaction.
In other words, the scenario above illustrates the the circumstances required to not get this guarantee:
- A Ledger which guarantees only causality ordering (eg multi-domain partitioned topology)
- A Participant which is not involved in the consensus of the transactions in question