Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GasPriceUpdater ¶
type GasPriceUpdater struct {
// contains filtered or unexported fields
}
func NewGasPriceUpdater ¶
func NewGasPriceUpdater( gasPricer *GasPricer, epochStartBlockNumber uint64, averageBlockGasLimit uint64, epochLengthSeconds uint64, getLatestBlockNumberFn GetLatestBlockNumberFn, getGasUsedByBlockFn GetGasUsedByBlockFn, updateL2GasPriceFn UpdateL2GasPriceFn, ) (*GasPriceUpdater, error)
func (*GasPriceUpdater) GetGasPrice ¶
func (g *GasPriceUpdater) GetGasPrice() uint64
func (*GasPriceUpdater) UpdateGasPrice ¶
func (g *GasPriceUpdater) UpdateGasPrice() error
type GasPricer ¶
type GasPricer struct {
// contains filtered or unexported fields
}
func NewGasPricer ¶
func NewGasPricer(curPrice, floorPrice uint64, getTargetGasPerSecond GetTargetGasPerSecond, maxPercentChangePerEpoch float64) (*GasPricer, error)
NewGasPricer creates a GasPricer and checks its config beforehand
func (*GasPricer) CalcNextEpochGasPrice ¶
CalcNextEpochGasPrice calculates the next gas price given some average gas per second over the last epoch
type GetLatestBlockNumberFn ¶
type GetTargetGasPerSecond ¶
type GetTargetGasPerSecond func() float64
type UpdateL2GasPriceFn ¶
Click to show internal directories.
Click to hide internal directories.