Tezos_baking_alpha.Baking_automatonmodule Profiler : sig ... endval retry :
Tezos_client_alpha.Protocol_client_context.full ->
?max_delay:float ->
delay:float ->
factor:float ->
?tries:int ->
?msg:(Tezos_base.TzPervasives.tztrace -> string) ->
('a -> 'b Tezos_base.TzPervasives.tzresult Lwt.t) ->
'a ->
'b Tezos_base.TzPervasives.tzresult Lwt.tretry ctxt ~delay ?max_delay ~factor ~tries ?msg f x retries applying f x tries until it succeeds or returns an error different from Connection_failed, at most tries number of times. After each try it waits for a number of seconds, but not more than max_delay, if given. The wait time between tries is given by the initial delay, multiplied by factor at each subsequent try. At each failure, msg together with the current delay is printed using ctxt#message.
val try_resolve_consensus_keys :
Tezos_client_alpha.Protocol_client_context.rpc_context ->
Baking_state_types.Key.t ->
Tezos_protocol_alpha.Protocol.Alpha_context.public_key_hash Lwt.ttry_resolve_consensus_keys cctxt key attempts to resolve the primary delegate associated with the given key.
key is a primary baking key, it is returned directly.key is a consensus key, attestation rights over the past 50 levels are inspected to retrieve the associated primary delegate.key if no rights are found, or if key is neither a registered delegate nor a consensus key.val sleep_until : Tezos_base.TzPervasives.Time.Protocol.t -> unit Lwt.t optionsleep_until time is blocking until it is time.
val first_potential_round_at_next_level :
Baking_state.state ->
earliest_round:Tezos_protocol_alpha.Protocol.Alpha_context.Round.t ->
(Tezos_protocol_alpha.Protocol.Alpha_context.Round.t
* Baking_state_types.Delegate.t)
optionfirst_potential_round_at_next_level Returns the first round at the next level, at or after earliest_round, whose baking slot belongs to one of our own delegates; also returns the corresponding delegate. Or returns None if no such round exists.
val first_potential_round_at_current_level :
Baking_state.state ->
earliest_round:Tezos_protocol_alpha.Protocol.Alpha_context.Round.t ->
(Tezos_protocol_alpha.Protocol.Alpha_context.Round.t
* Baking_state_types.Delegate.t)
optionfirst_potential_round_at_current_level Returns the first round at current level, at or after earliest_round, whose baking slot belongs to one of our own delegates; also returns the corresponding delegate. Or returns None if no such round exists.
val compute_next_potential_baking_time_at_next_level :
Baking_state.state ->
(Tezos_base.TzPervasives.Time.Protocol.t
* Tezos_protocol_alpha.Protocol.Alpha_context.Round.t)
option
Lwt.tcompute_next_potential_baking_time state From the current state, the function returns an optional association pair, which consists of the next baking timestamp and its baking round. In that case, an elected block must exist.
val compute_bootstrap_event :
Baking_state.state ->
Baking_state.event Tezos_base.TzPervasives.tzresultcompute_bootstrap_event state emits the first event. If the latest proposal is for the current round, then trigger the new proposal event to possibly preattest. Otherwise, trigger the end of round event (for the previous round) to check whether we need to propose at this level or not.
val create_loop_state :
?get_valid_blocks_stream:Baking_state_types.proposal Lwt_stream.t Lwt.t ->
heads_stream:Baking_state_types.proposal Lwt_stream.t ->
forge_event_stream:Baking_state.forge_event Lwt_stream.t ->
Operation_worker.t ->
loop_statecreate_loop_state ?get_valid_blocks_stream heads_stream forge_event_stream operation_worker creates a loop state with the streams of valid blocks, new heads, forged events and operations from the node's mempool.
val automaton_loop :
?stop_on_event:(Baking_state.event -> bool) ->
config:Baking_configuration.t ->
on_error:
(Tezos_base.TzPervasives.tztrace ->
(unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t) ->
loop_state ->
Baking_state.state ->
Baking_state.event ->
Baking_state.event option Tezos_base.TzPervasives.tzresult Lwt.tautomaton_loop ?stop_on_event baking_configuration on_error loop_state state event:
State_transitions.step with the state and event and recover a new state and an action to performBaking_actions.perform_action on this new state and actionbaking_configuration is not Baking_configuration.state_recorder_config.Memorystate using a function that returns an Lwt promise that fulfills once the nearest timeout (between those computed by wait_end_of_round and wait_baking_time_next_level) is expired (at that moment the state machine will react)stop_on_event matches the given event; recursively calls itself with the new event otherwise