Documentation ¶
Index ¶
- func ApplyHeaderQBFTExtra(header *types.Header, applies ...ApplyQBFTExtra) error
- func PrepareCommittedSeal(header *types.Header, round uint32) []byte
- type ApplyQBFTExtra
- type Engine
- func (e *Engine) Address() common.Address
- func (e *Engine) Author(header *types.Header) (common.Address, error)
- func (e *Engine) CalcDifficulty(chain consensus.ChainHeaderReader, time uint64, parent *types.Header) *big.Int
- func (e *Engine) CommitHeader(header *types.Header, seals [][]byte, round *big.Int) error
- func (e *Engine) ExtractGenesisValidators(header *types.Header) ([]common.Address, error)
- func (e *Engine) Finalize(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, ...)
- func (e *Engine) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, ...) (*types.Block, error)
- func (e *Engine) Prepare(chain consensus.ChainHeaderReader, header *types.Header, ...) error
- func (e *Engine) ReadVote(header *types.Header) (candidate common.Address, authorize bool, err error)
- func (e *Engine) Seal(chain consensus.ChainHeaderReader, block *types.Block, ...) (*types.Block, error)
- func (e *Engine) SealHash(header *types.Header) common.Hash
- func (e *Engine) Signers(header *types.Header) ([]common.Address, error)
- func (e *Engine) VerifyBlockProposal(chain consensus.ChainHeaderReader, block *types.Block, ...) (time.Duration, error)
- func (e *Engine) VerifyHeader(chain consensus.ChainHeaderReader, header *types.Header, ...) error
- func (e *Engine) VerifyHeaders(chain consensus.ChainHeaderReader, headers []*types.Header, seals []bool, ...) (chan<- struct{}, <-chan error)
- func (e *Engine) VerifySeal(chain consensus.ChainHeaderReader, header *types.Header, ...) error
- func (e *Engine) VerifyUncles(chain consensus.ChainReader, block *types.Block) error
- func (e *Engine) WriteVote(header *types.Header, candidate common.Address, authorize bool) error
- type SignerFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyHeaderQBFTExtra ¶
func ApplyHeaderQBFTExtra(header *types.Header, applies ...ApplyQBFTExtra) error
Types ¶
type ApplyQBFTExtra ¶
func Combine ¶
func Combine(applies ...ApplyQBFTExtra) ApplyQBFTExtra
func WriteValidators ¶
func WriteValidators(validators []common.Address) ApplyQBFTExtra
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) CalcDifficulty ¶
func (*Engine) CommitHeader ¶
func (*Engine) ExtractGenesisValidators ¶
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) 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) 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 ¶
VerifyUncles verifies that the given block's uncles conform to the consensus rules of a given engine.