eligibility

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBeacon

func NewBeacon(patternProvider patternProvider, confidenceParam uint64, lg log.Log) *beacon

NewBeacon returns a new beacon. patternProvider provides the contextually valid blocks. confidenceParam is the number of layers that the beacon assumes for consensus view.

Types

type Oracle

type Oracle struct {
	log.Log
	// contains filtered or unexported fields
}

Oracle is the hare eligibility oracle

func New

func New(beacon valueProvider, activeSetFunc activeSetFunc, vrfVerifier verifierFunc, vrfSigner signer,
	layersPerEpoch uint16, genesisActiveSet int, goodBlocksProvider goodBlocksProvider,
	cfg eCfg.Config, log log.Log) *Oracle

New returns a new eligibility oracle instance.

func (*Oracle) Eligible

func (o *Oracle) Eligible(layer types.LayerID, round int32, committeeSize int, id types.NodeId, sig []byte) (bool, error)

Eligible checks if Id is eligible on the given Layer where msg is the VRF message, sig is the role proof and assuming commSize as the expected committee size

func (*Oracle) IsIdentityActiveOnConsensusView

func (o *Oracle) IsIdentityActiveOnConsensusView(edId string, layer types.LayerID) (bool, error)

IsIdentityActiveOnConsensusView returns true if the provided identity is active on the consensus view derived from the specified layer, false otherwise.

func (*Oracle) Proof

func (o *Oracle) Proof(layer types.LayerID, round int32) ([]byte, error)

Proof returns the role proof for the current Layer & Round

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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