Michelson: fix the size of Micheline code predicted by the size model.
Context
It has recently been discovered, that the size model under-estimates the size of some contracts, sometimes even by 50%. The expectation is that the model should always over-approximate the size so that they're guaranteed to fit into the cache (making the model exact is impossible due to memory sharing, which OCaml performs internally). Investigation of the issue showed, that it is mostly the size of stored Micheline code that is under-estimated. This MR adds more tests for the size model, which catch the bug, and also a fix for the issue.
Manually testing the MR
Run the tests. !5608 (merged) extension to the get_contracts
script can be used to check model estimates for sizes of real-life smart contracts.
Checklist
-
Select suitable reviewers using the Reviewers
field below. -
Select as Assignee
the next person who should take action on that MR
Edited by Sventimir