package octez-protocol-011-PtHangz2-libs

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type transfer_strategy =
  1. | Fixed_amount of {
    1. mutez : Tezos_protocol_011_PtHangz2.Protocol.Alpha_context.Tez.t;
    }
    (*

    Amount to transfer

    *)
  2. | Evaporation of {
    1. fraction : float;
    }
    (*

    Maximum fraction of current wealth to transfer. Minimum amount is 1 mutez regardless of total wealth.

    *)
type limit =
  1. | Abs of int
    (*

    Absolute level at which we should stop

    *)
  2. | Rel of int
    (*

    Relative number of level before stopping

    *)
type parameters = {
  1. seed : int;
  2. fresh_probability : float;
    (*

    Per-transfer probability that the destination will be fresh

    *)
  3. tps : float;
    (*

    Transaction per seconds target

    *)
  4. strategy : transfer_strategy;
  5. fee_mutez : Tezos_protocol_011_PtHangz2.Protocol.Alpha_context.Tez.t;
    (*

    fees for each transfer, in mutez

    *)
  6. gas_limit : Tezos_protocol_011_PtHangz2.Protocol.Alpha_context.Gas.Arith.integral;
    (*

    gas limit per operation

    *)
  7. storage_limit : Z.t;
    (*

    storage limit per operation

    *)
  8. account_creation_storage : Z.t;
    (*

    upper bound on bytes consumed when creating a tz1 account

    *)
  9. total_transfers : int option;
    (*

    total number of transfers to perform; unbounded if None

    *)
  10. single_op_per_pkh_per_block : bool;
    (*

    if true, a single operation will be injected by pkh by block to improve the chance for the injected operations to be included in the next block

    *)
  11. level_limit : limit option;
    (*

    total number of levels during which the stresstest is run; unbounded if None

    *)
}
type origin =
  1. | Explicit
  2. | Wallet_pkh
  3. | Wallet_alias of string
type input_source =
  1. | Explicit of source
  2. | Wallet_alias of string
  3. | Wallet_pkh of Tezos_protocol_011_PtHangz2.Protocol.Alpha_context.public_key_hash
type source_origin = {
  1. source : source;
  2. origin : origin;
}
type state = {
  1. current_head_on_start : Tezos_base.TzPervasives.Block_hash.t;
  2. counters : (Tezos_base.TzPervasives.Block_hash.t * Z.t) Tezos_crypto.Signature.V0.Public_key_hash.Table.t;
  3. mutable pool : source_origin list;
  4. mutable pool_size : int;
    (*

    Some l if single_op_per_pkh_per_block is true

    *)
  5. mutable shuffled_pool : source list option;
  6. mutable revealed : Tezos_crypto.Signature.V0.Public_key_hash.Set.t;
  7. mutable last_block : Tezos_base.TzPervasives.Block_hash.t;
  8. mutable last_level : int;
  9. new_block_condition : unit Lwt_condition.t;
  10. injected_operations : Tezos_base.TzPervasives.Operation_hash.t list Tezos_base.TzPervasives.Block_hash.Table.t;
}
val verbose : bool Stdlib.ref
val debug : bool Stdlib.ref
val debug_msg : (unit -> unit Lwt.t) -> unit Lwt.t
val default_parameters : parameters
val input_source_list_encoding : input_source list Tezos_base.TzPervasives.Data_encoding.encoding
val parse_strategy : string -> (transfer_strategy, string) Stdlib.result

This command uses two different data structures for sources:

  • The in-output files one,
  • The normalized one.

The data structure used for in-output files does not directly contain the data required to forge operations. For efficiency purposes, the sources are converted into a normalized data structure that contains all the required data to forge operations and the format originally used to be able to revert this conversion.

val normalize_source : Tezos_client_base.Client_context.io_wallet -> input_source -> source_origin option Lwt.t

normalize_source cctxt src converts src from in-output data structure to normalized one. If the conversion fails, None is returned and a warning message is printed in cctxt.

Only unencrypted and encrypted sources from the wallet of cctxt are supported.

val unnormalize_source : source_origin -> input_source

unnormalize_source src_org converts src_org from normalized data structure to in-output one.

val sample_any_source_from_pool : state -> Stdlib.Random.State.t -> source Lwt.t

Samples from state.pool. Used to generate the destination of a transfer, and its source only when state.shuffled_pool is None meaning that --single-op-per-pkh-per-block is not set.

val sample_source_from_pool : state -> Stdlib.Random.State.t -> Tezos_client_011_PtHangz2.Protocol_client_context.full -> source Lwt.t

Generates the source of a transfer. If state.shuffled_pool has a value (meaning that --single-op-per-pkh-per-block is active) then it is sampled from there, otherwise from state.pool.

val random_seed : Stdlib.Random.State.t -> bytes
val generate_fresh_source : state -> Stdlib.Random.State.t -> source
val sample_transfer : Tezos_client_011_PtHangz2.Protocol_client_context.full -> Tezos_shell_services.Shell_services.chain -> Tezos_shell_services.Shell_services.block -> parameters -> state -> Stdlib.Random.State.t -> (transfer, Tezos_base.TzPervasives.Error_monad.tztrace) Stdlib.result Lwt.t
val inject_transfer : Tezos_client_011_PtHangz2.Protocol_client_context.full -> parameters -> state -> Stdlib.Random.State.t -> Tezos_shell_services.Shell_services.chain -> Tezos_shell_services.Shell_services.block -> transfer -> (unit, Tezos_base.TzPervasives.Error_monad.tztrace) Stdlib.result Lwt.t
val save_injected_operations : Tezos_client_011_PtHangz2.Protocol_client_context.full -> state -> unit Lwt.t
val launch : Tezos_client_011_PtHangz2.Protocol_client_context.full -> parameters -> state -> Stdlib.Random.State.t -> (unit -> unit Lwt.t) -> unit Tezos_base.TzPervasives.tzresult Lwt.t
val group : Tezos_clic.group
type pool_source =
  1. | From_string of {
    1. json : Ezjsonm.value;
    }
  2. | From_file of {
    1. path : string;
    2. json : Ezjsonm.value;
    }
val json_of_pool_source : pool_source -> Ezjsonm.value
val single_op_per_pkh_per_block_arg : (bool, Tezos_client_011_PtHangz2.Protocol_client_context.full) Tezos_clic.arg
val set_option : 'a option -> ('b -> 'a -> 'c) -> 'd -> 'e
val commands : [< `Mainnet | `Testnet ] option -> unit -> Tezos_client_011_PtHangz2.Protocol_client_context.full Tezos_clic.command list
OCaml

Innovation. Community. Security.