ethash

package
v0.0.0-...-8a657e3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FrontierBlockReward       = big.NewInt(5e+18) // Block reward in wei for successfully mining a block
	ByzantiumBlockReward      = big.NewInt(3e+18) // Block reward in wei for successfully mining a block upward from Byzantium
	ConstantinopleBlockReward = big.NewInt(2e+18) // Block reward in wei for successfully mining a block upward from Constantinople

)

Ethash proof-of-work protocol constants.

Functions

func CalcDifficulty

func CalcDifficulty(config *params.ChainConfig, time uint64, parent *types.Header) *big.Int

CalcDifficulty is the difficulty adjustment algorithm. It returns the difficulty that a new block should have when created at time given the parent block's time and difficulty.

Types

type Ethash

type Ethash struct{}

func (*Ethash) APIs

func (ethash *Ethash) APIs(chain consensus.ChainHeaderReader) []rpc.API

func (*Ethash) Author

func (ethash *Ethash) Author(header *types.Header) (common.Address, error)

func (*Ethash) CalcDifficulty

func (ethash *Ethash) CalcDifficulty(chain consensus.ChainHeaderReader, time uint64, parent *types.Header) *big.Int

CalcDifficulty is the difficulty adjustment algorithm. It returns the difficulty that a new block should have when created at time given the parent block's time and difficulty.

func (*Ethash) Close

func (ethash *Ethash) Close() error

func (*Ethash) Finalize

func (ethash *Ethash) Finalize(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header)

func (*Ethash) FinalizeAndAssemble

func (ethash *Ethash) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error)

func (*Ethash) Prepare

func (ethash *Ethash) Prepare(chain consensus.ChainHeaderReader, header *types.Header) error

func (*Ethash) Seal

func (ethash *Ethash) Seal(chain consensus.ChainHeaderReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error

func (*Ethash) SealHash

func (ethash *Ethash) SealHash(header *types.Header) (hash common.Hash)

func (*Ethash) VerifyHeader

func (ethash *Ethash) VerifyHeader(chain consensus.ChainHeaderReader, header *types.Header, seal bool) error

func (*Ethash) VerifyHeaders

func (ethash *Ethash) VerifyHeaders(chain consensus.ChainHeaderReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)

func (*Ethash) VerifyUncles

func (ethash *Ethash) VerifyUncles(chain consensus.ChainReader, block *types.Block) error

Jump to

Keyboard shortcuts

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