rules

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: GPL-3.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SafetyError

type SafetyError interface {
	error
	Common() bool
	Fetch() bool   //Is the error need fetch
	NewView() bool //need change view
	FetchPrepare() bool
}

type SafetyRules

type SafetyRules interface {
	// Security rules for proposed blocks
	PrepareBlockRules(block *protocols.PrepareBlock) SafetyError

	// Security rules for proposed votes
	PrepareVoteRules(vote *protocols.PrepareVote) SafetyError

	// Security rules for precommits
	PreCommitRules(vote *protocols.PreCommit) SafetyError

	// Security rules for viewChange
	ViewChangeRules(vote *protocols.ViewChange) SafetyError

	// Security rules for qcblock
	QCBlockRules(block *types.Block, qc *ctypes.QuorumCert) SafetyError
}

func NewSafetyRules

func NewSafetyRules(viewState *state.ViewState, blockTree *ctypes.BlockTree, config *ctypes.Config, validatorPool *validator.ValidatorPool) SafetyRules

type VoteError

type VoteError interface {
	error
	Discard() bool //Is the error need discard
}

type VoteRules

type VoteRules interface {
	// Determine if the resulting vote is allowed to be sent
	AllowVote(vote *protocols.PrepareVote) VoteError
	AllowPreCommit(vote *protocols.PreCommit) VoteError
}

func NewVoteRules

func NewVoteRules(viewState *state.ViewState) VoteRules

Jump to

Keyboard shortcuts

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