mutations

package
v1.12.18-0...-f7272fa Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2019 The multi-geth Authors This file is part of the multi-geth library.

The multi-geth library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The multi-geth library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the multi-geth library. If not, see <http://www.gnu.org/licenses/>.

Copyright 2019 The multi-geth Authors This file is part of the multi-geth library.

The multi-geth library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The multi-geth library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the multi-geth library. If not, see <http://www.gnu.org/licenses/>.

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 AccumulateRewards

func AccumulateRewards(config ctypes.ChainConfigurator, state *state.StateDB, header *types.Header, uncles []*types.Header)

AccumulateRewards credits the coinbase of the given block with the mining reward. The coinbase of each uncle block is also rewarded.

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 GetBlockEra

func GetBlockEra(blockNum, eraLength *big.Int) *big.Int

GetBlockEra gets which "Era" a given block is within, given an era length (ecip-1017 has era=5,000,000 blocks) Returns a zero-index era number, so "Era 1": 0, "Era 2": 1, "Era 3": 2 ...

func GetBlockUncleRewardByEra

func GetBlockUncleRewardByEra(era *big.Int, header, uncle *types.Header, blockReward *big.Int) *big.Int

GetBlockUncleRewardByEra gets called _for each uncle miner_ associated with a winner block's uncles.

func GetBlockWinnerRewardByEra

func GetBlockWinnerRewardByEra(era *big.Int, blockReward *big.Int) *big.Int

GetRewardByEra gets a block reward at disinflation rate. Constants MaxBlockReward, DisinflationRateQuotient, and DisinflationRateDivisor assumed.

func GetBlockWinnerRewardForUnclesByEra

func GetBlockWinnerRewardForUnclesByEra(era *big.Int, uncles []*types.Header, blockReward *big.Int) *big.Int

GetBlockWinnerRewardForUnclesByEra gets called _per winner_, and accumulates rewards for each included uncle. Assumes uncles have been validated and limited (@ func (v *BlockValidator) VerifyUncles).

func GetRewards

func GetRewards(config ctypes.ChainConfigurator, header *types.Header, uncles []*types.Header) (*big.Int, []*big.Int)

GetRewards calculates the mining reward. The total reward consists of the static block reward and rewards for included uncles. The coinbase of each uncle block is also calculated.

func VerifyDAOHeaderExtraData

func VerifyDAOHeaderExtraData(config ctypes.ChainConfigurator, 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:

  • if the node is no-fork, do not accept blocks in the [fork, fork+10) range with the fork specific extra-data set.
  • if the node is pro-fork, require blocks in the specific range to have the unique extra-data set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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