Tezos_baking_alpha.Operation_workerThe 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.
type candidate = {hash : Tezos_base.TzPervasives.Block_hash.t;level_watched : Stdlib.Int32.t;round_watched : Tezos_protocol_alpha.Protocol.Alpha_context.Round.t;payload_hash_watched : Tezos_protocol_alpha.Protocol.Block_payload_hash.t;branch_watched : Tezos_base.TzPervasives.Block_hash.t option;}val candidate_encoding : candidate Tezos_base.TzPervasives.Data_encoding.ttype event = | Prequorum_reached of candidate
* Tezos_protocol_alpha.Protocol.Alpha_context.Kind.preattestation
Tezos_protocol_alpha.Protocol.Alpha_context.operation
list| Quorum_reached of candidate
* Tezos_protocol_alpha.Protocol.Alpha_context.Kind.attestation
Tezos_protocol_alpha.Protocol.Alpha_context.operation
listval run :
?monitor_node_operations:bool ->
round_durations:
Tezos_protocol_alpha.Protocol.Alpha_context.Round.round_durations ->
Tezos_client_alpha.Protocol_client_context.full ->
t Lwt.trun ?monitor_node_operations ~round_durations cctxt spawns an operation worker.
val retrieve_pending_operations :
Tezos_client_alpha.Protocol_client_context.full ->
t ->
unit Tezos_base.TzPervasives.tzresult Lwt.tval get_current_operations : t -> Operation_pool.poolval monitor_preattestation_quorum :
t ->
consensus_threshold:int64 ->
consensus_committee:int64 ->
get_slot_voting_power:
(slot:Tezos_protocol_alpha.Protocol.Alpha_context.Slot.t -> int64 option) ->
candidate ->
unit Lwt.tmonitor_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_alpha.Protocol.Alpha_context.Slot.t -> int64 option) ->
candidate ->
unit Lwt.tmonitor_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 -> unitcancel_monitoring state removes current monitored payload. Does nothing if no payload is being monitored.
val shutdown_worker : t -> (unit, exn list) Stdlib.result Lwt.tshutdown_worker state closes the monitor_operations stream and removes current monitored payload.