gas

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

README

The gas package contains the necessary code for estimating and pricing l1 gas. Currently it's mostly barebone placeholders, but will evolve into precompiled smart contracts and binders for accessing their state in order to fit it in the gas mechanics.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateL1GasUsed

func CalculateL1GasUsed(data []byte, overhead *big.Int) *big.Int

CalculateL1GasUsed - calculates the gas cost of having a transaction on the l1.

Types

type ObscuroGasPool

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

func NewObscuroGasPool

func NewObscuroGasPool(gp *gethcore.GasPool) *ObscuroGasPool

func (*ObscuroGasPool) ForTransaction

func (gp *ObscuroGasPool) ForTransaction(tx *types.Transaction) (*gethcore.GasPool, error)

type Oracle

type Oracle interface {
	ProcessL1Block(block *types.Block)
	EstimateL1StorageGasCost(tx *types.Transaction, block *types.Block) (*big.Int, error)
	EstimateL1CostForMsg(args *gethapi.TransactionArgs, block *types.Block) (*big.Int, error)
}

Oracle - the interface for the future precompiled gas oracle contract which will expose necessary l1 information.

func NewGasOracle

func NewGasOracle() Oracle

Jump to

Keyboard shortcuts

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