Documentation ¶
Index ¶
- func AddEpochGas(stateDb vm.StateDB, gasValue *big.Int, epochID uint64)
- func GetEpochGasPool(stateDb vm.StateDB, epochID uint64) *big.Int
- func GetEpochIncentive(epochID uint64) (*big.Int, error)
- func GetEpochIncentiveBlockNumber(epochID uint64) (*big.Int, error)
- func GetEpochLeaderActivity(stateDb vm.StateDB, epochID uint64) ([]common.Address, []int)
- func GetEpochPayDetail(epochID uint64) ([][]vm.ClientIncentive, error)
- func GetEpochRBLeaderActivity(stateDb vm.StateDB, epochID uint64) ([]common.Address, []int)
- func GetEpochRemain(epochID uint64) (*big.Int, error)
- func GetIncentivePool(stateDb *state.StateDB, epochID uint64) (*big.Int, *big.Int, *big.Int)
- func GetRBAddress(epochID uint64) []common.Address
- func GetRunTimes() (*big.Int, error)
- func GetSlotLeaderActivity(chain consensus.ChainReader, epochID uint64) ([]common.Address, []int, float64, int)
- func GetTotalIncentive() (*big.Int, error)
- func GetTotalRemain() (*big.Int, error)
- func Init(get GetStakerInfoFn, set SetStakerInfoFn, getRbAddr GetRandomProposerAddressFn)
- func Run(chain consensus.ChainReader, stateDb *state.StateDB, epochID uint64) bool
- type GetEpochLeaderInfoFn
- type GetRandomProposerAddressFn
- type GetRandomProposerInfoFn
- type GetSlotLeaderInfoFn
- type GetStakerInfoFn
- type SetStakerInfoFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddEpochGas ¶
AddEpochGas is used for every block's gas fee collection in each epoch
func GetEpochGasPool ¶
GetEpochGasPool use to get epoch gas pool
func GetEpochIncentive ¶
GetEpochIncentive get total incentive of all epoch
func GetEpochLeaderActivity ¶
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 ¶
GetEpochRBLeaderActivity can get the address and activity of RB leaders
func GetEpochRemain ¶
GetEpochRemain get remain of epoch input
func GetIncentivePool ¶
GetIncentivePool can get the total incentive, foundation part and gas pool part.
func GetRBAddress ¶
GetRBAddress use to get random proposer address list
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 ¶
GetTotalIncentive get total incentive of all epoch
func GetTotalRemain ¶
GetTotalRemain get remain of epoch input
func Init ¶
func Init(get GetStakerInfoFn, set SetStakerInfoFn, getRbAddr GetRandomProposerAddressFn)
Init is use to init the outsides interface of staker. Should be called at the node start
Types ¶
type GetEpochLeaderInfoFn ¶
GetEpochLeaderInfoFn is a function use to get epoch activity and address
type GetRandomProposerAddressFn ¶
GetRandomProposerAddressFn is use to get rb group address
type GetRandomProposerInfoFn ¶
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 ¶
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