package octez-protocol-alpha-libs

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type consensus_key = {
  1. alias : string option;
  2. public_key : Tezos_base.TzPervasives.Signature.public_key;
  3. public_key_hash : Tezos_base.TzPervasives.Signature.public_key_hash;
  4. secret_key_uri : Tezos_client_base.Client_keys.sk_uri;
}
val pp_consensus_key : Format.formatter -> consensus_key -> unit
val pp_consensus_key_and_delegate : Format.formatter -> consensus_key_and_delegate -> unit
type validation_mode =
  1. | Node
  2. | Local of Abstract_context_index.t

The validation mode specifies whether the baker (filters and) validates mempool operations via an RPC to the node, or if it does so "locally", by using the context.

type block_to_bake = {
  1. predecessor : block_info;
  2. round : Tezos_protocol_alpha.Protocol.Alpha_context.Round.t;
  3. delegate : consensus_key_and_delegate;
  4. kind : block_kind;
  5. force_apply : bool;
    (*

    if true, while baking the block, try and apply the block and its operations instead of only validating them. this can be permanently set using the --force-apply flag (see force_apply_switch_arg in baking_commands.ml).

    *)
}
type delegate_slot = {
  1. consensus_key_and_delegate : consensus_key_and_delegate;
  2. first_slot : Tezos_protocol_alpha.Protocol.Alpha_context.Slot.t;
  3. attesting_power : int;
}

A delegate slot consists of the delegate's consensus key, its public key hash, its first slot, and its attesting power at some level.

module Delegate_slots : sig ... end
type delegate_slots = Delegate_slots.t
type proposal = {
  1. block : block_info;
  2. predecessor : block_info;
}
val is_first_block_in_protocol : proposal -> bool

Identify the first block of the protocol, ie. the block that activates the current protocol.

This block should be baked by the baker of the previous protocol (that's why this same block is also referred to as the last block of the previous protocol). It is always considered final and therefore is not attested.

type attestable_payload = {
  1. proposal : proposal;
  2. prequorum : prequorum;
}
type consensus_vote_kind =
  1. | Attestation
  2. | Preattestation
val pp_consensus_vote_kind : Format.formatter -> consensus_vote_kind -> unit
type signed_consensus_vote = {
  1. unsigned_consensus_vote : unsigned_consensus_vote;
  2. signed_operation : Tezos_protocol_alpha.Protocol.Alpha_context.packed_operation;
}
type unsigned_consensus_vote_batch = private {
  1. batch_kind : consensus_vote_kind;
  2. batch_content : batch_content;
  3. batch_branch : Tezos_base.TzPervasives.Block_hash.t;
  4. unsigned_consensus_votes : unsigned_consensus_vote list;
}
type signed_consensus_vote_batch = private {
  1. batch_kind : consensus_vote_kind;
  2. batch_content : batch_content;
  3. batch_branch : Tezos_base.TzPervasives.Block_hash.t;
  4. signed_consensus_votes : signed_consensus_vote list;
}
type Tezos_base.TzPervasives.error +=
  1. | Mismatch_signed_consensus_vote_in_batch
val make_singleton_consensus_vote_batch : signed_consensus_vote -> signed_consensus_vote_batch
type level_state = {
  1. current_level : int32;
  2. latest_proposal : proposal;
  3. is_latest_proposal_applied : bool;
  4. locked_round : locked_round option;
  5. attestable_payload : attestable_payload option;
  6. elected_block : elected_block option;
  7. delegate_slots : delegate_slots;
  8. next_level_delegate_slots : delegate_slots;
  9. next_level_proposed_round : Tezos_protocol_alpha.Protocol.Alpha_context.Round.t option;
}
type phase =
  1. | Idle
  2. | Awaiting_preattestations
  3. | Awaiting_attestations
  4. | Awaiting_application
type round_state = {
  1. current_round : Tezos_protocol_alpha.Protocol.Alpha_context.Round.t;
  2. current_phase : phase;
  3. delayed_quorum : Tezos_protocol_alpha.Protocol.Alpha_context.Kind.attestation Tezos_protocol_alpha.Protocol.Alpha_context.operation list option;
  4. early_attestations : signed_consensus_vote list;
  5. awaiting_unlocking_pqc : bool;
}
type forge_event =
  1. | Block_ready of prepared_block
  2. | Preattestation_ready of signed_consensus_vote
  3. | Attestation_ready of signed_consensus_vote

forge_event type used to return the result of a task completion in the forge worker.

type forge_request =
  1. | Forge_and_sign_block of block_to_bake
  2. | Forge_and_sign_preattestations of {
    1. unsigned_preattestations : unsigned_consensus_vote_batch;
    }
  3. | Forge_and_sign_attestations of {
    1. unsigned_attestations : unsigned_consensus_vote_batch;
    }

forge_request type used to push a concurrent forging task in the forge worker.

type forge_worker_hooks = {
  1. push_request : forge_request -> unit;
  2. get_forge_event_stream : unit -> forge_event Lwt_stream.t;
  3. cancel_all_pending_tasks : unit -> unit;
}

forge_worker_hooks type that allows interactions with the forge worker. Hooks are needed in order to break a circular dependency.

type state = {
  1. global_state : global_state;
  2. level_state : level_state;
  3. round_state : round_state;
}
type t = state
val update_current_phase : t -> phase -> t
val round_proposer : state -> level:[ `Current | `Next ] -> Tezos_protocol_alpha.Protocol.Alpha_context.Round.t -> delegate_slot option

Returns, among our *own* delegates, the delegate (and its attesting slot) that has a proposer slot at the given round and the current or next level, if any.

type timeout_kind =
  1. | End_of_round of {
    1. ending_round : Tezos_protocol_alpha.Protocol.Alpha_context.Round.t;
    }
  2. | Time_to_prepare_next_level_block of {
    1. at_round : Tezos_protocol_alpha.Protocol.Alpha_context.Round.t;
    }
type state_data = {
  1. level_data : int32;
  2. locked_round_data : locked_round option;
  3. attestable_payload_data : attestable_payload option;
}
val record_state : t -> unit Tezos_base.TzPervasives.tzresult Lwt.t
val may_record_new_state : previous_state:t -> new_state:t -> unit Tezos_base.TzPervasives.tzresult Lwt.t
val may_load_attestable_data : t -> t Tezos_base.TzPervasives.tzresult Lwt.t
val create_cache : unit -> cache

From the current state, the function returns an optional association pair, which consists of the next round timestamp and its round.

val pp_validation_mode : Format.formatter -> validation_mode -> unit
val pp_global_state : Format.formatter -> global_state -> unit
val pp_option : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a option -> unit
val pp_block_info : Format.formatter -> block_info -> unit
val pp_proposal : Format.formatter -> proposal -> unit
val pp_locked_round : Format.formatter -> locked_round -> unit
val pp_attestable_payload : Format.formatter -> attestable_payload -> unit
val pp_elected_block : Format.formatter -> elected_block -> unit
val pp_delegate_slot : Format.formatter -> delegate_slot -> unit
val pp_delegate_slots : Format.formatter -> delegate_slots -> unit
val pp_prepared_block : Format.formatter -> prepared_block -> unit
val pp_level_state : Format.formatter -> level_state -> unit
val pp_phase : Format.formatter -> phase -> unit
val pp_round_state : Format.formatter -> round_state -> unit
val pp : Format.formatter -> t -> unit
val pp_timeout_kind : Format.formatter -> timeout_kind -> unit
val pp_event : Format.formatter -> event -> unit
val pp_forge_event : Format.formatter -> forge_event -> unit
OCaml

Innovation. Community. Security.