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 ¶
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker which checks gas power
func (*Checker) CalcGasPower ¶
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 MinEnsuredAlloc uint64 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 Reader ¶
type Reader interface {
GetValidationContext() *ValidationContext
}
Reader is accessed by the validator to get the current state.
type ValidationContext ¶
type ValidationContext struct { Epoch idx.Epoch Configs [inter.GasPowerConfigs]Config EpochStart inter.Timestamp Validators *pos.Validators ValidatorStates []ValidatorState }
ValidationContext for gaspower checking
type ValidatorState ¶
Click to show internal directories.
Click to hide internal directories.