Documentation ¶
Overview ¶
Copyright (c) 2018-2019 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2018-2019 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2018-2019 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2018-2019 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2018-2019 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2018-2019 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php
Index ¶
- Constants
- Variables
- func CheckBlock(block *types.Block) error
- func GetAllElectedByHash(hash common.Hash, tp common.RoleType) ([]vm.DepositDetail, error)
- func GetAllNativeDataForUpdate(electstate mc.ElectGraph, electonline mc.ElectOnlineStatus, ...) support.AllNative
- func GetCurrentTopology(hash common.Hash, reqtypes common.RoleType) (*mc.TopologyGraph, error)
- func GetFound() []vm.DepositDetail
- func GetOnlineAlter(offline []common.Address, online []common.Address, ...) []mc.Alternative
- type ElectReturnInfo
- type ReElection
- func (p *ReElection) GenElection(state *state.StateDBManage, preBlockHash common.Hash) []common.Elect
- func (self *ReElection) GetBroadcastIntervalByHash(hash common.Hash) (*mc.BCIntervalInfo, error)
- func (self *ReElection) GetElectConfig(hash common.Hash) (*mc.ElectConfigInfo_All, error)
- func (self *ReElection) GetElectGenTimes(hash common.Hash) (*mc.ElectGenTimeStruct, error)
- func (self *ReElection) GetElectPlug(hash common.Hash) (baseinterface.ElectionInterface, error)
- func (self *ReElection) GetElection(state *state.StateDBManage, hash common.Hash) (*ElectReturnInfo, error)
- func (self *ReElection) GetHeaderHashByNumber(hash common.Hash, height uint64) (common.Hash, error)
- func (p *ReElection) GetNetTopology(num uint64, parentHash common.Hash, bcInterval *mc.BCIntervalInfo) (*common.NetTopology, []*mc.HD_OnlineConsensusVoteResultMsg)
- func (self *ReElection) GetNetTopologyAll(hash common.Hash) (*ElectReturnInfo, error)
- func (self *ReElection) GetNextElectNodeInfo(electGraph *mc.ElectGraph, types common.RoleType) (master []mc.ElectNodeInfo, backup []mc.ElectNodeInfo, cand []mc.ElectNodeInfo, ...)
- func (self *ReElection) GetNumberByHash(hash common.Hash) (uint64, error)
- func (self *ReElection) GetSeed(hash common.Hash) (*big.Int, error)
- func (self *ReElection) GetTopoChange(hash common.Hash, offline []common.Address, online []common.Address) ([]mc.Alternative, error)
- func (self *ReElection) GetViPList(hash common.Hash) ([]mc.VIPConfig, error)
- func (self *ReElection) HandleTopGen(hash common.Hash) (TopGenStatus, error)
- func (self *ReElection) IsMinerTopGenTiming(hash common.Hash) bool
- func (self *ReElection) IsValidatorTopGenTiming(hash common.Hash) bool
- func (self *ReElection) LastMinerGenTimeStamp(height uint64, types common.RoleType, hash common.Hash) (uint64, error)
- func (self *ReElection) ProduceElectGraphData(block *types.Block, readFn core.PreStateReadFn) (interface{}, error)
- func (self *ReElection) ProduceElectOnlineStateData(block *types.Block, readFn core.PreStateReadFn) (interface{}, error)
- func (self *ReElection) ProduceMinHashData(block *types.Block, readFn core.PreStateReadFn) (interface{}, error)
- func (self *ReElection) ProducePreBroadcastStateData(block *types.Block, readFn core.PreStateReadFn) (interface{}, error)
- func (self *ReElection) ToGenMinerTop(hash common.Hash) ([]mc.ElectNodeInfo, []mc.ElectNodeInfo, []mc.ElectNodeInfo, error)
- func (self *ReElection) ToGenValidatorTop(hash common.Hash) ([]mc.ElectNodeInfo, []mc.ElectNodeInfo, []mc.ElectNodeInfo, error)
- func (self *ReElection) TopoUpdate(allNative support.AllNative, top *mc.TopologyGraph, hash common.Hash) ([]mc.Alternative, error)
- func (self *ReElection) TransferToElectionStu(info *ElectReturnInfo) []common.Elect
- func (self *ReElection) TransferToNetTopologyAllStu(info *ElectReturnInfo) *common.NetTopology
- func (self *ReElection) TransferToNetTopologyChgStu(alterInfo []mc.Alternative) *common.NetTopology
- func (p *ReElection) VerifyElection(header *types.Header, state *state.StateDBManage) error
- func (p *ReElection) VerifyNetTopology(header *types.Header, ...) error
- func (p *ReElection) VerifyVrf(header *types.Header) error
- type TopGenStatus
- type TopNodeService
Constants ¶
const (
Module = "换届服务"
)
Variables ¶
var ( Time_Out_Limit = 2 * time.Second ChanSize = 10 )
Functions ¶
func CheckBlock ¶ added in v1.1.1
func GetAllElectedByHash ¶ added in v1.1.2
func GetAllNativeDataForUpdate ¶ added in v1.1.1
func GetAllNativeDataForUpdate(electstate mc.ElectGraph, electonline mc.ElectOnlineStatus, top *mc.TopologyGraph) support.AllNative
func GetCurrentTopology ¶
func GetFound ¶
func GetFound() []vm.DepositDetail
func GetOnlineAlter ¶ added in v1.1.1
func GetOnlineAlter(offline []common.Address, online []common.Address, electonline mc.ElectOnlineStatus) []mc.Alternative
Types ¶
type ElectReturnInfo ¶
type ElectReturnInfo struct { MasterMiner []mc.ElectNodeInfo BackUpMiner []mc.ElectNodeInfo MasterValidator []mc.ElectNodeInfo BackUpValidator []mc.ElectNodeInfo }
type ReElection ¶
type ReElection struct {
// contains filtered or unexported fields
}
func New ¶
func New(bc *core.BlockChain, random *baseinterface.Random, topNode TopNodeService) (*ReElection, error)
func (*ReElection) GenElection ¶ added in v1.1.1
func (p *ReElection) GenElection(state *state.StateDBManage, preBlockHash common.Hash) []common.Elect
func (*ReElection) GetBroadcastIntervalByHash ¶ added in v1.1.1
func (self *ReElection) GetBroadcastIntervalByHash(hash common.Hash) (*mc.BCIntervalInfo, error)
func (*ReElection) GetElectConfig ¶ added in v1.1.1
func (self *ReElection) GetElectConfig(hash common.Hash) (*mc.ElectConfigInfo_All, error)
func (*ReElection) GetElectGenTimes ¶ added in v1.1.1
func (self *ReElection) GetElectGenTimes(hash common.Hash) (*mc.ElectGenTimeStruct, error)
func (*ReElection) GetElectPlug ¶ added in v1.1.1
func (self *ReElection) GetElectPlug(hash common.Hash) (baseinterface.ElectionInterface, error)
func (*ReElection) GetElection ¶
func (self *ReElection) GetElection(state *state.StateDBManage, hash common.Hash) (*ElectReturnInfo, error)
func (*ReElection) GetHeaderHashByNumber ¶ added in v1.1.1
func (*ReElection) GetNetTopology ¶ added in v1.1.1
func (p *ReElection) GetNetTopology(num uint64, parentHash common.Hash, bcInterval *mc.BCIntervalInfo) (*common.NetTopology, []*mc.HD_OnlineConsensusVoteResultMsg)
func (*ReElection) GetNetTopologyAll ¶
func (self *ReElection) GetNetTopologyAll(hash common.Hash) (*ElectReturnInfo, error)
func (*ReElection) GetNextElectNodeInfo ¶ added in v1.1.1
func (self *ReElection) GetNextElectNodeInfo(electGraph *mc.ElectGraph, types common.RoleType) (master []mc.ElectNodeInfo, backup []mc.ElectNodeInfo, cand []mc.ElectNodeInfo, err error)
func (*ReElection) GetNumberByHash ¶ added in v1.1.1
func (self *ReElection) GetNumberByHash(hash common.Hash) (uint64, error)
func (*ReElection) GetTopoChange ¶
func (self *ReElection) GetTopoChange(hash common.Hash, offline []common.Address, online []common.Address) ([]mc.Alternative, error)
func (*ReElection) GetViPList ¶ added in v1.1.1
func (*ReElection) HandleTopGen ¶
func (self *ReElection) HandleTopGen(hash common.Hash) (TopGenStatus, error)
func (*ReElection) IsMinerTopGenTiming ¶ added in v1.1.1
func (self *ReElection) IsMinerTopGenTiming(hash common.Hash) bool
是不是矿工拓扑生成时间段
func (*ReElection) IsValidatorTopGenTiming ¶ added in v1.1.1
func (self *ReElection) IsValidatorTopGenTiming(hash common.Hash) bool
是不是验证者拓扑生成时间段
func (*ReElection) LastMinerGenTimeStamp ¶ added in v1.1.1
func (*ReElection) ProduceElectGraphData ¶ added in v1.1.1
func (self *ReElection) ProduceElectGraphData(block *types.Block, readFn core.PreStateReadFn) (interface{}, error)
func (*ReElection) ProduceElectOnlineStateData ¶ added in v1.1.1
func (self *ReElection) ProduceElectOnlineStateData(block *types.Block, readFn core.PreStateReadFn) (interface{}, error)
func (*ReElection) ProduceMinHashData ¶ added in v1.1.1
func (self *ReElection) ProduceMinHashData(block *types.Block, readFn core.PreStateReadFn) (interface{}, error)
func (*ReElection) ProducePreBroadcastStateData ¶ added in v1.1.1
func (self *ReElection) ProducePreBroadcastStateData(block *types.Block, readFn core.PreStateReadFn) (interface{}, error)
func (*ReElection) ToGenMinerTop ¶
func (self *ReElection) ToGenMinerTop(hash common.Hash) ([]mc.ElectNodeInfo, []mc.ElectNodeInfo, []mc.ElectNodeInfo, error)
func (*ReElection) ToGenValidatorTop ¶
func (self *ReElection) ToGenValidatorTop(hash common.Hash) ([]mc.ElectNodeInfo, []mc.ElectNodeInfo, []mc.ElectNodeInfo, error)
func (*ReElection) TopoUpdate ¶
func (self *ReElection) TopoUpdate(allNative support.AllNative, top *mc.TopologyGraph, hash common.Hash) ([]mc.Alternative, error)
func (*ReElection) TransferToElectionStu ¶
func (self *ReElection) TransferToElectionStu(info *ElectReturnInfo) []common.Elect
func (*ReElection) TransferToNetTopologyAllStu ¶
func (self *ReElection) TransferToNetTopologyAllStu(info *ElectReturnInfo) *common.NetTopology
func (*ReElection) TransferToNetTopologyChgStu ¶
func (self *ReElection) TransferToNetTopologyChgStu(alterInfo []mc.Alternative) *common.NetTopology
func (*ReElection) VerifyElection ¶ added in v1.1.1
func (p *ReElection) VerifyElection(header *types.Header, state *state.StateDBManage) error
func (*ReElection) VerifyNetTopology ¶ added in v1.1.1
func (p *ReElection) VerifyNetTopology(header *types.Header, onlineConsensusResults []*mc.HD_OnlineConsensusVoteResultMsg) error
type TopGenStatus ¶ added in v1.1.1
type TopGenStatus struct { MastV []mc.ElectNodeInfo BackV []mc.ElectNodeInfo CandV []mc.ElectNodeInfo MastM []mc.ElectNodeInfo BackM []mc.ElectNodeInfo CandM []mc.ElectNodeInfo }
type TopNodeService ¶ added in v1.1.1
type TopNodeService interface {
GetConsensusOnlineResults() []*mc.HD_OnlineConsensusVoteResultMsg
}