Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Type EstimatorType `mapstructure:"Type"` DefaultGasPriceWei uint64 `mapstructure:"DefaultGasPriceWei"` MaxPrice *big.Int `mapstructure:"MaxPrice"` IgnorePrice *big.Int `mapstructure:"IgnorePrice"` CheckBlocks int `mapstructure:"CheckBlocks"` Percentile int `mapstructure:"Percentile"` UpdatePeriod types.Duration `mapstructure:"UpdatePeriod"` Factor float64 `mapstructure:"Factor"` }
Config for gas price estimator.
type DefaultGasPricer ¶
type DefaultGasPricer struct {
// contains filtered or unexported fields
}
DefaultGasPricer gas price from config is set.
func (*DefaultGasPricer) UpdateGasPriceAvg ¶
func (d *DefaultGasPricer) UpdateGasPriceAvg()
UpdateGasPriceAvg not needed for default strategy.
type EstimatorType ¶
type EstimatorType string
EstimatorType different gas estimator types.
const ( // DefaultType default gas price from config is set. DefaultType EstimatorType = "default" // LastNBatchesType calculate average gas tip from last n batches. LastNBatchesType EstimatorType = "lastnbatches" // FollowerType calculate the gas price basing on the L1 gasPrice. FollowerType EstimatorType = "follower" )
type FollowerGasPrice ¶
type FollowerGasPrice struct {
// contains filtered or unexported fields
}
FollowerGasPrice struct.
func (*FollowerGasPrice) UpdateGasPriceAvg ¶
func (f *FollowerGasPrice) UpdateGasPriceAvg()
UpdateGasPriceAvg updates the gas price.
type L2GasPricer ¶
type L2GasPricer interface {
UpdateGasPriceAvg()
}
L2GasPricer interface for gas price suggester.
type LastNL2BlocksGasPrice ¶
type LastNL2BlocksGasPrice struct {
// contains filtered or unexported fields
}
LastNL2BlocksGasPrice struct for gas price estimator last n l2 blocks.
func (*LastNL2BlocksGasPrice) UpdateGasPriceAvg ¶
func (g *LastNL2BlocksGasPrice) UpdateGasPriceAvg()
UpdateGasPriceAvg for last n bathes strategy is not needed to implement this function.
Click to show internal directories.
Click to hide internal directories.