package tezos-protocol-alpha
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f
doc/tezos-protocol-alpha.raw/Tezos_raw_protocol_alpha/Sc_rollup_management_protocol/index.html
Module Tezos_raw_protocol_alpha.Sc_rollup_management_protocol
Source
This module provides a typed API for the Rollup Management Protocol that defines the communication protocol for exchanging messages between Layer 1 and Layer 2 for smart-contract rollups.
The API exposes functions for constructing inbox messages. These are messages produced by the Layer 1 protocol and added to a smart-contract rollups inbox.
The Layer 2 node is responsible for decoding and interpreting the messages.
A type outbox_message
representing messages from Layer 2 to Layer 1 is also provided. An outbox_message
consists of a set of transactions to L1 accounts.
type transaction = private
| Transaction : {
destination : Contract_hash.t;
entrypoint : Alpha_context.Entrypoint.t;
parameters_ty : ('a, _) Script_typed_ir.ty;
parameters : 'a;
unparsed_parameters : Alpha_context.Script.expr;
} -> transaction
A type representing a Layer 2 to Layer 1 transaction.
A type representing a batch of Layer 2 to Layer 1 transactions.
A typed representation of Sc_rollup.Outbox.Message.t
.
val make_internal_transfer :
Alpha_context.context ->
('a, _) Script_typed_ir.ty ->
payload:'a ->
sender:Contract_hash.t ->
source:Alpha_context.public_key_hash ->
destination:Tezos_raw_protocol_alpha.Alpha_context.Sc_rollup.Address.t ->
(Alpha_context.Sc_rollup.Inbox_message.t * Alpha_context.context)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
make_internal_transfer ctxt ty ~payload ~sender ~source ~destination
constructs a smart rollup's inbox message
(an L1 to L2 message) with the given payload
, sender
, and source
targeting destination
.
val outbox_message_of_outbox_message_repr :
Alpha_context.context ->
Alpha_context.Sc_rollup.Outbox.Message.t ->
(outbox_message * Alpha_context.context)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
outbox_message_of_outbox_message_repr ctxt msg
returns a typed version of of the given outbox message msg
.
Fails with an Sc_rollup_invalid_destination
error in case the parameters don't match the type of the entrypoint and destination.
Function for constructing and encoding inbox_message
and outbox_message
values. Since Layer 1 only ever consumes outbox_message
values and produces inbox_message
values, these functions are used for testing only.