heavycheck

package
v0.6.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongEventSig  = errors.New("event has wrong signature")
	ErrMalformedTxSig = errors.New("tx has wrong signature")
	ErrWrongTxHash    = errors.New("tx has wrong txs Merkle tree root")
)

Functions

This section is empty.

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Check which require only parents list + current epoch info

func New

func New(config *lachesis.DagConfig, reader DagReader, txSigner types.Signer, numOfThreads int) *Checker

New validator which performs heavy checks, related to signatures validation and Merkle tree validation

func NewDefault

func NewDefault(config *lachesis.DagConfig, reader DagReader, txSigner types.Signer) *Checker

NewDefault uses N-1 threads

func (*Checker) Enqueue

func (v *Checker) Enqueue(events inter.Events, onValidated OnValidatedFn) error

func (*Checker) Overloaded

func (v *Checker) Overloaded() bool

func (*Checker) Start

func (v *Checker) Start()

func (*Checker) Stop

func (v *Checker) Stop()

func (*Checker) Validate

func (v *Checker) Validate(e *inter.Event) error

Validate event

type DagReader

type DagReader interface {
	GetEpochPubKeys() (map[idx.StakerID]common.Address, idx.Epoch)
}

DagReader is accessed by the validator to get the current state.

type OnValidatedFn

type OnValidatedFn func(*TaskData)

OnValidatedFn is a callback type for notifying about validation result.

type TaskData

type TaskData struct {
	Events inter.Events // events to validate
	Result []error      // resulting errors of events, nil if ok
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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