Documentation ¶
Index ¶
Constants ¶
View Source
const ( StateStatusUnknown = iota StateStatusPrePrepared StateStatusPrepared StateStatusCommited )
Variables ¶
View Source
var (
ErrNoAcceptedBlocks = errors.New("there is no accepted blocks")
)
View Source
var Module = fx.Options( fx.Provide( NewConsensusManager, NewConsensusHandler, NewDisputeManager, ), )
Functions ¶
func NewMessage ¶
func NewMessage(cmsg *types2.ConsensusMessage, privKey crypto.PrivKey) (*pubsub.PubSubMessage, error)
Types ¶
type ConsensusHandler ¶
type ConsensusHandler struct {
// contains filtered or unexported fields
}
func NewConsensusHandler ¶
func NewConsensusHandler( bus EventBus.Bus, psb *pubsub.PubSubRouter, privKey crypto.PrivKey, ethereumClient ethclient.EthereumSideAPI, miner *blockchain.Miner, bc *blockchain.BlockChain, bp *ConsensusManager, db *drand2.DrandBeacon, mempool *pool.Mempool, h host.Host, ) *ConsensusHandler
type ConsensusInfo ¶
type ConsensusInfo struct { Blockhash []byte Block *types.Block State State MessageLog *ConsensusMessageLog }
type ConsensusManager ¶
type ConsensusManager struct {
// contains filtered or unexported fields
}
func NewConsensusManager ¶
func (*ConsensusManager) GetAllBlocksWithCommit ¶
func (crp *ConsensusManager) GetAllBlocksWithCommit() []*ConsensusInfo
func (*ConsensusManager) InsertMessageIntoLog ¶
func (crp *ConsensusManager) InsertMessageIntoLog(cmsg *types2.ConsensusMessage) error
func (*ConsensusManager) Prune ¶
func (crp *ConsensusManager) Prune()
Prune cleans known blocks list. It is called when new consensus round starts.
type ConsensusMessageLog ¶
type ConsensusMessageLog struct {
// contains filtered or unexported fields
}
func NewConsensusMessageLog ¶
func NewConsensusMessageLog() *ConsensusMessageLog
func (*ConsensusMessageLog) AddMessage ¶
func (ml *ConsensusMessageLog) AddMessage(msg *types2.ConsensusMessage) bool
func (*ConsensusMessageLog) Exists ¶
func (ml *ConsensusMessageLog) Exists(msg *types2.ConsensusMessage) bool
func (*ConsensusMessageLog) Get ¶
func (ml *ConsensusMessageLog) Get(typ types2.ConsensusMessageType, blockhash []byte) []*types2.ConsensusMessage
type ConsensusValidator ¶
type ConsensusValidator struct {
// contains filtered or unexported fields
}
func NewConsensusValidator ¶
func NewConsensusValidator(miner *blockchain.Miner, bc *blockchain.BlockChain, db *drand2.DrandBeacon) *ConsensusValidator
func (*ConsensusValidator) Valid ¶
func (cv *ConsensusValidator) Valid(msg *types2.ConsensusMessage) bool
type DisputeManager ¶
type DisputeManager struct {
// contains filtered or unexported fields
}
func NewDisputeManager ¶
func NewDisputeManager(bus EventBus.Bus, ethClient ethclient.EthereumSideAPI, bc *blockchain.BlockChain, cfg *config.Config, cm cache.CacheManager) (*DisputeManager, error)
func (*DisputeManager) Run ¶
func (dm *DisputeManager) Run(ctx context.Context)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.