package tezos-shell

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Tezos Shell - Prevalidation of pending operations (a.k.a Mempool)

The prevalidator is in charge of the mempool (a.k.a. the set of known not-invalid-for-sure operations that are not yet included in the blockchain).

The prevalidator also maintains a sorted subset of the mempool that might correspond to a valid block on top of the current head. The "in-progress" context produced by the application of those operations is called the (pre)validation context.

Before including an operation into the mempool, the prevalidation worker tries to append (in application mode)/evaluate (precheck mode) the operation to/in the prevalidation context. Only an operation that passes the application/precheck will be broadcast. If the operation is ill-formed, it will not be added into the mempool and then it will be ignored by the node and will never be broadcast. If the operation is only branch_refused or branch_delayed, it may be added to the mempool if it passes the application/precheck in the future.

See the prevalidator implementation overview to learn more.

type t

An (abstract) prevalidator context. Separate prevalidator contexts should be used for separate chains (e.g., mainchain vs testchain).

val shutdown : t -> unit Lwt.t
val notify_operations : t -> Tezos_base.P2p_peer.Id.t -> Tezos_base.Mempool.t -> unit Lwt.t

Notify the prevalidator that the identified peer has sent a bunch of operations relevant to the specified context.

val inject_operation : t -> force:bool -> Tezos_base.Operation.t -> unit Tezos_base.TzPervasives.tzresult Lwt.t

inject_operation t ~force op notifies the prevalidator worker of a new injected operation. If force is set to true the operation is injected without any check. force should be used for test purpose only.

Notify the prevalidator that a new head has been selected. update is used as an optimisation to know which operations previously classified require to be prevalidated again.

Returns the list of prevalidation contexts running and their associated chain

Worker status and events

val pipeline_length : t -> int
val rpc_directory : t option Tezos_rpc.Directory.t
OCaml

Innovation. Community. Security.