Documentation ¶
Index ¶
- Variables
- func ApplyDAOHardFork(statedb *state.IntraBlockState)
- func CalcBaseFee(config *chain.Config, parent *types.Header) *big.Int
- func CalcExcessDataGas(parentExcessDataGas *big.Int, newBlobs int) *big.Int
- func CountBlobs(txs []types.Transaction) int
- func FakeExponential(factor, num, denom *big.Int) *big.Int
- func GetDataGasPrice(excessDataGas *big.Int) *big.Int
- func VerifyDAOHeaderExtraData(config *chain.Config, header *types.Header) error
- func VerifyEip1559Header(config *chain.Config, parent, header *types.Header) error
- func VerifyEip4844Header(config *chain.Config, parent, header *types.Header) error
- func VerifyGaslimit(parentGasLimit, headerGasLimit uint64) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrBadProDAOExtra is returned if a header doesn't support the DAO fork on a // pro-fork client. ErrBadProDAOExtra = errors.New("bad DAO pro-fork extra-data") // ErrBadNoDAOExtra is returned if a header does support the DAO fork on a no- // fork client. ErrBadNoDAOExtra = errors.New("bad DAO no-fork extra-data") )
Functions ¶
func ApplyDAOHardFork ¶
func ApplyDAOHardFork(statedb *state.IntraBlockState)
ApplyDAOHardFork modifies the state database according to the DAO hard-fork rules, transferring all balances of a set of DAO accounts to a single refund contract.
func CalcBaseFee ¶
CalcBaseFee calculates the basefee of the header.
func CalcExcessDataGas ¶
CalcExcessDataGas implements calc_excess_data_gas from EIP-4844
func CountBlobs ¶
func CountBlobs(txs []types.Transaction) int
CountBlobs returns the number of blob transactions in txs
func FakeExponential ¶
FakeExponential approximates factor * e ** (num / denom) using a taylor expansion as described in the EIP-4844 spec.
func GetDataGasPrice ¶
GetDataGasPrice implements get_data_gas_price from EIP-4844
func VerifyDAOHeaderExtraData ¶
VerifyDAOHeaderExtraData validates the extra-data field of a block header to ensure it conforms to DAO hard-fork rules.
DAO hard-fork extension to the header validity:
a) if the node is no-fork, do not accept blocks in the [fork, fork+10) range with the fork specific extra-data set b) if the node is pro-fork, require blocks in the specific range to have the unique extra-data set.
func VerifyEip1559Header ¶
VerifyEip1559Header verifies some header attributes which were changed in EIP-1559, - gas limit check - basefee check
func VerifyEip4844Header ¶
VerifyEip4844Header verifies that the header is not malformed
func VerifyGaslimit ¶
VerifyGaslimit verifies the header gas limit according increase/decrease in relation to the parent gas limit.
Types ¶
This section is empty.