package tezos-shell

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

Module Tezos_shell.PrevalidatorSource

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.

Sourcetype t

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

Sourceval shutdown : t -> unit Lwt.t
Sourceval 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.

Sourceval 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.

Sourceval flush : t -> Tezos_shell_services.Chain_validator_worker_state.update -> Tezos_base.TzPervasives.Block_hash.t -> Tezos_base.TzPervasives.Block_hash.Set.t -> Tezos_base.TzPervasives.Operation_hash.Set.t -> unit Tezos_base.TzPervasives.tzresult Lwt.t

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.

Sourceval running_workers : unit -> (Tezos_base.TzPervasives.Chain_id.t * Tezos_base.TzPervasives.Protocol_hash.t * t) list

Returns the list of prevalidation contexts running and their associated chain

Worker status and events

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

Innovation. Community. Security.