Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commitment ¶
type Commitment struct { Data []byte // Data should be persisted for future initialization Proof []byte // Proof denotes the proof the data was honestly computed From int32 // From who this commitment was sent }
Commitment represents a commitment to randomness of a node
type Config ¶
type Config struct { // Nodes denotes all nodes the committee can be selected from Nodes Nodes // How many consensus rounds at minimum the committee remains MinimumLifespan int32 // FailedTotalNodesPercentage is the assumed upper bound // on the percentage of nodes that can fail out of all nodes // in the network. FailedTotalNodesPercentage int64 // InverseFailureChance is 1/p where p is the probability // to select more than a third // of failed nodes to the committee. // The higher this number is, the larger the committee. // The lower this number is, the bigger chance to select // a committee with too many failed nodes. InverseFailureChance int64 // ExcludedNodes are nodes the current committee decided // not to be included in this committee ExcludedNodes []int32 // MandatoryNodes are nodes that current committee decided // that must be in this committee MandatoryNodes []int32 // Weights denote relative multipliers for each node's chance // to be selected into a committee. Weights []Weight }
Config is the configuration of a committee
func (Config) EffectiveWeights ¶
type Feedback ¶
type Feedback struct { Commitment *Commitment // Commitment to broadcast, if applicable NextCommittee []int32 // The next committee, if applicable. It may be equal to the current committee }
Feedback denotes the action the committee selection library wants us to perform, namely to send a Commitment or ReconShares or to notify that a new committee has been selected
type Input ¶
type Input struct { // Commitments denotes commitments arriving from nodes Commitments []Commitment ReconShares []ReconShare // NextConfig is the configuration of the next committee selection if applicable NextConfig Config }
Input is what the committee selection library consumes each round
type Logger ¶
type Logger interface { Debugf(template string, args ...interface{}) Infof(template string, args ...interface{}) Errorf(template string, args ...interface{}) Warnf(template string, args ...interface{}) Panicf(template string, args ...interface{}) }
Logger defines the contract for logging.
type Node ¶
Node denotes a node in our protocol, which is identified by an identifier and a public key
type Nodes ¶
type Nodes []Node
Nodes is an aggregation of multiple nodes
type PrivateKey ¶
type PrivateKey []byte
type ReconShare ¶
type ReconShare struct {}
ReconShare represents a share for reconstructing the randomness of a node
type Selection ¶
type Selection interface { // GeneratePrivateKey generates a private key for an instance using the given randomness GenerateKeyPair(rand io.Reader) (PublicKey, PrivateKey, error) // Initialize initializes the committee selection instance with the given identifier and private key, // as well as with all the other nodes. Initialize(ID int32, PrivateKey PrivateKey, nodes Nodes) error // Process interacts with the committee selection and feeds it with events of other remote instances from Input, // and receives feedback on a committee change or requests of messages to be sent via Feedback. // The operation operates on the given state and the new state is returned. Process(State, Input) (Feedback, State, error) // VerifyCommitment should be called whenever the node receives a commitment // and before passing it to the library or persisting it VerifyCommitment(Commitment) error // and before passing it to the library or persisting it VerifyReconShare(ReconShare) error }
Selection is an interface that describes the API of the committee selection library