header

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: GPL-3.0, LGPL-3.0, LGPL-3.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseFee

func BaseFee(
	config *extras.ChainConfig,
	parent *types.Header,
	timestamp uint64,
) (*big.Int, error)

BaseFee takes the previous header and the timestamp of its child block and calculates the expected base fee for the child block. Under live.

func BlockGasCost

func BlockGasCost(
	_ *extras.ChainConfig,
	_ *types.Header,
	_ uint64,
) *big.Int

BlockGasCost returns the required block gas cost. Under replaces the legacy AP4/AP5 block gas cost mechanism, so the value is always zero.

func BlockGasCostWithStep

func BlockGasCostWithStep(_ *big.Int, _ uint64, _ uint64) uint64

BlockGasCostWithStep returns the required block gas cost given a parent cost, step, and time elapsed. Under activate-all-implicitly the LP-176 capacity model is the only fee model, so the legacy step-based cost is zero.

func EstimateNextBaseFee

func EstimateNextBaseFee(
	config *extras.ChainConfig,
	parent *types.Header,
	timestamp uint64,
) (*big.Int, error)

EstimateNextBaseFee attempts to estimate the base fee of a block built at `timestamp` on top of `parent`.

If timestamp is before parent.Time, then timestamp is set to parent.Time.

Warning: This function should only be used in estimation and should not be used when calculating the canonical base fee for a block.

func EstimateRequiredTip

func EstimateRequiredTip(
	_ *extras.ChainConfig,
	header *types.Header,
) (*big.Int, error)

EstimateRequiredTip estimates the tip a transaction would have needed to pay to be included in a given block. Under activate-all-implicitly the block gas cost is always zero, so the required tip is sourced from the header's base fee directly: there is no longer a per-block tip surcharge.

func ExtraPrefix

func ExtraPrefix(
	config *extras.ChainConfig,
	parent *types.Header,
	header *types.Header,
	desiredTargetExcess *gas.Gas,
) ([]byte, error)

ExtraPrefix returns the LP-176 fee-state prefix for the header's Extra canonical for every header.

If the `desiredTargetExcess` is nil, the parent's target excess is used.

func GasCapacity

func GasCapacity(
	config *extras.ChainConfig,
	parent *types.Header,
	timestamp uint64,
) (uint64, error)

GasCapacity takes the previous header and the timestamp of its child block and calculates the available gas that can be consumed in the child block. Under activate-all-implicitly the dynamic-fee state machine is always live.

func GasLimit

func GasLimit(
	config *extras.ChainConfig,
	parent *types.Header,
	timestamp uint64,
) (uint64, error)

GasLimit takes the previous header and the timestamp of its child block and calculates the gas limit for the child block. Under activate-all-implicitly the dynamic-fee state machine is always active.

func PredicateBytesFromExtra

func PredicateBytesFromExtra(_ extras.LuxRules, extra []byte) []byte

PredicateBytesFromExtra returns the predicate result bytes from the header's canonical for every header.

func RemainingAtomicGasCapacity

func RemainingAtomicGasCapacity(
	config *extras.ChainConfig,
	parent *types.Header,
	header *types.Header,
) (uint64, error)

RemainingAtomicGasCapacity returns the maximum amount ExtDataGasUsed could be on `header` while still being valid based on the initial capacity and consumed gas. Under activate-all-implicitly the dynamic-fee state machine is always live.

func SetPredicateBytesInExtra

func SetPredicateBytesInExtra(_ extras.LuxRules, extra []byte, predicateBytes []byte) []byte

SetPredicateBytesInExtra sets the predicate result bytes in the header's extra data. Under activate-all-implicitly the LP-176 offset is canonical.

func VerifyExtra

func VerifyExtra(_ extras.LuxRules, extra []byte) error

VerifyExtra verifies that the header's Extra field is correctly formatted. for every header.

func VerifyExtraPrefix

func VerifyExtraPrefix(
	config *extras.ChainConfig,
	parent *types.Header,
	header *types.Header,
) error

VerifyExtraPrefix verifies that the header's Extra field is correctly formatted under the canonical LP-176 layout.

func VerifyGasLimit

func VerifyGasLimit(
	config *extras.ChainConfig,
	parent *types.Header,
	header *types.Header,
) error

VerifyGasLimit verifies that the gas limit for the header is valid under activate-all-implicitly (dynamic-fee state always live).

func VerifyGasUsed

func VerifyGasUsed(
	config *extras.ChainConfig,
	parent *types.Header,
	header *types.Header,
) error

VerifyGasUsed verifies that the gas used is less than or equal to the gas always live.

Types

This section is empty.

Jump to

Keyboard shortcuts

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