qbftengine

package
v0.0.0-...-1d3cd56 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyHeaderQBFTExtra

func ApplyHeaderQBFTExtra(header *types.Header, applies ...ApplyQBFTExtra) error

func PrepareCommittedSeal

func PrepareCommittedSeal(header *types.Header, round uint32) []byte

PrepareCommittedSeal returns a committed seal for the given hash

Types

type ApplyQBFTExtra

type ApplyQBFTExtra func(*types.QBFTExtra) error

func Combine

func Combine(applies ...ApplyQBFTExtra) ApplyQBFTExtra

func WriteValidators

func WriteValidators(validators []common.Address) ApplyQBFTExtra

func WriteVote

func WriteVote(candidate common.Address, authorize bool) ApplyQBFTExtra

type Engine

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

func NewEngine

func NewEngine(cfg *istanbul.Config, signer common.Address, sign SignerFn) *Engine

func (*Engine) Address

func (e *Engine) Address() common.Address

func (*Engine) Author

func (e *Engine) Author(header *types.Header) (common.Address, error)

func (*Engine) CalcDifficulty

func (e *Engine) CalcDifficulty(chain consensus.ChainHeaderReader, time uint64, parent *types.Header) *big.Int

func (*Engine) CommitHeader

func (e *Engine) CommitHeader(header *types.Header, seals [][]byte, round *big.Int) error

func (*Engine) ExtractGenesisValidators

func (e *Engine) ExtractGenesisValidators(header *types.Header) ([]common.Address, error)

func (*Engine) Finalize

func (e *Engine) Finalize(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header)

Finalize runs any post-transaction state modifications (e.g. block rewards) and assembles the final block.

Note, the block header and state database might be updated to reflect any consensus rules that happen at finalization (e.g. block rewards).

func (*Engine) FinalizeAndAssemble

func (e *Engine) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error)

FinalizeAndAssemble implements consensus.Engine, ensuring no uncles are set, nor block rewards given, and returns the final block.

func (*Engine) Prepare

func (e *Engine) Prepare(chain consensus.ChainHeaderReader, header *types.Header, validators istanbul.ValidatorSet) error

func (*Engine) ReadVote

func (e *Engine) ReadVote(header *types.Header) (candidate common.Address, authorize bool, err error)

func (*Engine) Seal

func (e *Engine) Seal(chain consensus.ChainHeaderReader, block *types.Block, validators istanbul.ValidatorSet) (*types.Block, error)

Seal generates a new block for the given input block with the local miner's seal place on top.

func (*Engine) SealHash

func (e *Engine) SealHash(header *types.Header) common.Hash

func (*Engine) Signers

func (e *Engine) Signers(header *types.Header) ([]common.Address, error)

func (*Engine) VerifyBlockProposal

func (e *Engine) VerifyBlockProposal(chain consensus.ChainHeaderReader, block *types.Block, validators istanbul.ValidatorSet) (time.Duration, error)

func (*Engine) VerifyHeader

func (e *Engine) VerifyHeader(chain consensus.ChainHeaderReader, header *types.Header, parents []*types.Header, validators istanbul.ValidatorSet) error

func (*Engine) VerifyHeaders

func (e *Engine) VerifyHeaders(chain consensus.ChainHeaderReader, headers []*types.Header, seals []bool, validators istanbul.ValidatorSet) (chan<- struct{}, <-chan error)

func (*Engine) VerifySeal

func (e *Engine) VerifySeal(chain consensus.ChainHeaderReader, header *types.Header, validators istanbul.ValidatorSet) error

VerifySeal checks whether the crypto seal on a header is valid according to the consensus rules of the given engine.

func (*Engine) VerifyUncles

func (e *Engine) VerifyUncles(chain consensus.ChainReader, block *types.Block) error

VerifyUncles verifies that the given block's uncles conform to the consensus rules of a given engine.

func (*Engine) WriteVote

func (e *Engine) WriteVote(header *types.Header, candidate common.Address, authorize bool) error

type SignerFn

type SignerFn func(data []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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