Documentation
¶
Overview ¶
Copyright 2018 The MATRIX Authors as well as Copyright 2014-2017 The go-ethereum Authors This file is consisted of the MATRIX library and part of the go-ethereum library.
The MATRIX-ethereum library is free software: you can redistribute it and/or modify it under the terms of the MIT License.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject tothe following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright 2018 The MATRIX Authors as well as Copyright 2014-2017 The go-ethereum Authors This file is consisted of the MATRIX library and part of the go-ethereum library.
The MATRIX-ethereum library is free software: you can redistribute it and/or modify it under the terms of the MIT License.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject tothe following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- func Normalize(probVal []Stf) []pnormalized
- func Sample1NodesInValNodes(probnormalized []pnormalized, rand01 float64) string
- func WriteWithFileWrite(name, content string)
- type CandidateInfo
- type ElectEventType
- type ElectMMSub
- type ElectMVSub
- type ElectionResultInfo
- type Elector
- func (Ele *Elector) ChoiceEngine(flag int)
- func (Ele *Elector) CommbineFundNodesAndPricipal(probVal []Stf, probFund []Stf, PricipalValNodes []Strallyint, ...) []Strallyint
- func (Ele *Elector) EleServer()
- func (Ele *Elector) Listen()
- func (Ele *Elector) MinerNodesSelected(probVal []Stf, seed int64, Ms int) ([]Strallyint, []Strallyint)
- func (Ele *Elector) Post()
- func (Ele *Elector) PrimarylistUpdate(Q0, Q1, Q2 []mc.TopologyNodeInfo, online mc.TopologyNodeInfo, flag int) ([]mc.TopologyNodeInfo, []mc.TopologyNodeInfo, []mc.TopologyNodeInfo)
- func (Ele *Elector) SampleMPlusPNodes(probnormalized []pnormalized, seed int64) ([]Strallyint, []Strallyint, []Strallyint)
- func (Ele *Elector) SampleMinerNodes(probnormalized []pnormalized, seed int64, Ms int) ([]Strallyint, []Strallyint)
- func (Ele *Elector) ToPoUpdate(Q0, Q1, Q2 []mc.TopologyNodeInfo, nettopo mc.TopologyGraph, ...) []mc.Alternative
- func (Ele *Elector) ValNodesSelected(probVal []Stf, seed int64, M int, P int, J int) ([]Strallyint, []Strallyint, []Strallyint)
- type Mynode
- type Self
- type Stf
- type Strallyint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Sample1NodesInValNodes ¶
func WriteWithFileWrite ¶
func WriteWithFileWrite(name, content string)
Types ¶
type CandidateInfo ¶
type ElectEventType ¶
type ElectEventType string
type ElectMMSub ¶
type ElectMMSub struct {
MasterMinerReElectionReqMsgCH chan *mc.MasterMinerReElectionReqMsg
MasterMinerReElectionReqMsgSub event.Subscription
}
type ElectMVSub ¶
type ElectMVSub struct {
MasterValidatorReElectionReqMsgCH chan *mc.MasterValidatorReElectionReqMsg
MasterValidatorReElectionReqMsgSub event.Subscription
}
type ElectionResultInfo ¶
type Elector ¶
type Elector struct {
EleMMSub ElectMMSub
EleMVSub ElectMVSub
EleMMRs chan *mc.MasterMinerReElectionRsp
EleMVRs chan *mc.MasterValidatorReElectionRsq
Engine func(probVal []Stf, seed int64, M int, P int, J int) ([]Strallyint, []Strallyint, []Strallyint) //Engine func(probVal []Stf, seed int64) ([]Strallyint, []Strallyint, []Strallyint) //func(probVal map[string]float32, seed int64) ([]Strallyint, []Strallyint, []Strallyint)
MaxSample int //配置参数,采样最多发生1000次,是一个离P+M较远的值
J int //基金会验证节点个数tps_weight
M int //验证主节点个数
P int //备份主节点个数
N int //矿工主节点个数
// contains filtered or unexported fields
}
func (*Elector) ChoiceEngine ¶
func (*Elector) CommbineFundNodesAndPricipal ¶
func (Ele *Elector) CommbineFundNodesAndPricipal(probVal []Stf, probFund []Stf, PricipalValNodes []Strallyint, ratiodnlimit float64, ratiouplimit float64) []Strallyint
func (*Elector) MinerNodesSelected ¶
func (Ele *Elector) MinerNodesSelected(probVal []Stf, seed int64, Ms int) ([]Strallyint, []Strallyint)
func (*Elector) PrimarylistUpdate ¶
func (Ele *Elector) PrimarylistUpdate(Q0, Q1, Q2 []mc.TopologyNodeInfo, online mc.TopologyNodeInfo, flag int) ([]mc.TopologyNodeInfo, []mc.TopologyNodeInfo, []mc.TopologyNodeInfo)
func (*Elector) SampleMPlusPNodes ¶
func (Ele *Elector) SampleMPlusPNodes(probnormalized []pnormalized, seed int64) ([]Strallyint, []Strallyint, []Strallyint)
做异常判断
func (*Elector) SampleMinerNodes ¶
func (Ele *Elector) SampleMinerNodes(probnormalized []pnormalized, seed int64, Ms int) ([]Strallyint, []Strallyint)
func (*Elector) ToPoUpdate ¶
func (Ele *Elector) ToPoUpdate(Q0, Q1, Q2 []mc.TopologyNodeInfo, nettopo mc.TopologyGraph, offline []common.Address) []mc.Alternative
func (*Elector) ValNodesSelected ¶
func (Ele *Elector) ValNodesSelected(probVal []Stf, seed int64, M int, P int, J int) ([]Strallyint, []Strallyint, []Strallyint)
func (Ele *Elector) ValNodesSelected(probVal []Stf, seed int64) ([]Strallyint, []Strallyint, []Strallyint) {
type Stf ¶
func CalcAllValueFunction ¶
func CalcAllValueFunction(nodelist []vm.DepositDetail) []Stf
type Strallyint ¶
func CalcRemainingNodesVotes ¶
func CalcRemainingNodesVotes(RemainingProbNormalizedNodes []Strallyint) []Strallyint