heavycheck

package
v1.9.25-zilion-0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: MIT Imports: 13 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
}

Checker which requires only parents list + current epoch info

func New

func New(config Config, reader Reader, txSigner types.Signer) *Checker

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

func (*Checker) Enqueue

func (v *Checker) Enqueue(tasks []queuedcheck.EventTask, onValidated func([]queuedcheck.EventTask)) 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(de dag.Event) error

Validate event

type Config

type Config struct {
	MaxQueuedBatches int // the maximum number of event batches to queue up
	MaxBatch         int // Maximum number of events in an task batch (batch is divided if exceeded)
	Threads          int
}

func DefaultConfig

func DefaultConfig() Config

type Reader

type Reader interface {
	GetEpochPubKeys() (map[idx.ValidatorID]validatorpk.PubKey, idx.Epoch)
}

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

type TasksData

type TasksData struct {
	Tasks []queuedcheck.EventTask // events to validate
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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