gasprice

package
v0.0.0-...-8d1e6a5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2023 License: GPL-3.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Blocks     int
	Percentile int
	Default    *big.Int `toml:",omitempty"`
}

type Oracle

type Oracle struct {
	// contains filtered or unexported fields
}

Oracle recommends gas prices based on the content of recent blocks. Suitable for both light and full clients.

func NewOracle

func NewOracle(backend ethapi.Backend, params Config) *Oracle

NewOracle returns a new oracle.

func (*Oracle) SuggestPrice

func (gpo *Oracle) SuggestPrice(ctx context.Context) (*big.Int, error)

SuggestPrice returns the recommended gas price.

type RollupOracle

type RollupOracle struct {
	// contains filtered or unexported fields
}

RollupOracle holds the L1 and L2 gas prices for fee calculation

func NewRollupOracle

func NewRollupOracle() *RollupOracle

NewRollupOracle returns an initialized RollupOracle

func (*RollupOracle) SetL1GasPrice

func (gpo *RollupOracle) SetL1GasPrice(gasPrice *big.Int) error

SetL1GasPrice returns the current L1 gas price

func (*RollupOracle) SetL2GasPrice

func (gpo *RollupOracle) SetL2GasPrice(gasPrice *big.Int) error

SetL2GasPrice returns the current L2 gas price

func (*RollupOracle) SetOverhead

func (gpo *RollupOracle) SetOverhead(overhead *big.Int) error

SetOverhead caches the overhead value that is set in the OVM_GasPriceOracle

func (*RollupOracle) SetScalar

func (gpo *RollupOracle) SetScalar(scalar *big.Int, decimals *big.Int) error

SetScalar sets the scalar value held in the OVM_GasPriceOracle

func (*RollupOracle) SuggestL1GasPrice

func (gpo *RollupOracle) SuggestL1GasPrice(ctx context.Context) (*big.Int, error)

SuggestL1GasPrice returns the gas price which should be charged per byte of published data by the sequencer.

func (*RollupOracle) SuggestL2GasPrice

func (gpo *RollupOracle) SuggestL2GasPrice(ctx context.Context) (*big.Int, error)

SuggestL2GasPrice returns the gas price which should be charged per unit of gas set manually by the sequencer depending on congestion

func (*RollupOracle) SuggestOverhead

func (gpo *RollupOracle) SuggestOverhead(ctx context.Context) (*big.Int, error)

SuggestOverhead returns the cached overhead value from the OVM_GasPriceOracle

func (*RollupOracle) SuggestScalar

func (gpo *RollupOracle) SuggestScalar(ctx context.Context) (*big.Float, error)

SuggestScalar returns the cached scalar value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL