state

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultEpoch = 1
View Source
const DefaultViewNumber = 0

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) 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) AllPrepareVoteByIndex

func (vs *ViewState) AllPrepareVoteByIndex(index uint32) map[uint32]*protocols.PrepareVote

func (*ViewState) AllViewChange

func (vs *ViewState) AllViewChange() map[uint32]*protocols.ViewChange

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 added in v0.7.3

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

func (*ViewState) FindPrepareVote

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

func (*ViewState) HadSendPrepareVote

func (vs *ViewState) HadSendPrepareVote() *PrepareVoteQueue

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) HighestQCBlock

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

func (*ViewState) IsDeadline

func (vs *ViewState) IsDeadline() bool

func (*ViewState) LastViewChangeQC

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

func (*ViewState) MarshalJSON

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

func (*ViewState) MaxQCIndex

func (vs *ViewState) MaxQCIndex() uint32

func (*ViewState) MaxViewBlockIndex added in v0.7.3

func (vs *ViewState) MaxViewBlockIndex() uint32

func (*ViewState) MaxViewVoteIndex added in v0.7.3

func (vs *ViewState) MaxViewVoteIndex() uint32

func (*ViewState) NextViewBlockIndex

func (vs *ViewState) NextViewBlockIndex() uint32

func (*ViewState) PendingPrepareVote

func (vs *ViewState) PendingPrepareVote() *PrepareVoteQueue

func (*ViewState) PrepareBlockByIndex

func (vs *ViewState) PrepareBlockByIndex(index uint32) *protocols.PrepareBlock

func (*ViewState) PrepareVoteLenByIndex

func (vs *ViewState) PrepareVoteLenByIndex(index uint32) int

func (ViewState) Reset

func (v ViewState) Reset()

func (*ViewState) ResetView

func (vs *ViewState) ResetView(epoch uint64, viewNumber 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) SetHighestQCBlock

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

func (*ViewState) SetLastViewChangeQC

func (vs *ViewState) SetLastViewChangeQC(qc *ctypes.ViewChangeQC)

func (*ViewState) SetViewTimer

func (vs *ViewState) SetViewTimer(viewInterval uint64)

func (*ViewState) String

func (vs *ViewState) String() string

func (*ViewState) UnmarshalJSON added in v1.0.0

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

func (*ViewState) ViewBlockAndQC

func (vs *ViewState) ViewBlockAndQC(blockIndex uint32) (*types.Block, *ctypes.QuorumCert)

func (*ViewState) ViewBlockByIndex

func (vs *ViewState) ViewBlockByIndex(index uint32) *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) 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