package tezos-protocol-alpha

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

This modules deals with delegates' participation in consensus.

This module is responsible for maintaining the Storage.Contract.Missed_attestations table.

val expected_slots_for_given_active_stake : Raw_context.t -> total_active_stake_weight:int64 -> active_stake_weight:int64 -> int
type level_participation =
  1. | Participated
  2. | Didn't_participate

Record the participation of a delegate as a validator.

Sets the payload and block producer as active. Pays the baking reward and the fees to the payload producer and the reward bonus to the payload producer (if the reward_bonus is not None).

Check that a delegate participated enough in the last cycle (returns true if it did), and then reset the participation for preparing the next cycle.

type participation_info = {
  1. expected_cycle_activity : int;
    (*

    The total expected slots to be attested in the cycle. (static)

    *)
  2. minimal_cycle_activity : int;
    (*

    The minimal attesting slots in the cycle to get attesting rewards. (static)

    *)
  3. missed_slots : int;
    (*

    The number of missed attesting slots in the cycle. (dynamic)

    *)
  4. missed_levels : int;
    (*

    The number of missed attesting levels in the cycle. (dynamic)

    *)
  5. remaining_allowed_missed_slots : int;
    (*

    Remaining amount of attesting slots that can be missed in the cycle before forfeiting the rewards. (dynamic)

    *)
  6. expected_attesting_rewards : Tez_repr.t;
    (*

    Attesting rewards that will be distributed at the end of the cycle if activity at that point will be greater than the minimal required. If the activity is already known to be below the required minimum, then the rewards are zero. (dynamic)

    *)
}

Participation information. We denote by:

  • "static" information that does not change during the cycle
  • "dynamic" information that may change during the cycle

Only use this function for RPC: this is expensive.

delegate_participation_info and !val:check_delegate forms the implementation of RPC call "/context/delegates/<pkh>/participation".

OCaml

Innovation. Community. Security.