pokt-network / pocket

Official implementation of the Pocket Network Protocol v1
https://pokt.network
MIT License
63 stars 33 forks source link

[Consensus] Leader Election - Productionize the sortition algorithm #324

Open jessicadaugherty opened 2 years ago

jessicadaugherty commented 2 years ago

Objective

Implement random leader election proportional to the Validator's total stake that is not susceptible to grinding attacks, while also productionizing the leader election process.

Origin Document

The algorithm for HotPOKT leader election algorithm can be found in the consensus specification. It is based on Section 5.1 in the Algorand whitepaper.

The leader election package in this repository implements most of the core business logic as a separate library to enable this.

The current leader election algorithm uses round robin defined in consensus/helpers.go:

func (m *consensusModule) electNextLeader(message *typesCons.HotstuffMessage) error {
    leaderId, err := m.leaderElectionMod.ElectNextLeader(message)
    if err != nil || leaderId == 0 {
    // ...
}

Goals

Deliverable

Non-goals / Non-deliverables

General issue deliverables

Testing Methodology


Creator: @jessicadaugherty Co-Owners: @Olshansk

jessicadaugherty commented 2 years ago

@Olshansk define ty

jessicadaugherty commented 1 year ago

@gokutheengineer updated AC for review. Ty!