Module Tezos_baking_025_PsUshuai.Operation_worker

The operation worker is responsible for listening to the node's mempool and collecting incoming operations in an accessible operation pool. Upon request, it can monitor the (pre)quorum status for a given payload and report its completion through the provided quorum stream.

Only one payload quorum or prequorum can be monitored at a time; new monitoring requests override the previous one.

Datatypes

type t

Constructors

val run : ?monitor_node_operations:bool -> multi_node_setup:bool -> round_durations: Tezos_protocol_025_PsUshuai.Protocol.Alpha_context.Round.round_durations -> Tezos_client_025_PsUshuai.Protocol_client_context.full -> t Lwt.t

run ?monitor_node_operations ~multi_node_setup ~round_durations cctxt spawns an operation worker.

  • parameter monitor_node_operations

    monitor operations on the node (defaults: true). Set monitor_node_operations to false to only consider externally provided (non-node) operations.

  • parameter multi_node_setup

    if true, the worker will gracefully shutdown on fatal errors, allowing the supervisor to restart. If false, the worker will exit the entire process on fatal errors.

Utilities

Accessors

val get_current_operations : t -> Operation_pool.pool
val get_quorum_event_stream : t -> event Lwt_stream.t

Observers

val monitor_preattestation_quorum : t -> consensus_threshold:int64 -> consensus_committee:int64 -> get_slot_voting_power: (slot:Tezos_protocol_025_PsUshuai.Protocol.Alpha_context.Slot.t -> int64 option) -> candidate -> unit Lwt.t

monitor_preattestation_quorum state threshold get_slot_voting_power candidate Register candidate as the currently monitored payload, overriding any other prequorum or quorum payload. Completion of the prequorum is signaled through the quorum event stream.

val monitor_attestation_quorum : t -> consensus_threshold:int64 -> consensus_committee:int64 -> get_slot_voting_power: (slot:Tezos_protocol_025_PsUshuai.Protocol.Alpha_context.Slot.t -> int64 option) -> candidate -> unit Lwt.t

monitor_attestation_quorum state threshold get_slot_voting_power candidate Register candidate as the currently monitored payload, overriding any other prequorum or quorum payload. Completion of the quorum is signaled through the quorum event stream.

val cancel_monitoring : t -> unit

cancel_monitoring state removes current monitored payload. Does nothing if no payload is being monitored.

val shutdown_worker : t -> (unit, exn list) Stdlib.result Lwt.t

shutdown_worker state closes the monitor_operations stream and removes current monitored payload.

module Internal_for_tests : sig ... end