[go: up one dir, main page]

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 PACK instruction 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.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Konstantin Ivanov

Merge request reports

Loading