election

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2019 License: GPL-3.0 Imports: 5 Imported by: 2

Documentation

Overview

Package election implements dpor's election method.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Elect

func Elect(rpts rpt.RptList, seed int64, totalSeats int, lowRptCount int, lowRptSeats int) []common.Address

Elect simplifies the election method

In election, a certain number of candidates (referred as *seats*) are elected to be proposer according to their RPT value. We have two principles to design the election:

An RNode with higher RPT has higher chance to be elected; Each term of proposers has a certain number of representatives from RNodes with low RPT.

Thus, the main ideas of election process are:

Candidates are divided into two partitions, high-RPT RNodes and low-RPT RNodes; Either partition has a number of available seats; The probability mass for each node being elected is proportional to its RPT in its corresponding partition.

rpts: the reputation list of RNodes seed: a seed to generate a series of random numbers to select RNodes totalSeats: total seats of the election result lowRptCount: the number of low Rpt RNodes among the total RNodes lowRptSeats: the number of seats for low Rpt RNodes in the Proposer Committee

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL