Documentation ¶
Index ¶
- Constants
- Variables
- func Create(cfg *config.Config) (modules.ConsensusModule, error)
- func CreatePacemaker(cfg *config.Config) (m *paceMaker, err error)
- func CreateProposeMessage(m *consensusModule, step typesCons.HotstuffStep, ...) (*typesCons.HotstuffMessage, error)
- func CreateVoteMessage(m *consensusModule, step typesCons.HotstuffStep, block *types.Block) (*typesCons.HotstuffMessage, error)
- type HotstuffLeaderMessageHandler
- func (handler *HotstuffLeaderMessageHandler) HandleCommitMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
- func (handler *HotstuffLeaderMessageHandler) HandleDecideMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
- func (handler *HotstuffLeaderMessageHandler) HandleNewRoundMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
- func (handler *HotstuffLeaderMessageHandler) HandlePrecommitMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
- func (handler *HotstuffLeaderMessageHandler) HandlePrepareMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
- type HotstuffMessageHandler
- type HotstuffReplicaMessageHandler
- func (handler *HotstuffReplicaMessageHandler) HandleCommitMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
- func (handler *HotstuffReplicaMessageHandler) HandleDecideMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
- func (handler *HotstuffReplicaMessageHandler) HandleNewRoundMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
- func (handler *HotstuffReplicaMessageHandler) HandlePrecommitMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
- func (handler *HotstuffReplicaMessageHandler) HandlePrepareMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
- type Pacemaker
- type PacemakerDebug
Constants ¶
View Source
const ( NewRound = typesCons.HotstuffStep_HOTSTUFF_STEP_NEWROUND Prepare = typesCons.HotstuffStep_HOTSTUFF_STEP_PREPARE PreCommit = typesCons.HotstuffStep_HOTSTUFF_STEP_PRECOMMIT Commit = typesCons.HotstuffStep_HOTSTUFF_STEP_COMMIT Decide = typesCons.HotstuffStep_HOTSTUFF_STEP_DECIDE ByzantineThreshold = float64(2) / float64(3) HotstuffMessage = "consensus.HotstuffMessage" UtilityMessage = "consensus.UtilityMessage" Propose = typesCons.HotstuffMessageType_HOTSTUFF_MESAGE_PROPOSE Vote = typesCons.HotstuffMessageType_HOTSTUFF_MESSAGE_VOTE )
View Source
const (
DefaultLogPrefix string = "NODE" // Just a default that'll be replaced during consensus operations.
)
Variables ¶
View Source
var (
HotstuffSteps = [...]typesCons.HotstuffStep{NewRound, Prepare, PreCommit, Commit, Decide}
)
Functions ¶
func CreatePacemaker ¶
func CreateProposeMessage ¶
func CreateProposeMessage( m *consensusModule, step typesCons.HotstuffStep, qc *typesCons.QuorumCertificate, ) (*typesCons.HotstuffMessage, error)
func CreateVoteMessage ¶
func CreateVoteMessage( m *consensusModule, step typesCons.HotstuffStep, block *types.Block, ) (*typesCons.HotstuffMessage, error)
Types ¶
type HotstuffLeaderMessageHandler ¶
type HotstuffLeaderMessageHandler struct{}
func (*HotstuffLeaderMessageHandler) HandleCommitMessage ¶
func (handler *HotstuffLeaderMessageHandler) HandleCommitMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
func (*HotstuffLeaderMessageHandler) HandleDecideMessage ¶
func (handler *HotstuffLeaderMessageHandler) HandleDecideMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
func (*HotstuffLeaderMessageHandler) HandleNewRoundMessage ¶
func (handler *HotstuffLeaderMessageHandler) HandleNewRoundMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
func (*HotstuffLeaderMessageHandler) HandlePrecommitMessage ¶
func (handler *HotstuffLeaderMessageHandler) HandlePrecommitMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
func (*HotstuffLeaderMessageHandler) HandlePrepareMessage ¶
func (handler *HotstuffLeaderMessageHandler) HandlePrepareMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
type HotstuffMessageHandler ¶
type HotstuffMessageHandler interface { HandleNewRoundMessage(*consensusModule, *typesCons.HotstuffMessage) HandlePrepareMessage(*consensusModule, *typesCons.HotstuffMessage) HandlePrecommitMessage(*consensusModule, *typesCons.HotstuffMessage) HandleCommitMessage(*consensusModule, *typesCons.HotstuffMessage) HandleDecideMessage(*consensusModule, *typesCons.HotstuffMessage) }
TODO(olshansky): Should we just make these singletons or embed them directly in the consensusModule?
var (
LeaderMessageHandler HotstuffMessageHandler = &HotstuffLeaderMessageHandler{}
)
var (
ReplicaMessageHandler HotstuffMessageHandler = &HotstuffReplicaMessageHandler{}
)
type HotstuffReplicaMessageHandler ¶
type HotstuffReplicaMessageHandler struct{}
func (*HotstuffReplicaMessageHandler) HandleCommitMessage ¶
func (handler *HotstuffReplicaMessageHandler) HandleCommitMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
func (*HotstuffReplicaMessageHandler) HandleDecideMessage ¶
func (handler *HotstuffReplicaMessageHandler) HandleDecideMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
func (*HotstuffReplicaMessageHandler) HandleNewRoundMessage ¶
func (handler *HotstuffReplicaMessageHandler) HandleNewRoundMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
func (*HotstuffReplicaMessageHandler) HandlePrecommitMessage ¶
func (handler *HotstuffReplicaMessageHandler) HandlePrecommitMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
func (*HotstuffReplicaMessageHandler) HandlePrepareMessage ¶
func (handler *HotstuffReplicaMessageHandler) HandlePrepareMessage(m *consensusModule, msg *typesCons.HotstuffMessage)
type Pacemaker ¶
type Pacemaker interface { modules.Module PacemakerDebug // TODO(olshansky): Rather than exposing the underlying `consensusModule` struct, // we could create a `ConsensusModuleDebug` interface that'll expose setters/getters // for the height/round/step/etc, and interface with the module that way. SetConsensusModule(module *consensusModule) ValidateMessage(message *typesCons.HotstuffMessage) error RestartTimer() NewHeight() InterruptRound() }
type PacemakerDebug ¶
This Pacemaker interface is only used for development & debugging purposes.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
vrf
NOTE: At the time of implementation, the VRF library is only used with consensus, but may be extracted into shared/crypto when/if it will be needed elsewhere.
|
NOTE: At the time of implementation, the VRF library is only used with consensus, but may be extracted into shared/crypto when/if it will be needed elsewhere. |
Click to show internal directories.
Click to hide internal directories.