package tezos-protocol-alpha

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val init : Raw_context.t -> Contract_repr.t -> Tezos_crypto.Signature.public_key_hash -> (Raw_context.t, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t

Allow to register a delegate when creating an account.

val pubkey : Raw_context.t -> Tezos_crypto.Signature.public_key_hash -> (Tezos_crypto.Signature.public_key, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t
val set : Raw_context.t -> Contract_repr.t -> Tezos_crypto.Signature.public_key_hash option -> (Raw_context.t, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t

Updating the delegate of a contract.

When calling this function on an "implicit contract" and setting the delegate to the contract manager registers it as a delegate. One cannot unregister a delegate for now. The associate contract is now 'undeletable'.

val frozen_deposits_limit : Raw_context.t -> Tezos_crypto.Signature.public_key_hash -> (Tez_repr.t option, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t
type Tezos_protocol_environment_alpha__Environment.Error_monad.error +=
  1. | No_deletion of Tezos_crypto.Signature.public_key_hash
  2. | Active_delegate
  3. | Current_delegate
  4. | Empty_delegate_account of Tezos_crypto.Signature.public_key_hash
  5. | Unregistered_delegate of Tezos_crypto.Signature.public_key_hash
  6. | Unassigned_validation_slot_for_level of Level_repr.t * int
  7. | Cannot_find_active_stake of {
    1. cycle : Cycle_repr.t;
    2. delegate : Tezos_crypto.Signature.public_key_hash;
    }
  8. | Not_registered of Tezos_crypto.Signature.public_key_hash
val check_delegate : Raw_context.t -> Tezos_crypto.Signature.public_key_hash -> (unit, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t

Check that a given implicit account is a registered delegate.

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

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

    *)
  2. minimal_cycle_activity : int;
    (*

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

    *)
  3. missed_slots : int;
    (*

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

    *)
  4. missed_levels : int;
    (*

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

    *)
  5. remaining_allowed_missed_slots : int;
    (*

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

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

    Endorsing 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
val delegate_participation_info : Raw_context.t -> Tezos_crypto.Signature.public_key_hash -> (participation_info, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t
val fold : Raw_context.t -> order:[ `Sorted | `Undefined ] -> init:'a -> f:(Tezos_crypto.Signature.public_key_hash -> 'a -> 'a Lwt.t) -> 'a Lwt.t

Iterate on all registered delegates.

List all registered delegates.

val balance : Raw_context.t -> Tezos_crypto.Signature.public_key_hash -> (Tez_repr.tez, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t
type level_participation =
  1. | Participated
  2. | Didn't_participate
val record_endorsing_participation : Raw_context.t -> delegate:Tezos_crypto.Signature.public_key_hash -> participation:level_participation -> endorsing_power:int -> (Raw_context.t, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t

Record the participation of a delegate as a validator.

val record_baking_activity_and_pay_rewards_and_fees : Raw_context.t -> payload_producer:Tezos_crypto.Signature.public_key_hash -> block_producer:Tezos_crypto.Signature.public_key_hash -> baking_reward:Tez_repr.t -> reward_bonus:Tez_repr.t option -> (Raw_context.t * Receipt_repr.balance_updates, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t

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).

val cycle_end : Raw_context.t -> Cycle_repr.t -> Storage.Seed.unrevealed_nonce list -> (Raw_context.t * Receipt_repr.balance_updates * Tezos_crypto.Signature.public_key_hash list, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t

Trigger the context maintenance at the end of cycle 'n', i.e.: unfreeze the endorsing rewards, potentially deactivate delegates. Return the corresponding balances updates and the list of deactivated delegates.

val already_slashed_for_double_baking : Raw_context.t -> Tezos_crypto.Signature.public_key_hash -> Level_repr.t -> (bool, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t

Returns true if the given delegate has already been slashed for double baking for the given level.

val already_slashed_for_double_endorsing : Raw_context.t -> Tezos_crypto.Signature.public_key_hash -> Level_repr.t -> (bool, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t

Returns true if the given delegate has already been slashed for double preendorsing or double endorsing for the given level.

val punish_double_endorsing : Raw_context.t -> Tezos_crypto.Signature.public_key_hash -> Level_repr.t -> (Raw_context.t * Tez_repr.t * Receipt_repr.balance_updates, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t

Burn some frozen deposit for a delegate at a given level. Returns the burned amount.

val punish_double_baking : Raw_context.t -> Tezos_crypto.Signature.public_key_hash -> Level_repr.t -> (Raw_context.t * Tez_repr.t * Receipt_repr.balance_updates, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t
val frozen_deposits : Raw_context.t -> Tezos_crypto.Signature.public_key_hash -> (Storage.deposits, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t

Returns a delegate's frozen deposits, both the current amount and the initial freezed amount.

A delegate's frozen balance is only composed of frozen deposits; rewards and fees are not frozen, but simply credited at the right moment.

val full_balance : Raw_context.t -> Tezos_crypto.Signature.public_key_hash -> (Tez_repr.t, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t

Returns the full 'balance' of the implicit contract associated to a given key, i.e. the sum of the spendable balance and of the frozen balance.

Only use this function for RPCs: this is expensive.

val staking_balance : Raw_context.t -> Tezos_crypto.Signature.public_key_hash -> (Tez_repr.t, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t
val delegated_balance : Raw_context.t -> Tezos_crypto.Signature.public_key_hash -> (Tez_repr.t, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t

Only use this function for RPCs: this is expensive.

val deactivated : Raw_context.t -> Tezos_crypto.Signature.public_key_hash -> (bool, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t
val slot_owner : Raw_context.t -> Level_repr.t -> Slot_repr.t -> (Raw_context.t * (Tezos_crypto.Signature.public_key * Tezos_crypto.Signature.public_key_hash), Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t

Participation slots potentially associated to accounts. The accounts that didn't place a deposit will be excluded from this list. This function should only be used to compute the deposits to freeze or initialize the protocol while stitching. RPCs can use this function to predict an approximation of long term future slot allocations. It shouldn't be used in the baker.

val baking_rights_owner : Raw_context.t -> Level_repr.t -> round:Round_repr.round -> (Raw_context.t * int * (Tezos_crypto.Signature.public_key * Tezos_crypto.Signature.public_key_hash), Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t
val freeze_deposits_do_not_call_except_for_migration : Raw_context.t -> new_cycle:Cycle_repr.t -> balance_updates:Receipt_repr.balance_updates -> (Raw_context.t * Receipt_repr.balance_updates, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t
OCaml

Innovation. Community. Security.