Documentation ¶
Index ¶
- type Validator
- type ValidatorMetricsWrapper
- func (w ValidatorMetricsWrapper) ValidateProposal(proposal *model.Proposal) error
- func (w ValidatorMetricsWrapper) ValidateQC(qc *flow.QuorumCertificate) error
- func (w ValidatorMetricsWrapper) ValidateTC(tc *flow.TimeoutCertificate) error
- func (w ValidatorMetricsWrapper) ValidateVote(vote *model.Vote) (*flow.Identity, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator is responsible for validating QC, Block and Vote
func (*Validator) ValidateProposal ¶
ValidateProposal validates the block proposal A block is considered as valid if it's a valid extension of existing forks. Note it doesn't check if it's conflicting with finalized block During normal operations, the following error returns are expected:
- model.InvalidProposalError if the block is invalid
- model.ErrViewForUnknownEpoch if the proposal refers unknown epoch
Any other error should be treated as exception
func (*Validator) ValidateQC ¶
func (v *Validator) ValidateQC(qc *flow.QuorumCertificate) error
ValidateQC validates the Quorum Certificate `qc`. During normal operations, the following error returns are expected:
- model.InvalidQCError if the QC is invalid
- model.ErrViewForUnknownEpoch if the QC refers unknown epoch
Any other error should be treated as exception
func (*Validator) ValidateTC ¶ added in v0.29.0
func (v *Validator) ValidateTC(tc *flow.TimeoutCertificate) error
ValidateTC validates the TimeoutCertificate `TC`. During normal operations, the following error returns are expected:
- model.InvalidTCError if the TC is invalid
- model.ErrViewForUnknownEpoch if the TC refers unknown epoch
Any other error should be treated as exception
func (*Validator) ValidateVote ¶
ValidateVote validates the vote and returns the identity of the voter who signed vote - the vote to be validated During normal operations, the following error returns are expected:
- model.InvalidVoteError for invalid votes
- model.ErrViewForUnknownEpoch if the vote refers unknown epoch
Any other error should be treated as exception
type ValidatorMetricsWrapper ¶
type ValidatorMetricsWrapper struct {
// contains filtered or unexported fields
}
ValidatorMetricsWrapper implements the hotstuff.Validator interface. It wraps a hotstuff.Validator instance and measures the time which the HotStuff's core logic spends in the hotstuff.Validator component, i.e. the with verifying higher-level consensus messages. The measured time durations are reported as values for the ValidatorProcessingDuration metric.
func NewMetricsWrapper ¶
func NewMetricsWrapper(validator hotstuff.Validator, metrics module.HotstuffMetrics) *ValidatorMetricsWrapper
func (ValidatorMetricsWrapper) ValidateProposal ¶
func (w ValidatorMetricsWrapper) ValidateProposal(proposal *model.Proposal) error
func (ValidatorMetricsWrapper) ValidateQC ¶
func (w ValidatorMetricsWrapper) ValidateQC(qc *flow.QuorumCertificate) error
func (ValidatorMetricsWrapper) ValidateTC ¶ added in v0.29.0
func (w ValidatorMetricsWrapper) ValidateTC(tc *flow.TimeoutCertificate) error