package tezos-protocol-012-Psithaca

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

This module supports advancing the ledger state by applying operations.

Each operation application takes and returns an Alpha_context.t, representing the old and new state, respectively.

The Main module provides wrappers for the functionality in this module, satisfying the Protocol signature.

type Tezos_protocol_environment_012_Psithaca.Error_monad.error +=
  1. | Wrong_level_for_consensus_operation of {
    1. expected : Alpha_context.Raw_level.t;
    2. provided : Alpha_context.Raw_level.t;
    }
  2. | Wrong_round_for_consensus_operation of {
    1. expected : Alpha_context.Round.t;
    2. provided : Alpha_context.Round.t;
    }
  3. | Preendorsement_round_too_high of {
    1. block_round : Alpha_context.Round.t;
    2. provided : Alpha_context.Round.t;
    }
type denunciation_kind =
  1. | Preendorsement
  2. | Endorsement
  3. | Block
type Tezos_protocol_environment_012_Psithaca.Error_monad.error +=
  1. | Gas_quota_exceeded_init_deserialize
type apply_mode =
  1. | Application of {
    1. predecessor_block : Tezos_protocol_environment_012_Psithaca.Block_hash.t;
    2. payload_hash : Block_payload_hash.t;
    3. locked_round : Alpha_context.Round.t option;
    4. predecessor_level : Alpha_context.Level.t;
    5. predecessor_round : Alpha_context.Round.t;
    6. round : Alpha_context.Round.t;
    }
  2. | Full_construction of {
    1. predecessor_block : Tezos_protocol_environment_012_Psithaca.Block_hash.t;
    2. payload_hash : Block_payload_hash.t;
    3. predecessor_level : Alpha_context.Level.t;
    4. predecessor_round : Alpha_context.Round.t;
    5. round : Alpha_context.Round.t;
    }
  3. | Partial_construction of {
    1. predecessor_level : Alpha_context.Level.t;
    2. predecessor_round : Alpha_context.Round.t;
    3. grand_parent_round : Alpha_context.Round.t;
    }
type finalize_application_mode =
  1. | Finalize_full_construction of {
    1. level : Alpha_context.Raw_level.t;
    2. predecessor_round : Alpha_context.Round.t;
    }
  2. | Finalize_application of Alpha_context.Fitness.t

precheck_manager_contents_list validation_state contents_list Returns an updated context, and a list of prechecked contents containing balance updates for fees related to each manager operation in contents_list

If mempool_mode, the function checks whether the total gas limit of this batch of operation is below the gas_limit of a block and fails with a permanent error when above. Otherwise, the gas limit of the batch is removed from the one of the block (when possible) before moving on.

val cache_layout : int list

cache_layout describes how the caches needed by the protocol. The length of the list defines the number of caches while each element of this list corresponds to the size limit of each cache.

Check if endorsements are required for a given level.

val check_minimum_endorsements : endorsing_power:int -> minimum:int -> unit Tezos_protocol_environment_012_Psithaca.Error_monad.tzresult Tezos_protocol_environment_012_Psithaca.Lwt.t

Check if a block's endorsing power is at least the minim required.

check_manager_signature validation_state op raw_operation The function starts by retrieving the public key hash pkh of the manager operation. In case the operation is batched, the function also checks that the sources are all the same. Once the pkh is retrieved, the function looks for its associated public key. For that, the manager operation is inspected to check if it contains a public key revelation. If not, the public key is searched in the context.

  • returns

    Error Invalid_signature if the signature check fails

  • returns

    Error Unrevealed_manager_key if the manager has not yet been revealed

  • returns

    Error Failure "get_manager_key" if the key is not found in the context

  • returns

    Error Inconsistent_sources if the operations in a batch are not from the same manager

OCaml

Innovation. Community. Security.