Documentation ¶
Index ¶
- Constants
- Variables
- func VerifyBlockSignatures(chainConf protocol.ChainConf, ac protocol.AccessControlProvider, ...) error
- type ConsensusMaxBftImpl
- func (cbi *ConsensusMaxBftImpl) Broadcast(height uint64, data []byte)
- func (cbi *ConsensusMaxBftImpl) GetConsensusStateJSON() ([]byte, error)
- func (cbi *ConsensusMaxBftImpl) GetLastHeight() uint64
- func (cbi *ConsensusMaxBftImpl) GetValidators() ([]string, error)
- func (cbi *ConsensusMaxBftImpl) Module() string
- func (cbi *ConsensusMaxBftImpl) OnMessage(message *msgbus.Message)
- func (cbi *ConsensusMaxBftImpl) OnQuit()
- func (cbi *ConsensusMaxBftImpl) Start() error
- func (cbi *ConsensusMaxBftImpl) Stop() error
- func (cbi *ConsensusMaxBftImpl) Verify(consensusType consensus.ConsensusType, chainConfig *configPb.ChainConfig) error
- func (cbi *ConsensusMaxBftImpl) VerifyBlockSignatures(block *common.Block) error
- type MaxBftState
- type SecpAlgo
- type ThresholdAlgo
Constants ¶
View Source
const ( CONSENSUSCAPABILITY = 100000 INTERNALCAPABILITY = 100000 ModuleName = "maxbft" )
View Source
const (
MaxSyncBlockNum = 10
)
Variables ¶
View Source
var ( ErrInvalidPeer = errors.New("invalid peer") ErrValidateSign = errors.New("validate sign error") )
Functions ¶
func VerifyBlockSignatures ¶
func VerifyBlockSignatures(chainConf protocol.ChainConf, ac protocol.AccessControlProvider, store protocol.BlockchainStore, block *common.Block, ledger protocol.LedgerCache) error
VerifyBlockSignatures verify consensus qc at incoming block and chainconf now, implement check commit in all nodes, not in selected committee
Types ¶
type ConsensusMaxBftImpl ¶
type ConsensusMaxBftImpl struct {
// contains filtered or unexported fields
}
ConsensusMaxBftImpl implements maxbft protocol
func New ¶
func New(config *consensusUtils.ConsensusImplConfig) (*ConsensusMaxBftImpl, error)
New returns an instance of maxbft consensus
func (*ConsensusMaxBftImpl) Broadcast ¶
func (cbi *ConsensusMaxBftImpl) Broadcast(height uint64, data []byte)
Broadcast signs the consensus message and broadcasts it to consensus group
func (*ConsensusMaxBftImpl) GetConsensusStateJSON ¶
func (cbi *ConsensusMaxBftImpl) GetConsensusStateJSON() ([]byte, error)
func (*ConsensusMaxBftImpl) GetLastHeight ¶
func (cbi *ConsensusMaxBftImpl) GetLastHeight() uint64
func (*ConsensusMaxBftImpl) GetValidators ¶
func (cbi *ConsensusMaxBftImpl) GetValidators() ([]string, error)
func (*ConsensusMaxBftImpl) OnMessage ¶
func (cbi *ConsensusMaxBftImpl) OnMessage(message *msgbus.Message)
OnMessage MsgBus implement interface, receive message from MsgBus
func (*ConsensusMaxBftImpl) Start ¶
func (cbi *ConsensusMaxBftImpl) Start() error
Start start consensus
func (*ConsensusMaxBftImpl) Verify ¶
func (cbi *ConsensusMaxBftImpl) Verify(consensusType consensus.ConsensusType, chainConfig *configPb.ChainConfig) error
Verify use by chainConf, check chain config before chain_config_contract run
func (*ConsensusMaxBftImpl) VerifyBlockSignatures ¶
func (cbi *ConsensusMaxBftImpl) VerifyBlockSignatures(block *common.Block) error
VerifyBlockSignatures verify consensus qc at incoming block
type MaxBftState ¶
type MaxBftState struct { Id string // The identity of the local node ChainId string // chain ID SelfIndexInEpoch uint64 // Index of the local node in the validator collection of the // current epoch EpochId uint64 // The epochID in now CurrentLevel uint64 // The current level of the local node LockedLevel uint64 // the latest locked level in local node HighestTCLevel uint64 // The tc level in incoming msg(proposal or vote) LastCommittedLevel uint64 // the latest committed level in local node LastReceivedQcHeight uint64 // The height of the latest received QC LastVoteLevel uint64 LastCommitWalIndex uint64 State maxbftpb.ConsStateType // The current consensus state of the local node LockedBlock *common.Block // the latest locked block in local node HighestCertifiedBlock *common.Block // highest block with qc in local node HighestQC *maxbftpb.QuorumCert // highest qc in local node CommitQuorumCert *maxbftpb.QuorumCert // The latest committed QC on the chain TimeoutCertificate *maxbftpb.QuorumCert // The latest timeout QC info LastVoteMsg *maxbftpb.ConsensusPayload Validators []*peer // The collection of validators for the current epoch LastValidators []*peer // The collection of validators for the prev epoch }
type SecpAlgo ¶
type SecpAlgo struct {
// contains filtered or unexported fields
}
func NewSecpAlgo ¶
func NewSecpAlgo(cbi *ConsensusMaxBftImpl) *SecpAlgo
type ThresholdAlgo ¶
type ThresholdAlgo struct { }
func NewThresholdAlgo ¶
func NewThresholdAlgo() *ThresholdAlgo
Source Files ¶
Click to show internal directories.
Click to hide internal directories.