Module Evm_node_lib_dev.Tx_queue

The Tx_queue is a worker allowing to batch raw transactions in a single eth_sendRawTransaction at a regular interval. It provides a non-blocking interface based on the use of callbacks.

type callback = [ `Accepted | `Confirmed | `Dropped | `Refused ] -> unit Lwt.t

A callback is called by the Tx_queue at various stages of a submitted transaction's life.

The next tick after its insertion in the queue, a transaction is submitted to the relay node within a batch of eth_sendRawTransaction requests.

  • Depending on the result of the RPC, its callback is called with either `Accepted or `Refused).
  • As soon as the transaction appears in a blueprint, its callback is called with `Confirmed. If this does not happen before 2s, the callback is called with `Dropped.

tx_container ~chain_family is a pair (start, container) where start ~config ~max_transaction_batch_length () starts the worker, meaning it is possible to call inject, confirm and beacon and container is a wrapper of the Tx_queue to be compatible with the Tx_container signature for the services.

/

module Internal_for_tests : sig ... end