Documentation ¶
Index ¶
- Constants
- Variables
- func CanBaseKeyByAddr(addr common.NodeAddress) []byte
- func CanBaseKeyBySuffix(addr []byte) []byte
- func CanMutableKeyByAddr(addr common.NodeAddress) []byte
- func CanMutableKeyBySuffix(addr []byte) []byte
- func CompareDefault(removes NeedRemoveCans, left, right *Validator) int
- func CompareForDel(removes NeedRemoveCans, left, right *Validator) int
- func DecodeDelegateKey(key []byte) (delAddr common.Address, nodeId enode.IDv0, stakeBlockNumber uint64)
- func GetAccountStakeRcKey(addr common.Address) []byte
- func GetDelegateKey(delAddr common.Address, nodeId enode.IDv0, stakeBlockNumber uint64) []byte
- func GetDelegateKeyBySuffix(suffix []byte) []byte
- func GetDelegationLockKey(delAddr common.Address) []byte
- func GetEpochIndexKey() []byte
- func GetEpochValArrKey(start, end uint64) []byte
- func GetPPOSHASHKey() []byte
- func GetRoundAddrBoundaryKey() []byte
- func GetRoundIndexKey() []byte
- func GetRoundValAddrArrKey(round uint64) []byte
- func GetRoundValArrKey(start, end uint64) []byte
- func GetUnStakeCountKey(epoch uint64) []byte
- func GetUnStakeItemKey(epoch, index uint64) []byte
- func HistoryValidatorDBKey(ID common.Hash) []byte
- func HistoryValidatorIDListKey(blockNumber uint64) []byte
- func TallyPowerKey(programVersion uint32, shares *big.Int, stakeBlockNum uint64, ...) []byte
- type Candidate
- type CandidateBase
- type CandidateBaseQueue
- type CandidateHex
- type CandidateHexQueue
- type CandidateMap
- type CandidateMutable
- func (can *CandidateMutable) AddShares(amount *big.Int)
- func (can *CandidateMutable) AppendStatus(status CandidateStatus)
- func (can *CandidateMutable) CleanCurrentEpochDelegateReward()
- func (can *CandidateMutable) CleanLowRatioStatus()
- func (can *CandidateMutable) CleanShares()
- func (can *CandidateMutable) IsDuplicateSign() bool
- func (can *CandidateMutable) IsEmpty() bool
- func (can *CandidateMutable) IsInvalid() bool
- func (can *CandidateMutable) IsInvalidDuplicateSign() bool
- func (can *CandidateMutable) IsInvalidLowRatio() bool
- func (can *CandidateMutable) IsInvalidLowRatioDel() bool
- func (can *CandidateMutable) IsInvalidLowRatioNotEnough() bool
- func (can *CandidateMutable) IsInvalidNotEnough() bool
- func (can *CandidateMutable) IsInvalidWithdrew() bool
- func (can *CandidateMutable) IsLowRatio() bool
- func (can *CandidateMutable) IsLowRatioDel() bool
- func (can *CandidateMutable) IsLowRatioNotEnough() bool
- func (can *CandidateMutable) IsNotEmpty() bool
- func (can *CandidateMutable) IsNotEnough() bool
- func (can *CandidateMutable) IsPureInvalid() bool
- func (can *CandidateMutable) IsPureLowRatio() bool
- func (can *CandidateMutable) IsPureLowRatioDel() bool
- func (can *CandidateMutable) IsPureNotEnough() bool
- func (can *CandidateMutable) IsPureWithdrew() bool
- func (can *CandidateMutable) IsValid() bool
- func (can *CandidateMutable) IsWithdrew() bool
- func (can *CandidateMutable) PrepareNextEpoch() bool
- func (can *CandidateMutable) SetStatus(status CandidateStatus)
- func (can *CandidateMutable) SetValided()
- func (can *CandidateMutable) ShouldGiveDelegateReward() bool
- func (can *CandidateMutable) String() string
- func (can *CandidateMutable) SubShares(amount *big.Int)
- type CandidateQueue
- type CandidateStatus
- func (status CandidateStatus) IsDuplicateSign() bool
- func (status CandidateStatus) IsInvalid() bool
- func (status CandidateStatus) IsInvalidDuplicateSign() bool
- func (status CandidateStatus) IsInvalidLowRatio() bool
- func (status CandidateStatus) IsInvalidLowRatioDel() bool
- func (status CandidateStatus) IsInvalidLowRatioNotEnough() bool
- func (status CandidateStatus) IsInvalidNotEnough() bool
- func (status CandidateStatus) IsInvalidWithdrew() bool
- func (status CandidateStatus) IsLowRatio() bool
- func (status CandidateStatus) IsLowRatioDel() bool
- func (status CandidateStatus) IsLowRatioNotEnough() bool
- func (status CandidateStatus) IsNotEnough() bool
- func (status CandidateStatus) IsPureInvalid() bool
- func (status CandidateStatus) IsPureLowRatio() bool
- func (status CandidateStatus) IsPureLowRatioDel() bool
- func (status CandidateStatus) IsPureNotEnough() bool
- func (status CandidateStatus) IsPureWithdrew() bool
- func (status CandidateStatus) IsValid() bool
- func (status CandidateStatus) IsWithdrew() bool
- type DelByDelegateEpoch
- type DelRelatedQueue
- type DelegateRelated
- type Delegation
- type DelegationEx
- type DelegationExV1
- type DelegationForStorage
- type DelegationHex
- type DelegationHexV1
- type DelegationInfo
- type DelegationLock
- type DelegationLockHex
- type DelegationLockPeriod
- type DelegationLockPeriodHex
- type Description
- type HistoryValidator
- type HistoryValidatorEx
- type HistoryValidatorIDList
- type HistoryValidatorList
- type NeedRemoveCans
- type SlashNodeItem
- type SlashQueue
- type StakingDB
- func (db *StakingDB) AddAccountStakeRc(blockHash common.Hash, addr common.Address) error
- func (db *StakingDB) AddUnStakeItemStore(blockHash common.Hash, epoch uint64, canAddr common.NodeAddress, ...) error
- func (db *StakingDB) Del(blockHash common.Hash, key []byte) error
- func (db *StakingDB) DelCanBaseStore(blockHash common.Hash, addr common.NodeAddress) error
- func (db *StakingDB) DelCanMutableStore(blockHash common.Hash, addr common.NodeAddress) error
- func (db *StakingDB) DelCanPowerStore(blockHash common.Hash, can *Candidate) error
- func (db *StakingDB) DelCandidateStore(blockHash common.Hash, addr common.NodeAddress) error
- func (db *StakingDB) DelDelegateStore(blockHash common.Hash, delAddr common.Address, nodeId enode.IDv0, ...) error
- func (db *StakingDB) DelEpochValListByBlockHash(blockHash common.Hash, start, end uint64) error
- func (db *StakingDB) DelRoundValListByBlockHash(blockHash common.Hash, start, end uint64) error
- func (db *StakingDB) DelRoundValidatorAddrs(blockHash common.Hash, key []byte) error
- func (db *StakingDB) DelUnStakeCountStore(blockHash common.Hash, epoch uint64) error
- func (db *StakingDB) DelUnStakeItemStore(blockHash common.Hash, epoch, index uint64) error
- func (db *StakingDB) GetCanBaseStore(blockHash common.Hash, addr common.NodeAddress) (*CandidateBase, error)
- func (db *StakingDB) GetCanBaseStoreByIrr(addr common.NodeAddress) (*CandidateBase, error)
- func (db *StakingDB) GetCanBaseStoreByIrrWithSuffix(suffix []byte) (*CandidateBase, error)
- func (db *StakingDB) GetCanBaseStoreWithSuffix(blockHash common.Hash, suffix []byte) (*CandidateBase, error)
- func (db *StakingDB) GetCanMutableStore(blockHash common.Hash, addr common.NodeAddress) (*CandidateMutable, error)
- func (db *StakingDB) GetCanMutableStoreByIrr(addr common.NodeAddress) (*CandidateMutable, error)
- func (db *StakingDB) GetCanMutableStoreByIrrWithSuffix(suffix []byte) (*CandidateMutable, error)
- func (db *StakingDB) GetCanMutableStoreWithSuffix(blockHash common.Hash, suffix []byte) (*CandidateMutable, error)
- func (db *StakingDB) GetCandidateStore(blockHash common.Hash, addr common.NodeAddress) (*Candidate, error)
- func (db *StakingDB) GetCandidateStoreByIrr(addr common.NodeAddress) (*Candidate, error)
- func (db *StakingDB) GetCandidateStoreByIrrWithSuffix(suffix []byte) (*Candidate, error)
- func (db *StakingDB) GetCandidateStoreWithSuffix(blockHash common.Hash, suffix []byte) (*Candidate, error)
- func (db *StakingDB) GetDB() snapshotdb.DB
- func (db *StakingDB) GetDelegateStore(blockHash common.Hash, delAddr common.Address, nodeId enode.IDv0, ...) (*Delegation, error)
- func (db *StakingDB) GetDelegatesInfo(blockHash common.Hash, delAddr common.Address) ([]*DelegationInfo, error)
- func (db *StakingDB) GetDelegationLock(blockHash common.Hash, delAddr common.Address, currentEpoch uint32) (*DelegationLock, error)
- func (db *StakingDB) GetEpochValIndexByBlockHash(blockHash common.Hash) (ValArrIndexQueue, error)
- func (db *StakingDB) GetEpochValIndexByIrr() (ValArrIndexQueue, error)
- func (db *StakingDB) GetEpochValListByBlockHash(blockHash common.Hash, start, end uint64) (ValidatorQueue, error)
- func (db *StakingDB) GetEpochValListByIrr(start, end uint64) (ValidatorQueue, error)
- func (db *StakingDB) GetLastKVHash(blockHash common.Hash) []byte
- func (db *StakingDB) GetRoundAddrBoundary(blockHash common.Hash) (uint64, error)
- func (db *StakingDB) GetRoundValIndexByBlockHash(blockHash common.Hash) (ValArrIndexQueue, error)
- func (db *StakingDB) GetRoundValIndexByIrr() (ValArrIndexQueue, error)
- func (db *StakingDB) GetRoundValListByBlockHash(blockHash common.Hash, start, end uint64) (ValidatorQueue, error)
- func (db *StakingDB) GetRoundValListByIrr(start, end uint64) (ValidatorQueue, error)
- func (db *StakingDB) GetUnStakeCountStore(blockHash common.Hash, epoch uint64) (uint64, error)
- func (db *StakingDB) GetUnStakeItemStore(blockHash common.Hash, epoch, index uint64) (*UnStakeItem, error)
- func (db *StakingDB) HasAccountStakeRc(blockHash common.Hash, addr common.Address) (bool, error)
- func (db *StakingDB) IteratorCandidatePowerByBlockHash(blockHash common.Hash, ranges int) iterator.Iterator
- func (db *StakingDB) IteratorDelegateByBlockHashWithAddr(blockHash common.Hash, addr common.Address, ranges int) iterator.Iterator
- func (db *StakingDB) LoadRoundValidatorAddrs(blockHash common.Hash, key []byte) ([]common.Address, error)
- func (db *StakingDB) PutDelegationLock(blockHash common.Hash, delAddr common.Address, infos *DelegationLock) error
- func (db *StakingDB) SetCanBaseStore(blockHash common.Hash, addr common.NodeAddress, can *CandidateBase) error
- func (db *StakingDB) SetCanMutableStore(blockHash common.Hash, addr common.NodeAddress, can *CandidateMutable) error
- func (db *StakingDB) SetCanPowerStore(blockHash common.Hash, addr common.NodeAddress, can *Candidate) error
- func (db *StakingDB) SetCandidateStore(blockHash common.Hash, addr common.NodeAddress, can *Candidate) error
- func (db *StakingDB) SetDelegateStore(blockHash common.Hash, delAddr common.Address, nodeId enode.IDv0, ...) error
- func (db *StakingDB) SetEpochValIndex(blockHash common.Hash, indexArr ValArrIndexQueue) error
- func (db *StakingDB) SetEpochValList(blockHash common.Hash, start, end uint64, valArr ValidatorQueue) error
- func (db *StakingDB) SetRoundAddrBoundary(blockHash common.Hash, round uint64) error
- func (db *StakingDB) SetRoundValIndex(blockHash common.Hash, indexArr ValArrIndexQueue) error
- func (db *StakingDB) SetRoundValList(blockHash common.Hash, start, end uint64, valArr ValidatorQueue) error
- func (db *StakingDB) StoreRoundValidatorAddrs(blockHash common.Hash, key []byte, arry []common.NodeAddress) error
- func (db *StakingDB) SubAccountStakeRc(blockHash common.Hash, addr common.Address) error
- type UnStakeItem
- type ValArrIndex
- type ValArrIndexQueue
- type Validator
- type ValidatorArray
- type ValidatorEx
- type ValidatorExQueue
- type ValidatorQueue
Constants ¶
const ( CanBasePrefixStr = "CanBase" CanMutablePrefixStr = "CanMut" CanPowerPrefixStr = "Power" UnStakeCountKeyStr = "UnStakeCount" UnStakeItemKeyStr = "UnStakeItem" DelegatePrefixStr = "Del" DelegationLockPrefixStr = "DelegationLock" EpochIndexKeyStr = "EpochIndex" EpochValArrPrefixStr = "EpochValArr" RoundIndexKeyStr = "RoundIndex" RoundValArrPrefixStr = "RoundValArr" AccountStakeRcPrefixStr = "AccStakeRc" PPOSHASHStr = "PPOSHASH" RoundValAddrArrPrefixStr = "RoundValAddrArr" RoundAddrBoundaryPrefixStr = "RoundAddrBoundary" )
const ( MaxExternalIdLen = 70 MaxNodeNameLen = 30 MaxWebsiteLen = 140 MaxDetailsLen = 280 )
Variables ¶
var ( CanBaseKeyPrefix = []byte(CanBasePrefixStr) CanMutableKeyPrefix = []byte(CanMutablePrefixStr) CanPowerKeyPrefix = []byte(CanPowerPrefixStr) UnStakeCountKey = []byte(UnStakeCountKeyStr) UnStakeItemKey = []byte(UnStakeItemKeyStr) DelegateKeyPrefix = []byte(DelegatePrefixStr) DelegationLockKeyPrefix = []byte(DelegationLockPrefixStr) EpochIndexKey = []byte(EpochIndexKeyStr) EpochValArrPrefix = []byte(EpochValArrPrefixStr) RoundIndexKey = []byte(RoundIndexKeyStr) RoundValArrPrefix = []byte(RoundValArrPrefixStr) AccountStakeRcPrefix = []byte(AccountStakeRcPrefixStr) PPOSHASHKey = []byte(PPOSHASHStr) RoundValAddrArrPrefix = []byte(RoundValAddrArrPrefixStr) RoundAddrBoundaryPrefix = []byte(RoundAddrBoundaryPrefixStr) )
var ( ErrWrongBlsPubKey = common.NewBizError(301000, "Invalid BLS public key length") ErrWrongBlsPubKeyProof = common.NewBizError(301001, "The BLS proof is incorrect") ErrDescriptionLen = common.NewBizError(301002, "The Description length is incorrect") ErrWrongProgramVersionSign = common.NewBizError(301003, "The program version signature is invalid") ErrProgramVersionTooLow = common.NewBizError(301004, "The program version is too low") ErrDeclVsFialedCreateCan = common.NewBizError(301005, "The Version Declaration is failed when creating staking") ErrNoSameStakingAddr = common.NewBizError(301006, "The address must be the same as the one initiated staking") ErrInvalidRewardPer = common.NewBizError(301007, "Invalid param RewardPer") ErrRewardPerInterval = common.NewBizError(301008, "Modify the commission reward ratio too frequently") ErrRewardPerChangeRange = common.NewBizError(301009, "The modification range exceeds the limit") ErrStakeVonTooLow = common.NewBizError(301100, "Staking deposit is insufficient") ErrCanAlreadyExist = common.NewBizError(301101, "The candidate already existed") ErrCanNoExist = common.NewBizError(301102, "The candidate does not exist") ErrCanStatusInvalid = common.NewBizError(301103, "This candidate status is expired") ErrIncreaseStakeVonTooLow = common.NewBizError(301104, "Increased stake is insufficient") ErrDelegateVonTooLow = common.NewBizError(301105, "Delegate deposit is insufficient") ErrAccountNoAllowToDelegate = common.NewBizError(301106, "The account is not allowed to delegate") ErrCanNoAllowDelegate = common.NewBizError(301107, "The candidate is not allowed to delegate") ErrWithdrewDelegationVonTooLow = common.NewBizError(301108, "Withdrawal of delegation is insufficient") ErrDelegateNoExist = common.NewBizError(301109, "The delegate does not exist") ErrWrongVonOptType = common.NewBizError(301110, "The von operation type is incorrect") ErrAccountVonNoEnough = common.NewBizError(301111, "The account balance is insufficient") ErrBlockNumberDisordered = common.NewBizError(301112, "The blockNumber is inconsistent with the expected number") ErrDelegateVonNoEnough = common.NewBizError(301113, "The balance of delegate is insufficient") ErrWrongWithdrewDelVonCalc = common.NewBizError(301114, "The amount of delegate withdrawal is incorrect") ErrValidatorNoExist = common.NewBizError(301115, "The validator does not exist") ErrWrongFuncParams = common.NewBizError(301116, "The fn params is invalid") ErrWrongSlashType = common.NewBizError(301117, "The slash type is illegal") ErrSlashVonOverflow = common.NewBizError(301118, "The amount of slash is overflowed") ErrWrongSlashVonCalc = common.NewBizError(301119, "The amount of slash for decreasing staking is incorrect") ErrGetVerifierList = common.NewBizError(301200, "Retreiving verifier list failed") ErrGetValidatorList = common.NewBizError(301201, "Retreiving validator list failed") ErrGetCandidateList = common.NewBizError(301202, "Retreiving candidate list failed") ErrGetDelegateRelated = common.NewBizError(301203, "Retreiving delegation related mapping failed") ErrQueryCandidateInfo = common.NewBizError(301204, "Query candidate info failed") ErrQueryDelegateInfo = common.NewBizError(301205, "Query delegate info failed") ErrNodeID2Addr = common.NewBizError(301206, "Failed to convert Node ID to address") ErrDelegateLockBalanceNotEnough = common.NewBizError(301207, "the user delegation lock balance is not enough for delegate") ErrQueryDelegationLockInfo = common.NewBizError(301208, "Query delegation lock info failed") )
Functions ¶
func CanBaseKeyByAddr ¶ added in v0.7.4
func CanBaseKeyByAddr(addr common.NodeAddress) []byte
func CanBaseKeyBySuffix ¶ added in v0.7.4
func CanMutableKeyByAddr ¶ added in v0.7.4
func CanMutableKeyByAddr(addr common.NodeAddress) []byte
func CanMutableKeyBySuffix ¶ added in v0.7.4
func CompareDefault ¶
func CompareDefault(removes NeedRemoveCans, left, right *Validator) int
NOTE: Sort By Default
When sorting is done by default, it is slashed and is sorted to the end.
The priorities just like that: Slashing > ProgramVersion > Shares > BlockNumber > TxIndex
Slashing: From no to yes ProgramVersion: From big to small Shares: From big to small BlockNumber: From small to big TxIndex: From small to big
Compare Left And Right 1: Left > Right 0: Left == Right -1:Left < Right
func CompareForDel ¶
func CompareForDel(removes NeedRemoveCans, left, right *Validator) int
NOTE: These are sorted by priority that will be removed
When sorting is done by delete slashing, it is slashed and is sorted to the front.
The priorities just like that: Invalid > ProgramVersion > validaotorTerm > Shares > BlockNumber > TxIndex
What is the invalid ? That are DuplicateSign and lowRatio&invalid and lowVersion and withdrew&NotInEpochValidators
Invalid Status: From invalid to valid ProgramVersion: From small to big validaotorTerm: From big to small Shares: From small to big BlockNumber: From big to small TxIndex: From big to small
Compare Left And Right 1: Left > Right 0: Left == Right -1:Left < Right
func DecodeDelegateKey ¶ added in v0.7.6
func DecodeDelegateKey(key []byte) (delAddr common.Address, nodeId enode.IDv0, stakeBlockNumber uint64)
notice this assume key must right
func GetAccountStakeRcKey ¶
func GetDelegateKey ¶
func GetDelegateKeyBySuffix ¶
func GetDelegationLockKey ¶ added in v1.3.0
func GetEpochIndexKey ¶
func GetEpochIndexKey() []byte
func GetEpochValArrKey ¶
func GetPPOSHASHKey ¶
func GetPPOSHASHKey() []byte
func GetRoundAddrBoundaryKey ¶ added in v0.7.4
func GetRoundAddrBoundaryKey() []byte
func GetRoundIndexKey ¶
func GetRoundIndexKey() []byte
func GetRoundValAddrArrKey ¶ added in v0.7.3
func GetRoundValArrKey ¶
func GetUnStakeCountKey ¶
func GetUnStakeItemKey ¶
func HistoryValidatorDBKey ¶ added in v1.4.0
func HistoryValidatorIDListKey ¶ added in v1.4.0
Types ¶
type Candidate ¶
type Candidate struct { *CandidateBase *CandidateMutable }
The Candidate info
func (*Candidate) IsNotEmpty ¶ added in v0.7.4
type CandidateBase ¶ added in v0.7.4
type CandidateBase struct { NodeId enode.IDv0 // bls public key BlsPubKey bls.PublicKeyHex // The account used to initiate the staking StakingAddress common.Address // The account receive the block rewards and the staking rewards BenefitAddress common.Address // The tx index at the time of staking StakingTxIndex uint32 // The version of the node program // (Store Large Verson: the 2.1.x large version is 2.1.0) ProgramVersion uint32 // Block height at the time of staking StakingBlockNum uint64 // Node desc Description }
func (*CandidateBase) IsEmpty ¶ added in v0.7.4
func (can *CandidateBase) IsEmpty() bool
func (*CandidateBase) IsNotEmpty ¶ added in v0.7.4
func (can *CandidateBase) IsNotEmpty() bool
func (*CandidateBase) String ¶ added in v0.7.4
func (can *CandidateBase) String() string
type CandidateBaseQueue ¶ added in v0.7.4
type CandidateBaseQueue []*CandidateBase
func (CandidateBaseQueue) IsEmpty ¶ added in v0.7.4
func (queue CandidateBaseQueue) IsEmpty() bool
func (CandidateBaseQueue) IsNotEmpty ¶ added in v0.7.4
func (queue CandidateBaseQueue) IsNotEmpty() bool
type CandidateHex ¶
type CandidateHex struct { NodeId enode.IDv0 BlsPubKey bls.PublicKeyHex StakingAddress common.Address BenefitAddress common.Address RewardPer uint16 NextRewardPer uint16 RewardPerChangeEpoch uint32 StakingTxIndex uint32 ProgramVersion uint32 Status CandidateStatus StakingEpoch uint32 StakingBlockNum uint64 Released *hexutil.Big ReleasedHes *hexutil.Big RestrictingPlan *hexutil.Big RestrictingPlanHes *hexutil.Big DelegateEpoch uint32 DelegateTotal *hexutil.Big DelegateTotalHes *hexutil.Big DelegateRewardTotal *hexutil.Big Description }
Display amount field using 0x hex
func (*CandidateHex) IsEmpty ¶ added in v0.7.4
func (can *CandidateHex) IsEmpty() bool
func (*CandidateHex) IsNotEmpty ¶ added in v0.7.4
func (can *CandidateHex) IsNotEmpty() bool
func (*CandidateHex) String ¶
func (can *CandidateHex) String() string
type CandidateHexQueue ¶
type CandidateHexQueue []*CandidateHex
func (CandidateHexQueue) IsEmpty ¶ added in v0.7.4
func (queue CandidateHexQueue) IsEmpty() bool
func (CandidateHexQueue) IsNotEmpty ¶ added in v0.7.4
func (queue CandidateHexQueue) IsNotEmpty() bool
func (CandidateHexQueue) String ¶ added in v0.7.4
func (queue CandidateHexQueue) String() string
type CandidateMap ¶
type CandidateMutable ¶ added in v0.7.4
type CandidateMutable struct { // The candidate status // Reference `THE CANDIDATE STATUS` Status CandidateStatus // The epoch number at staking or edit StakingEpoch uint32 Shares *big.Int // The staking von is circulating for effective epoch (in effect) Released *big.Int // The staking von is circulating for hesitant epoch (in hesitation) ReleasedHes *big.Int // The staking von is RestrictingPlan for effective epoch (in effect) RestrictingPlan *big.Int // The staking von is RestrictingPlan for hesitant epoch (in hesitation) RestrictingPlanHes *big.Int // The epoch number at delegate or edit DelegateEpoch uint32 // Effective total delegate DelegateTotal *big.Int // hesitant total delegate DelegateTotalHes *big.Int // Delegate reward amount percent for current settlement cycle RewardPer uint16 // Delegate reward amount percent for next settlement cycle NextRewardPer uint16 // Number of settlement cycles when changing the commission reward percentage RewardPerChangeEpoch uint32 // current epoch total Delegate reward CurrentEpochDelegateReward *big.Int // total Delegate reward have give DelegateRewardTotal *big.Int }
func (*CandidateMutable) AddShares ¶ added in v0.7.4
func (can *CandidateMutable) AddShares(amount *big.Int)
func (*CandidateMutable) AppendStatus ¶ added in v1.0.0
func (can *CandidateMutable) AppendStatus(status CandidateStatus)
func (*CandidateMutable) CleanCurrentEpochDelegateReward ¶ added in v0.7.6
func (can *CandidateMutable) CleanCurrentEpochDelegateReward()
func (*CandidateMutable) CleanLowRatioStatus ¶ added in v0.7.4
func (can *CandidateMutable) CleanLowRatioStatus()
func (*CandidateMutable) CleanShares ¶ added in v0.7.4
func (can *CandidateMutable) CleanShares()
func (*CandidateMutable) IsDuplicateSign ¶ added in v0.7.4
func (can *CandidateMutable) IsDuplicateSign() bool
func (*CandidateMutable) IsEmpty ¶ added in v0.7.4
func (can *CandidateMutable) IsEmpty() bool
func (*CandidateMutable) IsInvalid ¶ added in v0.7.4
func (can *CandidateMutable) IsInvalid() bool
func (*CandidateMutable) IsInvalidDuplicateSign ¶ added in v0.7.4
func (can *CandidateMutable) IsInvalidDuplicateSign() bool
func (*CandidateMutable) IsInvalidLowRatio ¶ added in v0.7.4
func (can *CandidateMutable) IsInvalidLowRatio() bool
func (*CandidateMutable) IsInvalidLowRatioDel ¶ added in v0.7.4
func (can *CandidateMutable) IsInvalidLowRatioDel() bool
func (*CandidateMutable) IsInvalidLowRatioNotEnough ¶ added in v0.7.4
func (can *CandidateMutable) IsInvalidLowRatioNotEnough() bool
func (*CandidateMutable) IsInvalidNotEnough ¶ added in v0.7.4
func (can *CandidateMutable) IsInvalidNotEnough() bool
func (*CandidateMutable) IsInvalidWithdrew ¶ added in v0.7.4
func (can *CandidateMutable) IsInvalidWithdrew() bool
func (*CandidateMutable) IsLowRatio ¶ added in v0.7.4
func (can *CandidateMutable) IsLowRatio() bool
func (*CandidateMutable) IsLowRatioDel ¶ added in v0.7.4
func (can *CandidateMutable) IsLowRatioDel() bool
func (*CandidateMutable) IsLowRatioNotEnough ¶ added in v0.7.4
func (can *CandidateMutable) IsLowRatioNotEnough() bool
func (*CandidateMutable) IsNotEmpty ¶ added in v0.7.4
func (can *CandidateMutable) IsNotEmpty() bool
func (*CandidateMutable) IsNotEnough ¶ added in v0.7.4
func (can *CandidateMutable) IsNotEnough() bool
func (*CandidateMutable) IsPureInvalid ¶ added in v0.7.4
func (can *CandidateMutable) IsPureInvalid() bool
func (*CandidateMutable) IsPureLowRatio ¶ added in v0.7.4
func (can *CandidateMutable) IsPureLowRatio() bool
func (*CandidateMutable) IsPureLowRatioDel ¶ added in v0.7.4
func (can *CandidateMutable) IsPureLowRatioDel() bool
func (*CandidateMutable) IsPureNotEnough ¶ added in v0.7.4
func (can *CandidateMutable) IsPureNotEnough() bool
func (*CandidateMutable) IsPureWithdrew ¶ added in v0.7.4
func (can *CandidateMutable) IsPureWithdrew() bool
func (*CandidateMutable) IsValid ¶ added in v0.7.4
func (can *CandidateMutable) IsValid() bool
func (*CandidateMutable) IsWithdrew ¶ added in v0.7.4
func (can *CandidateMutable) IsWithdrew() bool
func (*CandidateMutable) PrepareNextEpoch ¶ added in v0.7.6
func (can *CandidateMutable) PrepareNextEpoch() bool
func (*CandidateMutable) SetStatus ¶ added in v1.0.0
func (can *CandidateMutable) SetStatus(status CandidateStatus)
func (*CandidateMutable) SetValided ¶ added in v1.0.0
func (can *CandidateMutable) SetValided()
func (*CandidateMutable) ShouldGiveDelegateReward ¶ added in v0.7.6
func (can *CandidateMutable) ShouldGiveDelegateReward() bool
func (*CandidateMutable) String ¶ added in v0.7.4
func (can *CandidateMutable) String() string
func (*CandidateMutable) SubShares ¶ added in v0.7.4
func (can *CandidateMutable) SubShares(amount *big.Int)
type CandidateQueue ¶
type CandidateQueue []*Candidate
func (CandidateQueue) String ¶ added in v0.7.4
func (queue CandidateQueue) String() string
type CandidateStatus ¶ added in v0.7.4
type CandidateStatus uint32
const ( /** ###### ###### ###### ###### # THE CANDIDATE STATUS # ###### ###### ###### ###### */ Invalided CandidateStatus = 1 << iota // 0001: The current candidate withdraws from the staking qualification (Active OR Passive) LowRatio // 0010: The candidate was low package ratio AND no delete NotEnough // 0100: The current candidate's von does not meet the minimum staking threshold DuplicateSign // 1000: The Duplicate package or Duplicate sign LowRatioDel // 0001,0000: The lowRatio AND must delete Withdrew // 0010,0000: The Active withdrew Valided = 0 // 0000: The current candidate is in force NotExist = 1 << 31 // 1000,xxxx,... : The candidate is not exist )
func (CandidateStatus) IsDuplicateSign ¶ added in v0.7.4
func (status CandidateStatus) IsDuplicateSign() bool
func (CandidateStatus) IsInvalid ¶ added in v0.7.4
func (status CandidateStatus) IsInvalid() bool
func (CandidateStatus) IsInvalidDuplicateSign ¶ added in v0.7.4
func (status CandidateStatus) IsInvalidDuplicateSign() bool
func (CandidateStatus) IsInvalidLowRatio ¶ added in v0.7.4
func (status CandidateStatus) IsInvalidLowRatio() bool
func (CandidateStatus) IsInvalidLowRatioDel ¶ added in v0.7.4
func (status CandidateStatus) IsInvalidLowRatioDel() bool
func (CandidateStatus) IsInvalidLowRatioNotEnough ¶ added in v0.7.4
func (status CandidateStatus) IsInvalidLowRatioNotEnough() bool
func (CandidateStatus) IsInvalidNotEnough ¶ added in v0.7.4
func (status CandidateStatus) IsInvalidNotEnough() bool
func (CandidateStatus) IsInvalidWithdrew ¶ added in v0.7.4
func (status CandidateStatus) IsInvalidWithdrew() bool
func (CandidateStatus) IsLowRatio ¶ added in v0.7.4
func (status CandidateStatus) IsLowRatio() bool
func (CandidateStatus) IsLowRatioDel ¶ added in v0.7.4
func (status CandidateStatus) IsLowRatioDel() bool
func (CandidateStatus) IsLowRatioNotEnough ¶ added in v0.7.4
func (status CandidateStatus) IsLowRatioNotEnough() bool
func (CandidateStatus) IsNotEnough ¶ added in v0.7.4
func (status CandidateStatus) IsNotEnough() bool
func (CandidateStatus) IsPureInvalid ¶ added in v0.7.4
func (status CandidateStatus) IsPureInvalid() bool
func (CandidateStatus) IsPureLowRatio ¶ added in v0.7.4
func (status CandidateStatus) IsPureLowRatio() bool
func (CandidateStatus) IsPureLowRatioDel ¶ added in v0.7.4
func (status CandidateStatus) IsPureLowRatioDel() bool
func (CandidateStatus) IsPureNotEnough ¶ added in v0.7.4
func (status CandidateStatus) IsPureNotEnough() bool
func (CandidateStatus) IsPureWithdrew ¶ added in v0.7.4
func (status CandidateStatus) IsPureWithdrew() bool
func (CandidateStatus) IsValid ¶ added in v0.7.4
func (status CandidateStatus) IsValid() bool
func (CandidateStatus) IsWithdrew ¶ added in v0.7.4
func (status CandidateStatus) IsWithdrew() bool
type DelByDelegateEpoch ¶ added in v1.0.0
type DelByDelegateEpoch []*DelegationInfo
func (DelByDelegateEpoch) Len ¶ added in v1.0.0
func (d DelByDelegateEpoch) Len() int
func (DelByDelegateEpoch) Less ¶ added in v1.0.0
func (d DelByDelegateEpoch) Less(i, j int) bool
func (DelByDelegateEpoch) Swap ¶ added in v1.0.0
func (d DelByDelegateEpoch) Swap(i, j int)
type DelRelatedQueue ¶
type DelRelatedQueue []*DelegateRelated
func (DelRelatedQueue) IsEmpty ¶ added in v0.7.4
func (queue DelRelatedQueue) IsEmpty() bool
func (DelRelatedQueue) String ¶ added in v0.7.4
func (queue DelRelatedQueue) String() string
type DelegateRelated ¶
func (*DelegateRelated) String ¶
func (dr *DelegateRelated) String() string
type Delegation ¶
type Delegation struct { // The epoch number at delegate or edit DelegateEpoch uint32 // The delegate von is circulating for effective epoch (in effect) Released *big.Int // The delegate von is circulating for hesitant epoch (in hesitation) ReleasedHes *big.Int // The delegate von is RestrictingPlan for effective epoch (in effect) RestrictingPlan *big.Int // The delegate von is RestrictingPlan for hesitant epoch (in hesitation) RestrictingPlanHes *big.Int // Cumulative delegate income (Waiting for withdrawal) CumulativeIncome *big.Int // 处于犹豫期的委托金,源自锁定期 LockReleasedHes *big.Int LockRestrictingPlanHes *big.Int }
the Delegate information
func NewDelegation ¶ added in v1.0.0
func NewDelegation() *Delegation
func (*Delegation) CleanCumulativeIncome ¶ added in v0.7.6
func (del *Delegation) CleanCumulativeIncome(epoch uint32)
func (*Delegation) IsEmpty ¶ added in v0.7.4
func (del *Delegation) IsEmpty() bool
func (*Delegation) String ¶
func (del *Delegation) String() string
func (*Delegation) TotalHes ¶ added in v1.3.0
func (del *Delegation) TotalHes() *big.Int
type DelegationEx ¶
type DelegationEx struct { Addr common.Address NodeId enode.IDv0 StakingBlockNum uint64 DelegationHex }
func (*DelegationEx) IsEmpty ¶ added in v0.7.4
func (dex *DelegationEx) IsEmpty() bool
func (*DelegationEx) String ¶
func (dex *DelegationEx) String() string
func (*DelegationEx) V1 ¶ added in v1.3.0
func (dex *DelegationEx) V1() *DelegationExV1
type DelegationExV1 ¶ added in v1.3.0
type DelegationForStorage ¶ added in v1.3.0
type DelegationForStorage Delegation
type DelegationHex ¶
type DelegationHex struct { // The epoch number at delegate or edit DelegateEpoch uint32 // The delegate von is circulating for effective epoch (in effect) Released *hexutil.Big // The delegate von is circulating for hesitant epoch (in hesitation) ReleasedHes *hexutil.Big // The delegate von is RestrictingPlan for effective epoch (in effect) RestrictingPlan *hexutil.Big // The delegate von is RestrictingPlan for hesitant epoch (in hesitation) RestrictingPlanHes *hexutil.Big // Cumulative delegate income (Waiting for withdrawal) CumulativeIncome *hexutil.Big LockReleasedHes *hexutil.Big LockRestrictingPlanHes *hexutil.Big }
func (*DelegationHex) String ¶
func (delHex *DelegationHex) String() string
type DelegationHexV1 ¶ added in v1.3.0
type DelegationHexV1 struct { // The epoch number at delegate or edit DelegateEpoch uint32 // The delegate von is circulating for effective epoch (in effect) Released *hexutil.Big // The delegate von is circulating for hesitant epoch (in hesitation) ReleasedHes *hexutil.Big // The delegate von is RestrictingPlan for effective epoch (in effect) RestrictingPlan *hexutil.Big // The delegate von is RestrictingPlan for hesitant epoch (in hesitation) RestrictingPlanHes *hexutil.Big // Cumulative delegate income (Waiting for withdrawal) CumulativeIncome *hexutil.Big }
type DelegationInfo ¶ added in v0.7.6
type DelegationInfo struct { NodeID enode.IDv0 StakeBlockNumber uint64 Delegation *Delegation }
type DelegationLock ¶ added in v1.3.0
type DelegationLock struct { // 锁定期 Locks []*DelegationLockPeriod // 解锁期 Released *big.Int RestrictingPlan *big.Int // contains filtered or unexported fields }
func NewDelegationLock ¶ added in v1.3.0
func NewDelegationLock() *DelegationLock
func (*DelegationLock) AddLock ¶ added in v1.3.0
func (d *DelegationLock) AddLock(lockEpoch uint32, released, restrictingPlan *big.Int)
func (*DelegationLock) AdvanceLockedFunds ¶ added in v1.3.0
AdvanceLockedFunds 使用锁定期的委托金
func (*DelegationLock) Change ¶ added in v1.3.0
func (d *DelegationLock) Change() bool
func (*DelegationLock) ToHex ¶ added in v1.3.0
func (d *DelegationLock) ToHex() *DelegationLockHex
type DelegationLockHex ¶ added in v1.3.0
type DelegationLockHex struct { // 锁定期 Locks []*DelegationLockPeriodHex //处于解锁期的委托金 Released *hexutil.Big //处于解锁期的委托金 RestrictingPlan *hexutil.Big }
type DelegationLockPeriod ¶ added in v1.3.0
type DelegationLockPeriod struct { // 锁定截止周期 Epoch uint32 //处于锁定期的委托金,解锁后释放到用户余额 Released *big.Int //处于锁定期的委托金,解锁后释放到用户锁仓账户 RestrictingPlan *big.Int }
func (*DelegationLockPeriod) String ¶ added in v1.3.0
func (d *DelegationLockPeriod) String() string
func (*DelegationLockPeriod) ToHex ¶ added in v1.3.0
func (d *DelegationLockPeriod) ToHex() *DelegationLockPeriodHex
type DelegationLockPeriodHex ¶ added in v1.3.0
type Description ¶
type Description struct { // External Id for the third party to pull the node description (with length limit) ExternalId string // The Candidate Node's Name (with a length limit) NodeName string // The third-party home page of the node (with a length limit) Website string // Description of the node (with a length limit) Details string }
func (*Description) CheckLength ¶
func (desc *Description) CheckLength() error
type HistoryValidator ¶ added in v1.4.0
type HistoryValidator struct { NodeId enode.IDv0 BlsPubKey bls.PublicKeyHex }
For historical node records. Store historical node information and participate in hash calculation.
func (*HistoryValidator) Decode ¶ added in v1.4.0
func (hv *HistoryValidator) Decode(enVal []byte) error
func (*HistoryValidator) Encode ¶ added in v1.4.0
func (hv *HistoryValidator) Encode() ([]byte, error)
func (*HistoryValidator) ID ¶ added in v1.4.0
func (hv *HistoryValidator) ID() common.Hash
type HistoryValidatorEx ¶ added in v1.4.0
type HistoryValidatorEx struct { Address common.NodeAddress NodeId enode.IDv0 BlsPubKey bls.PublicKeyHex }
Structure returned to the external caller.
func (*HistoryValidatorEx) String ¶ added in v1.4.0
func (h *HistoryValidatorEx) String() string
type HistoryValidatorIDList ¶ added in v1.4.0
func (HistoryValidatorIDList) Decode ¶ added in v1.4.0
func (hvil HistoryValidatorIDList) Decode(enVal []byte) error
func (HistoryValidatorIDList) Encode ¶ added in v1.4.0
func (hvil HistoryValidatorIDList) Encode() ([]byte, error)
type HistoryValidatorList ¶ added in v1.4.0
type HistoryValidatorList []*HistoryValidator
type NeedRemoveCans ¶
type SlashNodeItem ¶ added in v0.7.3
type SlashNodeItem struct { // the nodeId will be slashed NodeId enode.IDv0 // the amount of von with slashed Amount *big.Int // slash type SlashType CandidateStatus // the benefit adrr who will receive the slash amount of von BenefitAddr common.Address }
An item that exists for slash
func (*SlashNodeItem) String ¶ added in v0.7.4
func (s *SlashNodeItem) String() string
type SlashQueue ¶ added in v0.7.3
type SlashQueue []*SlashNodeItem
func (SlashQueue) String ¶ added in v0.7.4
func (queue SlashQueue) String() string
type StakingDB ¶
type StakingDB struct {
// contains filtered or unexported fields
}
func NewStakingDB ¶
func NewStakingDB() *StakingDB
func NewStakingDBWithDB ¶ added in v0.7.6
func NewStakingDBWithDB(db snapshotdb.DB) *StakingDB
func (*StakingDB) AddAccountStakeRc ¶
func (*StakingDB) AddUnStakeItemStore ¶
func (*StakingDB) DelCanBaseStore ¶ added in v0.7.4
func (*StakingDB) DelCanMutableStore ¶ added in v0.7.4
func (*StakingDB) DelCanPowerStore ¶
func (*StakingDB) DelCandidateStore ¶
func (*StakingDB) DelDelegateStore ¶
func (*StakingDB) DelEpochValListByBlockHash ¶
func (*StakingDB) DelRoundValListByBlockHash ¶
func (*StakingDB) DelRoundValidatorAddrs ¶ added in v0.7.3
func (*StakingDB) DelUnStakeCountStore ¶
func (*StakingDB) DelUnStakeItemStore ¶
func (*StakingDB) GetCanBaseStore ¶ added in v0.7.4
func (db *StakingDB) GetCanBaseStore(blockHash common.Hash, addr common.NodeAddress) (*CandidateBase, error)
func (*StakingDB) GetCanBaseStoreByIrr ¶ added in v0.7.4
func (db *StakingDB) GetCanBaseStoreByIrr(addr common.NodeAddress) (*CandidateBase, error)
func (*StakingDB) GetCanBaseStoreByIrrWithSuffix ¶ added in v0.7.4
func (db *StakingDB) GetCanBaseStoreByIrrWithSuffix(suffix []byte) (*CandidateBase, error)
func (*StakingDB) GetCanBaseStoreWithSuffix ¶ added in v0.7.4
func (*StakingDB) GetCanMutableStore ¶ added in v0.7.4
func (db *StakingDB) GetCanMutableStore(blockHash common.Hash, addr common.NodeAddress) (*CandidateMutable, error)
func (*StakingDB) GetCanMutableStoreByIrr ¶ added in v0.7.4
func (db *StakingDB) GetCanMutableStoreByIrr(addr common.NodeAddress) (*CandidateMutable, error)
func (*StakingDB) GetCanMutableStoreByIrrWithSuffix ¶ added in v0.7.4
func (db *StakingDB) GetCanMutableStoreByIrrWithSuffix(suffix []byte) (*CandidateMutable, error)
func (*StakingDB) GetCanMutableStoreWithSuffix ¶ added in v0.7.4
func (*StakingDB) GetCandidateStore ¶
func (*StakingDB) GetCandidateStoreByIrr ¶
func (db *StakingDB) GetCandidateStoreByIrr(addr common.NodeAddress) (*Candidate, error)
func (*StakingDB) GetCandidateStoreByIrrWithSuffix ¶
func (*StakingDB) GetCandidateStoreWithSuffix ¶
func (*StakingDB) GetDB ¶ added in v1.0.0
func (db *StakingDB) GetDB() snapshotdb.DB
func (*StakingDB) GetDelegateStore ¶
func (*StakingDB) GetDelegatesInfo ¶ added in v0.7.6
func (*StakingDB) GetDelegationLock ¶ added in v1.3.0
func (*StakingDB) GetEpochValIndexByBlockHash ¶
func (db *StakingDB) GetEpochValIndexByBlockHash(blockHash common.Hash) (ValArrIndexQueue, error)
func (*StakingDB) GetEpochValIndexByIrr ¶
func (db *StakingDB) GetEpochValIndexByIrr() (ValArrIndexQueue, error)
func (*StakingDB) GetEpochValListByBlockHash ¶
func (*StakingDB) GetEpochValListByIrr ¶
func (db *StakingDB) GetEpochValListByIrr(start, end uint64) (ValidatorQueue, error)
func (*StakingDB) GetRoundAddrBoundary ¶ added in v0.7.4
func (*StakingDB) GetRoundValIndexByBlockHash ¶
func (db *StakingDB) GetRoundValIndexByBlockHash(blockHash common.Hash) (ValArrIndexQueue, error)
func (*StakingDB) GetRoundValIndexByIrr ¶
func (db *StakingDB) GetRoundValIndexByIrr() (ValArrIndexQueue, error)
func (*StakingDB) GetRoundValListByBlockHash ¶
func (*StakingDB) GetRoundValListByIrr ¶
func (db *StakingDB) GetRoundValListByIrr(start, end uint64) (ValidatorQueue, error)
func (*StakingDB) GetUnStakeCountStore ¶
func (*StakingDB) GetUnStakeItemStore ¶
func (*StakingDB) HasAccountStakeRc ¶
func (*StakingDB) IteratorCandidatePowerByBlockHash ¶
func (*StakingDB) IteratorDelegateByBlockHashWithAddr ¶
func (*StakingDB) LoadRoundValidatorAddrs ¶ added in v0.7.3
func (*StakingDB) PutDelegationLock ¶ added in v1.3.0
func (*StakingDB) SetCanBaseStore ¶ added in v0.7.4
func (db *StakingDB) SetCanBaseStore(blockHash common.Hash, addr common.NodeAddress, can *CandidateBase) error
func (*StakingDB) SetCanMutableStore ¶ added in v0.7.4
func (db *StakingDB) SetCanMutableStore(blockHash common.Hash, addr common.NodeAddress, can *CandidateMutable) error
func (*StakingDB) SetCanPowerStore ¶
func (*StakingDB) SetCandidateStore ¶
func (*StakingDB) SetDelegateStore ¶
func (*StakingDB) SetEpochValIndex ¶
func (db *StakingDB) SetEpochValIndex(blockHash common.Hash, indexArr ValArrIndexQueue) error
func (*StakingDB) SetEpochValList ¶
func (*StakingDB) SetRoundAddrBoundary ¶ added in v0.7.4
func (*StakingDB) SetRoundValIndex ¶
func (db *StakingDB) SetRoundValIndex(blockHash common.Hash, indexArr ValArrIndexQueue) error
func (*StakingDB) SetRoundValList ¶
func (*StakingDB) StoreRoundValidatorAddrs ¶ added in v0.7.3
type UnStakeItem ¶
type UnStakeItem struct { // this is the nodeAddress NodeAddress common.NodeAddress StakingBlockNum uint64 // Return to normal staking state Recovery bool }
type ValArrIndex ¶
func (*ValArrIndex) String ¶ added in v0.7.4
func (vindex *ValArrIndex) String() string
type ValArrIndexQueue ¶
type ValArrIndexQueue []*ValArrIndex
func (ValArrIndexQueue) ConstantAppend ¶
func (queue ValArrIndexQueue) ConstantAppend(index *ValArrIndex, size int) (*ValArrIndex, ValArrIndexQueue)
func (ValArrIndexQueue) String ¶ added in v0.7.4
func (queue ValArrIndexQueue) String() string
type Validator ¶
type Validator struct { ProgramVersion uint32 StakingTxIndex uint32 ValidatorTerm uint32 // Validator's term in the consensus round StakingBlockNum uint64 NodeAddress common.NodeAddress NodeId enode.IDv0 BlsPubKey bls.PublicKeyHex }
the Validator info They are Simplified Candidate They are consensus nodes and Epoch nodes snapshot
type Validator struct { NodeAddress common.Address NodeId discover.NodeID // bls public key BlsPubKey bls.PublicKeyHex // The weight snapshot // NOTE: // converted from the weight snapshot of Candidate, they array order is: // // programVersion, candidate.shares, stakingBlocknum, stakingTxindex // // They origin type is: uint32, *big.Int, uint64, uint32 StakingWeight [SWeightItem]string // Validator's term in the consensus round ValidatorTerm uint32 }
type ValidatorArray ¶
type ValidatorArray struct { // the round start blockNumber or epoch start blockNumber Start uint64 // the round end blockNumber or epoch blockNumber End uint64 // the round validators or epoch validators Arr ValidatorQueue }
some consensus round validators or current epoch validators
func (ValidatorArray) String ¶ added in v0.7.4
func (v ValidatorArray) String() string
type ValidatorEx ¶
type ValidatorEx struct { //NodeAddress common.Address NodeId enode.IDv0 // bls public key BlsPubKey bls.PublicKeyHex // The account used to initiate the staking StakingAddress common.Address // The account receive the block rewards and the staking rewards BenefitAddress common.Address // Delegate reward amount percent for current settlement cycle RewardPer uint16 // Delegate reward amount percent for next settlement cycle NextRewardPer uint16 // Number of settlement cycles when changing the commission reward percentage RewardPerChangeEpoch uint32 // The tx index at the time of staking StakingTxIndex uint32 // The version of the node process ProgramVersion uint32 // Block height at the time of staking StakingBlockNum uint64 //Shares *big.Int Shares *hexutil.Big // Node desc Description // this is the term of validator in consensus round // [0, N] ValidatorTerm uint32 // Effective total delegate DelegateTotal *hexutil.Big DelegateRewardTotal *hexutil.Big }
func (*ValidatorEx) String ¶
func (vex *ValidatorEx) String() string
type ValidatorExQueue ¶
type ValidatorExQueue []*ValidatorEx
func (ValidatorExQueue) IsEmpty ¶ added in v0.7.4
func (queue ValidatorExQueue) IsEmpty() bool
func (ValidatorExQueue) IsNotEmpty ¶ added in v0.7.4
func (queue ValidatorExQueue) IsNotEmpty() bool
func (ValidatorExQueue) String ¶ added in v0.7.4
func (queue ValidatorExQueue) String() string
type ValidatorQueue ¶
type ValidatorQueue []*Validator
func (ValidatorQueue) IsEmpty ¶ added in v0.7.4
func (queue ValidatorQueue) IsEmpty() bool
func (ValidatorQueue) IsNotEmpty ¶ added in v0.7.4
func (queue ValidatorQueue) IsNotEmpty() bool
func (ValidatorQueue) String ¶ added in v0.7.4
func (queue ValidatorQueue) String() string
func (ValidatorQueue) ValidatorSort ¶
func (arr ValidatorQueue) ValidatorSort(removes NeedRemoveCans, compare func(slashs NeedRemoveCans, c, can *Validator) int)