Module Tezos_baking_alpha.Baking_scheduling

create_initial_state context ?synchronize chain baking_configuration operation_worker dal_attestable_slots_worker current_proposal ?constants consensus_keys creates an initial Baking_state.t by initializing a Baking_state.global_state, a Baking_state.level_state and a Baking_state.round_state.

  • For the global_state and automaton_state initialization, a validation mode is set based on the baking_configuration and a forge worker is started. If constants is not provided, an RPC is called to recover them from the context.
  • For the level_state initialization, information regarding the current level is retrieved (the current level being that of the current_proposal) and delegates slots are computed for the given consensus_keys.
  • For the round_state initialization, current round is compute by calling Baking_actions.compute_round with current_proposal information if synchronize is set to true (which is the default).

run context ?canceler ?stop_on_event ?on_error ?constants chain baking_configuration consensus_keys is the entry point of the baker automaton. This function performs the following tasks:

  • perform a sanity check that check the location of the baking files, nonces, highwatermarks and state files, also verifying that the files are loadable
  • create the streams for valid blocks, new heads, and operations from the node's mempool's
  • create an initial state, see Baking_automaton.create_initial_state
  • register dal profiles by calling the register_dal_profiles node RPC