Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrWrongGasPowerLeft indicates that event's GasPowerLeft is miscalculated. ErrWrongGasPowerLeft = errors.New("event has wrong GasPowerLeft") )
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker which checks gas power
func (*Checker) CalcGasPower ¶
func (v *Checker) CalcGasPower(e *inter.EventHeaderData, selfParent *inter.EventHeaderData) (inter.GasPowerLeft, error)
CalcGasPower calculates available gas power for the event, i.e. how many gas its content may consume
type Config ¶
type Config struct { Idx int AllocPerSec uint64 MaxAllocPeriod inter.Timestamp StartupAllocPeriod inter.Timestamp MinStartupGas uint64 }
Config for gaspower checking. There'll be 2 different configs for short-term and long-term gas power checks.
type DagReader ¶
type DagReader interface {
GetValidationContext() *ValidationContext
}
DagReader is accessed by the validator to get the current state.
type ValidationContext ¶
type ValidationContext struct { Epoch idx.Epoch Configs [2]Config Validators *pos.Validators PrevEpochLastHeaders inter.HeadersByCreator PrevEpochEndTime inter.Timestamp PrevEpochRefunds map[idx.StakerID]uint64 }
ValidationContext for gaspower checking
Click to show internal directories.
Click to hide internal directories.