worker

package
v1.10.3-0...-ec03cfc Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: LGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Worker

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

Worker is the main object which takes care of submitting new work to consensus engine and gathering the sealing result.

func New

func New(
	config *params.ChainConfig, chain *core.BlockChain, engine consensus_engine.Engine,
) *Worker

New create a new worker object.

func (*Worker) CollectVerifiedSlashes

func (w *Worker) CollectVerifiedSlashes() error

CollectVerifiedSlashes sets w.current.slashes only to those that past verification

func (*Worker) CommitReceipts

func (w *Worker) CommitReceipts(receiptsList []*types.CXReceiptsProof) error

CommitReceipts commits a list of already verified incoming cross shard receipts

func (*Worker) CommitSortedTransactions

func (w *Worker) CommitSortedTransactions(
	txs *types.TransactionsByPriceAndNonce,
	coinbase common.Address,
)

CommitSortedTransactions commits transactions for new block.

func (*Worker) CommitTransactions

func (w *Worker) CommitTransactions(
	pendingNormal map[common.Address]types.Transactions,
	pendingStaking staking.StakingTransactions, coinbase common.Address,
) error

CommitTransactions commits transactions for new block.

func (*Worker) FinalizeNewBlock

func (w *Worker) FinalizeNewBlock(
	commitSigs chan []byte, viewID func() uint64, coinbase common.Address,
	crossLinks types.CrossLinks, shardState *shard.State,
) (*types.Block, error)

FinalizeNewBlock generate a new block for the next consensus round.

func (*Worker) GetCurrentHeader

func (w *Worker) GetCurrentHeader() *block.Header

GetCurrentHeader returns the current header to propose

func (*Worker) GetCurrentReceipts

func (w *Worker) GetCurrentReceipts() []*types.Receipt

GetCurrentReceipts get the receipts generated starting from the last state.

func (*Worker) GetCurrentState

func (w *Worker) GetCurrentState() *state.DB

GetCurrentState gets the current state.

func (*Worker) GetNewEpoch

func (w *Worker) GetNewEpoch() *big.Int

GetNewEpoch gets the current epoch.

func (*Worker) IncomingReceipts

func (w *Worker) IncomingReceipts() []*types.CXReceiptsProof

IncomingReceipts get incoming receipts in destination shard that is received from source shard

func (*Worker) OutgoingReceipts

func (w *Worker) OutgoingReceipts() []*types.CXReceipt

OutgoingReceipts get the receipts generated starting from the last state.

func (*Worker) UpdateCurrent

func (w *Worker) UpdateCurrent() error

UpdateCurrent updates the current environment with the current state and header.

Jump to

Keyboard shortcuts

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