types

package
v0.0.1-pre-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// INFO
	DisregardHotstuffMessage = "Discarding hotstuff message"
	NotLockedOnQC            = "node is not locked on any QC"
	ProposalBlockExtends     = "the ProposalQC block is the same as the LockedQC block"

	// WARN
	NilUtilityContextWarning     = "[WARN] Utility context not nil when preparing a new block? Releasing for now but should not happen"
	InvalidPartialSigInQCWarning = "[WARN] QC contains an invalid partial signature"

	// DEBUG
	DebugResetToGenesis  = "[DEBUG] Resetting to genesis..."
	DebugTriggerNextView = "[DEBUG] Triggering next view..."
)

Logs and warnings

Variables

View Source
var (
	ErrNilBlock                               = errors.New(nilBLockError)
	ErrNilBlockProposal                       = errors.New(nilBLockProposalError)
	ErrNilBlockVote                           = errors.New(nilBLockVoteError)
	ErrProposalNotValidInPrepare              = errors.New(proposalNotValidInPrepareError)
	ErrNilQC                                  = errors.New(nilQCError)
	ErrNilQCProposal                          = errors.New(nilQCProposalError)
	ErrNilBlockInQC                           = errors.New(nilBlockInQCError)
	ErrNilThresholdSigInQC                    = errors.New(nilThresholdSigInQCError)
	ErrNotEnoughSignatures                    = errors.New(notEnoughSignaturesError)
	ErrNodeIsLockedOnPastQC                   = errors.New(nodeIsLockedOnPastQCError)
	ErrUnhandledProposalCase                  = errors.New(unhandledProposalCaseError)
	ErrUnnecessaryPartialSigForNewRound       = errors.New(unnecessaryPartialSigForNewRoundError)
	ErrUnnecessaryPartialSigForLeaderProposal = errors.New(unnecessaryPartialSigForLeaderProposalError)
	ErrNilPartialSig                          = errors.New(nilPartialSigError)
	ErrNilPartialSigOrSourceNotSpecified      = errors.New(nilPartialSigOrSourceNotSpecifiedError)
	ErrOlderMessage                           = errors.New(olderHeightMessageError)
	ErrFutureMessage                          = errors.New(futureHeightMessageError)
	ErrSelfProposal                           = errors.New(selfProposalError)
	ErrOlderStepRound                         = errors.New(olderStepRoundError)
	ErrUnexpectedPacemakerCase                = errors.New(unexpectedPacemakerCaseError)
	ErrConsensusMempoolFull                   = errors.New(consensusMempoolFullError)
	ErrApplyBlock                             = errors.New(applyBlockError)
	ErrPrepareBlock                           = errors.New(prepareBlockError)
	ErrCommitBlock                            = errors.New(commitBlockError)
	ErrReplicaPrepareBlock                    = errors.New(replicaPrepareBlockError)
	ErrLeaderApplyBLock                       = errors.New(leaderErrApplyBlock)
	ErrSendMessage                            = errors.New(sendMessageError)
	ErrBroadcastMessage                       = errors.New(broadcastMessageError)
	ErrCreateConsensusMessage                 = errors.New(createConsensusMessageError)
	ErrHotstuffValidation                     = errors.New(anteValidationError)
	ErrNilLeaderId                            = errors.New(nilLeaderIdError)
)
View Source
var StepToString map[HotstuffStep]string

Functions

func BroadcastingMessage

func BroadcastingMessage(msg *HotstuffMessage) string

func CommittingBlock

func CommittingBlock(height uint64, numTxs int) string

func DebugHandlingHotstuffMessage

func DebugHandlingHotstuffMessage(msg *HotstuffMessage) string

func DebugNodeState

func DebugNodeState(state ConsensusNodeState) string

func DebugTogglePacemakerManualMode

func DebugTogglePacemakerManualMode(mode string) string

func ElectedNewLeader

func ElectedNewLeader(address string, nodeId NodeId) string

func ElectedSelfAsNewLeader

func ElectedSelfAsNewLeader(address string, nodeId NodeId) string

func ErrByzantineThresholdCheck

func ErrByzantineThresholdCheck(n int, threshold float64) error

func ErrCreateProposeMessage

func ErrCreateProposeMessage(step HotstuffStep) error

func ErrCreateVoteMessage

func ErrCreateVoteMessage(step HotstuffStep) error

func ErrInvalidAppHash

func ErrInvalidAppHash(blockHeaderHash, appHash string) error

func ErrInvalidBlockSize

func ErrInvalidBlockSize(blockSize, maxSize uint64) error

func ErrLeaderElection

func ErrLeaderElection(msg *HotstuffMessage) error

func ErrMissingValidator

func ErrMissingValidator(address string, nodeId NodeId) error

func ErrPacemakerUnexpectedMessageHeight

func ErrPacemakerUnexpectedMessageHeight(err error, heightCurrent, heightMessage uint64) error

func ErrPacemakerUnexpectedMessageStepRound

func ErrPacemakerUnexpectedMessageStepRound(err error, step HotstuffStep, round uint64, msg *HotstuffMessage) error

func ErrQCInvalid

func ErrQCInvalid(step HotstuffStep) error

func ErrUnknownConsensusMessageType

func ErrUnknownConsensusMessageType(msg interface{}) error

func ErrValidatingPartialSig

func ErrValidatingPartialSig(senderAddr string, senderNodeId NodeId, msg *HotstuffMessage, pubKey string) error

func GetValAddrToIdMap

func GetValAddrToIdMap(validatorMap map[string]*typesGenesis.Validator) (ValAddrToIdMap, IdToValAddrMap)

func OptimisticVoteCountPassed

func OptimisticVoteCountPassed(step HotstuffStep) string

func OptimisticVoteCountWaiting

func OptimisticVoteCountWaiting(step HotstuffStep, status string) string

func PacemakerCatchup

func PacemakerCatchup(height1, step1, round1, height2, step2, round2 uint64) string

func PacemakerInterrupt

func PacemakerInterrupt(height uint64, step HotstuffStep, round uint64) string

func PacemakerNewHeight

func PacemakerNewHeight(height uint64) string

func PacemakerTimeout

func PacemakerTimeout(height uint64, step HotstuffStep, round uint64) string

func SendingMessage

func SendingMessage(msg *HotstuffMessage, nodeId NodeId) string

func WarnDiscardHotstuffMessage

func WarnDiscardHotstuffMessage(_ *HotstuffMessage, reason string) string

func WarnIncompletePartialSig

func WarnIncompletePartialSig(ps *PartialSignature, msg *HotstuffMessage) string

func WarnInvalidPartialSigInQC

func WarnInvalidPartialSigInQC(address string, nodeId NodeId) string

func WarnMissingPartialSig

func WarnMissingPartialSig(msg *HotstuffMessage) string

func WarnUnexpectedMessageInPool

func WarnUnexpectedMessageInPool(_ *HotstuffMessage, height uint64, step HotstuffStep, round uint64) string

Types

type ConsensusNodeState

type ConsensusNodeState struct {
	NodeId NodeId
	Height uint64
	Round  uint8
	Step   uint8

	LeaderId NodeId
	IsLeader bool
}

type IdToValAddrMap

type IdToValAddrMap map[NodeId]string // Mapping from node id to a hex encoded string address.

type NodeId

type NodeId uint64

type ValAddrToIdMap

type ValAddrToIdMap map[string]NodeId // Mapping from hex encoded address to an integer node id.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL