Versions in this module Expand all Collapse all v0 v0.7.2 Apr 16, 2020 v0.7.1 Apr 9, 2020 Changes in this version + const CAP_ACTION_CHANNEL + const CAP_MESSAGE_CHANNEL + const CAP_MSG_SEND_CHANNEL + const MAX_PEER_CONNECTIONS + const MAX_SYNCING_CHECK_BLK_NUM + func GetGovernanceView(memdb *overlaydb.MemDB) (*gov.GovernanceView, error) + func GetPeersConfig(memdb *overlaydb.MemDB) ([]*config.VBFTPeerStakeInfo, error) + func GetStorageValue(memdb *overlaydb.MemDB, backend *ledger.Ledger, addr common.Address, ...) (value []byte, err error) + func GetVbftConfigInfo(memdb *overlaydb.MemDB) (*config.VBFTConfig, error) + func HashMsg(msg ConsensusMsg) (common.Uint256, error) + func SerializeVbftMsg(msg ConsensusMsg) ([]byte, error) + func SignMsg(account *account.Account, msg ConsensusMsg) ([]byte, error) + type BftAction struct + BlockNum uint32 + Proposal *blockProposalMsg + Type BftActionType + type BftActionType uint8 + const CommitBlock + const EndorseBlock + const FastForward + const MakeProposal + const ReBroadcast + const SealBlock + const SubmitBlock + type Block struct + Block *types.Block + EmptyBlock *types.Block + Info *vconfig.VbftBlockInfo + PrevBlockMerkleRoot common.Uint256 + func (blk *Block) Deserialize(data []byte) error + func (blk *Block) Serialize() []byte + type BlockFetchRespMsg struct + BlockData *Block + BlockHash common.Uint256 + BlockNumber uint32 + func (msg *BlockFetchRespMsg) Deserialize(data []byte) error + func (msg *BlockFetchRespMsg) GetBlockNum() uint32 + func (msg *BlockFetchRespMsg) Serialize() ([]byte, error) + func (msg *BlockFetchRespMsg) Type() MsgType + func (msg *BlockFetchRespMsg) Verify(pub keypair.PublicKey) error + type BlockFromPeers map[uint32]*Block + type BlockInfoFetchMsg struct + StartBlockNum uint32 + func (msg *BlockInfoFetchMsg) GetBlockNum() uint32 + func (msg *BlockInfoFetchMsg) Serialize() ([]byte, error) + func (msg *BlockInfoFetchMsg) Type() MsgType + func (msg *BlockInfoFetchMsg) Verify(pub keypair.PublicKey) error + type BlockInfoFetchRespMsg struct + Blocks []*BlockInfo_ + func (msg *BlockInfoFetchRespMsg) GetBlockNum() uint32 + func (msg *BlockInfoFetchRespMsg) Serialize() ([]byte, error) + func (msg *BlockInfoFetchRespMsg) Type() MsgType + func (msg *BlockInfoFetchRespMsg) Verify(pub keypair.PublicKey) error + type BlockInfo_ struct + BlockNum uint32 + Proposer uint32 + Signatures map[uint32][]byte + type BlockList []*Block + type BlockMsgFromPeer struct + type BlockParticipantConfig struct + BlockNum uint32 + ChainConfig *vconfig.ChainConfig + Committers []uint32 + Endorsers []uint32 + Proposers []uint32 + Vrf vconfig.VRFValue + type BlockPool struct + HistoryLen uint32 + type BlockSyncReq struct + type CandidateEndorseSigInfo struct + EndorsedProposer uint32 + ForEmpty bool + Signature []byte + type CandidateInfo struct + CommitMsgs []*blockCommitMsg + CommittedEmptyProposal *blockProposalMsg + CommittedProposal *blockProposalMsg + EndorseSigs map[uint32][]*CandidateEndorseSigInfo + EndorsedEmptyProposal *blockProposalMsg + EndorsedProposal *blockProposalMsg + Proposals []*blockProposalMsg + SealedBlock *Block + type ChainStore struct + func OpenBlockStore(db *ledger.Ledger, serverPid *actor.PID) (*ChainStore, error) + func (self *ChainStore) AddBlock(block *Block) error + func (self *ChainStore) GetChainedBlockNum() uint32 + func (self *ChainStore) ReloadFromLedger() + type ConsensusMsg interface + GetBlockNum func() uint32 + Serialize func() ([]byte, error) + Type func() MsgType + Verify func(pub keypair.PublicKey) error + func DeserializeVbftMsg(msgPayload []byte) (ConsensusMsg, error) + type ConsensusMsgPayload struct + Len uint32 + Payload []byte + Type MsgType + type ConsensusRound struct + type ConsensusRoundMsgs map[MsgType][]ConsensusMsg + type EventTimer struct + C chan *TimerEvent + func NewEventTimer(server *Server) *EventTimer + func (self *EventTimer) Cancel2ndProposalTimer(blockNum uint32) + func (self *EventTimer) CancelBackoffTimer(blockNum uint32) + func (self *EventTimer) CancelCommitMsgTimer(blockNum uint32) + func (self *EventTimer) CancelEndorseEmptyBlockTimer(blockNum uint32) + func (self *EventTimer) CancelEndorseMsgTimer(blockNum uint32) + func (self *EventTimer) CancelProposalBackoffTimer(blockNum uint32) + func (self *EventTimer) CancelProposalTimer(blockNum uint32) + func (self *EventTimer) CancelTimer(idx uint32) + func (self *EventTimer) CancelTxBlockTimeout(blockNum uint32) + func (self *EventTimer) Start2ndProposalTimer(blockNum uint32) error + func (self *EventTimer) StartBackoffTimer(blockNum uint32) error + func (self *EventTimer) StartCommitTimer(blockNum uint32) error + func (self *EventTimer) StartEndorseEmptyBlockTimer(blockNum uint32) error + func (self *EventTimer) StartEndorsingTimer(blockNum uint32) error + func (self *EventTimer) StartProposalBackoffTimer(blockNum uint32) error + func (self *EventTimer) StartProposalTimer(blockNum uint32) error + func (self *EventTimer) StartTimer(Idx uint32, timeout time.Duration) + func (self *EventTimer) StartTxBlockTimeout(blockNum uint32) error + type FaultyReport struct + FaultyID uint32 + FaultyMsgHash common.Uint256 + type MsgPool struct + func (pool *MsgPool) AddMsg(msg ConsensusMsg, msgHash common.Uint256) error + func (pool *MsgPool) DropMsg(msg ConsensusMsg) + func (pool *MsgPool) GetBlockSubmitMsgNums(blocknum uint32) []ConsensusMsg + func (pool *MsgPool) GetCommitMsgs(blocknum uint32) []ConsensusMsg + func (pool *MsgPool) GetEndorsementsMsgs(blocknum uint32) []ConsensusMsg + func (pool *MsgPool) GetProposalMsgs(blocknum uint32) []ConsensusMsg + func (pool *MsgPool) HasMsg(msg ConsensusMsg, msgHash common.Uint256) bool + type MsgType uint8 + const BlockCommitMessage + const BlockEndorseMessage + const BlockFetchMessage + const BlockFetchRespMessage + const BlockInfoFetchMessage + const BlockInfoFetchRespMessage + const BlockProposalMessage + const BlockSubmitMessage + const PeerHandshakeMessage + const PeerHeartbeatMessage + const ProposalFetchMessage + type Peer struct + Index uint32 + LastUpdateTime time.Time + LatestInfo *peerHeartbeatMsg + PubKey keypair.PublicKey + type PeerPool struct + IDMap map[string]uint32 + P2pMap map[uint32]uint64 + func NewPeerPool(maxSize int, server *Server) *PeerPool + func (pool *PeerPool) GetAllPubKeys() map[uint32]keypair.PublicKey + func (pool *PeerPool) GetPeerIndex(nodeId string) (uint32, bool) + func (pool *PeerPool) GetPeerPubKey(peerIdx uint32) keypair.PublicKey + func (pool *PeerPool) RemovePeerIndex(nodeId string) + type PeerState struct + type PeerSyncer struct + type PendingBlock struct + type SendMsgEvent struct + Msg ConsensusMsg + ToPeer uint32 + type Server struct + Index uint32 + LastConfigBlockNum uint32 + func NewVbftServer(account *account.Account, txpool, p2p *actor.PID) (*Server, error) + func (self *Server) CheckSubmitBlock(blkNum uint32, stateRoot common.Uint256) bool + func (self *Server) GetCommittedBlockNo() uint32 + func (self *Server) GetCurrentBlockNo() uint32 + func (self *Server) GetPID() *actor.PID + func (self *Server) Halt() error + func (self *Server) LoadChainConfig(blkNum uint32) error + func (self *Server) NewConsensusPayload(payload *p2pmsg.ConsensusPayload) + func (self *Server) Receive(context actor.Context) + func (self *Server) Start() error + type ServerState int + const Configured + const Init + const LocalConfigured + const SyncReady + const Synced + const Syncing + const SyncingCheck + const WaitNetworkReady + type StateEvent struct + Type StateEventType + type StateEventType int + const ConfigLoaded + const ForceCheckSync + const LiveTick + const SyncDone + const SyncReadyTimeout + const UpdatePeerConfig + const UpdatePeerState + type StateMgr struct + StateEventC chan *StateEvent + type SyncCheckReq struct + type SyncMsg struct + type Syncer struct + type TimerEvent struct + type TimerEventType int + const EventCommitBlockTimeout + const EventEndorseBlockTimeout + const EventEndorseEmptyBlockTimeout + const EventMax + const EventPeerHeartbeat + const EventProposalBackoff + const EventPropose2ndBlockTimeout + const EventProposeBlockTimeout + const EventRandomBackoff + const EventTxBlockTimeout + const EventTxPool + type TimerItem struct + type TimerQueue []*TimerItem + func (tq *TimerQueue) Pop() interface{} + func (tq *TimerQueue) Push(x interface{}) + func (tq TimerQueue) Len() int + func (tq TimerQueue) Less(i, j int) bool + func (tq TimerQueue) Swap(i, j int)