Module Evm_node_lib_dev.Block_producer

type parameters = {
  1. signer : Signer.map;
  2. maximum_number_of_chunks : int;
  3. sequencer_sunset_sec : int64;
  4. preconfirmation_stream_enabled : bool;
}
type force =
  1. | True
    (*

    Force the creation of a block with the computed timestamp

    *)
  2. | False
    (*

    Create a block iff there is txs to be included

    *)
  3. | With_timestamp of Tezos_base.TzPervasives.Time.Protocol.t
    (*

    Force the creation of a block with the provided timestamp

    *)

force defines if the block producer should force the creation of a block even if there is no txs to be included.

start parameters starts the events follower.

val shutdown : unit -> unit Lwt.t

shutdown () stops the events follower.

produce_genesis ~timestamp ~parent_hash creates the first empty block with the provided timestamp and parent hash

val produce_block : force:force -> [ `Block_produced of int | `No_block ] Tezos_base.TzPervasives.tzresult Lwt.t

produce_block ~force takes the transactions in the tx pool and produces a block from it, returns the number of transaction in the block. The block is not produced if the list of transactions is empty and force is set to False.

preconfirm_transactions ~transactions validates each transaction in transactions and streams every successfully validated one to the preconfirmation pipeline. Fails with Services_backend_sig.IC_disabled if instant confirmation is not enabled.

val lock_block_production : unit -> unit Tezos_base.TzPervasives.tzresult Lwt.t

lock_block_production () locks block production. While locked, produce_block will not produce blocks and preconfirmations will be refused.

val unlock_block_production : unit -> unit Tezos_base.TzPervasives.tzresult Lwt.t

unlock_block_production () unlocks block production if it was locked by lock_block_production.

module Internal_for_tests : sig ... end