Documentation
      ¶
    
    
  
    
  
    Index ¶
- Variables
 - func IsInvalidBlockError(err error) bool
 - func IsInvalidVoteError(err error) bool
 - func IsMissingBlockError(err error) bool
 - func IsNoVoteError(err error) bool
 - func ProposalToFlow(proposal *Proposal) *flow.Header
 - type Block
 - type ByzantineThresholdExceededError
 - type ConfigurationError
 - type InvalidBlockError
 - type InvalidVoteError
 - type MissingBlockError
 - type NewViewEvent
 - type NoVoteError
 - type Proposal
 - type TimeoutMode
 - type TimerInfo
 - type Vote
 
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidSignature = errors.New("invalid signature")
    var ErrInvalidSigner = errors.New("invalid signer(s)")
    var ErrUnverifiableBlock = errors.New("block proposal can't be verified, because its view is above the finalized view, but its QC is below the finalized view")
    Functions ¶
func IsInvalidBlockError ¶
IsInvalidBlockError returns whether an error is InvalidBlockError
func IsInvalidVoteError ¶
IsInvalidVoteError returns whether an error is InvalidVoteError
func IsMissingBlockError ¶
IsMissingBlockError returns whether an error is MissingBlockError
func IsNoVoteError ¶
IsNoVoteError returns whether an error is NoVoteError
func ProposalToFlow ¶
ProposalToFlow turns a block proposal into a flow header.
Types ¶
type Block ¶
type Block struct {
	View        uint64
	BlockID     flow.Identifier
	ProposerID  flow.Identifier
	QC          *flow.QuorumCertificate
	PayloadHash flow.Identifier
	Timestamp   time.Time
}
    Block is the HotStuff algorithm's concept of a block, which - in the bigger picture - corresponds to the block header.
func BlockFromFlow ¶
BlockFromFlow converts a flow header to a hotstuff block.
func GenesisBlockFromFlow ¶
GenesisBlockFromFlow returns a HotStuff block model representing a genesis block based on the given header.
type ByzantineThresholdExceededError ¶
type ByzantineThresholdExceededError struct {
	Evidence string
}
    ByzantineThresholdExceededError is raised if HotStuff detects malicious conditions which prove a Byzantine threshold of consensus replicas has been exceeded. Per definition, the byzantine threshold is exceeded is there are byzantine consensus replicas with _at least_ 1/3 stake.
func (ByzantineThresholdExceededError) Error ¶
func (e ByzantineThresholdExceededError) Error() string
type ConfigurationError ¶
type ConfigurationError struct {
	Msg string
}
    func (ConfigurationError) Error ¶
func (e ConfigurationError) Error() string
type InvalidBlockError ¶
type InvalidBlockError struct {
	BlockID flow.Identifier
	View    uint64
	Err     error
}
    func (InvalidBlockError) Error ¶
func (e InvalidBlockError) Error() string
func (InvalidBlockError) Unwrap ¶
func (e InvalidBlockError) Unwrap() error
type InvalidVoteError ¶
type InvalidVoteError struct {
	VoteID flow.Identifier
	View   uint64
	Err    error
}
    func (InvalidVoteError) Error ¶
func (e InvalidVoteError) Error() string
func (InvalidVoteError) Unwrap ¶
func (e InvalidVoteError) Unwrap() error
type MissingBlockError ¶
type MissingBlockError struct {
	View    uint64
	BlockID flow.Identifier
}
    func (MissingBlockError) Error ¶
func (e MissingBlockError) Error() string
type NewViewEvent ¶
type NewViewEvent struct {
	View uint64
}
    NewViewEvent is the new view event that contains the new view.
type NoVoteError ¶
type NoVoteError struct {
	Msg string
}
    NoVoteError contains the reason of why the voter didn't vote for a block proposal.
func (NoVoteError) Error ¶
func (e NoVoteError) Error() string
type Proposal ¶
Proposal represent a new proposed block within HotStuff (and thus a a header in the bigger picture), signed by the proposer.
func ProposalFromFlow ¶
ProposalFromFlow turns a flow header into a hotstuff block type.
func (*Proposal) ProposerVote ¶
ProposerVote extracts the proposer vote from the proposal
type TimeoutMode ¶
type TimeoutMode int
TimeoutMode enum type
const ( // ReplicaTimeout represents the time period that the replica is waiting for the block for the current view. ReplicaTimeout TimeoutMode = iota // VoteCollectionTimeout represents the time period that the leader is waiting for votes in order to build // the next block. VoteCollectionTimeout )
func (TimeoutMode) String ¶
func (m TimeoutMode) String() string
type TimerInfo ¶
TimerInfo represents a time period that pacemaker is waiting for a specific event. The end of the time period is the timeout that will trigger pacemaker's view change.
type Vote ¶
type Vote struct {
	View     uint64
	BlockID  flow.Identifier
	SignerID flow.Identifier
	SigData  []byte
}
    Vote is the HotStuff algorithm's concept of a vote for a block proposal.
func VoteFromFlow ¶
func VoteFromFlow(signerID flow.Identifier, blockID flow.Identifier, view uint64, sig crypto.Signature) *Vote
VoteFromFlow turns the vote parameters into a vote struct.