Mavkit_smart_rollup_node.Protocol_plugins
type proto_plugin = (module Protocol_plugin_sig.S)
val register : proto_plugin -> unit
Register a protocol plugin for a specific protocol to be used by the rollup node.
val registered_protocols :
unit ->
Mavryk_base.TzPervasives.Protocol_hash.t list
Returns the list of registered protocols.
val last_registered : unit -> Mavryk_base.TzPervasives.Protocol_hash.t
Returns the last registered protocol.
NOTE: This is the last protocol with which the rollup node is linked against, and this is decided only by the order in manifest/main.ml
.
val proto_plugin_for_protocol :
Mavryk_base.TzPervasives.Protocol_hash.t ->
proto_plugin Mavryk_base.TzPervasives.tzresult
Return the protocol plugin for a given protocol (or an error if not supported).
val proto_plugin_for_level :
_ Node_context.t ->
int32 ->
proto_plugin Mavryk_base.TzPervasives.tzresult Lwt.t
Return the protocol plugin for a given level (or an error if not supported).
val proto_plugin_for_level_with_store :
_ Store.t ->
int32 ->
proto_plugin Mavryk_base.TzPervasives.tzresult Lwt.t
Return the protocol plugin for a given level (or an error if not supported).
val proto_plugin_for_block :
_ Node_context.t ->
Mavryk_base.TzPervasives.Block_hash.t ->
proto_plugin Mavryk_base.TzPervasives.tzresult Lwt.t
Return the protocol plugin for a given block (or an error if not supported).
val last_proto_plugin :
_ Node_context.t ->
proto_plugin Mavryk_base.TzPervasives.tzresult Lwt.t
Returns the plugin corresponding to the last protocol seen by the rollup node.
val last_proto_plugin_opt :
_ Node_context.t ->
proto_plugin option Mavryk_base.TzPervasives.tzresult Lwt.t
Same as last_proto_plugin
but returns None
if the rollup node has not registered any protocol information yet
These functions provide a way to retrieve constants in a safe manner, depending on the context.
val get_constants_of_level :
_ Node_context.t ->
int32 ->
Mavkit_smart_rollup.Rollup_constants.protocol_constants
Mavryk_base.TzPervasives.tzresult
Lwt.t
Retrieve constants for a given level (values are cached).
val get_constants_of_block_hash :
_ Node_context.t ->
Mavryk_base.TzPervasives.Block_hash.t ->
Mavkit_smart_rollup.Rollup_constants.protocol_constants
Mavryk_base.TzPervasives.tzresult
Lwt.t
Retrieve constants for a given block hash (values are cached).
val get_constants_of_protocol :
?level:int32 ->
_ Node_context.t ->
Mavryk_base.TzPervasives.Protocol_hash.t ->
Mavkit_smart_rollup.Rollup_constants.protocol_constants
Mavryk_base.TzPervasives.tzresult
Lwt.t
Retrieve constants for a given protocol (values are cached). level
, if provided, must be a level of the protocol.