Documentation ¶
Index ¶
- Variables
- func IsConfigurationError(err error) bool
- func IsDoubleVoteError(err error) bool
- func IsDuplicatedSignerError(err error) bool
- func IsInsufficientSignaturesError(err error) bool
- func IsInvalidBlockError(err error) bool
- func IsInvalidFormatError(err error) bool
- func IsInvalidSignatureIncludedError(err error) bool
- func IsInvalidSignerError(err error) bool
- func IsInvalidVoteError(err error) bool
- func IsMissingBlockError(err error) bool
- func IsNoVoteError(err error) bool
- func NewConfigurationError(err error) error
- func NewConfigurationErrorf(msg string, args ...interface{}) error
- func NewDoubleVoteErrorf(firstVote, conflictingVote *Vote, msg string, args ...interface{}) error
- func NewDuplicatedSignerError(err error) error
- func NewDuplicatedSignerErrorf(msg string, args ...interface{}) error
- func NewInsufficientSignaturesError(err error) error
- func NewInsufficientSignaturesErrorf(msg string, args ...interface{}) error
- func NewInvalidFormatError(err error) error
- func NewInvalidFormatErrorf(msg string, args ...interface{}) error
- func NewInvalidSignatureIncludedError(err error) error
- func NewInvalidSignatureIncludedErrorf(msg string, args ...interface{}) error
- func NewInvalidSignerError(err error) error
- func NewInvalidSignerErrorf(msg string, args ...interface{}) error
- func NewInvalidVoteErrorf(vote *Vote, msg string, args ...interface{}) error
- func ProposalToFlow(proposal *Proposal) *flow.Header
- func UnpackRandomBeaconSig(sigData []byte) (crypto.Signature, error)
- type Block
- type ByzantineThresholdExceededError
- type ConfigurationError
- type DoubleVoteError
- type DuplicatedSignerError
- type InsufficientSignaturesError
- type InvalidBlockError
- type InvalidFormatError
- type InvalidSignatureIncludedError
- type InvalidSignerError
- type InvalidVoteError
- type MissingBlockError
- type NewViewEvent
- type NoVoteError
- type Proposal
- type SigDataPacker
- type SignatureData
- type TimeoutMode
- type TimerInfo
- type Vote
Constants ¶
This section is empty.
Variables ¶
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") ErrInvalidSignature = errors.New("invalid signature") )
Functions ¶
func IsConfigurationError ¶ added in v0.23.9
IsConfigurationError returns whether err is a ConfigurationError
func IsDoubleVoteError ¶ added in v0.23.9
IsDoubleVoteError returns whether an error is DoubleVoteError
func IsDuplicatedSignerError ¶ added in v0.23.9
IsDuplicatedSignerError returns whether err is an DuplicatedSignerError
func IsInsufficientSignaturesError ¶ added in v0.23.9
IsInsufficientSignaturesError returns whether err is an InsufficientSignaturesError
func IsInvalidBlockError ¶
IsInvalidBlockError returns whether an error is InvalidBlockError
func IsInvalidFormatError ¶ added in v0.26.1
IsInvalidFormatError returns whether err is a InvalidFormatError
func IsInvalidSignatureIncludedError ¶ added in v0.23.9
IsInvalidSignatureIncludedError returns whether err is an InvalidSignatureIncludedError
func IsInvalidSignerError ¶ added in v0.23.9
IsInvalidSignerError returns whether err is an InvalidSignerError
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 NewConfigurationError ¶ added in v0.23.9
func NewConfigurationErrorf ¶ added in v0.23.9
func NewDoubleVoteErrorf ¶ added in v0.23.9
func NewDuplicatedSignerError ¶ added in v0.23.9
func NewDuplicatedSignerErrorf ¶ added in v0.23.9
func NewInsufficientSignaturesError ¶ added in v0.23.9
func NewInsufficientSignaturesErrorf ¶ added in v0.23.9
func NewInvalidFormatError ¶ added in v0.26.1
func NewInvalidFormatErrorf ¶ added in v0.26.1
func NewInvalidSignatureIncludedError ¶ added in v0.23.9
func NewInvalidSignatureIncludedErrorf ¶ added in v0.23.9
func NewInvalidSignerError ¶ added in v0.23.9
func NewInvalidSignerErrorf ¶ added in v0.23.9
func NewInvalidVoteErrorf ¶ added in v0.23.9
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 if there are byzantine consensus replicas with _at least_ 1/3 weight.
func (ByzantineThresholdExceededError) Error ¶
func (e ByzantineThresholdExceededError) Error() string
type ConfigurationError ¶
type ConfigurationError struct {
// contains filtered or unexported fields
}
ConfigurationError indicates that a constructor or component was initialized with invalid or inconsistent parameters.
func (ConfigurationError) Error ¶
func (e ConfigurationError) Error() string
func (ConfigurationError) Unwrap ¶ added in v0.23.9
func (e ConfigurationError) Unwrap() error
type DoubleVoteError ¶ added in v0.23.9
type DoubleVoteError struct { FirstVote *Vote ConflictingVote *Vote // contains filtered or unexported fields }
DoubleVoteError indicates that a consensus replica has voted for two different blocks, or has provided two semantically different votes for the same block.
func AsDoubleVoteError ¶ added in v0.23.9
func AsDoubleVoteError(err error) (*DoubleVoteError, bool)
AsDoubleVoteError determines whether the given error is a DoubleVoteError (potentially wrapped). It follows the same semantics as a checked type cast.
func (DoubleVoteError) Error ¶ added in v0.23.9
func (e DoubleVoteError) Error() string
func (DoubleVoteError) Unwrap ¶ added in v0.23.9
func (e DoubleVoteError) Unwrap() error
type DuplicatedSignerError ¶ added in v0.23.9
type DuplicatedSignerError struct {
// contains filtered or unexported fields
}
DuplicatedSignerError indicates that a signature from the same node ID has already been added
func (DuplicatedSignerError) Error ¶ added in v0.23.9
func (e DuplicatedSignerError) Error() string
func (DuplicatedSignerError) Unwrap ¶ added in v0.23.9
func (e DuplicatedSignerError) Unwrap() error
type InsufficientSignaturesError ¶ added in v0.23.9
type InsufficientSignaturesError struct {
// contains filtered or unexported fields
}
InsufficientSignaturesError indicates that not enough signatures have been stored to complete the operation.
func (InsufficientSignaturesError) Error ¶ added in v0.23.9
func (e InsufficientSignaturesError) Error() string
func (InsufficientSignaturesError) Unwrap ¶ added in v0.23.9
func (e InsufficientSignaturesError) Unwrap() error
type InvalidBlockError ¶
type InvalidBlockError struct { BlockID flow.Identifier View uint64 Err error }
InvalidBlockError indicates that the block with identifier `BlockID` is invalid
func (InvalidBlockError) Error ¶
func (e InvalidBlockError) Error() string
func (InvalidBlockError) Unwrap ¶
func (e InvalidBlockError) Unwrap() error
type InvalidFormatError ¶ added in v0.26.1
type InvalidFormatError struct {
// contains filtered or unexported fields
}
InvalidFormatError indicates that some data has an incompatible format.
func (InvalidFormatError) Error ¶ added in v0.26.1
func (e InvalidFormatError) Error() string
func (InvalidFormatError) Unwrap ¶ added in v0.26.1
func (e InvalidFormatError) Unwrap() error
type InvalidSignatureIncludedError ¶ added in v0.23.9
type InvalidSignatureIncludedError struct {
// contains filtered or unexported fields
}
InvalidSignatureIncludedError indicates that some signatures, included via TrustedAdd, are invalid
func (InvalidSignatureIncludedError) Error ¶ added in v0.23.9
func (e InvalidSignatureIncludedError) Error() string
func (InvalidSignatureIncludedError) Unwrap ¶ added in v0.23.9
func (e InvalidSignatureIncludedError) Unwrap() error
type InvalidSignerError ¶ added in v0.23.9
type InvalidSignerError struct {
// contains filtered or unexported fields
}
InvalidSignerError indicates that the signer is not authorized or unknown
func (InvalidSignerError) Error ¶ added in v0.23.9
func (e InvalidSignerError) Error() string
func (InvalidSignerError) Unwrap ¶ added in v0.23.9
func (e InvalidSignerError) Unwrap() error
type InvalidVoteError ¶
type InvalidVoteError struct { VoteID flow.Identifier View uint64 Err error }
InvalidVoteError indicates that the vote with identifier `VoteID` is invalid
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 }
MissingBlockError indicates that no block with identifier `BlockID` is known
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 SigDataPacker ¶ added in v0.26.1
type SigDataPacker struct {
// contains filtered or unexported fields
}
SigDataPacker implements logic for encoding/decoding SignatureData using RLP encoding.
func (*SigDataPacker) Decode ¶ added in v0.26.1
func (p *SigDataPacker) Decode(data []byte) (*SignatureData, error)
Decode performs decoding of SignatureData
func (*SigDataPacker) Encode ¶ added in v0.26.1
func (p *SigDataPacker) Encode(sigData *SignatureData) ([]byte, error)
Encode performs encoding of SignatureData
type SignatureData ¶ added in v0.26.1
type SignatureData struct { // bit-vector indicating type of signature for each signer. // the order of each sig type matches the order of corresponding signer IDs SigType []byte AggregatedStakingSig []byte AggregatedRandomBeaconSig []byte ReconstructedRandomBeaconSig crypto.Signature }
SignatureData is a compact data type for encoding the block signature data
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.