validator

package
v0.29.17-read-ledger Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: AGPL-3.0 Imports: 8 Imported by: 3

Documentation

Index

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 New

func New(
	committee hotstuff.Replicas,
	verifier hotstuff.Verifier,
) *Validator

New creates a new Validator instance

func (*Validator) ValidateProposal

func (v *Validator) ValidateProposal(proposal *model.Proposal) error

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.InvalidBlockError 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

func (v *Validator) ValidateVote(vote *model.Vote) (*flow.Identity, error)

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 (ValidatorMetricsWrapper) ValidateTC added in v0.29.0

func (ValidatorMetricsWrapper) ValidateVote

func (w ValidatorMetricsWrapper) ValidateVote(vote *model.Vote) (*flow.Identity, error)

Jump to

Keyboard shortcuts

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