Module Pos.Make

Parameters

Signature

val sortition : 'a Simulator.Block.t -> int -> int list -> int list

Perform stake-based sortition, returning a list with the ids of the selected nodes.

  • parameter block

    the block whose balances will be used by sortition

  • parameter num_selections

    the number of nodes sortition will select

  • parameter params

    a list of integers that identify the selection (seed for the RNG-based abstraction)

val in_committee : int -> 'a Simulator.Block.t -> int -> int list -> credential option

Check if a given node was selected by sortition to be part of the committee.

  • parameter node_id

    the id of the node

  • parameter block

    the block whose balances will be used by sortition

  • parameter committee_size

    the size of the committee

  • parameter params

    a list of integers that identify the selection (seed for the RNG-based abstraction)

val is_proposer : int -> 'a Simulator.Block.t -> int -> int list -> credential option

Check if a given node was selected by sortition to be part of the committee.

  • parameter node_id

    the id of the node

  • parameter block

    the block whose balances will be used by sortition

  • parameter proposer_count

    the number of different proposers

  • parameter params

    a list of integers that identify the selection (seed for the RNG-based abstraction)

val valid_proposer : int -> 'a Simulator.Block.t -> int -> int list -> credential -> bool

Check if the given credentials belong to a valid proposer.

  • parameter node_id

    the id of the node

  • parameter block

    the block whose balances will be used by sortition

  • parameter proposer_count

    the number of different proposers

  • parameter params

    a list of integers that identify the selection (seed for the RNG-based abstraction)

  • parameter credential

    the node's credentials

val valid_committee_member : int -> 'a Simulator.Block.t -> int -> int list -> credential -> bool

Check if the given credentials belong to a valid committee member.

  • parameter node_id

    the id of the node

  • parameter block

    the block whose balances will be used by sortition

  • parameter committee_size

    the size of the committee

  • parameter params

    a list of integers that identify the selection (seed for the RNG-based abstraction)

  • parameter credential

    the node's credentials

val proposer_priority : int -> 'a Simulator.Block.t -> int -> int list -> credential -> int

Obtain the priority associated with a node that was selected to propose a block.

  • parameter node_id

    the id of the node

  • parameter block

    the block whose balances will be used by sortition

  • parameter proposer_count

    the number of different proposers

  • parameter params

    a list of integers that identify the selection (seed for the RNG-based abstraction)

  • parameter credential

    the node's credentials