state

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

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 (*PrepareVoteQueue) Push

func (p *PrepareVoteQueue) Push(vote *protocols.PrepareVote)

func (*PrepareVoteQueue) Top

type ViewState

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

func NewViewState

func NewViewState(period uint64, blockTree *ctypes.BlockTree) *ViewState

func (ViewState) AddBlockNumber

func (v ViewState) AddBlockNumber(qc *ctypes.QuorumCert)

func (ViewState) AddHadSendPreCommitNumber

func (v ViewState) AddHadSendPreCommitNumber(number uint64, vote *protocols.PreCommit)

func (ViewState) AddHadSendVoteNumber

func (v ViewState) AddHadSendVoteNumber(number uint64, vote *protocols.PrepareVote)

func (*ViewState) AddPreCommit

func (vs *ViewState) AddPreCommit(id uint32, vote *protocols.PreCommit)

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 (vs *ViewState) AllPreCommitByNumber(blockNumber uint64) map[uint32]*protocols.PreCommit

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 (vs *ViewState) BlockNumber() uint64

func (*ViewState) Deadline

func (vs *ViewState) Deadline() time.Time

func (*ViewState) Epoch

func (vs *ViewState) Epoch() uint64

func (*ViewState) Executing

func (vs *ViewState) Executing() (uint32, bool)

Returns the block index being executed, has it been completed

func (*ViewState) FindBlock

func (vs *ViewState) FindBlock(hash common.Hash, number uint64) *types.Block

func (*ViewState) FindPreCommit

func (vs *ViewState) FindPreCommit(blockNumber uint64, validatorIndex uint32) *protocols.PreCommit

func (*ViewState) FindPrepareVote

func (vs *ViewState) FindPrepareVote(blockNumber uint64, validatorIndex uint32) *protocols.PrepareVote

func (*ViewState) HadPreCommitQC

func (vs *ViewState) HadPreCommitQC(hash common.Hash, number uint64, viewNumber uint64) bool

func (*ViewState) HadPrepareVoteQC

func (vs *ViewState) HadPrepareVoteQC(hash common.Hash, number uint64, viewNumber uint64) bool

func (*ViewState) HadSendPreCommit

func (vs *ViewState) HadSendPreCommit(vote *protocols.PreCommit) bool

func (ViewState) HadSendPreCommitLast

func (v ViewState) HadSendPreCommitLast() *protocols.PreCommit

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 (vs *ViewState) HighestBlockString() string

func (*ViewState) HighestCommitBlock

func (vs *ViewState) HighestCommitBlock() *types.Block

func (*ViewState) HighestExecutedBlock

func (vs *ViewState) HighestExecutedBlock() *types.Block

func (*ViewState) HighestLockBlock

func (vs *ViewState) HighestLockBlock() *types.Block

func (*ViewState) HighestPreCommitQCBlock

func (vs *ViewState) HighestPreCommitQCBlock() *types.Block

func (*ViewState) HighestQCBlock

func (vs *ViewState) HighestQCBlock() *types.Block

func (*ViewState) IsDeadline

func (vs *ViewState) IsDeadline() bool

func (ViewState) LastAddBlockNumberTime

func (v ViewState) LastAddBlockNumberTime() int64

func (*ViewState) LastViewChangeQC

func (vs *ViewState) LastViewChangeQC() *ctypes.ViewChangeQC

func (*ViewState) MarshalJSON

func (vs *ViewState) MarshalJSON() ([]byte, error)

func (ViewState) MaxExecutedBlockNumber

func (v ViewState) MaxExecutedBlockNumber() uint64

func (*ViewState) MaxPreCommitQCNumber

func (vs *ViewState) MaxPreCommitQCNumber() uint64

func (*ViewState) MaxQCIndex

func (vs *ViewState) MaxQCIndex() uint32

func (*ViewState) MaxQCNumber

func (vs *ViewState) MaxQCNumber() uint64

func (*ViewState) MaxViewBlockNumber

func (vs *ViewState) MaxViewBlockNumber() uint64

func (*ViewState) MaxViewPreCommitsNumber

func (vs *ViewState) MaxViewPreCommitsNumber() uint64

func (*ViewState) MaxViewVoteIndex

func (vs *ViewState) MaxViewVoteIndex() uint64

func (*ViewState) MaxViewVotesNumber

func (vs *ViewState) MaxViewVotesNumber() uint64

func (*ViewState) MinViewBlockNumber

func (vs *ViewState) MinViewBlockNumber() uint64

func (*ViewState) MinViewVoteIndex

func (vs *ViewState) MinViewVoteIndex() uint64

func (*ViewState) NextViewBlockIndex

func (vs *ViewState) NextViewBlockIndex() uint32

func (*ViewState) NextViewBlockNumber

func (vs *ViewState) NextViewBlockNumber() uint64

func (*ViewState) PendingPrepareVote

func (vs *ViewState) PendingPrepareVote() *PrepareVoteQueue

func (*ViewState) PreCommitLenByNumber

func (vs *ViewState) PreCommitLenByNumber(blockNumber uint64) int

func (*ViewState) PrepareBlockByIndex

func (vs *ViewState) PrepareBlockByIndex(number uint64) *protocols.PrepareBlock

func (*ViewState) PrepareVoteLenByNumber

func (vs *ViewState) PrepareVoteLenByNumber(blockNumber uint64) int

func (ViewState) Reset

func (v ViewState) Reset(blockNumber uint64)

func (*ViewState) ResetView

func (vs *ViewState) ResetView(epoch uint64, viewNumber uint64, blockNumber uint64)

func (ViewState) SetBlockNumber

func (v ViewState) SetBlockNumber(blockNumber uint64)

func (*ViewState) SetExecuting

func (vs *ViewState) SetExecuting(index uint32, finish bool)

Set Executing block status

func (*ViewState) SetHighestCommitBlock

func (vs *ViewState) SetHighestCommitBlock(ext *types.Block)

func (*ViewState) SetHighestLockBlock

func (vs *ViewState) SetHighestLockBlock(ext *types.Block)

func (*ViewState) SetHighestPreCommitQCBlock

func (vs *ViewState) SetHighestPreCommitQCBlock(ext *types.Block)

func (*ViewState) SetHighestQCBlock

func (vs *ViewState) SetHighestQCBlock(ext *types.Block)

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 (vs *ViewState) SetViewTimer(viewInterval uint64)

func (*ViewState) Step

func (vs *ViewState) Step() ctypes.RoundStepType

func (*ViewState) String

func (vs *ViewState) String() string

func (*ViewState) UnmarshalJSON

func (vs *ViewState) UnmarshalJSON(input []byte) error

func (*ViewState) UpdateStep

func (vs *ViewState) UpdateStep(step ctypes.RoundStepType)

func (*ViewState) ViewBlockAndPreCommitQC

func (vs *ViewState) ViewBlockAndPreCommitQC(blockNumber uint64) (*types.Block, *ctypes.QuorumCert)

func (*ViewState) ViewBlockAndQC

func (vs *ViewState) ViewBlockAndQC(blockNumber uint64) (*types.Block, *ctypes.QuorumCert)

func (*ViewState) ViewBlockByIndex

func (vs *ViewState) ViewBlockByIndex(number uint64) *types.Block

Find the block corresponding to the current view according to the index

func (*ViewState) ViewBlockSize

func (vs *ViewState) ViewBlockSize() int

func (*ViewState) ViewChangeByIndex

func (vs *ViewState) ViewChangeByIndex(index uint32) *protocols.ViewChange

func (*ViewState) ViewChangeLen

func (vs *ViewState) ViewChangeLen() int

func (*ViewState) ViewNumber

func (vs *ViewState) ViewNumber() uint64

func (*ViewState) ViewPrepareVoteQC

func (vs *ViewState) ViewPrepareVoteQC() *ctypes.QuorumCert

func (*ViewState) ViewString

func (vs *ViewState) ViewString() string

func (*ViewState) ViewTimeout

func (vs *ViewState) ViewTimeout() <-chan time.Time

func (*ViewState) ViewVoteSize

func (vs *ViewState) ViewVoteSize() int

Jump to

Keyboard shortcuts

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