reelection

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: MIT Imports: 17 Imported by: 20

Documentation

Overview

Copyright (c) 2018 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 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 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 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 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 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

View Source
const (
	Module = "换届服务"
)

Variables

View Source
var (
	Time_Out_Limit = 2 * time.Second
	ChanSize       = 10
)

Functions

func CheckBlock added in v1.1.1

func CheckBlock(block *types.Block) error

func GetAllElectedByHash added in v1.1.2

func GetAllElectedByHash(hash common.Hash, tp common.RoleType) ([]vm.DepositDetail, error)

func GetAllNativeDataForUpdate added in v1.1.1

func GetAllNativeDataForUpdate(electstate mc.ElectGraph, electonline mc.ElectOnlineStatus, top *mc.TopologyGraph) support.AllNative

func GetCurrentTopology

func GetCurrentTopology(hash common.Hash, reqtypes common.RoleType) (*mc.TopologyGraph, error)

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 (self *ReElection) GetHeaderHashByNumber(hash common.Hash, height uint64) (common.Hash, error)

func (*ReElection) GetNetTopology added in v1.1.1

func (p *ReElection) GetNetTopology(num uint64, version string, 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) GetSeed

func (self *ReElection) GetSeed(hash common.Hash) (*big.Int, 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 (self *ReElection) GetViPList(hash common.Hash) ([]mc.VIPConfig, error)

func (*ReElection) HandleTopGen

func (self *ReElection) HandleTopGen(hash common.Hash, stateDb *state.StateDBManage) (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 (self *ReElection) LastMinerGenTimeStamp(height uint64, types common.RoleType, hash common.Hash) (uint64, error)

func (*ReElection) ProduceElectGraphData added in v1.1.1

func (self *ReElection) ProduceElectGraphData(block *types.Block, stateDb *state.StateDBManage, readFn core.PreStateReadFn) (interface{}, error)

func (*ReElection) ProduceElectOnlineStateData added in v1.1.1

func (self *ReElection) ProduceElectOnlineStateData(block *types.Block, stateDb *state.StateDBManage, readFn core.PreStateReadFn) (interface{}, error)

func (*ReElection) ProduceMinHashData added in v1.1.1

func (self *ReElection) ProduceMinHashData(block *types.Block, stateDb *state.StateDBManage, readFn core.PreStateReadFn) (interface{}, error)

func (*ReElection) ProducePreBroadcastStateData added in v1.1.1

func (self *ReElection) ProducePreBroadcastStateData(block *types.Block, stateDb *state.StateDBManage, 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, stateDb *state.StateDBManage) ([]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(version string, header *types.Header, onlineConsensusResults []*mc.HD_OnlineConsensusVoteResultMsg) error

func (*ReElection) VerifyVrf added in v1.1.1

func (p *ReElection) VerifyVrf(header *types.Header) 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
}

Jump to

Keyboard shortcuts

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