Module Evm_node_lib_dev.Services_backend_sig

module type S = sig ... end
module type Backend = sig ... end
type endpoint =
  1. | Rpc of Uri.t
  2. | Websocket of Websocket_client.t
  3. | Block_producer

Represents the different ways transactions can be injected into the system

type callback_status = [
  1. | `Accepted
  2. | `Confirmed
  3. | `Dropped
  4. | `Refused
]
type 'a variant_callback = 'a -> 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.
module type Tx_container = sig ... end

Tx_container is the signature of the module that deals with storing and forwarding transactions. the module type is used by Services.dispatch_request to request informations about pending transactions.

'f tx_container is a GADT parametrized by the same type argument as L2_types.chain_family. It is useful to statically guarantee that the launched tx-container uses types compatible with the chain's chain family.

val tx_container_module : 'f tx_container -> (module Tx_container)

Some functions of the Tx_container module, such as add, have interfaces which actually depend on the chain family but many others, such as clear don't.

In the former case, we usually know statically the type of the chain family and hence of the tx-container and we can for example invoke add as follows:

  let Evm_tx_container (module Tx_container) = tx_container in
  let** hash = Tx_container.add ~next_nonce ~raw_tx tx_obj in

In the latter case, statically knowing the type of the chain family is not required and the following tx_container_module function can be used to get a Tx_container module:

  let (module Tx_container) = Services_backend_sig.tx_container_module tx_container in
  let* () = Tx_container.clear () in
type ex_tx_container =
  1. | Ex_tx_container : _ tx_container -> ex_tx_container