validator

package
v0.22.9-patch-1-epoch-... Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: AGPL-3.0 Imports: 9 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.Committee,
	forks hotstuff.ForksReader,
	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

func (*Validator) ValidateQC

func (v *Validator) ValidateQC(qc *flow.QuorumCertificate, block *model.Block) error

ValidateQC validates the QC qc - the qc to be validated block - the block that the qc is pointing to

func (*Validator) ValidateVote

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

ValidateVote validates the vote and returns the identity of the voter who signed vote - the vote to be validated block - the voting block. Assuming the block has been validated.

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, block *model.Block) error

func (ValidatorMetricsWrapper) ValidateVote

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

Jump to

Keyboard shortcuts

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