proposer

package
v0.0.0-...-bda353b Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULTDURATION = 1000 // default proposal duration, millis seconds

	RETRY  = 0
	REMOVE = 1
)

Variables

This section is empty.

Functions

func NewBlockProposer

func NewBlockProposer(config BlockProposerConfig, log protocol.Logger) (protocol.BlockProposer, error)

Types

type BlockProposerConfig

type BlockProposerConfig struct {
	ChainId         string
	TxPool          protocol.TxPool
	SnapshotManager protocol.SnapshotManager
	MsgBus          msgbus.MessageBus
	Identity        protocol.SigningParticipant
	LedgerCache     protocol.LedgerCache
	TxScheduler     protocol.TxScheduler
	ProposalCache   protocol.ProposalCache
	ChainConf       protocol.ChainConf
	AC              protocol.AccessControlProvider
	BlockchainStore protocol.BlockchainStore
	StoreHelper     config.StoreHelper
	TxFilter        protocol.TxFilter
}

type BlockProposerImpl

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

BlockProposerImpl implements BlockProposer interface. In charge of propose a new block.

func (*BlockProposerImpl) FetchTxFromOtherBlock

func (bp *BlockProposerImpl) FetchTxFromOtherBlock(height uint64, preHash []byte) (
	[]*commonpb.Transaction, []string)

func (*BlockProposerImpl) OnReceiveMaxBFTProposal

func (bp *BlockProposerImpl) OnReceiveMaxBFTProposal(proposal *maxbft.BuildProposal)

OnReceiveMaxBFTProposal to check if this proposer should propose a new block Only for maxbft consensus

func (*BlockProposerImpl) OnReceiveProposeStatusChange

func (bp *BlockProposerImpl) OnReceiveProposeStatusChange(proposeStatus bool)

* OnReceiveProposeStatusChange, to update isProposer status when received proposeStatus from consensus * if node is proposer, then reset the timer, otherwise stop the timer

func (*BlockProposerImpl) OnReceiveRwSetVerifyFailTxs

func (bp *BlockProposerImpl) OnReceiveRwSetVerifyFailTxs(rwSetVerifyFailTxs *consensuspb.RwSetVerifyFailTxs)

OnReceiveRwSetVerifyFailTxs remove verify fail txs

func (*BlockProposerImpl) OnReceiveTxPoolSignal

func (bp *BlockProposerImpl) OnReceiveTxPoolSignal(txPoolSignal *txpoolpb.TxPoolSignal)

OnReceiveTxPoolSignal receive txpool signal and deliver to chan txpool signal

func (*BlockProposerImpl) OnReceiveYieldProposeSignal

func (bp *BlockProposerImpl) OnReceiveYieldProposeSignal(isYield bool)

OnReceiveYieldProposeSignal receive yield propose signal

func (*BlockProposerImpl) ProposeBlock

func (bp *BlockProposerImpl) ProposeBlock(proposal *maxbft.BuildProposal) (*consensuspb.ProposalBlock, error)

func (*BlockProposerImpl) Start

func (bp *BlockProposerImpl) Start() error

Start proposer

func (*BlockProposerImpl) Stop

func (bp *BlockProposerImpl) Stop() error

Stop proposing loop

Jump to

Keyboard shortcuts

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