MIR: Add PACK instruction
Context
Depends on !10691 (merged)
Adds PACK that works on values.
As discussed:
- I use the existing function for untyping value, as we don't strictly need pure optimized representation, at least for now.
- I do not add full coverage for
PACK, we have TZTs for this.
As for gas, there are 4 stages in interpreting PACK:
- Facing
PACKinstruction is itself free. Nevertheless, I put that to gas-related consts so that it can be overridden when we become parametrized by the gas model. - Octez implementation needs to strip locations from the value, we don't.
- Value untyper cost - I do not handle it here, but separately I started some work for the future MR.
- Serialization cost - added.
Manually testing the MR
cargo test
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
Edited by Konstantin Ivanov