Documentation
¶
Index ¶
- func BaseFee(config *extras.ChainConfig, parent *types.Header, timestamp uint64) (*big.Int, error)
- func BlockGasCost(_ *extras.ChainConfig, _ *types.Header, _ uint64) *big.Int
- func BlockGasCostWithStep(_ *big.Int, _ uint64, _ uint64) uint64
- func EstimateNextBaseFee(config *extras.ChainConfig, parent *types.Header, timestamp uint64) (*big.Int, error)
- func EstimateRequiredTip(_ *extras.ChainConfig, header *types.Header) (*big.Int, error)
- func ExtraPrefix(config *extras.ChainConfig, parent *types.Header, header *types.Header, ...) ([]byte, error)
- func GasCapacity(config *extras.ChainConfig, parent *types.Header, timestamp uint64) (uint64, error)
- func GasLimit(config *extras.ChainConfig, parent *types.Header, timestamp uint64) (uint64, error)
- func PredicateBytesFromExtra(_ extras.LuxRules, extra []byte) []byte
- func RemainingAtomicGasCapacity(config *extras.ChainConfig, parent *types.Header, header *types.Header) (uint64, error)
- func SetPredicateBytesInExtra(_ extras.LuxRules, extra []byte, predicateBytes []byte) []byte
- func VerifyExtra(_ extras.LuxRules, extra []byte) error
- func VerifyExtraPrefix(config *extras.ChainConfig, parent *types.Header, header *types.Header) error
- func VerifyGasLimit(config *extras.ChainConfig, parent *types.Header, header *types.Header) error
- func VerifyGasUsed(config *extras.ChainConfig, parent *types.Header, header *types.Header) error
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
SetPredicateBytesInExtra sets the predicate result bytes in the header's extra data. Under activate-all-implicitly the LP-176 offset is canonical.
func VerifyExtra ¶
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 ¶
VerifyGasUsed verifies that the gas used is less than or equal to the gas always live.
Types ¶
This section is empty.