Skip to content

Protocol/Michelson: UNPAIR instruction

Raphaël Cauderlier requested to merge rafoo@unpair into proto-proposal

This MR adds an UNPAIR instruction that behaves as the current UNPAIR macro.

Motivations for doing it:

  • the UNPAIR macro is very widely used, promoting it as an instruction diminishes its gas cost which profits almost all contracts (this was the purpose of the incorrect implementation of the peephole optimisation that Carthage removes)
  • providing an alternative to the CAR and CDR instructions seems required for linear typing; a feature that might be desirable for value stamping (see https://forum.tezosagora.org/t/contract-signatures/1458). Note however that linear alternatives to GET and UPDATE should also be added.

Because of the ubiquitous use of the UNPAIR macro in the testsuite, the difference in the regression log is unfortunately too big to be checked by a human reviewer.

Edited by Raphaël Cauderlier

Merge request reports