Linear tickets
This MR contains a simplified implementation of tickets that rely on linear typing (tickets are forbidden in DUP
) instead of the global storage of MR !326 (closed).
The visible differences for Michelson devs are:
- the
OWN
andPUNCH
instructions have been removed, - the
ticket_handle
type has been renamed toticket
, -
READ_TICKET
always succeed (returns the triple directly instead of an option), - at type-checking,
DUP
checks that it is not duplicating a ticket (some gas is consumed for this).
Pros:
- tickets are probably easier to manipulate in this setting because the devs cannot shoot themselves in the foot by forgetting a
OWN
or pay unnecessary storage by forgetting toPUNCH
, - the code is much simpler.
Cons:
- the constraint on
DUP
might be hard to fulfill for compiler developers, - relying on the Michelson type system to preserve invariants might complicate future migrations to unlinear type systems.