Open
Description
Protocol updates consist of multiple Cardano transactions and are thus not atomic. More specifically:
- Inserting new protocol version creates multiple (say, n) UTxOs, each containing a reference script (either a validator or a minting policy). It therefore requires n Cardano transactions. The reason for this is to not exceed transaction size limit with attached reference scripts.
- Invalidating an existing protocol version behaves identical to insertion, burning N versioning tokens in N transactions. This is probably a result of copy-paste of code, since it should be safe to burn multiple versioning tokens in one transaction.
- Updating protocol attempts to avoid unnecessary burning of tokens and tries to re-use them if possible. I think that in theory update should require max(M, N) Cardano transactions, where N is the number of versioned scripts in the old version, and M number of scripts in the new version. I also believe that at the moment this is not the case and the actual amount of transactions is larger.
We should ensure atomicity of the updates to guarantee that an active protocol version is always complete, i.e. contains all the required scripts at any given time.