package octez-protocol-017-PtNairob-libs

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

Module type Mockup_simulator.HooksSource

The way to control behavior of a mockup node.

val on_inject_block : level:int32 -> round:int32 -> block_hash:Tezos_base.TzPervasives.Block_hash.t -> block_header:Tezos_base.TzPervasives.Block_header.t -> operations:Tezos_base.TzPervasives.Operation.t list list -> protocol_data: Tezos_protocol_017_PtNairob.Protocol.Alpha_context.Block_header.protocol_data -> (Tezos_base.TzPervasives.Block_hash.t * Tezos_base.TzPervasives.Block_header.t * Tezos_base.TzPervasives.Operation.t list list * propagation_vector) Tezos_base.TzPervasives.tzresult Lwt.t

This function is called on injection of a block by a particular baker. It allows us to inspect, change, or discard the block. Calling the injection RPC and actually updating the state of the mockup node are two different operations. Normally the first entails the latter, but not always. In particular, the propagation_vector controls what bakers will see and incorporate the block.

val on_inject_operation : op_hash:Tezos_base.TzPervasives.Operation_hash.t -> op:Tezos_protocol_017_PtNairob.Protocol.Alpha_context.packed_operation -> (Tezos_base.TzPervasives.Operation_hash.t * Tezos_protocol_017_PtNairob.Protocol.Alpha_context.packed_operation * propagation_vector) Tezos_base.TzPervasives.tzresult Lwt.t

This function is called on injection of an operation. It is similar to on_inject_block, which see.

val on_new_validated_block : block_hash:Tezos_base.TzPervasives.Block_hash.t -> block_header:Tezos_base.TzPervasives.Block_header.t -> operations:Tezos_base.TzPervasives.Operation.t list list -> (Tezos_base.TzPervasives.Block_hash.t * Tezos_base.TzPervasives.Block_header.t * Tezos_base.TzPervasives.Operation.t list list) option Lwt.t

This is called when a new validated block is going to be sent as the response to a "monitor validated blocks" RPC call. Returning None here terminates the process for the baker.

val on_new_head : block_hash:Tezos_base.TzPervasives.Block_hash.t -> block_header:Tezos_base.TzPervasives.Block_header.t -> (Tezos_base.TzPervasives.Block_hash.t * Tezos_base.TzPervasives.Block_header.t) option Lwt.t

This is called when a new head is going to be sent as the response to a "monitor heads" RPC call. Returning None here terminates the process for the baker.

val on_new_operation : (Tezos_base.TzPervasives.Operation_hash.t * Tezos_protocol_017_PtNairob.Protocol.Alpha_context.packed_operation) -> (Tezos_base.TzPervasives.Operation_hash.t * Tezos_protocol_017_PtNairob.Protocol.Alpha_context.packed_operation) option Lwt.t

This is called when a new operation is going to be sent as the response to a "monitor operations" RPC call. Returning None here indicates that the node has advanced to the next level.

val check_block_before_processing : level:int32 -> round:int32 -> block_hash:Tezos_base.TzPervasives.Block_hash.t -> block_header:Tezos_base.TzPervasives.Block_header.t -> protocol_data: Tezos_protocol_017_PtNairob.Protocol.Alpha_context.Block_header.protocol_data -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Check a block before processing it in the mockup.

val check_chain_after_processing : level:int32 -> round:int32 -> chain:chain -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Check the chain after processing a proposal.

val check_mempool_after_processing : mempool: (Tezos_base.TzPervasives.Operation_hash.t * Tezos_client_017_PtNairob.Mockup.M.Protocol.operation) list -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Check operations in the mempool after injecting an operation.

This hook is used to decide when the baker is supposed to shut down. It is triggered by receiving an event.

val on_start_baker : baker_position:int -> delegates:Tezos_baking_017_PtNairob.Baking_state.consensus_key list -> cctxt:Tezos_client_017_PtNairob.Protocol_client_context.full -> unit Lwt.t

This hook is used to gather information on the baker when it is started (usually recording for later use). The first argument baker_position, is the position of the baker in the list of bakers that were started for this run.

val check_chain_on_success : chain:chain -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Check to run on the chain upon successful termination.

OCaml

Innovation. Community. Security.