Proto: Use saturated arithmetic in the cost model implementation
This MR replaces metastatedev/tezos!371 (closed).
Context
This MR replaces Z.t
by Saturation_repr.t
in the implementation of the cost model, optimizing cost computation time.
Following the same idea as in !2329 (merged), 2^62 - 1 seems sufficiently large to represent any gas-related cost because it will eventually be subtracted to gas level limits which are (and will be) smaller than this.
Since Saturation_repr.t
are always positive integers, the current unit tests for gas implementation are useless (and removed from the codebase).
Related: #1013 (closed)
Depends on: !2329 (merged)
Manually testing the MR
The fact that the gas levels of the testsuite are unchanged is probably sufficient to witness the observational equivalence between the original and the new gas model (in the domain where saturation does not occur).
Checklist
-
[ ] Document the interface of any function added or modified (see the [coding guidelines](https://tezos.gitlab.io/developer/guidelines.html)) [ ] Provide automatic testing (see the testing guide).[ ] Add item in theDevelopment Version
section ofCHANGES.md
(only for new features and bug fixes).