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
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
- Variables
- func PublishEvent(aim EventCode, data interface{}) error
- func ReturnBroadCastType() (bType map[string]bool)
- func SubscribeEvent(aim EventCode, ch interface{}) (event.Subscription, error)
- type Alternative
- type BCIntervalInfo
- func (info *BCIntervalInfo) GetBackupEnableNumber() uint64
- func (info *BCIntervalInfo) GetBroadcastInterval() uint64
- func (info *BCIntervalInfo) GetLastBroadcastNumber() uint64
- func (info *BCIntervalInfo) GetLastReElectionNumber() uint64
- func (info *BCIntervalInfo) GetNextBroadcastNumber(number uint64) uint64
- func (info *BCIntervalInfo) GetNextReElectionNumber(number uint64) uint64
- func (info *BCIntervalInfo) GetReElectionInterval() uint64
- func (info *BCIntervalInfo) IsBroadcastNumber(number uint64) bool
- func (info *BCIntervalInfo) IsReElectionNumber(number uint64) bool
- func (info *BCIntervalInfo) SetBackupBCInterval(interval uint64, enableNumber uint64)
- func (info *BCIntervalInfo) SetLastBCNumber(number uint64)
- func (info *BCIntervalInfo) SetLastReelectNumber(number uint64)
- func (info *BCIntervalInfo) UsingBackupInterval()
- type BlkRewardCfg
- type BlockData
- type BlockGenor_BroadcastMiningReqMsg
- type BlockInfo
- type BlockInsertedMsg
- type BlockLocalVerifyOK
- type BlockPOSFinishedNotify
- type BlockProduceSlashBlackList
- type BlockProduceSlashCfg
- type BlockProduceSlashStatsStatus
- type BlockProduceStats
- type BlockToBucket
- type BlockToLinker
- type BroadCastEvent
- type Center
- type ChainState
- type ConsensusTurnInfo
- type DepositDetail
- type ElectConfigInfo
- type ElectConfigInfo_All
- type ElectGenTimeStruct
- type ElectGraph
- type ElectMinerNumStruct
- type ElectNodeInfo
- type ElectOnlineStatus
- type ElectWhiteListSwitcher
- type ElectionEvent
- type EntrustInfo
- type EventCode
- type EveryBlockSeedRspMsg
- type HD_BlkConsensusReqMsg
- type HD_BlockInsertNotify
- type HD_BroadcastMiningRspMsg
- type HD_ConsensusVote
- type HD_FullBlockReqMsg
- type HD_FullBlockRspMsg
- type HD_MiningReqMsg
- type HD_MiningRspMsg
- type HD_OldBroadcastMiningRspMsg
- type HD_OldFullBlockRspMsg
- type HD_OnlineConsensusReqs
- type HD_OnlineConsensusVoteResultMsg
- type HD_OnlineConsensusVotes
- type HD_ReelectBroadcastMsg
- type HD_ReelectBroadcastRspMsg
- type HD_ReelectInquiryReqMsg
- type HD_ReelectInquiryRspMsg
- type HD_ReelectLeaderConsensus
- type HD_ReelectLeaderReqMsg
- type HD_V2_ConsensusVote
- type HD_V2_ReelectBroadcastMsg
- type HD_V2_ReelectBroadcastRspMsg
- type HD_V2_ReelectInquiryReqMsg
- type HD_V2_ReelectInquiryRspMsg
- type HD_V2_ReelectLeaderConsensus
- type HD_V2_ReelectLeaderReqMsg
- type HdRev
- type InterestCfg
- type LeaderChangeNotify
- type LeaderConfig
- type LeaderStateMsg
- type LocalBlockVerifyConsensusReq
- type LotteryCfg
- type LotteryFrom
- type LotteryInfo
- type MasterMinerReElectionReqMsg
- type MasterMinerReElectionRsp
- type MasterMinerReElectionRspMsg
- type MasterValidatorReElectionReqMsg
- type MasterValidatorReElectionRspMsg
- type MasterValidatorReElectionRsq
- type MinerOutReward
- type MultiCoinMinerOutReward
- type NewBlockReadyMsg
- type OlLdBlockData
- type OldBlockData
- type OnlineConsensusReq
- type OnlineState
- type PreBroadStateRoot
- type RandomInfoStruct
- type RandomRequest
- type RecoveryStateMsg
- type RecoveryType
- type ReelectRSPType
- type RewardRateCfg
- type RoleUpdatedMsg
- type SlashCfg
- type SortVIPConfig
- type SuperBlkCfg
- type SyncIdEvent
- type TopologyGraph
- func (self *TopologyGraph) AccountIsInGraph(account common.Address) bool
- func (self *TopologyGraph) CheckAccountRole(account common.Address, role common.RoleType) bool
- func (self *TopologyGraph) FindNextValidator(account common.Address) common.Address
- func (self *TopologyGraph) Transfer2NextGraph(number uint64, blockTopology *common.NetTopology) (*TopologyGraph, error)
- type TopologyNodeInfo
- type TxsRewardCfg
- type UserBlockProduceNum
- type UserBlockProduceSlash
- type VIPConfig
- type VrfMsg
Constants ¶
const ( MSKeyVersionInfo = "version_info" // 版本信息 MSKeyBroadcastTx = "broad_txs" // 广播交易 MSKeyTopologyGraph = "topology_graph" // 拓扑图 MSKeyElectGraph = "elect_graph" // 选举图 MSKeyElectOnlineState = "elect_state" // 选举节点在线信息 //通用 MSKeyBroadcastInterval = "broad_interval" // 广播区块周期 MSKeyElectGenTime = "elect_gen_time" // 选举生成时间 MSKeyElectMinerNum = "elect_miner_num" // 选举矿工数量 MSKeyElectConfigInfo = "elect_details_info" // 选举配置 MSKeyElectBlackList = "elect_black_list" // 选举黑名单 MSKeyElectWhiteList = "elect_white_list" // 选举白名单 MSKeyElectWhiteListSwitcher = "elect_white_list_switcher" // 选举白名单生效开关 MSKeyAccountBroadcasts = "account_broadcasts" // 广播账户 []common.Address MSKeyAccountInnerMiners = "account_inner_miners" // 基金会矿工 []common.Address MSKeyAccountFoundation = "account_foundation" // 基金会账户 common.Address MSKeyAccountVersionSupers = "account_version_supers" // 版本签名账户 []common.Address MSKeyAccountBlockSupers = "account_block_supers" // 超级区块签名账户 []common.Address MSKeyAccountMultiCoinSupers = "account_multicoin_supers" // 超级多币种签名账户 []common.Address MSKeyAccountSubChainSupers = "account_subchain_supers" // 子链签名账户 []common.Address MSKeyVIPConfig = "vip_config" // VIP配置信息 MSKeyPreBroadcastRoot = "pre_broadcast_Root" // 前广播区块root信息 MSKeyLeaderConfig = "leader_config" // leader服务配置信息 MSKeyMinHash = "pre_100_min_hash" // 最小hash MSKeySuperBlockCfg = "super_block_config" // 超级区块配置 MSKeyMinimumDifficulty = "min_difficulty" // 最小挖矿难度 //奖励配置 MSKeyBlkRewardCfg = "blk_reward" // 区块奖励配置 MSKeyTxsRewardCfg = "txs_reward" // 交易奖励配置 MSKeyInterestCfg = "interest_reward" // 利息配置 MSKeyLotteryCfg = "lottery_reward" // 彩票配置 MSKeySlashCfg = "slash_reward" // 惩罚配置 MSKeyPreMinerBlkReward = "preMiner_blkreward" // 上一矿工区块奖励金额 MSKeyPreMinerTxsReward = "preMiner_txsreward" // 上一矿工交易奖励金额 MSKeyUpTimeNum = "upTime_num" // upTime状态 MSKeyLotteryNum = "lottery_num" // 彩票状态 MSKeyLotteryAccount = "lottery_from" // 彩票候选账户 MSKeyInterestCalcNum = "interest_calc_num" // 利息计算状态 MSKeyInterestPayNum = "interest_pay_num" // 利息支付状态 MSKeySlashNum = "slash_num" // 惩罚状态 //奖励算法配置 MSKeyBlkCalc = "blk_calc" MSKeyTxsCalc = "txs_calc" MSKeyInterestCalc = "interest_calc" MSKeyLotteryCalc = "lottery_calc" MSKeySlashCalc = "slash_calc" //未出块选举惩罚配置相关 MSKeyBlockProduceStatsStatus = "block_produce_stats_status" // MSKeyBlockProduceSlashCfg = "block_produce_slash_cfg" // MSKeyBlockProduceStats = "block_produce_stats" // MSKeyBlockProduceBlackList = "block_produce_blacklist" // //交易配置 MSTxpoolGasLimitCfg = "man_TxpoolGasLimitCfg" //入池gas配置 MSCurrencyConfig = "man_CurrencyConfig" //币种配置 MSAccountBlackList = "man_AccountBlackList" //账户黑名单设置 )
const ( Heartbeat = "Heartbeat" // 心跳交易(广播区块Hash对99取余) Publickey = "SeedProof" // 公钥交易 Privatekey = "Seed" // 私钥交易 CallTheRoll = "CallTheRoll" //点名交易 (广播节点随机连接1000个点) )
by // 2018-08-18由tx_pool.go转移到此
const ReelectionTimes = uint64(3) // 选举周期的倍数(广播周期*ReelectionTimes = 选举周期)
const (
RewardFullRate = uint64(10000)
)
Variables ¶
var ( SubErrorNoThisEvent = errors.New("SubscribeEvent Failed No This Event") PostErrorNoThisEvent = errors.New("PostEvent Failed No This Event") )
Functions ¶
func PublishEvent ¶
func ReturnBroadCastType ¶
func SubscribeEvent ¶
func SubscribeEvent(aim EventCode, ch interface{}) (event.Subscription, error)
Types ¶
type Alternative ¶
type BCIntervalInfo ¶
type BCIntervalInfo struct { LastBCNumber uint64 // 最后的广播区块高度 LastReelectNumber uint64 // 最后的选举区块高度 BCInterval uint64 // 广播周期 BackupEnableNumber uint64 // 预备广播周期启用高度 BackupBCInterval uint64 // 预备广播周期 }
func (*BCIntervalInfo) GetBackupEnableNumber ¶
func (info *BCIntervalInfo) GetBackupEnableNumber() uint64
func (*BCIntervalInfo) GetBroadcastInterval ¶
func (info *BCIntervalInfo) GetBroadcastInterval() uint64
func (*BCIntervalInfo) GetLastBroadcastNumber ¶
func (info *BCIntervalInfo) GetLastBroadcastNumber() uint64
func (*BCIntervalInfo) GetLastReElectionNumber ¶
func (info *BCIntervalInfo) GetLastReElectionNumber() uint64
func (*BCIntervalInfo) GetNextBroadcastNumber ¶
func (info *BCIntervalInfo) GetNextBroadcastNumber(number uint64) uint64
func (*BCIntervalInfo) GetNextReElectionNumber ¶
func (info *BCIntervalInfo) GetNextReElectionNumber(number uint64) uint64
func (*BCIntervalInfo) GetReElectionInterval ¶
func (info *BCIntervalInfo) GetReElectionInterval() uint64
func (*BCIntervalInfo) IsBroadcastNumber ¶
func (info *BCIntervalInfo) IsBroadcastNumber(number uint64) bool
func (*BCIntervalInfo) IsReElectionNumber ¶
func (info *BCIntervalInfo) IsReElectionNumber(number uint64) bool
func (*BCIntervalInfo) SetBackupBCInterval ¶
func (info *BCIntervalInfo) SetBackupBCInterval(interval uint64, enableNumber uint64)
func (*BCIntervalInfo) SetLastBCNumber ¶
func (info *BCIntervalInfo) SetLastBCNumber(number uint64)
func (*BCIntervalInfo) SetLastReelectNumber ¶
func (info *BCIntervalInfo) SetLastReelectNumber(number uint64)
func (*BCIntervalInfo) UsingBackupInterval ¶
func (info *BCIntervalInfo) UsingBackupInterval()
type BlkRewardCfg ¶
type BlockGenor_BroadcastMiningReqMsg ¶
type BlockGenor_BroadcastMiningReqMsg struct {
BlockMainData *BlockData
}
type BlockInsertedMsg ¶
type BlockLocalVerifyOK ¶
type BlockLocalVerifyOK struct { Header *types.Header // 包含签名列表的header BlockHash common.Hash OriginalTxs []types.CoinSelfTransaction // 原始交易列表 FinalTxs []types.CoinSelfTransaction // 最终交易列表(含奖励交易) Receipts []types.CoinReceipts // 收据 State *state.StateDBManage // apply state changes here 状态数据库 }
type BlockPOSFinishedNotify ¶
type BlockPOSFinishedNotify struct { Number uint64 Header *types.Header // 包含签名列表的header ConsensusTurn ConsensusTurnInfo TxsCode []*common.RetCallTxN }
type BlockProduceSlashBlackList ¶
type BlockProduceSlashBlackList struct {
BlackList []UserBlockProduceSlash
}
type BlockProduceSlashCfg ¶
type BlockProduceSlashStatsStatus ¶
type BlockProduceSlashStatsStatus struct {
Number uint64
}
type BlockProduceStats ¶
type BlockProduceStats struct {
StatsList []UserBlockProduceNum
}
type BlockToBucket ¶
type BlockToLinker ¶
type BlockToLinker struct { Height *big.Int BroadCastInterval *BCIntervalInfo Role common.RoleType }
type ChainState ¶
type ChainState struct {
// contains filtered or unexported fields
}
func (*ChainState) Cmp ¶
func (self *ChainState) Cmp(superSeq uint64, curNumber uint64) int
/////////////////////////////////////////////////////////////////////////////////////////////////// self > param: return 1 self == param: return 0 self < param: return -1
func (*ChainState) CurNumber ¶
func (self *ChainState) CurNumber() uint64
func (*ChainState) Reset ¶
func (self *ChainState) Reset(superSeq uint64, curNumber uint64)
func (*ChainState) SuperSeq ¶
func (self *ChainState) SuperSeq() uint64
type ConsensusTurnInfo ¶
type ConsensusTurnInfo struct { PreConsensusTurn uint32 // 前一次共识轮次 UsedReelectTurn uint32 // 完成共识花费的重选轮次 }
func (*ConsensusTurnInfo) Cmp ¶
func (info *ConsensusTurnInfo) Cmp(target ConsensusTurnInfo) int64
if < target, return -1 if == target, return 0 if > target, return 1
func (*ConsensusTurnInfo) String ¶
func (info *ConsensusTurnInfo) String() string
///////////////////////////////////////////////////////////////////////////////////////////////////
func (*ConsensusTurnInfo) TotalTurns ¶
func (info *ConsensusTurnInfo) TotalTurns() uint32
type DepositDetail ¶
type DepositDetail struct { Address common.Address NodeID discover.NodeID Deposit *big.Int WithdrawH *big.Int OnlineTime *big.Int }
拓扑生成模块
type ElectConfigInfo ¶
type ElectConfigInfo_All ¶
type ElectGenTimeStruct ¶
type ElectGraph ¶
type ElectGraph struct { Number uint64 ElectList []ElectNodeInfo NextMinerElect []ElectNodeInfo NextValidatorElect []ElectNodeInfo }
func (*ElectGraph) TransferElect2CommonElect ¶
func (eg *ElectGraph) TransferElect2CommonElect() []common.Elect
///////////////////////////////////////////////////////////////////////////////////////////////////
func (*ElectGraph) TransferNextElect2CommonElect ¶
func (eg *ElectGraph) TransferNextElect2CommonElect() []common.Elect
type ElectMinerNumStruct ¶
type ElectMinerNumStruct struct {
MinerNum uint16
}
type ElectNodeInfo ¶
type ElectOnlineStatus ¶
type ElectOnlineStatus struct { Number uint64 ElectOnline []ElectNodeInfo }
func (*ElectOnlineStatus) FindNodeElectOnlineState ¶
func (eos *ElectOnlineStatus) FindNodeElectOnlineState(node common.Address) *ElectNodeInfo
type ElectWhiteListSwitcher ¶
type ElectWhiteListSwitcher struct {
Switcher bool
}
type EntrustInfo ¶
type EventCode ¶
type EventCode int
const ( NewBlockMessage EventCode = iota SendBroadCastTx HD_MiningReq HD_MiningRsp HD_BroadcastMiningReq HD_BroadcastMiningRsp //CA CA_RoleUpdated // RoleUpdatedMsg CA_ReqCurrentBlock //P2P P2P_BlkVerifyRequest // BlockVerifyReqMsg //Leader service Leader_LeaderChangeNotify // LeaderChangeNotify Leader_RecoveryState //BlockVerify service HD_BlkConsensusReq HD_BlkConsensusVote BlkVerify_VerifyConsensusOK //BlockVerifyConsensusOK BlkVerify_POSFinishedNotify //BlockPOSFinishedNotify //BlockGenor service BlockGenor_HeaderGenerateReq HD_NewBlockInsert BlockGenor_HeaderVerifyReq BlockGenor_NewBlockReady HD_FullBlockReq HD_FullBlockRsp //topnode online HD_TopNodeConsensusReq HD_TopNodeConsensusVote HD_TopNodeConsensusVoteResult //leader HD_LeaderReelectInquiryReq HD_LeaderReelectInquiryRsp HD_LeaderReelectReq HD_LeaderReelectVote HD_LeaderReelectBroadcast HD_LeaderReelectBroadcastRsp //Topology ReElec_MasterMinerReElectionReq ReElec_MasterValidatorElectionReq Topo_MasterMinerElectionRsp Topo_MasterValidatorElectionRsp //random ReElec_TopoSeedReq Random_TopoSeedRsp P2P_HDMSG BlockToBuckets BlockToLinkers SendUdpTx SendSyncRole //lb TxPoolManager //1030_scf EveryBlockSeedRsp BlockInserted //leaderV2 HD_V2_LeaderReelectInquiryReq HD_V2_LeaderReelectInquiryRsp HD_V2_LeaderReelectReq HD_V2_LeaderReelectVote HD_V2_LeaderReelectBroadcast HD_V2_LeaderReelectBroadcastRsp LastEventCode )
type EveryBlockSeedRspMsg ¶
type HD_BlkConsensusReqMsg ¶
type HD_BlkConsensusReqMsg struct { From common.Address Header *types.Header ConsensusTurn ConsensusTurnInfo TxsCode []*common.RetCallTxN OnlineConsensusResults []*HD_OnlineConsensusVoteResultMsg }
block verify server
func (*HD_BlkConsensusReqMsg) TxsCodeCount ¶
func (req *HD_BlkConsensusReqMsg) TxsCodeCount() int
///////////////////////////////////////////////////////////////////////////////////////////////////
type HD_BlockInsertNotify ¶
BolckGenor
type HD_ConsensusVote ¶
type HD_ConsensusVote struct { SignHash common.Hash Number uint64 Sign common.Signature From common.Address }
共识投票消息
type HD_FullBlockReqMsg ¶
type HD_FullBlockRspMsg ¶
type HD_MiningReqMsg ¶
Miner Module
type HD_MiningRspMsg ¶
type HD_OldBroadcastMiningRspMsg ¶
type HD_OldBroadcastMiningRspMsg struct { From common.Address BlockMainData *OldBlockData }
type HD_OldFullBlockRspMsg ¶
type HD_OnlineConsensusReqs ¶
type HD_OnlineConsensusReqs struct { From common.Address ReqList []*OnlineConsensusReq //请求结构 }
在线状态共识请求消息
type HD_OnlineConsensusVoteResultMsg ¶
type HD_OnlineConsensusVoteResultMsg struct { Req *OnlineConsensusReq //请求结构 SignList []common.Signature //签名列表 From common.Address }
共识结果
func (*HD_OnlineConsensusVoteResultMsg) IsValidity ¶
func (msg *HD_OnlineConsensusVoteResultMsg) IsValidity(curNumber uint64, validityTime uint64) bool
type HD_OnlineConsensusVotes ¶
type HD_OnlineConsensusVotes struct {
Votes []HD_ConsensusVote
}
type HD_ReelectBroadcastMsg ¶
type HD_ReelectBroadcastMsg struct { Number uint64 Type ReelectRSPType POSResult *HD_BlkConsensusReqMsg RLResult *HD_ReelectLeaderConsensus TimeStamp uint64 From common.Address }
type HD_ReelectInquiryReqMsg ¶
type HD_ReelectInquiryRspMsg ¶
type HD_ReelectInquiryRspMsg struct { Number uint64 ReqHash common.Hash Type ReelectRSPType AgreeSign common.Signature POSResult *HD_BlkConsensusReqMsg RLResult *HD_ReelectLeaderConsensus NewBlock *types.Header From common.Address }
type HD_ReelectLeaderConsensus ¶
type HD_ReelectLeaderConsensus struct { Req *HD_ReelectLeaderReqMsg Votes []common.Signature }
type HD_ReelectLeaderReqMsg ¶
type HD_ReelectLeaderReqMsg struct { InquiryReq *HD_ReelectInquiryReqMsg AgreeSigns []common.Signature TimeStamp uint64 }
type HD_V2_ConsensusVote ¶
type HD_V2_ConsensusVote struct { SignHash common.Hash Number uint64 Sign common.Signature From common.Address }
共识投票消息
type HD_V2_ReelectBroadcastMsg ¶
type HD_V2_ReelectBroadcastMsg struct { Number uint64 Type ReelectRSPType POSResult *HD_BlkConsensusReqMsg RLResult *HD_V2_ReelectLeaderConsensus TimeStamp uint64 From common.Address }
type HD_V2_ReelectInquiryRspMsg ¶
type HD_V2_ReelectInquiryRspMsg struct { Number uint64 ReqHash common.Hash Type ReelectRSPType AgreeSign common.Signature POSResult *HD_BlkConsensusReqMsg RLResult *HD_V2_ReelectLeaderConsensus NewBlock *types.Header From common.Address }
type HD_V2_ReelectLeaderConsensus ¶
type HD_V2_ReelectLeaderConsensus struct { Req *HD_V2_ReelectLeaderReqMsg Votes []common.Signature }
type HD_V2_ReelectLeaderReqMsg ¶
type HD_V2_ReelectLeaderReqMsg struct { InquiryReq *HD_V2_ReelectInquiryReqMsg AgreeSigns []common.Signature TimeStamp uint64 }
type InterestCfg ¶
type LeaderChangeNotify ¶
type LeaderConfig ¶
type LeaderStateMsg ¶
type LocalBlockVerifyConsensusReq ¶
type LocalBlockVerifyConsensusReq struct { BlkVerifyConsensusReq *HD_BlkConsensusReqMsg OriginalTxs []types.CoinSelfTransaction // 原始交易列表 FinalTxs []types.CoinSelfTransaction // 最终交易列表(含奖励交易) Receipts []types.CoinReceipts // 收据 State *state.StateDBManage // apply state changes here 状态数据库 }
type LotteryCfg ¶
type LotteryCfg struct {
LotteryInfo []LotteryInfo
}
type LotteryFrom ¶
type LotteryInfo ¶
type MasterMinerReElectionReqMsg ¶
type MasterMinerReElectionReqMsg struct { SeqNum uint64 RandSeed *big.Int MinerList []vm.DepositDetail ElectConfig ElectConfigInfo_All }
矿工主节点生成请求
type MasterMinerReElectionRsp ¶
type MasterMinerReElectionRsp struct { SeqNum uint64 MasterMiner []ElectNodeInfo }
矿工主节点生成响应
type MasterMinerReElectionRspMsg ¶
type MasterMinerReElectionRspMsg struct {
SeqNum uint64
}
Election Module
type MasterValidatorReElectionReqMsg ¶
type MasterValidatorReElectionReqMsg struct { SeqNum uint64 RandSeed *big.Int ValidatorList []vm.DepositDetail FoundationValidatorList []vm.DepositDetail ElectConfig ElectConfigInfo_All VIPList []VIPConfig BlockProduceBlackList BlockProduceSlashBlackList }
验证者主节点生成请求
type MasterValidatorReElectionRspMsg ¶
type MasterValidatorReElectionRspMsg struct {
SeqNum uint64
}
type MasterValidatorReElectionRsq ¶
type MasterValidatorReElectionRsq struct { SeqNum uint64 MasterValidator []ElectNodeInfo BackUpValidator []ElectNodeInfo CandidateValidator []ElectNodeInfo }
验证者主节点生成响应
type MinerOutReward ¶
type MultiCoinMinerOutReward ¶
type NewBlockReadyMsg ¶
type NewBlockReadyMsg struct { Header *types.Header State *state.StateDBManage }
type OlLdBlockData ¶
type OlLdBlockData struct { Header *types.OldHeader Txs []types.CoinSelfTransaction }
type OldBlockData ¶
type OldBlockData struct { Header *types.OldHeader Txs []types.CoinSelfTransaction }
type OnlineConsensusReq ¶
type OnlineConsensusReq struct { Number uint64 // 高度 LeaderTurn uint32 // leader轮次 Leader common.Address // leader地址 Node common.Address // node 地址 OnlineState OnlineState //在线状态 }
在线状态共识请求
type OnlineState ¶
type OnlineState uint8
const ( OnLine OnlineState = iota + 1 OffLine )
func (OnlineState) String ¶
func (os OnlineState) String() string
type PreBroadStateRoot ¶
type RandomInfoStruct ¶
type RandomRequest ¶
type RandomRequest struct { MinHash common.Hash PrivateMap map[common.Address][]byte PublicMap map[common.Address][]byte }
随机数生成请求
type RecoveryStateMsg ¶
type RecoveryType ¶
type RecoveryType uint8
const ( RecoveryTypePOS RecoveryType = iota RecoveryTypeFullHeader )
type ReelectRSPType ¶
type ReelectRSPType uint8
const ( ReelectRSPTypeNone ReelectRSPType = iota ReelectRSPTypePOS ReelectRSPTypeAlreadyRL ReelectRSPTypeAgree ReelectRSPTypeNewBlockReady )
type RewardRateCfg ¶
type RewardRateCfg struct { MinerOutRate uint64 //出块矿工奖励 ElectedMinerRate uint64 //当选矿工奖励 FoundationMinerRate uint64 //基金会网络奖励 LeaderRate uint64 //出块验证者(leader)奖励 ElectedValidatorsRate uint64 //当选验证者奖励 FoundationValidatorRate uint64 //基金会网络奖励 OriginElectOfflineRate uint64 //初选下线验证者奖励 BackupRewardRate uint64 //当前替补验证者奖励 }
type RoleUpdatedMsg ¶
type SortVIPConfig ¶
type SortVIPConfig []VIPConfig
func (SortVIPConfig) Len ¶
func (self SortVIPConfig) Len() int
func (SortVIPConfig) Less ¶
func (self SortVIPConfig) Less(i, j int) bool
func (SortVIPConfig) Swap ¶
func (self SortVIPConfig) Swap(i, j int)
type SuperBlkCfg ¶
type SyncIdEvent ¶
type TopologyGraph ¶
type TopologyGraph struct { NodeList []TopologyNodeInfo CurNodeNumber uint8 }
func NewGenesisTopologyGraph ¶
func NewGenesisTopologyGraph(number uint64, netTopology common.NetTopology) (*TopologyGraph, error)
func (*TopologyGraph) AccountIsInGraph ¶
func (self *TopologyGraph) AccountIsInGraph(account common.Address) bool
func (*TopologyGraph) CheckAccountRole ¶
func (*TopologyGraph) FindNextValidator ¶
func (self *TopologyGraph) FindNextValidator(account common.Address) common.Address
func (*TopologyGraph) Transfer2NextGraph ¶
func (self *TopologyGraph) Transfer2NextGraph(number uint64, blockTopology *common.NetTopology) (*TopologyGraph, error)
type TopologyNodeInfo ¶
type TxsRewardCfg ¶
type TxsRewardCfg struct { MinersRate uint64 //矿工网络奖励 ValidatorsRate uint64 //验证者网络奖励 RewardRate RewardRateCfg }