reelection

package
v0.0.0-...-2f68b9a Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: MIT Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or 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 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 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 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 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 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

func CheckBlock(block *types.Block) error

func GetAllElectedByHash

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

func GetAllNativeDataForUpdate

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

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

func (p *ReElection) GenElection(state *state.StateDB, preBlockHash common.Hash) []common.Elect

func (*ReElection) GetBroadcastIntervalByHash

func (self *ReElection) GetBroadcastIntervalByHash(hash common.Hash) (*mc.BCIntervalInfo, error)

func (*ReElection) GetElectConfig

func (self *ReElection) GetElectConfig(hash common.Hash) (*mc.ElectConfigInfo_All, error)

func (*ReElection) GetElectGenTimes

func (self *ReElection) GetElectGenTimes(hash common.Hash) (*mc.ElectGenTimeStruct, error)

func (*ReElection) GetElectPlug

func (self *ReElection) GetElectPlug(hash common.Hash) (baseinterface.ElectionInterface, error)

func (*ReElection) GetElection

func (self *ReElection) GetElection(state *state.StateDB, hash common.Hash) (*ElectReturnInfo, error)

func (*ReElection) GetHeaderHashByNumber

func (self *ReElection) GetHeaderHashByNumber(hash common.Hash, height uint64) (common.Hash, error)

func (*ReElection) GetNetTopology

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

func (self *ReElection) GetNextElectNodeInfo(electGraph *mc.ElectGraph, types common.RoleType) (master []mc.ElectNodeInfo, backup []mc.ElectNodeInfo, cand []mc.ElectNodeInfo, err error)

func (*ReElection) GetNumberByHash

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

func (self *ReElection) GetViPList(hash common.Hash) ([]mc.VIPConfig, error)

func (*ReElection) HandleTopGen

func (self *ReElection) HandleTopGen(hash common.Hash) (TopGenStatus, error)

func (*ReElection) IsMinerTopGenTiming

func (self *ReElection) IsMinerTopGenTiming(hash common.Hash) bool

是不是矿工拓扑生成时间段

func (*ReElection) IsValidatorTopGenTiming

func (self *ReElection) IsValidatorTopGenTiming(hash common.Hash) bool

是不是验证者拓扑生成时间段

func (*ReElection) LastMinerGenTimeStamp

func (self *ReElection) LastMinerGenTimeStamp(height uint64, types common.RoleType, hash common.Hash) (uint64, error)

func (*ReElection) ProduceElectGraphData

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

func (*ReElection) ProduceElectOnlineStateData

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

func (*ReElection) ProduceMinHashData

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

func (*ReElection) ProducePreBroadcastStateData

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

func (p *ReElection) VerifyElection(header *types.Header, state *state.StateDB) error

func (*ReElection) VerifyNetTopology

func (p *ReElection) VerifyNetTopology(header *types.Header, onlineConsensusResults []*mc.HD_OnlineConsensusVoteResultMsg) error

func (*ReElection) VerifyVrf

func (p *ReElection) VerifyVrf(header *types.Header) error

type TopGenStatus

type TopGenStatus struct {
	MastV []mc.ElectNodeInfo
	BackV []mc.ElectNodeInfo
	CandV []mc.ElectNodeInfo

	MastM []mc.ElectNodeInfo
	BackM []mc.ElectNodeInfo
	CandM []mc.ElectNodeInfo
}

type TopNodeService

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