incentive

package
v2.1.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: GPL-3.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEpochGas

func AddEpochGas(stateDb vm.StateDB, gasValue *big.Int, epochID uint64)

AddEpochGas is used for every block's gas fee collection in each epoch

func GetEpochGasPool

func GetEpochGasPool(stateDb vm.StateDB, epochID uint64) *big.Int

GetEpochGasPool use to get epoch gas pool

func GetEpochIncentive

func GetEpochIncentive(epochID uint64) (*big.Int, error)

GetEpochIncentive get total incentive of all epoch

func GetEpochIncentiveBlockNumber

func GetEpochIncentiveBlockNumber(epochID uint64) (*big.Int, error)

func GetEpochLeaderActivity

func GetEpochLeaderActivity(stateDb vm.StateDB, epochID uint64) ([]common.Address, []int)

GetEpochLeaderActivity can get the address and activity of epoch leaders

func GetEpochPayDetail

func GetEpochPayDetail(epochID uint64) ([][]vm.ClientIncentive, error)

GetEpochPayDetail use to get detail payment array

func GetEpochRBLeaderActivity

func GetEpochRBLeaderActivity(stateDb vm.StateDB, epochID uint64) ([]common.Address, []int)

GetEpochRBLeaderActivity can get the address and activity of RB leaders

func GetEpochRemain

func GetEpochRemain(epochID uint64) (*big.Int, error)

GetEpochRemain get remain of epoch input

func GetIncentivePool

func GetIncentivePool(stateDb *state.StateDB, epochID uint64) (*big.Int, *big.Int, *big.Int)

GetIncentivePool can get the total incentive, foundation part and gas pool part.

func GetRBAddress

func GetRBAddress(epochID uint64) []common.Address

GetRBAddress use to get random proposer address list

func GetRunTimes

func GetRunTimes() (*big.Int, error)

GetRunTimes returns incentive run times

func GetSlotLeaderActivity

func GetSlotLeaderActivity(chain consensus.ChainReader, epochID uint64) ([]common.Address, []int, float64, int)

GetSlotLeaderActivity can get the address, blockCnt, and activity of slotleader

func GetTotalIncentive

func GetTotalIncentive() (*big.Int, error)

GetTotalIncentive get total incentive of all epoch

func GetTotalRemain

func GetTotalRemain() (*big.Int, error)

GetTotalRemain get remain of epoch input

func Init

Init is use to init the outsides interface of staker. Should be called at the node start

func Run

func Run(chain consensus.ChainReader, stateDb *state.StateDB, epochID uint64) bool

Run is use to run the incentive should be called in Finalize of consensus

Types

type GetEpochLeaderInfoFn

type GetEpochLeaderInfoFn func(stateDb vm.StateDB, epochID uint64) ([]common.Address, []int)

GetEpochLeaderInfoFn is a function use to get epoch activity and address

type GetRandomProposerAddressFn

type GetRandomProposerAddressFn func(epochID uint64) []vm.Leader

GetRandomProposerAddressFn is use to get rb group address

type GetRandomProposerInfoFn

type GetRandomProposerInfoFn func(stateDb vm.StateDB, epochID uint64) ([]common.Address, []int)

GetRandomProposerInfoFn is use to get rb group and activity

type GetSlotLeaderInfoFn

type GetSlotLeaderInfoFn func(chain consensus.ChainReader, epochID uint64, slotCount int) ([]common.Address, []int, float64, int)

GetSlotLeaderInfoFn is use to get slotleader address and activity

type GetStakerInfoFn

type GetStakerInfoFn func(uint64, common.Address) (*vm.ValidatorInfo, error)

GetStakerInfoFn is a function use to get staker info

type SetStakerInfoFn

type SetStakerInfoFn func(uint64, [][]vm.ClientIncentive) error

SetStakerInfoFn is a function use to set payment info

Jump to

Keyboard shortcuts

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