leader

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const EstimatedSixMonthOfViews = 15000000 // 1 sec block time * 60 secs * 60 mins * 24 hours * 30 days * 6 months

Variables

This section is empty.

Functions

func NewSelectionForBootstrap

func NewSelectionForBootstrap() *committee.LeaderSelection

NewBootstrapLeaderSelection creates a leader selection for bootstrapping process to create genesis QC. The returned leader selection does not have any pre-generated leader selections since the bootstrapping process don't need it.

func NewSelectionForConsensus

func NewSelectionForConsensus(count int, rootHeader *flow.Header, rootQC *flow.QuorumCertificate, st protocol.State) (*committee.LeaderSelection, error)

func ReadSeed

func ReadSeed(indices []uint32, rootHeader *flow.Header, rootQC *flow.QuorumCertificate, st protocol.State) ([]byte, error)

ReadSeed returns the random seed, used by the leader selection. There are a few cases when nodes startup: 1. Protocol state has no block after sporking 2. Protocol state has only the root block. The root block has no QC. 3. Protocol state has the root block and another valid block built on top of the root block. 4. Protocol state has crossed epoch, meaning the epoch block is not the root block stored on disk. For case 1-2, we will use read random seed from the rootQC, because protocol state

doesn't have a block that has the seed.

For case 3-4, we will read the seed from both rootQC and protocol state, and do a

santity check to ensure they are identical.

Types

This section is empty.

Jump to

Keyboard shortcuts

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