package octez-protocol-019-PtParisB-libs

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

The type of desired delegate selection. For each level, and each round, one can provide a public key hash that would be the proposer. All non- specified level and rounds are not constrained.

val bruteforce : ?show_progress:bool -> ?random_seed:int -> ?max:int -> ?parameters:Tezos_client_019_PtParisB.Mockup.Protocol_parameters.t -> ?constants_overrides_json:Data_encoding.json -> ?bootstrap_accounts_json:Data_encoding.json -> delegate_selection -> Tezos_protocol_019_PtParisB.Protocol.State_hash.t option Tezos_base.TzPervasives.tzresult Lwt.t

Brute-force an initial seed nonce for the desired delegate selection. When found, the seed nonce is returned as a byte sequence of size 32. If no nonce is necessary to obtain the desired selection, None is returned (there won't be any brute-forcing then).

Note: When using this function in your tests, take care of saving the nonce once it is found locallty (in this case call check_seed_nonce to ensure it yields the desired selection) to avoid unnecessary computation (in particular this function should not be called in the CI).

  • parameter show_progress

    if true, display a spinner and the number of iterations on the output (stderr) while brutefore is running.

  • parameter random_seed

    initialize OCaml's random number generator with this seed (by default 0). This is useful to spawn multiple bruteforce in parallel or on multiple machines.

  • parameter constants_overrides_json

    JSON representation of some constants that are to be overwritten for the in-memory context. The most useful change is to set the size of cycles (which directly impacts the attribution of rights) or the committee size with e.g.

    { "blocks_per_cycle" : 8, "consensus_committee_size" : 25 } 
  • parameter bootstrap_accounts_json

    JSON representation of bootstrap accounts of the form:

    [ { "name" : "bootstrap1"
        "sk_uri": "unencrypted:edsk3gUfUPyBSfrS9CCgmCiQsTCHGkviBDusMxDJstFtojtc1zcpsh",
        "amount": "3000000000000" },
      ...]
  • parameter parameters

    parameters of the protocol (optional).

Check that an initial seed nonce yields to the desired delegate selection. See bruteforce for the arguments.

OCaml

Innovation. Community. Security.