package octez-injector
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=dbc3b675aee59c2c574e5d0a771193a2ecfca31e7a5bc5aed66598080596ce1c
sha512=b97ed762b9d24744305c358af0d20f394376b64bfdd758dd4a81775326caf445caa57c4f6445da3dd6468ff492de18e4c14af6f374dfcbb7e4d64b7b720e5e2a
doc/octez-injector/Octez_injector/Injector_functor/Make/index.html
Module Injector_functor.Make
Source
Parameters
module P : Injector_sigs.PARAMETERS
Signature
type injected_info = {
op : Inj_operation.t;
(*The injector operation.
*)oph : Tezos_base.TzPervasives.Operation_hash.t;
(*The hash of the operation which contains
*)op
(this can be an L1 batch of several manager operations).op_index : int;
(*The index of the operation
*)op
in the L1 batch corresponding tooph
.
}
Information stored about an L1 operation that was injected on a Tezos node.
type included_info = {
op : Inj_operation.t;
(*The injector operation.
*)oph : Tezos_base.TzPervasives.Operation_hash.t;
(*The hash of the operation which contains
*)op
(this can be an L1 batch of several manager operations).op_index : int;
(*The index of the operation
*)op
in the L1 batch corresponding tooph
.l1_block : Tezos_base.TzPervasives.Block_hash.t;
(*The hash of the L1 block in which the operation was included.
*)l1_level : int32;
(*The level of
*)l1_block
.
}
Information stored about an L1 operation that was included in a Tezos block.
type status =
| Pending of P.Operation.t
(*The operation is pending injection.
*)| Injected of injected_info
(*The operation has been injected successfully in the node.
*)| Included of included_info
(*The operation has been included in a L1 block.
*)
Status of an operation in the injector.
val init :
Tezos_client_base.Client_context.full ->
data_dir:string ->
?retention_period:int ->
?allowed_attempts:int ->
?injection_ttl:int ->
?reconnection_delay:float ->
P.state ->
signers:
(Tezos_base.TzPervasives.Signature.public_key_hash
* Injector_sigs.injection_strategy
* P.Tag.t list)
list ->
unit Tezos_base.TzPervasives.tzresult Lwt.t
Initializes the injector with the rollup node state, for a list of signers, and start the workers. Each signer has its own worker with a queue of operations to inject.
retention_period
is the number of blocks for which the injector keeps the included information for, must be positive or zero. By default (when 0
), the injector will not keep information longer than necessary. It can be useful to set this value to something > 0
if we want to retrieve information about operations included on L1 for a given period.
allowed_attempts
is the number of attempts that will be made to inject an operation. Operations whose injection fails a number of times greater than this value will be discarded from the queue.
injection_ttl
is the number of blocks after which an operation that is injected but never include is retried.
The injector monitors L1 heads to update the statuses of its operations accordingly. The argument reconnection_delay
gives an initial value for the delay before attempting a reconnection (see Layer_1.init
).
val add_pending_operation :
?source:Tezos_base.TzPervasives.Signature.public_key_hash ->
P.Operation.t ->
Inj_operation.Hash.t Tezos_base.TzPervasives.tzresult Lwt.t
Add an operation as pending injection in the injector. If the source is not provided, the operation is queued to the worker which handles the corresponding tag. It returns the hash of the operation in the injector queue.
val inject :
?tags:P.Tag.t list ->
?header:Tezos_base.Block_header.shell_header ->
unit ->
unit Lwt.t
Trigger an injection of the pending operations for all workers. If tags
is given, only the workers which have a tag in tags
inject their pending operations. header
must be provided for the `Delay_block
strategy to compute the next block timestamp.
Shutdown the injectors, waiting for the ongoing request to be processed.
The status of an operation in the injector.
val register_proto_client :
Tezos_base.TzPervasives.Protocol_hash.t ->
(module Injector_sigs.PROTOCOL_CLIENT
with type operation = P.Operation.t
and type state = P.state) ->
unit
Register a protocol client for a specific protocol to be used by the injector. This function must be called for all protocols that the injector is meant support.