Documentation ¶
Index ¶
- type SafetyRules
- func (sr *SafetyRules) CommitRules(qc *maxbftpb.QuorumCert) (commit bool, commitBlock *common.Block, commitLevel uint64)
- func (sr *SafetyRules) GetLastCommittedLevel() uint64
- func (sr *SafetyRules) GetLastVoteLevel() uint64
- func (sr *SafetyRules) GetLastVoteMsg() *maxbftpb.ConsensusPayload
- func (sr *SafetyRules) GetLockedBlock() *common.Block
- func (sr *SafetyRules) GetLockedLevel() uint64
- func (sr *SafetyRules) SafeNode(proposal *maxbftpb.ProposalData) error
- func (sr *SafetyRules) SetLastCommittedBlock(block *common.Block, level uint64)
- func (sr *SafetyRules) SetLastCommittedLevel(level uint64)
- func (sr *SafetyRules) SetLastVote(vote *maxbftpb.ConsensusPayload, level uint64)
- func (sr *SafetyRules) UpdateLockedQC(qc *maxbftpb.QuorumCert)
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
Click to show internal directories.
Click to hide internal directories.