Documentation ¶
Index ¶
- type Worker
- func (w *Worker) CommitReceipts(receiptsList []*types.CXReceiptsProof) error
- func (w *Worker) CommitTransactions(pendingNormal map[common.Address]types.Transactions, coinbase common.Address, ...) error
- func (w *Worker) FinalizeNewBlock(sig []byte, signers []byte, viewID uint64, coinbase common.Address, ...) (*types.Block, error)
- func (w *Worker) GetCurrentReceipts() []*types.Receipt
- func (w *Worker) GetCurrentState() *state.DB
- func (w *Worker) GetNewEpoch() *big.Int
- func (w *Worker) IncomingReceipts() []*types.CXReceiptsProof
- func (w *Worker) OutgoingReceipts() []*types.CXReceipt
- func (w *Worker) ProposeShardStateWithoutBeaconSync() shard.State
- func (w *Worker) SelectStakingTransactionsForNewBlock(newBlockNum uint64, txs staking.StakingTransactions, coinbase common.Address) (staking.StakingTransactions, staking.StakingTransactions, ...)
- func (w *Worker) UpdateCurrent(coinbase common.Address) error
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) CommitReceipts ¶
func (w *Worker) CommitReceipts(receiptsList []*types.CXReceiptsProof) error
CommitReceipts commits a list of already verified incoming cross shard receipts
func (*Worker) CommitTransactions ¶
func (w *Worker) CommitTransactions( pendingNormal map[common.Address]types.Transactions, coinbase common.Address, txnErrorSink func([]types.RPCTransactionError), ) error
CommitTransactions commits transactions for new block.
func (*Worker) FinalizeNewBlock ¶
func (w *Worker) FinalizeNewBlock(sig []byte, signers []byte, viewID 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) GetCurrentReceipts ¶
GetCurrentReceipts get the receipts generated starting from the last state.
func (*Worker) GetCurrentState ¶
GetCurrentState gets the current state.
func (*Worker) GetNewEpoch ¶
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 ¶
OutgoingReceipts get the receipts generated starting from the last state.
func (*Worker) ProposeShardStateWithoutBeaconSync ¶
ProposeShardStateWithoutBeaconSync proposes the next shard state for next epoch.
func (*Worker) SelectStakingTransactionsForNewBlock ¶
func (w *Worker) SelectStakingTransactionsForNewBlock( newBlockNum uint64, txs staking.StakingTransactions, coinbase common.Address) (staking.StakingTransactions, staking.StakingTransactions, staking.StakingTransactions)
SelectStakingTransactionsForNewBlock selects staking transactions for new block.