Documentation ¶
Index ¶
- Constants
- type PrepareVoteQueue
- func (p *PrepareVoteQueue) Empty() bool
- func (p *PrepareVoteQueue) Had(index uint32) bool
- func (p *PrepareVoteQueue) Len() int
- func (p *PrepareVoteQueue) Peek() []*protocols.PrepareVote
- func (p *PrepareVoteQueue) Pop() *protocols.PrepareVote
- func (p *PrepareVoteQueue) Push(vote *protocols.PrepareVote)
- func (p *PrepareVoteQueue) Top() *protocols.PrepareVote
- type ViewState
- func (v ViewState) AddBlockNumber(qc *ctypes.QuorumCert)
- func (v ViewState) AddHadSendPreCommitNumber(number uint64, vote *protocols.PreCommit)
- func (v ViewState) AddHadSendVoteNumber(number uint64, vote *protocols.PrepareVote)
- func (vs *ViewState) AddPreCommit(id uint32, vote *protocols.PreCommit)
- func (vs *ViewState) AddPreCommitQC(qc *ctypes.QuorumCert)
- func (vs *ViewState) AddPrepareBlock(pb *protocols.PrepareBlock)
- func (vs *ViewState) AddPrepareVote(id uint32, vote *protocols.PrepareVote)
- func (vs *ViewState) AddQC(qc *ctypes.QuorumCert)
- func (vs *ViewState) AddQCBlock(block *types.Block, qc *ctypes.QuorumCert)
- func (vs *ViewState) AddViewChange(id uint32, viewChange *protocols.ViewChange)
- func (vs *ViewState) AllPreCommitByNumber(blockNumber uint64) map[uint32]*protocols.PreCommit
- func (vs *ViewState) AllPrepareVoteByNumber(blockNumber uint64) map[uint32]*protocols.PrepareVote
- func (vs *ViewState) AllViewChange() map[uint32]*protocols.ViewChange
- func (vs *ViewState) BlockNumber() uint64
- func (vs *ViewState) Deadline() time.Time
- func (vs *ViewState) Epoch() uint64
- func (vs *ViewState) Executing() (uint32, bool)
- func (vs *ViewState) FindBlock(hash common.Hash, number uint64) *types.Block
- func (vs *ViewState) FindPreCommit(blockNumber uint64, validatorIndex uint32) *protocols.PreCommit
- func (vs *ViewState) FindPrepareVote(blockNumber uint64, validatorIndex uint32) *protocols.PrepareVote
- func (vs *ViewState) HadPreCommitQC(hash common.Hash, number uint64, viewNumber uint64) bool
- func (vs *ViewState) HadPrepareVoteQC(hash common.Hash, number uint64, viewNumber uint64) bool
- func (vs *ViewState) HadSendPreCommit(vote *protocols.PreCommit) bool
- func (v ViewState) HadSendPreCommitLast() *protocols.PreCommit
- func (v ViewState) HadSendPreCommitNumber() uint64
- func (vs *ViewState) HadSendPreVote(vote *protocols.PrepareVote) bool
- func (vs *ViewState) HadSendPreVoteByQC(qc *ctypes.QuorumCert) bool
- func (vs *ViewState) HadSendPrepareVote() *PrepareVoteQueue
- func (v ViewState) HadSendVoteLast() *protocols.PrepareVote
- func (v ViewState) HadSendVoteNumber() uint64
- func (vs *ViewState) HighestBlockString() string
- func (vs *ViewState) HighestCommitBlock() *types.Block
- func (vs *ViewState) HighestExecutedBlock() *types.Block
- func (vs *ViewState) HighestLockBlock() *types.Block
- func (vs *ViewState) HighestPreCommitQCBlock() *types.Block
- func (vs *ViewState) HighestQCBlock() *types.Block
- func (vs *ViewState) IsDeadline() bool
- func (v ViewState) LastAddBlockNumberTime() int64
- func (vs *ViewState) LastViewChangeQC() *ctypes.ViewChangeQC
- func (vs *ViewState) MarshalJSON() ([]byte, error)
- func (v ViewState) MaxExecutedBlockNumber() uint64
- func (vs *ViewState) MaxPreCommitQCNumber() uint64
- func (vs *ViewState) MaxQCIndex() uint32
- func (vs *ViewState) MaxQCNumber() uint64
- func (vs *ViewState) MaxViewBlockNumber() uint64
- func (vs *ViewState) MaxViewPreCommitsNumber() uint64
- func (vs *ViewState) MaxViewVoteIndex() uint64
- func (vs *ViewState) MaxViewVotesNumber() uint64
- func (vs *ViewState) MinViewBlockNumber() uint64
- func (vs *ViewState) MinViewVoteIndex() uint64
- func (vs *ViewState) NextViewBlockIndex() uint32
- func (vs *ViewState) NextViewBlockNumber() uint64
- func (vs *ViewState) PendingPrepareVote() *PrepareVoteQueue
- func (vs *ViewState) PreCommitLenByNumber(blockNumber uint64) int
- func (vs *ViewState) PrepareBlockByIndex(number uint64) *protocols.PrepareBlock
- func (vs *ViewState) PrepareVoteLenByNumber(blockNumber uint64) int
- func (v ViewState) Reset(blockNumber uint64)
- func (vs *ViewState) ResetView(epoch uint64, viewNumber uint64, blockNumber uint64)
- func (v ViewState) SetBlockNumber(blockNumber uint64)
- func (vs *ViewState) SetExecuting(index uint32, finish bool)
- func (vs *ViewState) SetHighestCommitBlock(ext *types.Block)
- func (vs *ViewState) SetHighestLockBlock(ext *types.Block)
- func (vs *ViewState) SetHighestPreCommitQCBlock(ext *types.Block)
- func (vs *ViewState) SetHighestQCBlock(ext *types.Block)
- func (vs *ViewState) SetLastViewChangeQC(qc *ctypes.ViewChangeQC)
- func (v ViewState) SetMaxExecutedBlockNumber(blockNumber uint64)
- func (vs *ViewState) SetPreCommitQC(viewPreCommitQC *ctypes.QuorumCert)
- func (vs *ViewState) SetPrepareVoteQC(viewPrepareVoteQC *ctypes.QuorumCert)
- func (vs *ViewState) SetViewTimer(viewInterval uint64)
- func (vs *ViewState) Step() ctypes.RoundStepType
- func (vs *ViewState) String() string
- func (vs *ViewState) UnmarshalJSON(input []byte) error
- func (vs *ViewState) UpdateStep(step ctypes.RoundStepType)
- func (vs *ViewState) ViewBlockAndPreCommitQC(blockNumber uint64) (*types.Block, *ctypes.QuorumCert)
- func (vs *ViewState) ViewBlockAndQC(blockNumber uint64) (*types.Block, *ctypes.QuorumCert)
- func (vs *ViewState) ViewBlockByIndex(number uint64) *types.Block
- func (vs *ViewState) ViewBlockSize() int
- func (vs *ViewState) ViewChangeByIndex(index uint32) *protocols.ViewChange
- func (vs *ViewState) ViewChangeLen() int
- func (vs *ViewState) ViewNumber() uint64
- func (vs *ViewState) ViewPrepareVoteQC() *ctypes.QuorumCert
- func (vs *ViewState) ViewString() string
- func (vs *ViewState) ViewTimeout() <-chan time.Time
- func (vs *ViewState) ViewVoteSize() int
Constants ¶
View Source
const AddBlockNumberTimeInterval = 8
View Source
const DefaultEpoch = 1
View Source
const DefaultViewNumber = 0
View Source
const ViewCacheLen = 10
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrepareVoteQueue ¶
type PrepareVoteQueue struct {
Votes []*protocols.PrepareVote `json:"votes"`
}
func (*PrepareVoteQueue) Empty ¶
func (p *PrepareVoteQueue) Empty() bool
func (*PrepareVoteQueue) Had ¶
func (p *PrepareVoteQueue) Had(index uint32) bool
func (*PrepareVoteQueue) Len ¶
func (p *PrepareVoteQueue) Len() int
func (*PrepareVoteQueue) Peek ¶
func (p *PrepareVoteQueue) Peek() []*protocols.PrepareVote
func (*PrepareVoteQueue) Pop ¶
func (p *PrepareVoteQueue) Pop() *protocols.PrepareVote
func (*PrepareVoteQueue) Push ¶
func (p *PrepareVoteQueue) Push(vote *protocols.PrepareVote)
func (*PrepareVoteQueue) Top ¶
func (p *PrepareVoteQueue) Top() *protocols.PrepareVote
type ViewState ¶
type ViewState struct {
// contains filtered or unexported fields
}
func (ViewState) AddBlockNumber ¶
func (v ViewState) AddBlockNumber(qc *ctypes.QuorumCert)
func (ViewState) AddHadSendPreCommitNumber ¶
func (ViewState) AddHadSendVoteNumber ¶
func (v ViewState) AddHadSendVoteNumber(number uint64, vote *protocols.PrepareVote)
func (*ViewState) AddPreCommit ¶
func (*ViewState) AddPreCommitQC ¶
func (vs *ViewState) AddPreCommitQC(qc *ctypes.QuorumCert)
func (*ViewState) AddPrepareBlock ¶
func (vs *ViewState) AddPrepareBlock(pb *protocols.PrepareBlock)
func (*ViewState) AddPrepareVote ¶
func (vs *ViewState) AddPrepareVote(id uint32, vote *protocols.PrepareVote)
func (*ViewState) AddQC ¶
func (vs *ViewState) AddQC(qc *ctypes.QuorumCert)
func (*ViewState) AddQCBlock ¶
func (vs *ViewState) AddQCBlock(block *types.Block, qc *ctypes.QuorumCert)
func (*ViewState) AddViewChange ¶
func (vs *ViewState) AddViewChange(id uint32, viewChange *protocols.ViewChange)
func (*ViewState) AllPreCommitByNumber ¶
func (*ViewState) AllPrepareVoteByNumber ¶
func (vs *ViewState) AllPrepareVoteByNumber(blockNumber uint64) map[uint32]*protocols.PrepareVote
func (*ViewState) AllViewChange ¶
func (vs *ViewState) AllViewChange() map[uint32]*protocols.ViewChange
func (*ViewState) BlockNumber ¶
func (*ViewState) FindPreCommit ¶
func (*ViewState) FindPrepareVote ¶
func (vs *ViewState) FindPrepareVote(blockNumber uint64, validatorIndex uint32) *protocols.PrepareVote
func (*ViewState) HadPreCommitQC ¶
func (*ViewState) HadPrepareVoteQC ¶
func (*ViewState) HadSendPreCommit ¶
func (ViewState) HadSendPreCommitLast ¶
func (ViewState) HadSendPreCommitNumber ¶
func (v ViewState) HadSendPreCommitNumber() uint64
func (*ViewState) HadSendPreVote ¶
func (vs *ViewState) HadSendPreVote(vote *protocols.PrepareVote) bool
func (*ViewState) HadSendPreVoteByQC ¶
func (vs *ViewState) HadSendPreVoteByQC(qc *ctypes.QuorumCert) bool
func (*ViewState) HadSendPrepareVote ¶
func (vs *ViewState) HadSendPrepareVote() *PrepareVoteQueue
func (ViewState) HadSendVoteLast ¶
func (v ViewState) HadSendVoteLast() *protocols.PrepareVote
func (ViewState) HadSendVoteNumber ¶
func (v ViewState) HadSendVoteNumber() uint64
func (*ViewState) HighestBlockString ¶
func (*ViewState) HighestCommitBlock ¶
func (*ViewState) HighestExecutedBlock ¶
func (*ViewState) HighestLockBlock ¶
func (*ViewState) HighestPreCommitQCBlock ¶
func (*ViewState) HighestQCBlock ¶
func (*ViewState) IsDeadline ¶
func (ViewState) LastAddBlockNumberTime ¶
func (v ViewState) LastAddBlockNumberTime() int64
func (*ViewState) LastViewChangeQC ¶
func (vs *ViewState) LastViewChangeQC() *ctypes.ViewChangeQC
func (*ViewState) MarshalJSON ¶
func (ViewState) MaxExecutedBlockNumber ¶
func (v ViewState) MaxExecutedBlockNumber() uint64
func (*ViewState) MaxPreCommitQCNumber ¶
func (*ViewState) MaxQCIndex ¶
func (*ViewState) MaxQCNumber ¶
func (*ViewState) MaxViewBlockNumber ¶
func (*ViewState) MaxViewPreCommitsNumber ¶
func (*ViewState) MaxViewVoteIndex ¶
func (*ViewState) MaxViewVotesNumber ¶
func (*ViewState) MinViewBlockNumber ¶
func (*ViewState) MinViewVoteIndex ¶
func (*ViewState) NextViewBlockIndex ¶
func (*ViewState) NextViewBlockNumber ¶
func (*ViewState) PendingPrepareVote ¶
func (vs *ViewState) PendingPrepareVote() *PrepareVoteQueue
func (*ViewState) PreCommitLenByNumber ¶
func (*ViewState) PrepareBlockByIndex ¶
func (vs *ViewState) PrepareBlockByIndex(number uint64) *protocols.PrepareBlock
func (*ViewState) PrepareVoteLenByNumber ¶
func (ViewState) SetBlockNumber ¶
func (v ViewState) SetBlockNumber(blockNumber uint64)
func (*ViewState) SetExecuting ¶
Set Executing block status
func (*ViewState) SetHighestCommitBlock ¶
func (*ViewState) SetHighestLockBlock ¶
func (*ViewState) SetHighestPreCommitQCBlock ¶
func (*ViewState) SetHighestQCBlock ¶
func (*ViewState) SetLastViewChangeQC ¶
func (vs *ViewState) SetLastViewChangeQC(qc *ctypes.ViewChangeQC)
func (ViewState) SetMaxExecutedBlockNumber ¶
func (v ViewState) SetMaxExecutedBlockNumber(blockNumber uint64)
func (*ViewState) SetPreCommitQC ¶
func (vs *ViewState) SetPreCommitQC(viewPreCommitQC *ctypes.QuorumCert)
func (*ViewState) SetPrepareVoteQC ¶
func (vs *ViewState) SetPrepareVoteQC(viewPrepareVoteQC *ctypes.QuorumCert)
func (*ViewState) SetViewTimer ¶
func (*ViewState) Step ¶
func (vs *ViewState) Step() ctypes.RoundStepType
func (*ViewState) UnmarshalJSON ¶
func (*ViewState) UpdateStep ¶
func (vs *ViewState) UpdateStep(step ctypes.RoundStepType)
func (*ViewState) ViewBlockAndPreCommitQC ¶
func (*ViewState) ViewBlockAndQC ¶
func (*ViewState) ViewBlockByIndex ¶
Find the block corresponding to the current view according to the index
func (*ViewState) ViewBlockSize ¶
func (*ViewState) ViewChangeByIndex ¶
func (vs *ViewState) ViewChangeByIndex(index uint32) *protocols.ViewChange
func (*ViewState) ViewChangeLen ¶
func (*ViewState) ViewNumber ¶
func (*ViewState) ViewPrepareVoteQC ¶
func (vs *ViewState) ViewPrepareVoteQC() *ctypes.QuorumCert
func (*ViewState) ViewString ¶
func (*ViewState) ViewTimeout ¶
func (*ViewState) ViewVoteSize ¶
Click to show internal directories.
Click to hide internal directories.