package tezos-protocol-alpha

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t
type 'value slot_map
type slot_set
type slot
type round

Returns a map where each endorser's pkh is associated to the list of its endorsing slots (in decreasing order) for a given level.

Returns a map where each endorser's pkh is associated to the list of its endorsing slots (in decreasing order) for a given level.

val current_endorsement_power : t -> int

endorsement power ctx returns the endorsement power of the current block.

val initialize_consensus_operation : t -> allowed_endorsements: (Tezos_crypto.Signature.public_key * Tezos_crypto.Signature.public_key_hash * int) slot_map -> allowed_preendorsements: (Tezos_crypto.Signature.public_key * Tezos_crypto.Signature.public_key_hash * int) slot_map -> t

Initializes the map of allowed endorsements and preendorsements, this function must be called only once and before applying any consensus operation.

val record_grand_parent_endorsement : t -> Tezos_crypto.Signature.public_key_hash -> (t, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) result

record_grand_parent_endorsement ctx pkh records an grand_parent_endorsement for the current block. This is only useful for the partial construction mode.

val record_endorsement : t -> initial_slot:slot -> power:int -> (t, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) result

record_endorsement ctx ~initial_slot ~power records an endorsement for the current block.

The endorsement should be valid in the sense that Int_map.find_opt initial_slot allowed_endorsement ctx = Some (pkh, power).

val record_preendorsement : t -> initial_slot:slot -> power:int -> round -> (t, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) result

record_preendorsement ctx ~initial_slot ~power round payload_hash power records a preendorsement for a proposal at round with payload payload_hash.

The preendorsement should be valid in the sense that Int_map.find_opt initial_slot allowed_preendorsement ctx = Some (pkh, power).

val endorsements_seen : t -> slot_set
val get_preendorsements_quorum_round : t -> round option

get_preendorsements_quorum_round ctx returns None if no preendorsement are included in the current block. Otherwise, return Some r where r is the round of the preendorsements included in the block.

val set_preendorsements_quorum_round : t -> round -> t

set_preendorsements_quorum_round ctx round sets the round for preendorsements included in this block. This function should be called only once.

This function is only used in Full_construction mode.

val locked_round_evidence : t -> (round * int) option

locked_round_evidence ctx returns the round of the recorded preendorsements as well as their power.

val set_endorsement_branch : t -> (Tezos_crypto.Block_hash.t * Block_payload_hash.t) -> t
val endorsement_branch : t -> (Tezos_crypto.Block_hash.t * Block_payload_hash.t) option
val set_grand_parent_branch : t -> (Tezos_crypto.Block_hash.t * Block_payload_hash.t) -> t
val grand_parent_branch : t -> (Tezos_crypto.Block_hash.t * Block_payload_hash.t) option