Module Mavkit_smart_rollup_node.Configuration

type mode =
  1. | Observer
    (*

    Only follows the chain and reconstructs inboxes

    *)
  2. | Accuser
    (*

    Only publishes commitments for conflicts and play refutation games

    *)
  3. | Bailout
  4. | Batcher
    (*

    Accept transactions in its queue and batches them on the L1

    *)
  5. | Maintenance
    (*

    Follows the chain and publishes commitments

    *)
  6. | Operator
    (*

    Equivalent to maintenance + batcher

    *)
  7. | Custom of Mavkit_smart_rollup.Operation_kind.t list
    (*

    In this mode, the system handles only the specific operation kinds defined by the user, allowing for tailored control and flexibility.

    *)

Mode for the rollup node

type batcher = {
  1. min_batch_elements : int;
    (*

    The minimum number elements in a batch for it to be produced when the batcher receives new messages.

    *)
  2. min_batch_size : int;
    (*

    The minimum size in bytes of a batch for it to be produced when the batcher receives new messages.

    *)
  3. max_batch_elements : int;
    (*

    The maximum number of elements that we can put in a batch.

    *)
  4. max_batch_size : int option;
    (*

    The maximum size in bytes of a batch.

    *)
}

Configuration for the batcher.

Invariants:

  • 0 < min_batch_size <= max_batch_size <= protocol_max_batch_size
  • 0 < min_batch_elements <= max_batch_elements
type injector = {
  1. retention_period : int;
    (*

    The number of blocks during which the injector will keep track of an operation (in addition to the confirmation period).

    *)
  2. attempts : int;
    (*

    The number of attempts that will be made to inject an operation.

    *)
  3. injection_ttl : int;
    (*

    The number of blocks after which an operation that is injected but never included is retried.

    *)
}
type gc_parameters = {
  1. frequency_in_blocks : int32;
    (*

    Frequency at which the GC is triggered.

    *)
  2. context_splitting_period : int option;
    (*

    Number of blocks before splitting the context.

    *)
}
type history_mode =
  1. | Archive
    (*

    The whole history of the rollup (starting at its genesis) is kept

    *)
  2. | Full
    (*

    Only the history necessary to play refutation games is kept (i.e. after the LCC only)

    *)
type t = {
  1. sc_rollup_address : Mavryk_crypto.Hashed.Smart_rollup_address.t;
  2. boot_sector_file : string option;
  3. operators : Purpose.operators;
  4. rpc_addr : string;
  5. rpc_port : int;
  6. acl : Mavryk_rpc_http_server.RPC_server.Acl.policy;
  7. metrics_addr : string option;
  8. reconnection_delay : float;
  9. fee_parameters : fee_parameters;
  10. mode : mode;
  11. loser_mode : Loser_mode.t;
  12. apply_unsafe_patches : bool;
  13. unsafe_pvm_patches : Pvm_patches.unsafe_patch list;
  14. dal_node_endpoint : Uri.t option;
  15. dac_observer_endpoint : Uri.t option;
  16. dac_timeout : Z.t option;
  17. pre_images_endpoint : Uri.t option;
  18. batcher : batcher;
  19. injector : injector;
  20. l1_blocks_cache_size : int;
  21. l2_blocks_cache_size : int;
  22. prefetch_blocks : int option;
  23. l1_rpc_timeout : float;
  24. loop_retry_delay : float;
    (*

    Delay in seconds to retry the main loop and the refutation loop after an error.

    *)
  25. index_buffer_size : int option;
  26. irmin_cache_size : int option;
  27. log_kernel_debug : bool;
  28. no_degraded : bool;
  29. gc_parameters : gc_parameters;
  30. history_mode : history_mode option;
  31. cors : Resto_cohttp.Cors.t;
}
type Mavryk_base.TzPervasives.error +=
  1. | Empty_operation_kinds_for_custom_mode
val history_mode_of_string : string -> history_mode

history_mode_of_string s parses a history_mode from the given string s.

val string_of_history_mode : history_mode -> string

string_of_history_mode p returns a string representation of history_mode p.

val default_data_dir : string

default_data_dir is the default value for data_dir.

val default_storage_dir : string -> string

default_storage_dir returns the default value of the storage dir given a data_dir.

val default_context_dir : string -> string

default_context_dir returns the default value of the directory for persisting the context given a data_dir.

val default_rpc_addr : string

default_rpc_addr is the default value for rpc_addr.

val default_rpc_port : int

default_rpc_port is the default value for rpc_port.

default_acl is the default value for acl.

val default_metrics_port : int

default_metrics_port is the default port for the metrics server.

val default_reconnection_delay : float

default_reconnection_delay is the default value for reconnection_delay.

default_fee_parameter operation_kind is the default fee parameter to inject operation on L1. If operation_kind is provided, it returns the default fee parameter for this kind of operation.

val default_fee_parameters : fee_parameters

default_fee_parameters is the default fee parameters configuration build with default_fee_parameter for all purposes.

val default_batcher : batcher

default_batcher is the default configuration parameters for the batcher.

val default_injector : injector

default_injector is the default configuration parameters for the injector.

val default_l1_blocks_cache_size : int

default_l1_blocks_cache_size is the default number of L1 blocks that are cached by the rollup node

val default_l2_blocks_cache_size : int

default_l2_blocks_cache_size is the default number of L2 blocks that are cached by the rollup node

val default_l1_rpc_timeout : float

Default timeout for RPCs to the L1 node.

val default_gc_parameters : gc_parameters
val default_history_mode : history_mode

default_history_mode is the default history mode for the rollup node (Full).

val history_mode_encoding : history_mode Mavryk_base.TzPervasives.Data_encoding.t
val max_injector_retention_period : int

max_injector_retention_period is the maximum allowed value for injector_retention_period.

val modes : mode list

This is the list of available modes.

val string_of_mode : mode -> string

string_of_mode mode returns a string representation of the mode specified by the argument mode.

val mode_of_string : string -> mode Mavryk_base.TzPervasives.tzresult

mode_of_string s returns the mode represented by string s if it exists.

val description_of_mode : mode -> string

description_of_mode m returns a textual description of the mode m.

val config_filename : data_dir:string -> string

config_filename data_dir returns the configration filename from the data_dir

val purposes_of_mode : mode -> Purpose.ex_purpose list

purposes_of_mode mode returns purposes associated with the provided mode.

val operation_kinds_of_mode : mode -> Mavkit_smart_rollup.Operation_kind.t list

operation_kinds_of_mode mode returns operation kinds with the provided mode.

val can_inject : mode -> Mavkit_smart_rollup.Operation_kind.t -> bool

can_inject mode op_kind determines if a given operation kind can be injected based on the configuration settings.

val purpose_matches_mode : mode -> 'kind Purpose.t -> bool

purpose_matches_mode mode purpose returns true if and only if the given mode supports the given purpose.

val refutation_player_buffer_levels : int

Number of levels the refutation player waits until trying to play for a game state it already played before.

val default_irmin_cache_size : int
val default_index_buffer_size : int

The `default_index_buffer_size` defines the maximum amount of memory reserved for caching index entries before they are written to disk. Essentially, this cache aids the efficiency of the index. The total cache capacity is determined by `index_buffer_size * entry`, with each `entry` occupying approximately 56 bytes. An `entry` represents a single log record which can encompass various details such as a timestamp, message content, severity level, etc.

val encoding : t Mavryk_base.TzPervasives.Data_encoding.t

Encoding for configuration.

val encoding_no_default : t Mavryk_base.TzPervasives.Data_encoding.t

Encoding for configuration without any default value.

val save : force:bool -> data_dir:string -> t -> unit Mavryk_base.TzPervasives.tzresult Lwt.t

save ~force ~data_dir configuration writes the configuration file in data_dir. If force is true, existing configurations are overwritten.

val load : data_dir:string -> t Mavryk_base.TzPervasives.tzresult Lwt.t

load ~data_dir loads a configuration stored in data_dir.

module Cli : sig ... end