Skip to content

Linear tickets

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

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 and PUNCH instructions have been removed,
  • the ticket_handle type has been renamed to ticket,
  • 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 to PUNCH,
  • 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.

Merge request reports