Help us shape the future of Go! Take the 2026 Go Developer Survey

validator

package
v0.23.6 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 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