Skip to content

SCORU: Tag external inbox messages

Joel Bjornson requested to merge jobjo/tezos:tag-external-rmp-msg into master

Context

Addresses #3088 (closed).

A SCORU node need to be able to distinguish between external L1 to L2 messages—ones that originate from a Sc_rollup_add_messages manager-operation—and internal ones originating from L1 smart-contract calls.

This can be done by splitting the inbox_message type as in:

type t =
  | Internal of {
      payload : Script_repr.expr;
          (** A Micheline value containing the parameters passed to the rollup. *)
      sender : Contract_repr.t;  (** The L1 caller contract. *)
      source : Signature.public_key_hash;
          (** The implicit account that originated the transaction. *)
    }
  | External of string

They are encoded using the data-encoding library so internal and external messages have different tags.

This MR also factors out two modules from Sc_rollup_management_protocl:

  • Sc_rollup_inbox_message_repr
  • Sc_rollup_outbox_message_repr

They are needed in order to move the tagging of external messages to the level of Sc_rollup.Inbox.add_external_messages.

Manually testing the MR

CI including:

 dune exec tezt/tests/main.exe -- --file sc_rollup.ml 

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 Joel Bjornson

Merge request reports

Loading