package tezos-protocol-013-PtJakart

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

Tezos Protocol Implementation - Protocol Signature Instance

This module is the entrypoint to the protocol for shells and other embedders. This signature is an instance of the Updater.PROTOCOL signature from the Protocol Environment.

Each Protocol depends on a version of the Protocol Environment. For the currently developed protocol, this is normally the latest version. You can see the full list of versions here.

For details on how Protocol and Environment interact, see this overview.

type validation_mode =
  1. | Application of {
    1. block_header : Alpha_context.Block_header.t;
    2. fitness : Alpha_context.Fitness.t;
    3. payload_producer : Alpha_context.public_key_hash;
    4. block_producer : Alpha_context.public_key_hash;
    5. predecessor_round : Alpha_context.Round.t;
    6. predecessor_level : Alpha_context.Level.t;
    }
    (*

    Full Validation of a block. See Tezos_protocol_environment_sigs.V5.T.Updater.PROTOCOL.begin_application*

    *)
  2. | Partial_application of {
    1. block_header : Alpha_context.Block_header.t;
    2. fitness : Alpha_context.Fitness.t;
    3. payload_producer : Alpha_context.public_key_hash;
    4. block_producer : Alpha_context.public_key_hash;
    5. predecessor_level : Alpha_context.Level.t;
    6. predecessor_round : Alpha_context.Round.t;
    }
    (*

    Partial_application is use in chain bootstrapping - not all checks are done. Special case of Application to allow quick rejection of bad blocks. See Tezos_protocol_environment_sigs.V5.T.Updater.PROTOCOL.begin_partial_application

    *)
  3. | Partial_construction of {
    1. predecessor : Tezos_protocol_environment_013_PtJakart.Block_hash.t;
    2. predecessor_fitness : Tezos_protocol_environment_013_PtJakart.Fitness.t;
    3. predecessor_level : Alpha_context.Level.t;
    4. predecessor_round : Alpha_context.Round.t;
    }
    (*

    Shell/mempool-only construction of a virtual block. See Tezos_protocol_environment_sigs.V5.T.Updater.PROTOCOL.begin_construction

    *)
  4. | Full_construction of {
    1. predecessor : Tezos_protocol_environment_013_PtJakart.Block_hash.t;
    2. payload_producer : Alpha_context.public_key_hash;
    3. block_producer : Alpha_context.public_key_hash;
    4. protocol_data_contents : Alpha_context.Block_header.contents;
    5. level : Tezos_protocol_environment_013_PtJakart.Int32.t;
    6. round : Alpha_context.Round.t;
    7. predecessor_level : Alpha_context.Level.t;
    8. predecessor_round : Alpha_context.Round.t;
    }
    (*

    Baker-only block construction for baking in. See Tezos_protocol_environment_sigs.V5.T.Updater.PROTOCOL.begin_construction

    *)

validation_mode permits to differenciate !type:validation_state values.

TODO: #2536 Add some documentation for the different modes.

type validation_state = {
  1. mode : validation_mode;
  2. chain_id : Tezos_protocol_environment_013_PtJakart.Chain_id.t;
  3. ctxt : Alpha_context.t;
  4. op_count : int;
  5. migration_balance_updates : Alpha_context.Receipt.balance_updates;
  6. liquidity_baking_toggle_ema : Alpha_context.Liquidity_baking.Toggle_EMA.t;
  7. implicit_operations_results : Apply_results.packed_successful_manager_operation_result list;
}

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 Missing_manager_contract 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

precheck_manager validation_state op returns () if the manager operation op is solveable, returns an error otherwise. An operation is solveable if it is well-formed and can pay the fees to be included in a block with either a success or a failure status. This function uses Apply.precheck_manager_contents_list but discard the context and balance update

include Tezos_protocol_environment_013_PtJakart.Updater.PROTOCOL with type block_header_data = Alpha_context.Block_header.protocol_data and type block_header_metadata = Apply_results.block_metadata and type block_header = Alpha_context.Block_header.t and type operation_data := operation_data and type operation_receipt = Apply_results.packed_operation_metadata and type operation := operation and type validation_state := validation_state
val max_block_length : int
val max_operation_data_length : int
type block_header_metadata = Apply_results.block_metadata
val acceptable_passes : operation -> int list
val relative_position_within_block : operation -> operation -> int
OCaml

Innovation. Community. Security.