Switch to the new mutez subtraction operation
Clarification and motivation
Quoting from the official docs, starting with the ithaca
protocol:
- A new
SUB_MUTEZ
instruction has been added, it is similar to themutez
case of theSUB
instruction but its return type isoption mutez
instead ofmutez
. This allows subtractingmutez
values without failing in case of underflow. (MR !3079)- The
SUB
instruction on typemutez
is deprecated. It can be replaced bySUB_MUTEZ; ASSERT_SOME
(andSUB; DROP
can be replaced byASSERT_CMPGE
). (MR !3079)
Since ithaca
is supposed to be activated on mainnet
, we need to reflect these changes in morley
and lorentz
.
Note: this is tagged as breaking because the changes needed (or the lack thereof) will clearly change the behavior in a way that will cause failures on mainnet
. Any MR related to this issue should target the ithaca
branch instead of master
, before this new protocol is activated.
Acceptance criteria
- Support for the
SUB_MUTEZ
instruction is added. - the
SUB
instruction no longer operates onmutez
Edited by Pinto Pasquale