package octez-smart-rollup-node-lib

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

The rollup node stores and publishes commitments for the PVM every `Commitment.sc_rollup_commitment_period` levels.

Every time a finalized block is processed by the rollup node, the latter determines whether the last commitment that the node has produced referred to `Commitment.sc_rollup_commitment_period` blocks earlier. In this case, it computes and stores a new commitment in a level-indexed map.

Stored commitments are signed by the rollup node operator and published on the layer1 chain. To ensure that commitments produced by the rollup node are eventually published, storing and publishing commitments are decoupled. Every time a new head is processed, the node tries to publish the oldest commitment that was not published already.

process_head plugin node_ctxt ~predecessor head ctxt builds a new commitment if needed, by looking at the level of head and checking whether it is a multiple of `Commitment.sc_rollup_commitment_period` levels away from node_ctxt.initial_level. It uses the functionalities of PVM to compute the hash of to be included in the commitment.

publish_single_commitment node_ctxt commitment publishes a single commitment if it is missing. This function is meant to be used by the accuser mode to sparingly publish commitments when it detects a conflict.

Initialize worker for publishing and cementing commitments.

val publish_commitments : unit -> unit Tezos_base.TzPervasives.tzresult Lwt.t

publish_commitments () publishes the commitments that were not yet published up to the finalized head and which are after the last cemented commitment.

val cement_commitments : unit -> unit Tezos_base.TzPervasives.tzresult Lwt.t

cement_commitments () cements the commitments that can be cemented, i.e. the commitments that are after the current last cemented commitment and which have sc_rollup_challenge_period levels on top of them since they were originally published.

val shutdown : unit -> unit Lwt.t

Stop worker for publishing and cementing commitments.

OCaml

Innovation. Community. Security.