beacon

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Beacon

type Beacon struct {
	// contains filtered or unexported fields
}

Beacon is a consensus engine that uses the proof-of-stake algorithm.

func New

func New() *Beacon

New creates a consensus engine.

func NewFakeDelayer added in v0.2.0

func NewFakeDelayer(delay time.Duration) *Beacon

func NewFakeFailer added in v0.2.0

func NewFakeFailer(fail uint64) *Beacon

func NewFaker

func NewFaker() *Beacon

func NewFullFaker added in v0.2.0

func NewFullFaker() *Beacon

func (*Beacon) APIs

func (beacon *Beacon) APIs(chain consensus.ChainHeaderReader) []rpc.API

APIs implements consensus.Engine, returning the user facing RPC APIs.

func (*Beacon) Author

func (beacon *Beacon) Author(header *types.Header) (common.Address, error)

Author implements consensus.Engine, returning the verified author of the block.

func (*Beacon) Close

func (beacon *Beacon) Close() error

Close shutdowns the consensus engine

func (*Beacon) Finalize

func (beacon *Beacon) Finalize(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, body *types.Body)

Finalize implements consensus.Engine and processes withdrawals on top.

func (*Beacon) FinalizeAndAssemble

func (beacon *Beacon) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, body *types.Body, receipts []*types.Receipt) (*types.Block, error)

FinalizeAndAssemble implements consensus.Engine, setting the final state and assembling the block.

func (*Beacon) VerifyHeader

func (beacon *Beacon) VerifyHeader(chain consensus.ChainHeaderReader, header *types.Header) error

VerifyHeader checks whether a header conforms to the consensus rules of the stock Zond consensus engine.

func (*Beacon) VerifyHeaders

func (beacon *Beacon) VerifyHeaders(chain consensus.ChainHeaderReader, headers []*types.Header) (chan<- struct{}, <-chan error)

VerifyHeaders is similar to VerifyHeader, but verifies a batch of headers concurrently. The method returns a quit channel to abort the operations and a results channel to retrieve the async verifications. VerifyHeaders expect the headers to be ordered and continuous.

Jump to

Keyboard shortcuts

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