Documentation ¶
Index ¶
- Constants
- Variables
- type BVsOnly
- type Checker
- func (v *Checker) EnqueueBVs(bvs inter.LlrSignedBlockVotes, onValidated func(error)) error
- func (v *Checker) EnqueueEV(ev inter.LlrSignedEpochVote, onValidated func(error)) error
- func (v *Checker) EnqueueEvent(e inter.EventPayloadI, onValidated func(error)) error
- func (v *Checker) Overloaded() bool
- func (v *Checker) Start()
- func (v *Checker) Stop()
- func (v *Checker) ValidateBVs(bvs inter.LlrSignedBlockVotes) error
- func (v *Checker) ValidateEV(ev inter.LlrSignedEpochVote) error
- func (v *Checker) ValidateEvent(e inter.EventPayloadI) error
- func (v *Checker) ValidateEventLocator(e inter.SignedEventLocator, authEpoch idx.Epoch, authErr error, ...) error
- type Config
- type EVOnly
- type EventsOnly
- type Reader
Constants ¶
View Source
const ( // MaxBlocksPerEpoch is chosen so that even if validator chooses the latest non-liable epoch for BVs, // he still cannot vote for latest blocks (latest = from last 128 epochs), as an epoch has at least one block // The value is larger than a maximum possible number of blocks // in an epoch where a single validator doesn't have 2/3W+1 weight MaxBlocksPerEpoch = idx.Block(basiccheck.MaxLiableEpochs - 128) )
Variables ¶
View Source
var ( ErrWrongEventSig = errors.New("event has wrong signature") ErrMalformedTxSig = errors.New("tx has wrong signature") ErrWrongPayloadHash = errors.New("event has wrong payload hash") ErrPubkeyChanged = errors.New("validator pubkey has changed, cannot create BVs/EV for older epochs") ErrUnknownEpochEventLocator = errors.New("event locator has unknown epoch") ErrImpossibleBVsEpoch = errors.New("BVs have an impossible epoch") ErrUnknownEpochBVs = errors.New("BVs are unprocessable yet") ErrUnknownEpochEV = errors.New("EV is unprocessable yet") )
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 ¶
New validator which performs heavy checks, related to signatures validation and Merkle tree validation
func (*Checker) EnqueueBVs ¶
func (v *Checker) EnqueueBVs(bvs inter.LlrSignedBlockVotes, onValidated func(error)) error
func (*Checker) EnqueueEV ¶
func (v *Checker) EnqueueEV(ev inter.LlrSignedEpochVote, onValidated func(error)) error
func (*Checker) EnqueueEvent ¶
func (v *Checker) EnqueueEvent(e inter.EventPayloadI, onValidated func(error)) error
func (*Checker) Overloaded ¶
func (*Checker) ValidateBVs ¶
func (v *Checker) ValidateBVs(bvs inter.LlrSignedBlockVotes) error
func (*Checker) ValidateEV ¶
func (v *Checker) ValidateEV(ev inter.LlrSignedEpochVote) error
func (*Checker) ValidateEvent ¶
func (v *Checker) ValidateEvent(e inter.EventPayloadI) error
ValidateEvent runs heavy checks for event
func (*Checker) ValidateEventLocator ¶
type Config ¶
func DefaultConfig ¶
func DefaultConfig() Config
type EventsOnly ¶
type EventsOnly struct {
*Checker
}
type Reader ¶
type Reader interface { GetEpochPubKeys() (map[idx.ValidatorID]validatorpk.PubKey, idx.Epoch) GetEpochPubKeysOf(idx.Epoch) map[idx.ValidatorID]validatorpk.PubKey GetEpochBlockStart(idx.Epoch) idx.Block }
Reader is accessed by the validator to get the current state.
Click to show internal directories.
Click to hide internal directories.