Documentation ¶
Index ¶
- Variables
- func CalEpochProbabilityStaker(staker *vm.StakerInfo, epochID uint64) (infors []vm.ClientProbability, totalProbability *big.Int, err error)
- func CleanInactiveValidator(stateDb *state.StateDB, epochID uint64)
- func ListValidator(stateDb *state.StateDB)
- func StakeOutRun(stateDb *state.StateDB, epochID uint64) bool
- type EpochInfo
- type Epocher
- func (e *Epocher) CalProbability(amountWin *big.Int, lockTime uint64) *big.Int
- func (e *Epocher) GetBlkChain() *core.BlockChain
- func (e *Epocher) GetCurrentHeader() *types.Header
- func (e *Epocher) GetEpLeaderGroup(epochID uint64) []vm.Leader
- func (e *Epocher) GetEpochLastBlkNumber(targetEpochId uint64) uint64
- func (e *Epocher) GetEpochLeaders(epochID uint64) [][]byte
- func (e *Epocher) GetEpochProbability(epochId uint64, addr common.Address) (*vm.ValidatorInfo, error)
- func (e *Epocher) GetLeaderGroup(epochID uint64) []vm.Leader
- func (e *Epocher) GetProposerBn256PK(epochID uint64, idx uint64, addr common.Address) []byte
- func (e *Epocher) GetRBProposer(epochID uint64) [][]byte
- func (e *Epocher) GetRBProposerG1(epochID uint64) []bn256.G1
- func (e *Epocher) GetRBProposerGroup(epochID uint64) []vm.Leader
- func (e *Epocher) GetTargetBlkNumber(epochId uint64) uint64
- func (e *Epocher) GetWhiteArrayByEpochId(epochId uint64) ([][]byte, error)
- func (e *Epocher) GetWhiteByEpochId(epochId uint64) ([]string, error)
- func (e *Epocher) GetWhiteInfo(epochId uint64) (*vm.UpgradeWhiteEpochLeaderParam, error)
- func (e *Epocher) IsGenerateELSuc(epochID uint64) bool
- func (e *Epocher) IsGenerateRBPSuc(epochID uint64) bool
- func (e *Epocher) SelectLeadersLoop(epochId uint64) error
- func (e *Epocher) SetEpochIncentive(epochId uint64, infors [][]vm.ClientIncentive) (err error)
- type Proposer
- type ProposerSorter
- type RefundInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Big0 = big.NewInt(0) ErrInvalidRandomProposerSelection = errors.New("Invalid Random Proposer Selection") //Invalid Random Proposer Selection ErrInvalidEpochProposerSelection = errors.New("Invalid Epoch Proposer Selection") //Invalid Random Proposer Selection ErrInvalidProbabilityfloat2big = errors.New("Invalid Transform Probability From Float To Bigint") //Invalid Transform Probability From Float To Bigint ErrInvalidGenerateCommitment = errors.New("Invalid Commitment Generation") //Invalid Commitment Generation ErrInvalidArrayPieceGeneration = errors.New("Invalid ArrayPiece Generation") //Invalid ArrayPiece Generation ErrInvalidDleqProofGeneration = errors.New("Invalid DLEQ Proof Generation") //Invalid DLEQ Proof Generation ErrInvalidSecretMessageArrayGeneration = errors.New("Invalid Secret Message Array Generation") //Invalid Secret Message Array Generation ErrInvalidSortPublicKeys = errors.New("Invalid PublicKeys Sort Operation") //Invalid PublicKeys Sort Operation ErrInvalidSlotLeaderSequenceGeneration = errors.New("Invalid Slot Leader Sequence Generation") //Invalid Slot Leader Sequence Generation ErrInvalidSlotLeaderLocation = errors.New("Invalid Slot Leader Location") //Invalid Slot Leader Location ErrInvalidSlotLeaderProofGeneration = errors.New("Invalid Slot Leader Proof Generation") //Invalid Slot Leader Proof Generation )
Functions ¶
func CalEpochProbabilityStaker ¶
func CalEpochProbabilityStaker(staker *vm.StakerInfo, epochID uint64) (infors []vm.ClientProbability, totalProbability *big.Int, err error)
TODO Is this right?
func CleanInactiveValidator ¶
func ListValidator ¶
Types ¶
type Epocher ¶
type Epocher struct {
// contains filtered or unexported fields
}
func GetEpocher ¶
func GetEpocher() *Epocher
func NewEpocher ¶
func NewEpocher(blc *core.BlockChain) *Epocher
func NewEpocherWithLBN ¶
func NewEpocherWithLBN(blc *core.BlockChain, rbn string, epdbn string) *Epocher
func (*Epocher) CalProbability ¶
func (*Epocher) GetBlkChain ¶
func (e *Epocher) GetBlkChain() *core.BlockChain
func (*Epocher) GetCurrentHeader ¶
func (*Epocher) GetEpochLastBlkNumber ¶
NOTE: if the targetEpochId is future, will return current blockNumber.
func (*Epocher) GetEpochLeaders ¶
get epochLeaders of epochID in localdb
func (*Epocher) GetEpochProbability ¶
func (e *Epocher) GetEpochProbability(epochId uint64, addr common.Address) (*vm.ValidatorInfo, error)
incentive use it.
func (*Epocher) GetProposerBn256PK ¶
func (*Epocher) GetRBProposer ¶
func (*Epocher) GetRBProposerG1 ¶
func (*Epocher) GetRBProposerGroup ¶
get rbLeaders of epochID in localdb only for incentive. for incentive.
func (*Epocher) GetTargetBlkNumber ¶
func (*Epocher) GetWhiteArrayByEpochId ¶
func (*Epocher) GetWhiteByEpochId ¶
func (*Epocher) GetWhiteInfo ¶
func (e *Epocher) GetWhiteInfo(epochId uint64) (*vm.UpgradeWhiteEpochLeaderParam, error)
func (*Epocher) IsGenerateELSuc ¶
func (*Epocher) IsGenerateRBPSuc ¶
func (*Epocher) SelectLeadersLoop ¶
func (*Epocher) SetEpochIncentive ¶
func (e *Epocher) SetEpochIncentive(epochId uint64, infors [][]vm.ClientIncentive) (err error)
type ProposerSorter ¶
type ProposerSorter []Proposer
func (ProposerSorter) Less ¶
func (s ProposerSorter) Less(i, j int) bool
Click to show internal directories.
Click to hide internal directories.