Evm_node_lib_dev.Tx_queueThe 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.
val nonce :
next_nonce:Evm_node_lib_dev_encoding.Ethereum_types.quantity ->
string ->
Evm_node_lib_dev_encoding.Ethereum_types.quantity
Tezos_base.TzPervasives.tzresult
Lwt.tnonce ~next_nonce address must returns the next gap nonce available.
val add :
?callback:Services_backend_sig.callback ->
next_nonce:Evm_node_lib_dev_encoding.Ethereum_types.quantity ->
Tx_queue_types.transaction_object_t ->
raw_tx:Evm_node_lib_dev_encoding.Ethereum_types.hex ->
(Evm_node_lib_dev_encoding.Ethereum_types.hash, string) Stdlib.result
Tezos_base.TzPervasives.tzresult
Lwt.tadd ~next_nonce tx_object raw_tx returns the next gap nonce available based on the pending transaction of the tx_queue. next_nonce is the next expected nonce found in the backend.
val find :
Evm_node_lib_dev_encoding.Ethereum_types.hash ->
Tx_queue_types.transaction_object_t option Tezos_base.TzPervasives.tzresult
Lwt.tfind hash returns the transaction_object found in tx container.
val content :
unit ->
Transaction_object.txqueue_content Tezos_base.TzPervasives.tzresult Lwt.tcontent () returns all the transactions found in tx container.
val shutdown : unit -> unit Tezos_base.TzPervasives.tzresult Lwt.tshutdown () stops the tx container, waiting for the ongoing request to be processed.
val clear : unit -> unit Tezos_base.TzPervasives.tzresult Lwt.tclear () removes the container data but keeps the allocated space
val tx_queue_tick :
evm_node_endpoint:Services_backend_sig.endpoint ->
unit Tezos_base.TzPervasives.tzresult Lwt.tTrigger a tick in the Tx_queue.
val tx_queue_beacon :
evm_node_endpoint:Services_backend_sig.endpoint ->
tick_interval:float ->
unit Tezos_base.TzPervasives.tzresult Lwt.ttx_queue_beacon ~evm_node_endpoint ~tick_interval is a never fulfilled promise which triggers a tick in the Tx_queue every tick_interval seconds.
val confirm_transactions :
clear_pending_queue_after:bool ->
confirmed_txs:
Evm_node_lib_dev_encoding.Ethereum_types.hash Tezos_base.TzPervasives.Seq.t ->
unit Tezos_base.TzPervasives.tzresult Lwt.tThe Tx_queue has a table of pending transactions. There are two ways for transactions to be removed from this table; either they are confirmed because they have been seen in a block or they are dropped.
confirm_transactions ~clear_pending_queue_after ~confirmed_txs confirms confirmed_txs hash. If clear_pending_queue_after then any other pending transactions in the tx_queue are dropped.
val dropped_transaction :
dropped_tx:Evm_node_lib_dev_encoding.Ethereum_types.hash ->
reason:string ->
unit Tezos_base.TzPervasives.tzresult Lwt.tThe Tx_queue has a table of pending transactions. There are two ways for transactions to be removed from this table; either they are confirmed because they have been seen in a block or they are dropped.
dropped_transaction ~dropped_tx drops dropped_tx hash.
val add_pending_callback :
Evm_node_lib_dev_encoding.Ethereum_types.hash ->
callback:
[ `Confirmed | `Dropped | `Missing ] Services_backend_sig.variant_callback ->
unit Tezos_base.TzPervasives.tzresult Lwt.tadd_pending_callback hash ~callback registers callback for the transaction associated with hash. If the transaction is not found, callback is called immediately with `Missing. Otherwise, callback will be called when the transaction is either confirmed or dropped.
val pop_transactions :
maximum_cumulative_size:int ->
validate_tx:
('a ->
string ->
Tx_queue_types.transaction_object_t ->
[ `Keep of 'a | `Drop of string | `Stop ]
Tezos_base.TzPervasives.tzresult
Lwt.t) ->
initial_validation_state:'a ->
(string * Tx_queue_types.transaction_object_t) list
Tezos_base.TzPervasives.tzresult
Lwt.tThe Tx_pool pops transactions until the sum of the sizes of the popped transactions reaches maximum_cumulative_size; it ignores the validate_tx and initial_validation_state arguments, The Tx_queue however ignores maximum_cumulative_size and instead uses validate_tx to pop valid transactions until either `Drop or `Stop is returned.
val size_info :
unit ->
Metrics.Tx_pool.size_info Tezos_base.TzPervasives.tzresult Lwt.tsize_info returns the size of the tx container.
val start :
config:Evm_node_config.Configuration.tx_queue ->
keep_alive:bool ->
timeout:float ->
start_injector_worker:bool ->
unit ->
unit Tezos_base.TzPervasives.tzresult Lwt.tmodule Internal_for_tests : sig ... end