misc

package
v0.2.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.StateDB)

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

func CalcBaseFee(config *params.ChainConfig, parent *types.Header) *big.Int

CalcBaseFee calculates the basefee of the header.

func CalculateReward

func CalculateReward() *big.Int

CalculateReward calculates the coinbase rewards depending on the type of the block regions = # of regions zones = # of zones For each prime = Reward/3 For each region = Reward/(3*regions*time-factor) For each zone = Reward/(3*regions*zones*time-factor^2)

func VerifyDAOHeaderExtraData

func VerifyDAOHeaderExtraData(config *params.ChainConfig, header *types.Header) error

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 *params.ChainConfig, parent, header *types.Header) error

VerifyEip1559Header verifies some header attributes which were changed in EIP-1559, - gas limit check - basefee check

func VerifyForkHashes

func VerifyForkHashes(config *params.ChainConfig, header *types.Header, uncle bool) error

VerifyForkHashes verifies that blocks conforming to network hard-forks do have the correct hashes, to avoid clients going off on different chains. This is an optional feature.

func VerifyGaslimit

func VerifyGaslimit(parentGasLimit, headerGasLimit uint64) error

VerifyGaslimit verifies the header gas limit according increase/decrease in relation to the parent gas limit.

Types

This section is empty.

Jump to

Keyboard shortcuts

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