protocol: Use saturated arithmetic in the cost model implementation
requested to merge yrg@optimize-gas-model-implementation into yrg@optimize-gas-representation-with-saturated-arithmetic
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 !368 (closed), 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).
Edited by Yann Regis-Gianas