safetyrules

package
v0.0.0-...-8d456d7 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SafetyRules

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

SafetyRules implementation to validate incoming qc and block, include commit rules(3-chain) and vote rules

func NewSafetyRules

func NewSafetyRules(logger protocol.Logger, blkPool *blockpool.BlockPool,
	chainStore protocol.BlockchainStore) *SafetyRules

NewSafetyRules init a SafetyRules

func (*SafetyRules) CommitRules

func (sr *SafetyRules) CommitRules(qc *maxbftpb.QuorumCert) (commit bool, commitBlock *common.Block,
	commitLevel uint64)

CommitRules validate incoming qc to commit by three-chain

func (*SafetyRules) GetLastCommittedLevel

func (sr *SafetyRules) GetLastCommittedLevel() uint64

GetLastCommittedLevel get last committeed level

func (*SafetyRules) GetLastVoteLevel

func (sr *SafetyRules) GetLastVoteLevel() uint64

GetLastVoteLevel get last vote's level

func (*SafetyRules) GetLastVoteMsg

func (sr *SafetyRules) GetLastVoteMsg() *maxbftpb.ConsensusPayload

GetLastVoteMsg get last vote msg

func (*SafetyRules) GetLockedBlock

func (sr *SafetyRules) GetLockedBlock() *common.Block

GetLockedBlock get locked block

func (*SafetyRules) GetLockedLevel

func (sr *SafetyRules) GetLockedLevel() uint64

GetLockedLevel get locked level

func (*SafetyRules) SafeNode

func (sr *SafetyRules) SafeNode(proposal *maxbftpb.ProposalData) error

SafeNode validate incoming block and qc to vote

func (*SafetyRules) SetLastCommittedBlock

func (sr *SafetyRules) SetLastCommittedBlock(block *common.Block, level uint64)

SetLastCommittedBlock set last committed blcok

func (*SafetyRules) SetLastCommittedLevel

func (sr *SafetyRules) SetLastCommittedLevel(level uint64)

SetLastCommittedLevel set last committed level

func (*SafetyRules) SetLastVote

func (sr *SafetyRules) SetLastVote(vote *maxbftpb.ConsensusPayload, level uint64)

SetLastVote set last vote

func (*SafetyRules) UpdateLockedQC

func (sr *SafetyRules) UpdateLockedQC(qc *maxbftpb.QuorumCert)

UpdateLockedQC process incoming qc, update locked state by two-chain

Jump to

Keyboard shortcuts

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