Module No_plugin.Plugin

type config
val default_config : config
type info = unit

Static internal information needed by pre_filter.

It depends on the head block upon which a mempool is built.

Create an info based on the head block.

Should be called only once when a new prevalidator is started for a new protocol. Subsequent infos should be created using flush.

Create a new info based on the head block.

Parts of the old info (which may have been built on a different block) are recycled, so that this function is more efficient than init and does not need a Tezos_protocol_environment.Context.t argument.

val syntactic_check : operation -> [ `Well_formed | `Ill_formed ] Lwt.t

Perform some syntactic checks on the operation.

To be used mostly as an exceptional mechanism to prevent ill-formed operations to block block application.

Note that the functions exposed in the output of proto_with_validation_plugin already call syntactic_check when appropriate.

val equal_modulo_dummy_values : block_header_data -> block_header_data -> bool

equal_modulo_dummy_values data1 data2 compares the protocol data1 and data2 disregarding the fields that may have been initialized with a dummy value, namely the signature, the payload_hash and the proof_of_work nonce.

This function is used to check if a context resulting from a preapplied block can be used as the final context when applying an "equal" block.

This equality check is done across multiple fields but will fail if checking that all fields are equal. This is due to the fact that to preapply a block, some values are not yet known and need to be replaced with dummy values. When comparing a preapplied block with a block to apply, the values in the block to apply will have been set to a proper value, leading to an inequality if compared with the dummy ones.

It must be noted that the preapply optimization holds as long as the dummy values have no incidence in the resulting context. This equality check may return true for a block that should not be considered as already preapplied but, in this case, this function is not to blame, the preapply invariant has been broken and needs to be fixed (i.e. make sure that the dummy values have no influence over the resulting context hash)

val pre_filter : info -> config -> operation -> [ `Passed_prefilter of [ `High | `Medium | `Low of Q.t list ] | `Branch_delayed of Tezos_base.TzPervasives.tztrace | `Branch_refused of Tezos_base.TzPervasives.tztrace | `Refused of Tezos_base.TzPervasives.tztrace | `Outdated of Tezos_base.TzPervasives.tztrace ]

Perform some light preliminary checks on the operation.

If successful, return `Passed_prefilter with the priority of the operation, based on the operation kind and potentially its fee, gas, and size. If not, return a classification containing the encountered error.

Should be called on arrival of an operation and after a flush of the prevalidator.

val conflict_handler : config -> Mempool.conflict_handler

Return a conflict handler for Mempool.add_operation.

See the documentation of type Mempool.conflict_handler in e.g. lib_protocol_environment/sigs/v8/updater.mli.

Precondition: both operations must be individually valid (required by the protocol's operation comparison on which the implementation of this function relies).

module Conflict_map : sig ... end

The purpose of this module is to provide the fee_needed_to_replace_by_fee function. For this function to be correct, the caller must maintain the state of type t by calling update on each successfully validated operation and its induced replacements.

val fee_needed_to_overtake : op_to_overtake:operation -> candidate_op:operation -> int64 option

Compute the minimal fee (expressed in mutez) that candidate_op would need to have in order to be strictly greater than op_to_overtake according to compare_operations.

Return None when at least one operation is not a manager operation.

Also return None if both operations are manager operations but there was an error while computing the needed fee. However, note that this cannot happen when both manager operations have been successfully validated by the protocol.

type ctxt

Protocol context

Return the protocol context

type block_validation_state

Fast, plugin-managed state threaded through block validation.

This state is maintained purely on the shell side while iterating over the operations of a received block.

val init_block_validation_state : validation_state -> block_validation_state

Perform fast contextual checks on an operation before validate_operation during block validation.

The returned state is threaded to the next operation in the block.

val sources_from_operation : ctxt -> operation -> Tezos_crypto.Signature.public_key_hash list Lwt.t

Return the sources from the operation