beacon

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2021 License: Apache-2.0, MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeaconEntriesForBlock

func BeaconEntriesForBlock(ctx context.Context, bSchedule Schedule, epoch abi.ChainEpoch, parentEpoch abi.ChainEpoch, prev types.BeaconEntry) ([]types.BeaconEntry, error)

func ValidateBlockValues

func ValidateBlockValues(bSchedule Schedule, h *types.BlockHeader, parentEpoch abi.ChainEpoch,
	prevEntry types.BeaconEntry) error

Types

type BeaconPoint

type BeaconPoint struct {
	Start  abi.ChainEpoch
	Beacon RandomBeacon
}

type RandomBeacon

type RandomBeacon interface {
	Entry(context.Context, uint64) <-chan Response
	VerifyEntry(types.BeaconEntry, types.BeaconEntry) error
	MaxBeaconRoundForEpoch(abi.ChainEpoch) uint64
}

RandomBeacon represents a system that provides randomness to Epik. Other components interrogate the RandomBeacon to acquire randomness that's valid for a specific chain epoch. Also to verify beacon entries that have been posted on chain.

func NewMockBeacon

func NewMockBeacon(interval time.Duration) RandomBeacon

type Response

type Response struct {
	Entry types.BeaconEntry
	Err   error
}

type Schedule

type Schedule []BeaconPoint

func (Schedule) BeaconForEpoch

func (bs Schedule) BeaconForEpoch(e abi.ChainEpoch) RandomBeacon

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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