Documentation ¶
Index ¶
- func GenVoteMsg(emptyBlock *model.Block, signFunc SignHashFunc, addr common.Address, ...) (*model.VoteMsg, error)
- type AliveVerHaltHandler
- type CsProtocolFunction
- type HaltCheckConf
- type NeedChainReaderFunction
- type NeedWalletSigner
- type ProcessFunc
- type ProposalGenerator
- type ProposalGeneratorConfig
- type ProposalMsg
- type SignHashFunc
- type StateHandler
- func (haltCheckStateHandle *StateHandler) GenProposalConfig(voteType model.VoteMsgType) (ProposalGeneratorConfig, error)
- func (haltCheckStateHandle *StateHandler) ProcessAccountAndRegisterState(block model.AbstractBlock, preStateRoot, preRegisterRoot common.Hash) (stateRoot, registerRoot common.Hash, err error)
- func (haltCheckStateHandle *StateHandler) SaveFinalEmptyBlock(proposal ProposalMsg, votes map[common.Address]model.VoteMsg) error
- type SystemHaltedCheck
- type VBHaltHandler
- func (handler *VBHaltHandler) GetMinProposalMsg() ProposalMsg
- func (handler *VBHaltHandler) GetOtherProposalMessages() []ProposalMsg
- func (handler *VBHaltHandler) GetProposalMsg() *ProposalMsg
- func (handler *VBHaltHandler) HandlerAliveVerVotes(vote model.VoteMsg, currentVerifiers []common.Address) error
- func (handler *VBHaltHandler) HandlerProposalMessages(msg ProposalMsg, selectedProposal chan ProposalMsg) error
- func (handler *VBHaltHandler) MinProposalMsg() ProposalMsg
- func (handler *VBHaltHandler) OnNewProposalMsg(msg ProposalMsg) error
- func (handler *VBHaltHandler) ProposeEmptyBlock() (pm ProposalMsg, err error)
- func (handler *VBHaltHandler) VotesLen() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenVoteMsg ¶
func GenVoteMsg(emptyBlock *model.Block, signFunc SignHashFunc, addr common.Address, voteType model.VoteMsgType) (*model.VoteMsg, error)
Types ¶
type AliveVerHaltHandler ¶
type AliveVerHaltHandler struct {
// contains filtered or unexported fields
}
alive verifier halt handler
func NewAliveVerHaltHandler ¶
func NewAliveVerHaltHandler(signFunc SignHashFunc, addr common.Address) *AliveVerHaltHandler
func (*AliveVerHaltHandler) OnMinimalHashBlock ¶
func (handler *AliveVerHaltHandler) OnMinimalHashBlock(selectedProposal ProposalMsg) (*model.VoteMsg, error)
type CsProtocolFunction ¶
type HaltCheckConf ¶
type HaltCheckConf struct { NodeType int CsProtocol CsProtocolFunction NeedChainReader NeedChainReaderFunction WalletSigner NeedWalletSigner Broadcast broadcastEmptyBlock EconomyModel economy_model.EconomyModel }
type NeedChainReaderFunction ¶
type NeedChainReaderFunction interface { CurrentBlock() model.AbstractBlock GetSeenCommit(height uint64) []model.AbstractVerification GetCurrVerifiers() []common.Address SaveBlock(block model.AbstractBlock, seenCommits []model.AbstractVerification) error //AccountDB need ChainReader function GetBlockByNumber(number uint64) model.AbstractBlock GetVerifiers(round uint64) []common.Address IsChangePoint(block model.AbstractBlock, isProcessPackageBlock bool) bool GetLastChangePoint(block model.AbstractBlock) *uint64 GetSlot(block model.AbstractBlock) *uint64 BlockProcessor(root common.Hash) (*chain.BlockProcessor, error) BlockProcessorByNumber(num uint64) (*chain.BlockProcessor, error) BuildRegisterProcessor(preRoot common.Hash) (*registerdb.RegisterDB, error) }
type NeedWalletSigner ¶
type ProcessFunc ¶
type ProposalGenerator ¶
type ProposalGenerator struct { ProposalGeneratorConfig // contains filtered or unexported fields }
func (*ProposalGenerator) GenEmptyBlock ¶
func (g *ProposalGenerator) GenEmptyBlock() (*model.Block, error)
func (*ProposalGenerator) GenProposal ¶
func (g *ProposalGenerator) GenProposal() (*ProposalMsg, error)
type ProposalGeneratorConfig ¶
type ProposalGeneratorConfig struct { // block need CurBlock model.AbstractBlock NewBlockSeed common.Hash NewBlockProof []byte LastVerifications []model.AbstractVerification PubKey []byte // vote msg need SignHashFunc SignHashFunc //process account and register need ProcessStateFunc ProcessFunc VoteType model.VoteMsgType }
type ProposalMsg ¶
func GenProposalMsg ¶
func GenProposalMsg(config ProposalGeneratorConfig) (*ProposalMsg, error)
generate ProposalMsg
type SignHashFunc ¶
type StateHandler ¶
type StateHandler struct {
// contains filtered or unexported fields
}
func MakeHaltCheckStateHandler ¶
func MakeHaltCheckStateHandler(needChainReader NeedChainReaderFunction, walletSigner NeedWalletSigner, economyModel economy_model.EconomyModel) *StateHandler
func (*StateHandler) GenProposalConfig ¶
func (haltCheckStateHandle *StateHandler) GenProposalConfig(voteType model.VoteMsgType) (ProposalGeneratorConfig, error)
func (*StateHandler) ProcessAccountAndRegisterState ¶
func (haltCheckStateHandle *StateHandler) ProcessAccountAndRegisterState(block model.AbstractBlock, preStateRoot, preRegisterRoot common.Hash) (stateRoot, registerRoot common.Hash, err error)
func (*StateHandler) SaveFinalEmptyBlock ¶
func (haltCheckStateHandle *StateHandler) SaveFinalEmptyBlock(proposal ProposalMsg, votes map[common.Address]model.VoteMsg) error
type SystemHaltedCheck ¶
type SystemHaltedCheck struct { //verifier boot node synchronization status SynStatus uint32 // contains filtered or unexported fields }
func MakeSystemHaltedCheck ¶
func MakeSystemHaltedCheck(conf *HaltCheckConf) *SystemHaltedCheck
func (*SystemHaltedCheck) MsgHandlers ¶
func (systemHaltedCheck *SystemHaltedCheck) MsgHandlers() map[uint64]func(msg p2p.Msg, p chain_communication.PmAbstractPeer) error
func (*SystemHaltedCheck) Start ¶
func (systemHaltedCheck *SystemHaltedCheck) Start() error
func (*SystemHaltedCheck) Stop ¶
func (systemHaltedCheck *SystemHaltedCheck) Stop()
type VBHaltHandler ¶
type VBHaltHandler struct {
// contains filtered or unexported fields
}
verifier boot node halt handler A new one is generated after each timeout. This way resetting the state is not needed after finishing processing.
func NewHaltHandler ¶
func NewHaltHandler(conf ProposalGeneratorConfig) *VBHaltHandler
func (*VBHaltHandler) GetMinProposalMsg ¶
func (handler *VBHaltHandler) GetMinProposalMsg() ProposalMsg
func (*VBHaltHandler) GetOtherProposalMessages ¶
func (handler *VBHaltHandler) GetOtherProposalMessages() []ProposalMsg
func (*VBHaltHandler) GetProposalMsg ¶
func (handler *VBHaltHandler) GetProposalMsg() *ProposalMsg
func (*VBHaltHandler) HandlerAliveVerVotes ¶
func (*VBHaltHandler) HandlerProposalMessages ¶
func (handler *VBHaltHandler) HandlerProposalMessages(msg ProposalMsg, selectedProposal chan ProposalMsg) error
handle the received proposals and change the haltHandler status
func (*VBHaltHandler) MinProposalMsg ¶
func (handler *VBHaltHandler) MinProposalMsg() ProposalMsg
func (*VBHaltHandler) OnNewProposalMsg ¶
func (handler *VBHaltHandler) OnNewProposalMsg(msg ProposalMsg) error
receive msg of other VBoot
func (*VBHaltHandler) ProposeEmptyBlock ¶
func (handler *VBHaltHandler) ProposeEmptyBlock() (pm ProposalMsg, err error)
generate proposalMsg
func (*VBHaltHandler) VotesLen ¶
func (handler *VBHaltHandler) VotesLen() int
Click to show internal directories.
Click to hide internal directories.