Module Evm_node_lib_dev.Blueprints_follower

type sbl_callbacks_activated = {
  1. sbl_callbacks_activated : bool;
}

A new_blueprint_handler is a function that is called for every blueprint fetched from a remote EVM endpoint.

type finalized_levels_handler = l1_level:int32 -> start_l2_level:Evm_node_lib_dev_encoding.Ethereum_types.quantity -> end_l2_level:Evm_node_lib_dev_encoding.Ethereum_types.quantity -> unit Tezos_base.TzPervasives.tzresult Lwt.t

A finalized_levels_handler is a function that is called for every finalized l1-l2 levels association fetched from a remote EVM endpoint.

A next_block_info_handler is a function that is called for every next block informations (timestamp + number) fetched from a remote EVM.

A next_block_timestamp_handler is a function that is called for every transaction included in the next block fetched from a remote EVM.

A dropped_handler is a function that is called for every dropped transaction fetched from a remote EVM.

val start : multichain:bool -> time_between_blocks:Evm_node_config.Configuration.time_between_blocks -> evm_node_endpoint:Uri.t -> rpc_timeout:float -> next_blueprint_number:Evm_node_lib_dev_encoding.Ethereum_types.quantity -> instant_confirmations:bool -> on_new_blueprint:new_blueprint_handler -> on_finalized_levels:finalized_levels_handler -> on_next_block_info:next_block_info_handler -> on_inclusion:inclusion_handler -> on_dropped:dropped_handler -> unit -> 'a Tezos_base.TzPervasives.tzresult Lwt.t

start ~multichain ~time_between_blocks ~evm_node_endpoint ~rpc_timeout ~get_next_blueprint_number on_new_blueprint on_finalized_levels on_next_block_info on_inclusion on_dropped is a never-returning function that continuously streams blueprints from the given evm_node_endpoint and dispatches them to the appropriate handlers.

  • on_new_blueprint is called for each new blueprint received, in order.
  • on_finalized_levels is called when the remote EVM notifies finalized levels.
  • on_next_block_info is called whenever the remote node provides the information of a future block (instant confirmations).
  • on_inclusion is called for each transaction that is preconfirmed for inclusion in the next block (instant confirmations).
  • on_dropped is called for each transaction that did not pass the inclusion preconfirmation validation step (instant confirmations).

next_blueprint_number is the height of the current local head, while time_between_blocks is used to detect when a connection to evm_node_endpoint is stalling. multichain is used to know where to retrieve the block number.