package octez-l2-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/octez-l2-libs.smart-rollup/Octez_smart_rollup/Sc_rollup_block/index.html
Module Octez_smart_rollup.Sc_rollup_block
Source
Structure of layer 2 blocks
type header = {
block_hash : Tezos_base.TzPervasives.Block_hash.t;
(*Tezos block hash.
*)level : int32;
(*Level of the block, corresponds to the level of the tezos block.
*)predecessor : Tezos_base.TzPervasives.Block_hash.t;
(*Predecessor hash of the Tezos block.
*)commitment_hash : Octez_smart_rollup.Commitment.Hash.t option;
(*Hash of this block's commitment if any was computed for it.
*)previous_commitment_hash : Octez_smart_rollup.Commitment.Hash.t;
(*Previous commitment hash in the chain. If there is a commitment for this block, this field contains the commitment that was previously computed.
*)context : Smart_rollup_context_hash.t;
(*Hash of the layer 2 context for this block.
*)inbox_witness : Tezos_crypto.Hashed.Smart_rollup_merkelized_payload_hashes_hash.t;
(*Witness for the inbox for this block, i.e. the Merkle hash of payloads of messages.
*)inbox_hash : Octez_smart_rollup.Inbox.Hash.t;
(*Hash of the inbox for this block.
*)
}
A layer 2 block header contains information about the inbox and commitment with respect to a layer 1 block, but without the inbox content of messages.
type content = {
inbox : Inbox.t;
(*Inbox for this block.
*)messages : string list;
(*Serialized messages added to the inbox in this block.
*)commitment : Commitment.t option;
(*Commitment, if any is computed for this block.
*)header.commitment = Some h
iffcommitment = Some c
andhash c = h
.
}
Contents of blocks which include the actual content of the inbox and messages.
type ('header, 'content) block = {
header : 'header;
(*Header of this block.
*)content : 'content;
(*Content of the block.
*)initial_tick : Z.t;
(*Initial tick of the PVM at this block, i.e. before evaluation of the messages.
*)num_ticks : int64;
(*Number of ticks produced by the evaluation of the messages in this block.
*)
}
Block parameterized by a header and content. The parameters are here to allow to split the header and rest of the block.
The type of layer 2 blocks. This type corresponds to what is stored on disk for L2 blocks. The contents is stored in separate tables because it can be large to read is is not always necessary.
The type of layer 2 blocks including their content (inbox, messages, commitment).
Encodings
Helper functions
most_recent_commitment header
returns the most recent commitment information at the block of with header
. It is either the commitment for this block if there is one or the previous commitment otherwise.