Scoru,Proto: introduce versioned commitments
Context
Part of #2906 (closed)
To prepare migration of smart-contract rollup, we should add a version number to all values in the storage.
With this merge request, we will be able to introduce a V2 commitment in the storage. That is, when a value of type versioned is read from the storage, it is transformed to t which is the latest commitment version.
The potentially most critical code in this merge request can be of_versioned because the actual migration would happen here, but as there is for now no migration, I believe the code is safe.
Given the actual set-up of a unique version, the drawback of this MR is a bit of boiler-plate code and an additional byte in the binary representation.
Manually testing the MR
TODO: Does it needs additional tests? I guess that until we have a real migration transforming a V1 commitment to a V2 it doesn't need much tests?
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR