Documentation ¶
Index ¶
- Variables
- func ApplyBeaconRootEip4788(parentBeaconBlockRoot *libcommon.Hash, syscall consensus.SystemCall)
- func ApplyDAOHardFork(statedb *state.IntraBlockState)
- func CalcBaseFee(config *chain.Config, parent *types.Header) *big.Int
- func CalcExcessBlobGas(config *chain.Config, parent *types.Header) uint64
- func FakeExponential(factor, denom *uint256.Int, excessBlobGas uint64) (*uint256.Int, error)
- func GetBlobGasPrice(config *chain.Config, excessBlobGas uint64) (*uint256.Int, error)
- func GetBlobGasUsed(numBlobs int) uint64
- func IsPoSHeader(header *types.Header) bool
- func VerifyAbsenceOfCancunHeaderFields(header *types.Header) error
- func VerifyDAOHeaderExtraData(config *chain.Config, header *types.Header) error
- func VerifyEip1559Header(config *chain.Config, parent, header *types.Header, skipGasLimit bool) error
- func VerifyGaslimit(parentGasLimit, headerGasLimit uint64) error
- func VerifyPresenceOfCancunHeaderFields(header *types.Header) 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") )
var ( ProofOfStakeDifficulty = libcommon.Big0 // PoS block's difficulty is always 0 ProofOfStakeNonce = types.BlockNonce{} // PoS block's have all-zero nonces )
Constants for The Merge as specified by EIP-3675: Upgrade consensus to Proof-of-Stake
Functions ¶
func ApplyBeaconRootEip4788 ¶
func ApplyBeaconRootEip4788(parentBeaconBlockRoot *libcommon.Hash, syscall consensus.SystemCall)
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 CalcExcessBlobGas ¶
CalcExcessBlobGas implements calc_excess_blob_gas from EIP-4844
func FakeExponential ¶
FakeExponential approximates factor * e ** (num / denom) using a taylor expansion as described in the EIP-4844 spec.
func GetBlobGasPrice ¶
func GetBlobGasUsed ¶
func IsPoSHeader ¶
IsPoSHeader reports the header belongs to the PoS-stage with some special fields. This function is not suitable for a part of APIs like Prepare or CalcDifficulty because the header difficulty is not set yet.
func VerifyAbsenceOfCancunHeaderFields ¶
VerifyAbsenceOfCancunHeaderFields checks that the header doesn't have any fields added in Cancun (EIP-4844, EIP-4788).
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 ¶
func VerifyEip1559Header(config *chain.Config, parent, header *types.Header, skipGasLimit bool) error
VerifyEip1559Header verifies some header attributes which were changed in EIP-1559, - gas limit check - basefee check
func VerifyGaslimit ¶
VerifyGaslimit verifies the header gas limit according increase/decrease in relation to the parent gas limit.
func VerifyPresenceOfCancunHeaderFields ¶
VerifyPresenceOfCancunHeaderFields checks that the fields introduced in Cancun (EIP-4844, EIP-4788) are present.
Types ¶
This section is empty.