Documentation ¶
Overview ¶
This package contains the code for the messages that will be used during consensus. Each message implements messages.MsgHeader.
Messages that implement sig.MultiSigMsgHeader are considered to be signed messages. Messages of this type will be tracked by the consensusinterface objects.
Index ¶
- Variables
- func CreateBVMessage(binVal types.BinVal, round types.ConsensusRound) messages.InternalSignedMsgHeader
- func CreateBVMessageStage(binVal types.BinVal, round types.ConsensusRound, stage byte) messages.InternalSignedMsgHeader
- func GenerateCombinedMessageBytes(pms []*PartialMessage) (*messages.Message, error)
- func GeneratePartialMessageDirect(hdr messages.InternalSignedMsgHeader, round types.ConsensusRound, pieces int) ([]messages.InternalSignedMsgHeader, error)
- func GeneratePartialMessages(fullMsg []byte, round types.ConsensusRound, partialMessages [][]byte) []messages.InternalSignedMsgHeader
- func GetBVMessageInfo(header messages.InternalSignedMsgHeader) (binVal types.BinVal, round types.ConsensusRound, stage byte)
- type AuxBothMessage
- func (apm *AuxBothMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (apm *AuxBothMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (apm *AuxBothMessage) GetID() messages.HeaderID
- func (apm *AuxBothMessage) GetMsgID() messages.MsgID
- func (*AuxBothMessage) GetSignType() types.SignType
- func (apm *AuxBothMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (apm *AuxBothMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (apm *AuxBothMessage) ShallowCopy() messages.InternalSignedMsgHeader
- type AuxProofMessage
- func (apm *AuxProofMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (apm *AuxProofMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (apm *AuxProofMessage) GetID() messages.HeaderID
- func (apm *AuxProofMessage) GetMsgID() messages.MsgID
- func (apm *AuxProofMessage) GetSignType() types.SignType
- func (apm *AuxProofMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (apm *AuxProofMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (apm *AuxProofMessage) ShallowCopy() messages.InternalSignedMsgHeader
- type AuxProofMessageTimeout
- func (tm AuxProofMessageTimeout) Deserialize(*messages.Message, types.ConsensusIndexFuncs) (int, error)
- func (tm AuxProofMessageTimeout) GetBytes(*messages.Message) ([]byte, error)
- func (tm AuxProofMessageTimeout) GetID() messages.HeaderID
- func (tm AuxProofMessageTimeout) GetMsgID() messages.MsgID
- func (AuxProofMessageTimeout) PeekHeaders(*messages.Message, types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
- func (tm AuxProofMessageTimeout) Serialize(*messages.Message) (int, error)
- type AuxStage0Message
- func (apm *AuxStage0Message) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (apm *AuxStage0Message) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (apm *AuxStage0Message) GetID() messages.HeaderID
- func (apm *AuxStage0Message) GetMsgID() messages.MsgID
- func (*AuxStage0Message) GetSignType() types.SignType
- func (apm *AuxStage0Message) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (apm *AuxStage0Message) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (apm *AuxStage0Message) ShallowCopy() messages.InternalSignedMsgHeader
- type AuxStage1Message
- func (apm *AuxStage1Message) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (apm *AuxStage1Message) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (apm *AuxStage1Message) GetID() messages.HeaderID
- func (apm *AuxStage1Message) GetMsgID() messages.MsgID
- func (*AuxStage1Message) GetSignType() types.SignType
- func (apm *AuxStage1Message) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (apm *AuxStage1Message) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (apm *AuxStage1Message) ShallowCopy() messages.InternalSignedMsgHeader
- type BVMessage0
- func (bvm *BVMessage0) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (bvm *BVMessage0) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (bvm *BVMessage0) GetID() messages.HeaderID
- func (bvm *BVMessage0) GetMsgID() messages.MsgID
- func (*BVMessage0) GetSignType() types.SignType
- func (bvm *BVMessage0) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (bvm *BVMessage0) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (bvm *BVMessage0) ShallowCopy() messages.InternalSignedMsgHeader
- type BVMessage1
- func (bvm *BVMessage1) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (bvm *BVMessage1) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (bvm *BVMessage1) GetID() messages.HeaderID
- func (bvm *BVMessage1) GetMsgID() messages.MsgID
- func (*BVMessage1) GetSignType() types.SignType
- func (bvm *BVMessage1) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (bvm *BVMessage1) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (bvm *BVMessage1) ShallowCopy() messages.InternalSignedMsgHeader
- type BinMsgID
- type BinProposeMessage
- func (BinProposeMessage) Deserialize(*messages.Message, types.ConsensusIndexFuncs) (int, error)
- func (BinProposeMessage) GetBytes(*messages.Message) ([]byte, error)
- func (pm *BinProposeMessage) GetID() messages.HeaderID
- func (pm *BinProposeMessage) GetIndex() types.ConsensusIndex
- func (pm *BinProposeMessage) GetMsgID() messages.MsgID
- func (BinProposeMessage) PeekHeaders(*messages.Message, types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
- func (BinProposeMessage) Serialize(*messages.Message) (int, error)
- type CoinMessage
- func (cm *CoinMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (cm *CoinMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (cm *CoinMessage) GetID() messages.HeaderID
- func (cm *CoinMessage) GetMsgID() messages.MsgID
- func (cm *CoinMessage) GetSignType() types.SignType
- func (cm *CoinMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (cm *CoinMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (cm *CoinMessage) ShallowCopy() messages.InternalSignedMsgHeader
- type CoinMsgID
- type CoinPreMessage
- func (cm *CoinPreMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (cm *CoinPreMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (cm *CoinPreMessage) GetID() messages.HeaderID
- func (cm *CoinPreMessage) GetMsgID() messages.MsgID
- func (cm *CoinPreMessage) GetSignType() types.SignType
- func (cm *CoinPreMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (cm *CoinPreMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (cm *CoinPreMessage) ShallowCopy() messages.InternalSignedMsgHeader
- type CombinedMessage
- func CreatePartial(hdr messages.InternalSignedMsgHeader, round types.ConsensusRound, pieces int, ...) (combined *CombinedMessage, partials []messages.InternalSignedMsgHeader, ...)
- func GenerateCombinedMessage(pm *PartialMessage, fullMsg *messages.Message, ...) (*CombinedMessage, error)
- func NewCombinedMessage(fullMsg messages.InternalSignedMsgHeader) *CombinedMessage
- func NewCombinedMessageFromPartial(partial *PartialMessage, fullMsg messages.InternalSignedMsgHeader) *CombinedMessage
- func (mvi *CombinedMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (mvi *CombinedMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (mvi *CombinedMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (mvi *CombinedMessage) ShallowCopy() messages.InternalSignedMsgHeader
- type ConsBinStateMessage
- func (cm ConsBinStateMessage) Deserialize(m *messages.Message, _ types.ConsensusIndexFuncs) (int, error)
- func (cm ConsBinStateMessage) GetBytes(m *messages.Message) ([]byte, error)
- func (cm ConsBinStateMessage) GetID() messages.HeaderID
- func (cm ConsBinStateMessage) GetIndex() types.ConsensusInt
- func (cm ConsBinStateMessage) GetMsgID() messages.MsgID
- func (ConsBinStateMessage) PeekHeaders(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
- func (cm ConsBinStateMessage) Serialize(m *messages.Message) (int, error)
- type ConsMessage
- func (cm *ConsMessage) Deserialize(m *messages.Message, _ types.ConsensusIndexFuncs) (int, error)
- func (npm *ConsMessage) GetBytes(m *messages.Message) ([]byte, error)
- func (cm *ConsMessage) GetID() messages.HeaderID
- func (npm *ConsMessage) GetIndex() types.ConsensusIndex
- func (cm *ConsMessage) GetMsgID() messages.MsgID
- func (ConsMessage) PeekHeaders(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
- func (cm *ConsMessage) Serialize(m *messages.Message) (int, error)
- type EventMessage
- func (hm *EventMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (hm *EventMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (hm *EventMessage) GetEventInfoHash() types.HashBytes
- func (hm *EventMessage) GetID() messages.HeaderID
- func (hm *EventMessage) GetMsgID() messages.MsgID
- func (*EventMessage) GetSignType() types.SignType
- func (hm *EventMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (hm *EventMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (hm *EventMessage) ShallowCopy() messages.InternalSignedMsgHeader
- type HashMessage
- func (hm *HashMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (hm *HashMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (hm *HashMessage) GetID() messages.HeaderID
- func (hm *HashMessage) GetMsgID() messages.MsgID
- func (*HashMessage) GetSignType() types.SignType
- func (hm *HashMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (hm *HashMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (hm *HashMessage) ShallowCopy() messages.InternalSignedMsgHeader
- type IndexMessage
- func (hm *IndexMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (hm *IndexMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (hm *IndexMessage) GetID() messages.HeaderID
- func (hm *IndexMessage) GetMsgID() messages.MsgID
- func (*IndexMessage) GetSignType() types.SignType
- func (hm *IndexMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (hm *IndexMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (hm *IndexMessage) ShallowCopy() messages.InternalSignedMsgHeader
- type IndexRecoverMsg
- func (npm *IndexRecoverMsg) Deserialize(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (n int, err error)
- func (npm *IndexRecoverMsg) GetBytes(m *messages.Message) ([]byte, error)
- func (npm *IndexRecoverMsg) GetID() messages.HeaderID
- func (npm *IndexRecoverMsg) GetIndex() types.ConsensusIndex
- func (IndexRecoverMsg) PeekHeaders(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
- func (npm *IndexRecoverMsg) Serialize(m *messages.Message) (n int, err error)
- type MvCommitMessage
- func (mvc *MvCommitMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (mvc *MvCommitMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (mvc *MvCommitMessage) GetID() messages.HeaderID
- func (mvc *MvCommitMessage) GetMsgID() messages.MsgID
- func (mvc *MvCommitMessage) GetSignType() types.SignType
- func (mvc *MvCommitMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (mvc *MvCommitMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (mvc *MvCommitMessage) ShallowCopy() messages.InternalSignedMsgHeader
- type MvCommitMessageTimeout
- func (tm MvCommitMessageTimeout) Deserialize(*messages.Message, types.ConsensusIndexFuncs) (int, error)
- func (tm MvCommitMessageTimeout) GetBytes(*messages.Message) ([]byte, error)
- func (tm MvCommitMessageTimeout) GetID() messages.HeaderID
- func (tm MvCommitMessageTimeout) GetMsgID() messages.MsgID
- func (MvCommitMessageTimeout) PeekHeaders(*messages.Message, types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
- func (tm MvCommitMessageTimeout) Serialize(*messages.Message) (int, error)
- type MvEchoHashMessage
- func (mve *MvEchoHashMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (mve *MvEchoHashMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (mve *MvEchoHashMessage) GetID() messages.HeaderID
- func (mve *MvEchoHashMessage) GetMsgID() messages.MsgID
- func (*MvEchoHashMessage) GetSignType() types.SignType
- func (mve *MvEchoHashMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (mve *MvEchoHashMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (mve *MvEchoHashMessage) ShallowCopy() messages.InternalSignedMsgHeader
- type MvEchoMessage
- func (mve *MvEchoMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (mve *MvEchoMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (mve *MvEchoMessage) GetID() messages.HeaderID
- func (mve *MvEchoMessage) GetMsgID() messages.MsgID
- func (*MvEchoMessage) GetSignType() types.SignType
- func (mve *MvEchoMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (mve *MvEchoMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (mve *MvEchoMessage) ShallowCopy() messages.InternalSignedMsgHeader
- type MvEchoMessageTimeout
- func (tm MvEchoMessageTimeout) Deserialize(*messages.Message, types.ConsensusIndexFuncs) (int, error)
- func (tm MvEchoMessageTimeout) GetBytes(*messages.Message) ([]byte, error)
- func (tm MvEchoMessageTimeout) GetID() messages.HeaderID
- func (tm MvEchoMessageTimeout) GetMsgID() messages.MsgID
- func (MvEchoMessageTimeout) PeekHeaders(*messages.Message, types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
- func (tm MvEchoMessageTimeout) Serialize(*messages.Message) (int, error)
- type MvInitMessage
- func (mvi *MvInitMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (mvi *MvInitMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (mvi *MvInitMessage) GetID() messages.HeaderID
- func (mvi *MvInitMessage) GetMsgID() messages.MsgID
- func (*MvInitMessage) GetSignType() types.SignType
- func (mvi *MvInitMessage) NeedsSMValidation(msgIndex types.ConsensusIndex, proposalIdx int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (mvi *MvInitMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (mvi *MvInitMessage) ShallowCopy() messages.InternalSignedMsgHeader
- type MvInitMessageTimeout
- func (tm MvInitMessageTimeout) Deserialize(*messages.Message, types.ConsensusIndexFuncs) (int, error)
- func (tm MvInitMessageTimeout) GetBytes(*messages.Message) ([]byte, error)
- func (tm MvInitMessageTimeout) GetID() messages.HeaderID
- func (tm MvInitMessageTimeout) GetMsgID() messages.MsgID
- func (MvInitMessageTimeout) PeekHeaders(*messages.Message, types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
- func (tm MvInitMessageTimeout) Serialize(*messages.Message) (int, error)
- type MvInitSupportMessage
- func (mvi *MvInitSupportMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (mvi *MvInitSupportMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (mvi *MvInitSupportMessage) GetID() messages.HeaderID
- func (mvi *MvInitSupportMessage) GetMsgID() messages.MsgID
- func (*MvInitSupportMessage) GetSignType() types.SignType
- func (mvi *MvInitSupportMessage) NeedsSMValidation(msgIndex types.ConsensusIndex, proposalIdx int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (mvi *MvInitSupportMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (mvi *MvInitSupportMessage) ShallowCopy() messages.InternalSignedMsgHeader
- type MvMsgID
- type MvMultiInitMessage
- func (mvi *MvMultiInitMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (mvi *MvMultiInitMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (mvi *MvMultiInitMessage) GetID() messages.HeaderID
- func (mvi *MvMultiInitMessage) GetMsgID() messages.MsgID
- func (*MvMultiInitMessage) GetSignType() types.SignType
- func (mvi *MvMultiInitMessage) NeedsSMValidation(msgIndex types.ConsensusIndex, proposalIdx int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (mvi *MvMultiInitMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (mvi *MvMultiInitMessage) ShallowCopy() messages.InternalSignedMsgHeader
- type MvProposeMessage
- func (MvProposeMessage) Deserialize(*messages.Message, types.ConsensusIndexFuncs) (int, error)
- func (MvProposeMessage) GetBytes(*messages.Message) ([]byte, error)
- func (pm *MvProposeMessage) GetID() messages.HeaderID
- func (pm *MvProposeMessage) GetIndex() types.ConsensusIndex
- func (pm *MvProposeMessage) GetMsgID() messages.MsgID
- func (MvProposeMessage) PeekHeaders(*messages.Message, types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
- func (MvProposeMessage) Serialize(*messages.Message) (int, error)
- type MvRequestRecoverMessage
- func (mrm *MvRequestRecoverMessage) Deserialize(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (int, error)
- func (mrm *MvRequestRecoverMessage) GetBytes(m *messages.Message) ([]byte, error)
- func (mrm *MvRequestRecoverMessage) GetID() messages.HeaderID
- func (mrm *MvRequestRecoverMessage) GetIndex() types.ConsensusIndex
- func (mrm *MvRequestRecoverMessage) GetMsgID() messages.MsgID
- func (*MvRequestRecoverMessage) PeekHeaders(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
- func (mrm *MvRequestRecoverMessage) Serialize(m *messages.Message) (int, error)
- type NetworkTestMessage
- func (tm *NetworkTestMessage) Deserialize(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (int, error)
- func (tm *NetworkTestMessage) GetBytes(m *messages.Message) ([]byte, error)
- func (tm NetworkTestMessage) GetID() messages.HeaderID
- func (tm *NetworkTestMessage) GetIndex() types.ConsensusID
- func (tm *NetworkTestMessage) GetMsgID() messages.MsgID
- func (NetworkTestMessage) PeekHeaders(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
- func (tm *NetworkTestMessage) Serialize(m *messages.Message) (int, error)
- type NoProgressMessage
- func (npm *NoProgressMessage) Deserialize(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (int, error)
- func (npm *NoProgressMessage) GetBytes(m *messages.Message) ([]byte, error)
- func (npm *NoProgressMessage) GetID() messages.HeaderID
- func (npm *NoProgressMessage) GetIndex() types.ConsensusIndex
- func (npm *NoProgressMessage) GetMsgID() messages.MsgID
- func (NoProgressMessage) PeekHeaders(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
- func (npm *NoProgressMessage) Serialize(m *messages.Message) (int, error)
- type PartialMessage
- func (pm *PartialMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (pm *PartialMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (pm *PartialMessage) GetID() messages.HeaderID
- func (pm *PartialMessage) GetMsgID() messages.MsgID
- func (pm *PartialMessage) GetSignType() types.SignType
- func (pm *PartialMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (pm *PartialMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (pm *PartialMessage) ShallowCopy() messages.InternalSignedMsgHeader
- type ScMsgID
- type SimpleConsMessage
- func (scm *SimpleConsMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
- func (scm *SimpleConsMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
- func (scm *SimpleConsMessage) GetID() messages.HeaderID
- func (scm *SimpleConsMessage) GetMsgID() messages.MsgID
- func (*SimpleConsMessage) GetSignType() types.SignType
- func (scm *SimpleConsMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
- func (scm *SimpleConsMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
- func (scm *SimpleConsMessage) ShallowCopy() messages.InternalSignedMsgHeader
- type SimpleConsProposeMessage
- func (SimpleConsProposeMessage) Deserialize(*messages.Message, types.ConsensusIndexFuncs) (int, error)
- func (SimpleConsProposeMessage) GetBytes(*messages.Message) ([]byte, error)
- func (cm *SimpleConsProposeMessage) GetID() messages.HeaderID
- func (cm *SimpleConsProposeMessage) GetMsgID() messages.MsgID
- func (SimpleConsProposeMessage) PeekHeaders(*messages.Message, types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
- func (SimpleConsProposeMessage) Serialize(*messages.Message) (int, error)
- type TestMessageTimeout
- func (tm TestMessageTimeout) CreateCopy() messages.MsgHeader
- func (tm TestMessageTimeout) Deserialize(m *messages.Message, _ types.ConsensusIndexFuncs) (int, error)
- func (tm TestMessageTimeout) GetBytes(m *messages.Message) ([]byte, error)
- func (tm TestMessageTimeout) GetID() messages.HeaderID
- func (tm TestMessageTimeout) GetMsgID() messages.MsgID
- func (TestMessageTimeout) PeekHeaders(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
- func (tm TestMessageTimeout) Serialize(m *messages.Message) (int, error)
- type VRFProofMessage
- func (vrm *VRFProofMessage) Deserialize(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (bytesRead int, err error)
- func (vrm *VRFProofMessage) GetBytes(m *messages.Message) ([]byte, error)
- func (vrm *VRFProofMessage) GetID() messages.HeaderID
- func (vrm *VRFProofMessage) GetIndex() types.ConsensusIndex
- func (vrm *VRFProofMessage) GetMsgID() messages.MsgID
- func (*VRFProofMessage) PeekHeaders(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
- func (vrm *VRFProofMessage) Serialize(m *messages.Message) (bytesWritten int, err error)
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidStringMsg = fmt.Errorf("not equal string")
Functions ¶
func CreateBVMessage ¶
func CreateBVMessage(binVal types.BinVal, round types.ConsensusRound) messages.InternalSignedMsgHeader
func CreateBVMessageStage ¶
func CreateBVMessageStage(binVal types.BinVal, round types.ConsensusRound, stage byte) messages.InternalSignedMsgHeader
func GenerateCombinedMessageBytes ¶
func GenerateCombinedMessageBytes(pms []*PartialMessage) (*messages.Message, error)
GenerateCombinedMessage creates the bytes of the full message from a list of partial messages. It assumes the partial messages have already been verified and have the same meta-data.
func GeneratePartialMessageDirect ¶
func GeneratePartialMessageDirect(hdr messages.InternalSignedMsgHeader, round types.ConsensusRound, pieces int) ([]messages.InternalSignedMsgHeader, error)
GeneratePartialMessageDirect generates a partial message by evenly splitting it into pieces pieces. Round is the round of the proposal message in the consensus to distinguish the message from other rounds of the same index.
func GeneratePartialMessages ¶
func GeneratePartialMessages(fullMsg []byte, round types.ConsensusRound, partialMessages [][]byte) []messages.InternalSignedMsgHeader
GeneratePartialMessage creates a set of partial messages given the full message and its parts
func GetBVMessageInfo ¶
func GetBVMessageInfo(header messages.InternalSignedMsgHeader) (binVal types.BinVal, round types.ConsensusRound, stage byte)
Types ¶
type AuxBothMessage ¶
type AuxBothMessage struct { Round types.ConsensusRound // The round within the consensus instance BinVal types.BinVal // The supported binary value }
AuxBothMessage is the type of messages used by the binary consensus It implements messages.MsgHeader
func NewAuxBothMessage ¶
func NewAuxBothMessage() *AuxBothMessage
NewAuxBothMessage creates a new empty AuxBothMessage
func (*AuxBothMessage) DeserializeInternal ¶
func (apm *AuxBothMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*AuxBothMessage) GetBaseMsgHeader ¶
func (apm *AuxBothMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*AuxBothMessage) GetID ¶
func (apm *AuxBothMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*AuxBothMessage) GetMsgID ¶
func (apm *AuxBothMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a BinMsgID (see MsgID definition for more details)
func (*AuxBothMessage) GetSignType ¶
func (*AuxBothMessage) GetSignType() types.SignType
GetSignType returns types.NormalSignature
func (*AuxBothMessage) NeedsSMValidation ¶
func (apm *AuxBothMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns nil, since these messages do not need to be validated by the state machine.
func (*AuxBothMessage) SerializeInternal ¶
func (apm *AuxBothMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*AuxBothMessage) ShallowCopy ¶
func (apm *AuxBothMessage) ShallowCopy() messages.InternalSignedMsgHeader
type AuxProofMessage ¶
type AuxProofMessage struct { Round types.ConsensusRound // The round within the consensus instance BinVal types.BinVal // The supported binary value AllowCoin bool // Allows BinVal to take the value 0, 1, or Coin }
AuxProofMessage is the type of messages used by the binary consensus It implements messages.MsgHeader
func NewAuxProofMessage ¶
func NewAuxProofMessage(allowNotCoin bool) *AuxProofMessage
NewAuxProofMessage creates a new empty AuxProofMessage
func (*AuxProofMessage) DeserializeInternal ¶
func (apm *AuxProofMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*AuxProofMessage) GetBaseMsgHeader ¶
func (apm *AuxProofMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*AuxProofMessage) GetID ¶
func (apm *AuxProofMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*AuxProofMessage) GetMsgID ¶
func (apm *AuxProofMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a BinMsgID (see MsgID definition for more details)
func (*AuxProofMessage) GetSignType ¶
func (apm *AuxProofMessage) GetSignType() types.SignType
GetSignType returns types.Secondary signature for round 1, types.NormalSignature otherwise.
func (*AuxProofMessage) NeedsSMValidation ¶
func (apm *AuxProofMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns nil, since these messages do not need to be validated by the state machine.
func (*AuxProofMessage) SerializeInternal ¶
func (apm *AuxProofMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*AuxProofMessage) ShallowCopy ¶
func (apm *AuxProofMessage) ShallowCopy() messages.InternalSignedMsgHeader
type AuxProofMessageTimeout ¶
type AuxProofMessageTimeout types.ConsensusRound
AuxProofMessageTimeout is sent internally to indicate that timeout has passed for a round while waiting for AuxProofMessage
func (AuxProofMessageTimeout) Deserialize ¶
func (tm AuxProofMessageTimeout) Deserialize(*messages.Message, types.ConsensusIndexFuncs) (int, error)
Deserialize is unused since it is a local message.
func (AuxProofMessageTimeout) GetBytes ¶
func (tm AuxProofMessageTimeout) GetBytes(*messages.Message) ([]byte, error)
GetBytes is unused since it is a local message.
func (AuxProofMessageTimeout) GetID ¶
func (tm AuxProofMessageTimeout) GetID() messages.HeaderID
GetID returns the header id for this header.
func (AuxProofMessageTimeout) GetMsgID ¶
func (tm AuxProofMessageTimeout) GetMsgID() messages.MsgID
GetMsgID is unused since it is a local message.
func (AuxProofMessageTimeout) PeekHeaders ¶
func (AuxProofMessageTimeout) PeekHeaders(*messages.Message, types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
PeekHeaders is unused since it is a local message.
type AuxStage0Message ¶
type AuxStage0Message struct { Round types.ConsensusRound // The round within the consensus instance BinVal types.BinVal // The supported binary value }
AuxStage0Message is the type of messages used by the binary consensus It implements messages.MsgHeader
func NewAuxStage0Message ¶
func NewAuxStage0Message() *AuxStage0Message
NewAuxStage0Message creates a new empty AuxStage0Message
func (*AuxStage0Message) DeserializeInternal ¶
func (apm *AuxStage0Message) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*AuxStage0Message) GetBaseMsgHeader ¶
func (apm *AuxStage0Message) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*AuxStage0Message) GetID ¶
func (apm *AuxStage0Message) GetID() messages.HeaderID
GetID returns the header id for this header
func (*AuxStage0Message) GetMsgID ¶
func (apm *AuxStage0Message) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a BinMsgID (see MsgID definition for more details)
func (*AuxStage0Message) GetSignType ¶
func (*AuxStage0Message) GetSignType() types.SignType
GetSignType returns types.NormalSignature
func (*AuxStage0Message) NeedsSMValidation ¶
func (apm *AuxStage0Message) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns nil, since these messages do not need to be validated by the state machine.
func (*AuxStage0Message) SerializeInternal ¶
func (apm *AuxStage0Message) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*AuxStage0Message) ShallowCopy ¶
func (apm *AuxStage0Message) ShallowCopy() messages.InternalSignedMsgHeader
type AuxStage1Message ¶
type AuxStage1Message struct { Round types.ConsensusRound // The round within the consensus instance BinVal types.BinVal // The supported binary value, 0 represents a binary value, 1 represents bot }
AuxStage1Message is the type of messages used by the binary consensus It implements messages.MsgHeader
func NewAuxStage1Message ¶
func NewAuxStage1Message() *AuxStage1Message
NewAuxStage1Message creates a new empty AuxStage1Message
func (*AuxStage1Message) DeserializeInternal ¶
func (apm *AuxStage1Message) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*AuxStage1Message) GetBaseMsgHeader ¶
func (apm *AuxStage1Message) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*AuxStage1Message) GetID ¶
func (apm *AuxStage1Message) GetID() messages.HeaderID
GetID returns the header id for this header
func (*AuxStage1Message) GetMsgID ¶
func (apm *AuxStage1Message) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a BinMsgID (see MsgID definition for more details)
func (*AuxStage1Message) GetSignType ¶
func (*AuxStage1Message) GetSignType() types.SignType
GetSignType returns types.NormalSignature
func (*AuxStage1Message) NeedsSMValidation ¶
func (apm *AuxStage1Message) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns nil, since these messages do not need to be validated by the state machine.
func (*AuxStage1Message) SerializeInternal ¶
func (apm *AuxStage1Message) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*AuxStage1Message) ShallowCopy ¶
func (apm *AuxStage1Message) ShallowCopy() messages.InternalSignedMsgHeader
type BVMessage0 ¶
type BVMessage0 struct { Round types.ConsensusRound // The round within the consensus instance Stage byte // The stage within the consensus this message is for }
BVMessage0 is the type of messages used by the binary consensus It implements messages.MsgHeader
func (*BVMessage0) DeserializeInternal ¶
func (bvm *BVMessage0) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*BVMessage0) GetBaseMsgHeader ¶
func (bvm *BVMessage0) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*BVMessage0) GetID ¶
func (bvm *BVMessage0) GetID() messages.HeaderID
GetID returns the header id for this header
func (*BVMessage0) GetMsgID ¶
func (bvm *BVMessage0) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a BinMsgID (see MsgID definition for more details)
func (*BVMessage0) GetSignType ¶
func (*BVMessage0) GetSignType() types.SignType
GetSignType returns type.NormalSignature
func (*BVMessage0) NeedsSMValidation ¶
func (bvm *BVMessage0) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns nil, since these messages do not need to be validated by the state machine.
func (*BVMessage0) SerializeInternal ¶
func (bvm *BVMessage0) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*BVMessage0) ShallowCopy ¶
func (bvm *BVMessage0) ShallowCopy() messages.InternalSignedMsgHeader
type BVMessage1 ¶
type BVMessage1 struct { Round types.ConsensusRound // The round within the consensus instance Stage byte }
BVMessage1 is the type of messages used by the binary consensus It implements messages.MsgHeader
func (*BVMessage1) DeserializeInternal ¶
func (bvm *BVMessage1) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*BVMessage1) GetBaseMsgHeader ¶
func (bvm *BVMessage1) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*BVMessage1) GetID ¶
func (bvm *BVMessage1) GetID() messages.HeaderID
GetID returns the header id for this header
func (*BVMessage1) GetMsgID ¶
func (bvm *BVMessage1) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a BinMsgID (see MsgID definition for more details)
func (*BVMessage1) GetSignType ¶
func (*BVMessage1) GetSignType() types.SignType
GetSignType retursn types.NormalSignature
func (*BVMessage1) NeedsSMValidation ¶
func (bvm *BVMessage1) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns nil, since these messages do not need to be validated by the state machine.
func (*BVMessage1) SerializeInternal ¶
func (bvm *BVMessage1) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*BVMessage1) ShallowCopy ¶
func (bvm *BVMessage1) ShallowCopy() messages.InternalSignedMsgHeader
type BinMsgID ¶
type BinMsgID struct { HdrID messages.HeaderID Round types.ConsensusRound Stage byte }
BinMsgID implements messages.MsgID. It is used to differentiate between AuxProofMessages of different rounds by comparing them, for example, during consensus we can count n-t different AuxProofMessages of each round (even if the AuxProofMessages have different binary values, the BinMsgID should be equal for the same round).
func (BinMsgID) ToMsgIDInfo ¶
ToMsgIDInfo converts the MsgID to a MsgIDInfo
type BinProposeMessage ¶
type BinProposeMessage struct { Index types.ConsensusIndex // Index is the index of consensus BinVal types.BinVal // BinVal is the binary value to propose // contains filtered or unexported fields }
BinProposeMessage details a proposal for an instance of binary consensus. It implements messages.MsgHeader
func NewBinProposeMessage ¶
func NewBinProposeMessage(index types.ConsensusIndex, binVal types.BinVal) *BinProposeMessage
NewBinProposeMessage creates a new bin propose message
func (BinProposeMessage) Deserialize ¶
Deserialize is unsed since it is a lcoal message.
func (*BinProposeMessage) GetID ¶
func (pm *BinProposeMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*BinProposeMessage) GetIndex ¶
func (pm *BinProposeMessage) GetIndex() types.ConsensusIndex
GetIndex returns the consensus index of this message
func (*BinProposeMessage) GetMsgID ¶
func (pm *BinProposeMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header (see MsgID definition for more details)
func (BinProposeMessage) PeekHeaders ¶
func (BinProposeMessage) PeekHeaders(*messages.Message, types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
PeekHeaders is unused since it is a local message.
type CoinMessage ¶
type CoinMessage struct { Round types.ConsensusRound // The round within the consensus instance // contains filtered or unexported fields }
CoinMessage is used by random binary consensus. Once we receive n-t of these for the threshold signature, the coin value of the round is revealed. To ensure that coin is unpredictable, be sure to change config.CsID each time consensus is run (this is included in all signed messages). It implements messages.MsgHeader
func NewCoinMessage ¶
func NewCoinMessage() *CoinMessage
NewCoinMessage creates a new empty CoinMessage
func (*CoinMessage) DeserializeInternal ¶
func (cm *CoinMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*CoinMessage) GetBaseMsgHeader ¶
func (cm *CoinMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*CoinMessage) GetID ¶
func (cm *CoinMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*CoinMessage) GetMsgID ¶
func (cm *CoinMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a BinMsgID (see MsgID definition for more details)
func (*CoinMessage) GetSignType ¶
func (cm *CoinMessage) GetSignType() types.SignType
GetSignType returns the SignType that was used for this message during allocation.
func (*CoinMessage) NeedsSMValidation ¶
func (cm *CoinMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns nil, since these messages do not need to be validated by the state machine.
func (*CoinMessage) SerializeInternal ¶
func (cm *CoinMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*CoinMessage) ShallowCopy ¶
func (cm *CoinMessage) ShallowCopy() messages.InternalSignedMsgHeader
type CoinMsgID ¶
type CoinMsgID struct { HdrID messages.HeaderID Round types.ConsensusRound }
BinMsgID implements messages.MsgID. It is used to differentiate between CoinMessages of different rounds by comparing them, for example, during consensus we can count n-t different CoinMessages of each round (even if the CoinMessages have different binary values, the BinMsgID should be equal for the same round).
func (CoinMsgID) ToMsgIDInfo ¶
ToMsgIDInfo converts the MsgID to a MsgIDInfo
type CoinPreMessage ¶
type CoinPreMessage struct {
Round types.ConsensusRound // The round within the consensus instance
}
CoinPreMessage is used by random binary consensus. It is sent before the coin to change a t+1 threshold coin to an n-t one It implements messages.MsgHeader
func NewCoinPreMessage ¶
func NewCoinPreMessage() *CoinPreMessage
NewCoinPreMessage creates a new empty CoinPreMessage
func (*CoinPreMessage) DeserializeInternal ¶
func (cm *CoinPreMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*CoinPreMessage) GetBaseMsgHeader ¶
func (cm *CoinPreMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*CoinPreMessage) GetID ¶
func (cm *CoinPreMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*CoinPreMessage) GetMsgID ¶
func (cm *CoinPreMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a BinMsgID (see MsgID definition for more details)
func (*CoinPreMessage) GetSignType ¶
func (cm *CoinPreMessage) GetSignType() types.SignType
GetSignType returns the SignType that was used for this message during allocation.
func (*CoinPreMessage) NeedsSMValidation ¶
func (cm *CoinPreMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns nil, since these messages do not need to be validated by the state machine.
func (*CoinPreMessage) SerializeInternal ¶
func (cm *CoinPreMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*CoinPreMessage) ShallowCopy ¶
func (cm *CoinPreMessage) ShallowCopy() messages.InternalSignedMsgHeader
type CombinedMessage ¶
type CombinedMessage struct { messages.InternalSignedMsgHeader Round types.ConsensusRound FullMsgHash types.HashBytes PartialMsgHashes []types.HashBytes }
CombinedMsg is a full message constructed from partial messages It implements messages.InternalSignedMsgHeader
func CreatePartial ¶
func CreatePartial(hdr messages.InternalSignedMsgHeader, round types.ConsensusRound, pieces int, partialType types.PartialMessageType) (combined *CombinedMessage, partials []messages.InternalSignedMsgHeader, err error)
CreatePartial creates a list of partial messages and the corresponding combined message given a header, the number of pieces to break the message into and the partial message type.
func GenerateCombinedMessage ¶
func GenerateCombinedMessage(pm *PartialMessage, fullMsg *messages.Message, hdrFunc func(sig.Pub, *generalconfig.GeneralConfig, messages.HeaderID) (messages.MsgHeader, error), gc *generalconfig.GeneralConfig, pub sig.Pub) (*CombinedMessage, error)
GenerateCombinedMessage takes a PartialMessage that was one of the inputs to GenerateCombinedMessageBytes, the output of that function, and a function that will return a message header from the headerID. It outputs the CombinedMessage created from this.
func NewCombinedMessage ¶
func NewCombinedMessage(fullMsg messages.InternalSignedMsgHeader) *CombinedMessage
NewCombinedMessage returns a new CombinedMessage for the given internal message header type.
func NewCombinedMessageFromPartial ¶
func NewCombinedMessageFromPartial(partial *PartialMessage, fullMsg messages.InternalSignedMsgHeader) *CombinedMessage
NewCombinedMessage returns a new CombinedMessage for the given header and partial message.
func (*CombinedMessage) DeserializeInternal ¶
func (mvi *CombinedMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*CombinedMessage) GetBaseMsgHeader ¶
func (mvi *CombinedMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*CombinedMessage) SerializeInternal ¶
func (mvi *CombinedMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*CombinedMessage) ShallowCopy ¶
func (mvi *CombinedMessage) ShallowCopy() messages.InternalSignedMsgHeader
ShallowCopy returns a shallow copy of the message
type ConsBinStateMessage ¶
type ConsBinStateMessage []byte
ConsBinStateMessage represents a set of many consensus messages all appended together. It is used during recovery to send blocks of messages. It implements messages.MsgHeader
func (ConsBinStateMessage) Deserialize ¶
func (cm ConsBinStateMessage) Deserialize(m *messages.Message, _ types.ConsensusIndexFuncs) (int, error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (ConsBinStateMessage) GetBytes ¶
func (cm ConsBinStateMessage) GetBytes(m *messages.Message) ([]byte, error)
GetBytes returns the bytes that make up the message
func (ConsBinStateMessage) GetID ¶
func (cm ConsBinStateMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (ConsBinStateMessage) GetIndex ¶
func (cm ConsBinStateMessage) GetIndex() types.ConsensusInt
GetIndex returns 0.
func (ConsBinStateMessage) GetMsgID ¶
func (cm ConsBinStateMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header (see MsgID definition for more details)
func (ConsBinStateMessage) PeekHeaders ¶
func (ConsBinStateMessage) PeekHeaders(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
PeekHeader returns the indices related to the messages without impacting m.
type ConsMessage ¶
type ConsMessage struct {
// contains filtered or unexported fields
}
ConsMessage is a header that indicates it will be followed by a message dealing with consensus. It implements messages.MsgHeader
func NewConsMessage ¶
func NewConsMessage() *ConsMessage
func (*ConsMessage) Deserialize ¶
func (cm *ConsMessage) Deserialize(m *messages.Message, _ types.ConsensusIndexFuncs) (int, error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*ConsMessage) GetID ¶
func (cm *ConsMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*ConsMessage) GetIndex ¶
func (npm *ConsMessage) GetIndex() types.ConsensusIndex
GetIndex returns the consensus index for this message.
func (*ConsMessage) GetMsgID ¶
func (cm *ConsMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a BinMsgID (see MsgID definition for more details)
func (ConsMessage) PeekHeaders ¶
func (ConsMessage) PeekHeaders(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
PeekHeader returns the indices related to the messages without impacting m.
type EventMessage ¶
EventMessage is used during multi-value consensus to send a graph based message to all other nodes. It implements messages.MsgHeader
func NewEventMessage ¶
func NewEventMessage() *EventMessage
NewEventMessage creates a new mv echo message
func (*EventMessage) DeserializeInternal ¶
func (hm *EventMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*EventMessage) GetBaseMsgHeader ¶
func (hm *EventMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*EventMessage) GetEventInfoHash ¶
func (hm *EventMessage) GetEventInfoHash() types.HashBytes
GetEventInfoHash returns the hash of the event info object.
func (*EventMessage) GetID ¶
func (hm *EventMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*EventMessage) GetMsgID ¶
func (hm *EventMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a MvMsgID (see MsgID definition for more details)
func (*EventMessage) GetSignType ¶
func (*EventMessage) GetSignType() types.SignType
GetSignType returns types.NormalSignature
func (*EventMessage) NeedsSMValidation ¶
func (hm *EventMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns nil, since these messages do not need to be validated by the state machine (this is because we have concurrent proposals).
func (*EventMessage) SerializeInternal ¶
func (hm *EventMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*EventMessage) ShallowCopy ¶
func (hm *EventMessage) ShallowCopy() messages.InternalSignedMsgHeader
type HashMessage ¶
HashMessage is used during multi-value consensus to echo the MvInitMessage by all participants. It implements messages.MsgHeader
func NewHashMessage ¶
func NewHashMessage() *HashMessage
NewHashMessage creates a new mv echo message
func (*HashMessage) DeserializeInternal ¶
func (hm *HashMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*HashMessage) GetBaseMsgHeader ¶
func (hm *HashMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*HashMessage) GetID ¶
func (hm *HashMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*HashMessage) GetMsgID ¶
func (hm *HashMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a MvMsgID (see MsgID definition for more details)
func (*HashMessage) GetSignType ¶
func (*HashMessage) GetSignType() types.SignType
GetSignType returns types.NormalSignature
func (*HashMessage) NeedsSMValidation ¶
func (hm *HashMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns nil, since these messages do not need to be validated by the state machine.
func (*HashMessage) SerializeInternal ¶
func (hm *HashMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*HashMessage) ShallowCopy ¶
func (hm *HashMessage) ShallowCopy() messages.InternalSignedMsgHeader
type IndexMessage ¶
IndexMessage is used during multi-value consensus to send a graph based message to all other nodes. It implements messages.MsgHeader
func NewIndexMessage ¶
func NewIndexMessage() *IndexMessage
NewIndexMessage creates a new index message.
func (*IndexMessage) DeserializeInternal ¶
func (hm *IndexMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*IndexMessage) GetBaseMsgHeader ¶
func (hm *IndexMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*IndexMessage) GetID ¶
func (hm *IndexMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*IndexMessage) GetMsgID ¶
func (hm *IndexMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a BasicMsgID (see MsgID definition for more details)
func (*IndexMessage) GetSignType ¶
func (*IndexMessage) GetSignType() types.SignType
GetSignType returns types.NormalSignature
func (*IndexMessage) NeedsSMValidation ¶
func (hm *IndexMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns nil.
func (*IndexMessage) SerializeInternal ¶
func (hm *IndexMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*IndexMessage) ShallowCopy ¶
func (hm *IndexMessage) ShallowCopy() messages.InternalSignedMsgHeader
type IndexRecoverMsg ¶
type IndexRecoverMsg struct { IndexMessage MissingDependencies []graph.EventPointer // contains filtered or unexported fields }
IndexRecoverMsg is used for MvCons4 recovery
func NewIndexRecoverMsg ¶
func NewIndexRecoverMsg(index types.ConsensusIndex) *IndexRecoverMsg
NewIndexMessage creates a new index recover message.
func (*IndexRecoverMsg) Deserialize ¶
func (npm *IndexRecoverMsg) Deserialize(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (n int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*IndexRecoverMsg) GetID ¶
func (npm *IndexRecoverMsg) GetID() messages.HeaderID
GetID returns the header id for this header
func (*IndexRecoverMsg) GetIndex ¶
func (npm *IndexRecoverMsg) GetIndex() types.ConsensusIndex
GetIndex returns the consensus index for this message.
func (IndexRecoverMsg) PeekHeaders ¶
func (IndexRecoverMsg) PeekHeaders(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
PeekHeader returns the indices related to the messages without impacting m.
type MvCommitMessage ¶
type MvCommitMessage struct { ProposalHash types.HashBytes // The hash of the proposal being Commit'd Round types.ConsensusRound }
MvCommitMessage is used during multi-value consensus to Commit the MvInitMessage by all participants. It implements messages.MsgHeader
func NewMvCommitMessage ¶
func NewMvCommitMessage() *MvCommitMessage
NewMvCommitMessage creates a new mv Commit message
func (*MvCommitMessage) DeserializeInternal ¶
func (mvc *MvCommitMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*MvCommitMessage) GetBaseMsgHeader ¶
func (mvc *MvCommitMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*MvCommitMessage) GetID ¶
func (mvc *MvCommitMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*MvCommitMessage) GetMsgID ¶
func (mvc *MvCommitMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a MvMsgID (see MsgID definition for more details)
func (*MvCommitMessage) GetSignType ¶
func (mvc *MvCommitMessage) GetSignType() types.SignType
NeedsCoinProof returns false.
func (*MvCommitMessage) NeedsSMValidation ¶
func (mvc *MvCommitMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns nil, since these messages do not need to be validated by the state machine.
func (*MvCommitMessage) SerializeInternal ¶
func (mvc *MvCommitMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*MvCommitMessage) ShallowCopy ¶
func (mvc *MvCommitMessage) ShallowCopy() messages.InternalSignedMsgHeader
type MvCommitMessageTimeout ¶
type MvCommitMessageTimeout types.ConsensusRound
MvCommitMessageTimeout is sent internally to indicate that timeout has passed for a round while waiting for MvCommitMessage
func (MvCommitMessageTimeout) Deserialize ¶
func (tm MvCommitMessageTimeout) Deserialize(*messages.Message, types.ConsensusIndexFuncs) (int, error)
Deserialize is unused since it is a local message.
func (MvCommitMessageTimeout) GetBytes ¶
func (tm MvCommitMessageTimeout) GetBytes(*messages.Message) ([]byte, error)
GetBytes is unused since it is a local message.
func (MvCommitMessageTimeout) GetID ¶
func (tm MvCommitMessageTimeout) GetID() messages.HeaderID
GetID returns the header id for this header.
func (MvCommitMessageTimeout) GetMsgID ¶
func (tm MvCommitMessageTimeout) GetMsgID() messages.MsgID
GetMsgID is unused since it is a local message.
func (MvCommitMessageTimeout) PeekHeaders ¶
func (MvCommitMessageTimeout) PeekHeaders(*messages.Message, types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
PeekHeaders is unused since it is a local message.
type MvEchoHashMessage ¶
type MvEchoHashMessage struct { ProposalHash types.HashBytes // The hash of the proposal being echo'd Round types.ConsensusRound RandHash types.HashBytes // the hash to identify the unique set of members (when using types.LaterMC and random members) IncludeRandHash bool // if true we include the rand hash in the message }
MvEchoMessage is used during multi-value consensus to echo the MvInitMessage by all participants, plus an additional hash. It implements messages.MsgHeader
func NewMvEchoHashMessage ¶
func NewMvEchoHashMessage(includeRandHash bool) *MvEchoHashMessage
NewMvEchoMessage creates a new mv echo message
func (*MvEchoHashMessage) DeserializeInternal ¶
func (mve *MvEchoHashMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*MvEchoHashMessage) GetBaseMsgHeader ¶
func (mve *MvEchoHashMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*MvEchoHashMessage) GetID ¶
func (mve *MvEchoHashMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*MvEchoHashMessage) GetMsgID ¶
func (mve *MvEchoHashMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a MvMsgID (see MsgID definition for more details)
func (*MvEchoHashMessage) GetSignType ¶
func (*MvEchoHashMessage) GetSignType() types.SignType
GetSignType return types.NormalSignature
func (*MvEchoHashMessage) NeedsSMValidation ¶
func (mve *MvEchoHashMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns nil, since these messages do not need to be validated by the state machine.
func (*MvEchoHashMessage) SerializeInternal ¶
func (mve *MvEchoHashMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*MvEchoHashMessage) ShallowCopy ¶
func (mve *MvEchoHashMessage) ShallowCopy() messages.InternalSignedMsgHeader
type MvEchoMessage ¶
type MvEchoMessage struct { ProposalHash types.HashBytes // The hash of the proposal being echo'd Round types.ConsensusRound }
MvEchoMessage is used during multi-value consensus to echo the MvInitMessage by all participants. It implements messages.MsgHeader
func NewMvEchoMessage ¶
func NewMvEchoMessage() *MvEchoMessage
NewMvEchoMessage creates a new mv echo message
func (*MvEchoMessage) DeserializeInternal ¶
func (mve *MvEchoMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*MvEchoMessage) GetBaseMsgHeader ¶
func (mve *MvEchoMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*MvEchoMessage) GetID ¶
func (mve *MvEchoMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*MvEchoMessage) GetMsgID ¶
func (mve *MvEchoMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a MvMsgID (see MsgID definition for more details)
func (*MvEchoMessage) GetSignType ¶
func (*MvEchoMessage) GetSignType() types.SignType
GetSignType return types.NormalSignature
func (*MvEchoMessage) NeedsSMValidation ¶
func (mve *MvEchoMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns nil, since these messages do not need to be validated by the state machine.
func (*MvEchoMessage) SerializeInternal ¶
func (mve *MvEchoMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*MvEchoMessage) ShallowCopy ¶
func (mve *MvEchoMessage) ShallowCopy() messages.InternalSignedMsgHeader
type MvEchoMessageTimeout ¶
type MvEchoMessageTimeout types.ConsensusRound
MvEchoMessageTimeout is sent internally to indicate that timeout has passed for a round while waiting for MvEchoMessage
func (MvEchoMessageTimeout) Deserialize ¶
func (tm MvEchoMessageTimeout) Deserialize(*messages.Message, types.ConsensusIndexFuncs) (int, error)
Deserialize is unused since it is a local message.
func (MvEchoMessageTimeout) GetBytes ¶
func (tm MvEchoMessageTimeout) GetBytes(*messages.Message) ([]byte, error)
GetBytes is unused since it is a local message.
func (MvEchoMessageTimeout) GetID ¶
func (tm MvEchoMessageTimeout) GetID() messages.HeaderID
GetID returns the header id for this header.
func (MvEchoMessageTimeout) GetMsgID ¶
func (tm MvEchoMessageTimeout) GetMsgID() messages.MsgID
GetMsgID is unused since it is a local message.
func (MvEchoMessageTimeout) PeekHeaders ¶
func (MvEchoMessageTimeout) PeekHeaders(*messages.Message, types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
PeekHeaders is unused since it is a local message.
type MvInitMessage ¶
type MvInitMessage struct { Proposal []byte // The proposal ByzProposal []byte // Alternative proposal for byzantine nodes Round types.ConsensusRound }
MvInitMessage is used by the coordinator of a round of multi-value consensus to send its proposal. It implements messages.MsgHeader
func NewMvInitMessage ¶
func NewMvInitMessage() *MvInitMessage
NewMvInitMessage creates a new mv init message
func (*MvInitMessage) DeserializeInternal ¶
func (mvi *MvInitMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*MvInitMessage) GetBaseMsgHeader ¶
func (mvi *MvInitMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*MvInitMessage) GetID ¶
func (mvi *MvInitMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*MvInitMessage) GetMsgID ¶
func (mvi *MvInitMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a MvMsgID (see MsgID definition for more details)
func (*MvInitMessage) GetSignType ¶
func (*MvInitMessage) GetSignType() types.SignType
GetSignType returns types.NormalSignature
func (*MvInitMessage) NeedsSMValidation ¶
func (mvi *MvInitMessage) NeedsSMValidation(msgIndex types.ConsensusIndex, proposalIdx int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns the proposal bytes to be validated by the SM. It takes as input the current index and returns the index -1. It panics if proposalIdx is not 0.
func (*MvInitMessage) SerializeInternal ¶
func (mvi *MvInitMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*MvInitMessage) ShallowCopy ¶
func (mvi *MvInitMessage) ShallowCopy() messages.InternalSignedMsgHeader
ShallowCopy makes a shallow copy of the message
type MvInitMessageTimeout ¶
type MvInitMessageTimeout types.ConsensusRound
MvInitMessageTimeout is sent internally to indicate that timeout has passed for a round while waiting for MvInitMessage
func (MvInitMessageTimeout) Deserialize ¶
func (tm MvInitMessageTimeout) Deserialize(*messages.Message, types.ConsensusIndexFuncs) (int, error)
Deserialize is unused since it is a local message.
func (MvInitMessageTimeout) GetBytes ¶
func (tm MvInitMessageTimeout) GetBytes(*messages.Message) ([]byte, error)
GetBytes is unused since it is a local message.
func (MvInitMessageTimeout) GetID ¶
func (tm MvInitMessageTimeout) GetID() messages.HeaderID
GetID returns the header id for this header.
func (MvInitMessageTimeout) GetMsgID ¶
func (tm MvInitMessageTimeout) GetMsgID() messages.MsgID
GetMsgID is unused since it is a local message.
func (MvInitMessageTimeout) PeekHeaders ¶
func (MvInitMessageTimeout) PeekHeaders(*messages.Message, types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
PeekHeaders is unused since it is a local message.
type MvInitSupportMessage ¶
type MvInitSupportMessage struct { Proposal []byte // The proposal ByzProposal []byte // Alternative proposal for byzantine nodes SupportedIndex types.ConsensusInt // the index supported by this init SupportedHash types.HashBytes // the hash of the init message supported RandHash types.HashBytes // the hash to identify the unique set of members (when using types.LaterMC and random members) IncludeRandHash bool // if true we include the rand hash in the message }
MvInitSupportMessage is used by the coordinator of a round of multi-value consensus to send its proposal with the additional information about the previous proposal it points to. It implements messages.MsgHeader
func NewMvInitSupportMessage ¶
func NewMvInitSupportMessage(includeRandHash bool) *MvInitSupportMessage
NewMvInitMessage creates a new mv init message
func (*MvInitSupportMessage) DeserializeInternal ¶
func (mvi *MvInitSupportMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*MvInitSupportMessage) GetBaseMsgHeader ¶
func (mvi *MvInitSupportMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*MvInitSupportMessage) GetID ¶
func (mvi *MvInitSupportMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*MvInitSupportMessage) GetMsgID ¶
func (mvi *MvInitSupportMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a MvMsgID (see MsgID definition for more details)
func (*MvInitSupportMessage) GetSignType ¶
func (*MvInitSupportMessage) GetSignType() types.SignType
GetSignType returns types.NormalSignature
func (*MvInitSupportMessage) NeedsSMValidation ¶
func (mvi *MvInitSupportMessage) NeedsSMValidation(msgIndex types.ConsensusIndex, proposalIdx int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns the proposal bytes to be validated by the state machine.
func (*MvInitSupportMessage) SerializeInternal ¶
func (mvi *MvInitSupportMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*MvInitSupportMessage) ShallowCopy ¶
func (mvi *MvInitSupportMessage) ShallowCopy() messages.InternalSignedMsgHeader
ShallowCopy makes a shallow copy of the message
type MvMsgID ¶
type MvMsgID struct { HdrID messages.HeaderID Round types.ConsensusRound }
MvMsgID implements messages.MsgID. It is used to differentiate between multi-value consensus messages of different types rounds by comparing them, for example, during consensus we can count n-t different MvEchoMessages of each round (even if the MvEchoMessages have different echo values, the MvMsgID should be equal for the same round).
func (MvMsgID) ToMsgIDInfo ¶
ToMsgIDInfo converts the MsgID to a MsgIDInfo
type MvMultiInitMessage ¶
type MvMultiInitMessage struct {
Proposals [][]byte // The proposals
}
MvInitMessage is used by the coordinator of a round of multi-value consensus to send multiple proposals using a single consensus item. It implements messages.MsgHeader
func NewMvMultiInitMessage ¶
func NewMvMultiInitMessage() *MvMultiInitMessage
NewMvMultiInitMessage creates a new mv init message
func (*MvMultiInitMessage) DeserializeInternal ¶
func (mvi *MvMultiInitMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*MvMultiInitMessage) GetBaseMsgHeader ¶
func (mvi *MvMultiInitMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*MvMultiInitMessage) GetID ¶
func (mvi *MvMultiInitMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*MvMultiInitMessage) GetMsgID ¶
func (mvi *MvMultiInitMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a MvMsgID (see MsgID definition for more details)
func (*MvMultiInitMessage) GetSignType ¶
func (*MvMultiInitMessage) GetSignType() types.SignType
GetSignType returns types.NormalSignature
func (*MvMultiInitMessage) NeedsSMValidation ¶
func (mvi *MvMultiInitMessage) NeedsSMValidation(msgIndex types.ConsensusIndex, proposalIdx int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns the proposal bytes at the given proposalIdx to be validated by the SM. It returns the same msgIndex taken an input for idx output.
func (*MvMultiInitMessage) SerializeInternal ¶
func (mvi *MvMultiInitMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*MvMultiInitMessage) ShallowCopy ¶
func (mvi *MvMultiInitMessage) ShallowCopy() messages.InternalSignedMsgHeader
ShallowCopy makes a shallow copy of the message
type MvProposeMessage ¶
type MvProposeMessage struct { Index types.ConsensusIndex // Index is the index of consensus for the proposal Proposal []byte // The actual proposal ByzProposal []byte // Alternative proposal for byzantine nodes // contains filtered or unexported fields }
MvProposeMessage details a proposal for an instance of multi-value consensus. It implements messages.MsgHeader
func NewMvProposeMessage ¶
func NewMvProposeMessage(index types.ConsensusIndex, proposal []byte) *MvProposeMessage
NewMvProposeMessage creates a new mv propose message
func (MvProposeMessage) Deserialize ¶
Deserialize is unsed since it is a lcoal message.
func (*MvProposeMessage) GetID ¶
func (pm *MvProposeMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*MvProposeMessage) GetIndex ¶
func (pm *MvProposeMessage) GetIndex() types.ConsensusIndex
GetIndex returns the consensus index of this message
func (*MvProposeMessage) GetMsgID ¶
func (pm *MvProposeMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header (see MsgID definition for more details)
func (MvProposeMessage) PeekHeaders ¶
func (MvProposeMessage) PeekHeaders(*messages.Message, types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
PeekHeaders is unused since it is a local message.
type MvRequestRecoverMessage ¶
type MvRequestRecoverMessage struct { Index types.ConsensusIndex ProposalHash types.HashBytes // The hash of the proposal to recover }
MvRequestRecoverMessage is used when multi-value consensus has completed, but only a hash was received, so the full proposal must be requested. It implements messages.MsgHeader
func NewMvRequestRecoverMessage ¶
func NewMvRequestRecoverMessage() *MvRequestRecoverMessage
NewMvRequestRecoverMessage creates a new mv request recover message
func (*MvRequestRecoverMessage) Deserialize ¶
func (mrm *MvRequestRecoverMessage) Deserialize(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (int, error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*MvRequestRecoverMessage) GetBytes ¶
func (mrm *MvRequestRecoverMessage) GetBytes(m *messages.Message) ([]byte, error)
GetBytes returns the bytes that make up the message
func (*MvRequestRecoverMessage) GetID ¶
func (mrm *MvRequestRecoverMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*MvRequestRecoverMessage) GetIndex ¶
func (mrm *MvRequestRecoverMessage) GetIndex() types.ConsensusIndex
GetIndex returns the consensus index for this message.
func (*MvRequestRecoverMessage) GetMsgID ¶
func (mrm *MvRequestRecoverMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header (see MsgID definition for more details)
func (*MvRequestRecoverMessage) PeekHeaders ¶
func (*MvRequestRecoverMessage) PeekHeaders(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
PeekHeader returns the indices related to the messages without impacting m.
type NetworkTestMessage ¶
type NetworkTestMessage struct { ID uint32 Index types.ConsensusID }
func (*NetworkTestMessage) Deserialize ¶
func (tm *NetworkTestMessage) Deserialize(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (int, error)
func (*NetworkTestMessage) GetBytes ¶
func (tm *NetworkTestMessage) GetBytes(m *messages.Message) ([]byte, error)
func (NetworkTestMessage) GetID ¶
func (tm NetworkTestMessage) GetID() messages.HeaderID
func (*NetworkTestMessage) GetIndex ¶
func (tm *NetworkTestMessage) GetIndex() types.ConsensusID
func (*NetworkTestMessage) GetMsgID ¶
func (tm *NetworkTestMessage) GetMsgID() messages.MsgID
func (NetworkTestMessage) PeekHeaders ¶
func (NetworkTestMessage) PeekHeaders(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
PeekHeader returns the indices related to the messages without impacting m.
type NoProgressMessage ¶
type NoProgressMessage struct { TestID int IndexDecided bool // if true then have already decided this index so only want future information // contains filtered or unexported fields }
NoProgressMessage is sent when a node has made no progress towards consensus after a timeout. It implements messages.MsgHeader
func NewNoProgressMessage ¶
func NewNoProgressMessage(index types.ConsensusIndex, indexDecided bool, testID int) *NoProgressMessage
func (*NoProgressMessage) Deserialize ¶
func (npm *NoProgressMessage) Deserialize(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (int, error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*NoProgressMessage) GetID ¶
func (npm *NoProgressMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*NoProgressMessage) GetIndex ¶
func (npm *NoProgressMessage) GetIndex() types.ConsensusIndex
GetIndex returns the consensus index for this message.
func (*NoProgressMessage) GetMsgID ¶
func (npm *NoProgressMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a BinMsgID (see MsgID definition for more details)
func (NoProgressMessage) PeekHeaders ¶
func (NoProgressMessage) PeekHeaders(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
PeekHeader returns the indices related to the messages without impacting m.
type PartialMessage ¶
type PartialMessage struct { FullMsgHash types.HashBytes // Round is the consensus round, since we only have the index in the normal header, and we need the round for distingusing the proposals Round types.ConsensusRound PartialMsgHashes []types.HashBytes PartialMsg []byte PartialMsgIndex int }
PartialMessage is used by the coordinator of a round of multi-value consensus to send its proposal. It implements messages.InternalSignedMsgHeader
func NewPartialMessage ¶
func NewPartialMessage() *PartialMessage
NewPartialMessage creates a new partial message
func (*PartialMessage) DeserializeInternal ¶
func (pm *PartialMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*PartialMessage) GetBaseMsgHeader ¶
func (pm *PartialMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*PartialMessage) GetID ¶
func (pm *PartialMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*PartialMessage) GetMsgID ¶
func (pm *PartialMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header (see MsgID definition for more details) TODO
func (*PartialMessage) GetSignType ¶
func (pm *PartialMessage) GetSignType() types.SignType
GetSignType returns types.NormalSignature
func (*PartialMessage) NeedsSMValidation ¶
func (pm *PartialMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns nil, since these messages do not need to be validated by the state machine.
func (*PartialMessage) SerializeInternal ¶
func (pm *PartialMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*PartialMessage) ShallowCopy ¶
func (pm *PartialMessage) ShallowCopy() messages.InternalSignedMsgHeader
ShallowCopy returns a shallow copy of the message
type ScMsgID ¶
ScMsgID implements messages.MsgID. It is used to differentiate between multi-value consensus messages of different types by comparing them.
func (ScMsgID) ToMsgIDInfo ¶
ToMsgIDInfo converts the MsgID to a MsgIDInfo
type SimpleConsMessage ¶
SimpleConsMessage is the message type used for the simple cons test. The message itself includes the public key (for fun). It implements messages.MsgHeader
func NewSimpleConsMessage ¶
func NewSimpleConsMessage(pub sig.Pub) *SimpleConsMessage
NewSimpleConsMessage creates a new simple cons message
func (*SimpleConsMessage) DeserializeInternal ¶
func (scm *SimpleConsMessage) DeserializeInternal(m *messages.Message) (bytesRead, signEndOffset int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*SimpleConsMessage) GetBaseMsgHeader ¶
func (scm *SimpleConsMessage) GetBaseMsgHeader() messages.InternalSignedMsgHeader
GetBaseMsgHeader returns the header pertaning to the message contents.
func (*SimpleConsMessage) GetID ¶
func (scm *SimpleConsMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*SimpleConsMessage) GetMsgID ¶
func (scm *SimpleConsMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a BinMsgID (see MsgID definition for more details)
func (*SimpleConsMessage) GetSignType ¶
func (*SimpleConsMessage) GetSignType() types.SignType
GetSignType returns types.NormalSignature
func (*SimpleConsMessage) NeedsSMValidation ¶
func (scm *SimpleConsMessage) NeedsSMValidation(types.ConsensusIndex, int) (idx types.ConsensusIndex, proposal []byte, err error)
NeedsSMValidation returns nil, since these messages do not need to be validated by the state machine.
func (*SimpleConsMessage) SerializeInternal ¶
func (scm *SimpleConsMessage) SerializeInternal(m *messages.Message) (bytesWritten, signEndOffset int, err error)
Serialize appends a serialized header to the message m, and returns the size of bytes written
func (*SimpleConsMessage) ShallowCopy ¶
func (scm *SimpleConsMessage) ShallowCopy() messages.InternalSignedMsgHeader
type SimpleConsProposeMessage ¶
type SimpleConsProposeMessage struct {
// contains filtered or unexported fields
}
SimpleConsProposeMessage is used as a proposal for the simple cons test. The proposal is just the consensus index.
func NewSimpleConsProposeMessage ¶
func NewSimpleConsProposeMessage(index types.ConsensusIndex) *SimpleConsProposeMessage
func (SimpleConsProposeMessage) Deserialize ¶
func (SimpleConsProposeMessage) Deserialize(*messages.Message, types.ConsensusIndexFuncs) (int, error)
Deserialize is unsed since it is a lcoal message.
func (*SimpleConsProposeMessage) GetID ¶
func (cm *SimpleConsProposeMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*SimpleConsProposeMessage) GetMsgID ¶
func (cm *SimpleConsProposeMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header, in this case a BinMsgID (see MsgID definition for more details)
func (SimpleConsProposeMessage) PeekHeaders ¶
func (SimpleConsProposeMessage) PeekHeaders(*messages.Message, types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
PeekHeaders is unused since it is a local message.
type TestMessageTimeout ¶
type TestMessageTimeout int
TestMessageTimeout is used in the csnet package for testing.
func (TestMessageTimeout) CreateCopy ¶
func (tm TestMessageTimeout) CreateCopy() messages.MsgHeader
func (TestMessageTimeout) Deserialize ¶
func (tm TestMessageTimeout) Deserialize(m *messages.Message, _ types.ConsensusIndexFuncs) (int, error)
func (TestMessageTimeout) GetBytes ¶
func (tm TestMessageTimeout) GetBytes(m *messages.Message) ([]byte, error)
func (TestMessageTimeout) GetID ¶
func (tm TestMessageTimeout) GetID() messages.HeaderID
func (TestMessageTimeout) GetMsgID ¶
func (tm TestMessageTimeout) GetMsgID() messages.MsgID
func (TestMessageTimeout) PeekHeaders ¶
func (TestMessageTimeout) PeekHeaders(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
PeekHeader returns the indices related to the messages without impacting m.
type VRFProofMessage ¶
type VRFProofMessage struct { Index types.ConsensusIndex VRFProof sig.VRFProof }
VRFProofMessage contains a VRFProof.
func NewVRFProofMessage ¶
func NewVRFProofMessage(index types.ConsensusIndex, vrf sig.VRFProof) *VRFProofMessage
NewVRFProofMessage creates a new simple cons message
func (*VRFProofMessage) Deserialize ¶
func (vrm *VRFProofMessage) Deserialize(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (bytesRead int, err error)
Deserialize deserialzes a header into the object, returning the number of bytes read
func (*VRFProofMessage) GetBytes ¶
func (vrm *VRFProofMessage) GetBytes(m *messages.Message) ([]byte, error)
GetBytes returns the bytes that make up the message
func (*VRFProofMessage) GetID ¶
func (vrm *VRFProofMessage) GetID() messages.HeaderID
GetID returns the header id for this header
func (*VRFProofMessage) GetIndex ¶
func (vrm *VRFProofMessage) GetIndex() types.ConsensusIndex
GetIndex returns the consensus index for this message.
func (*VRFProofMessage) GetMsgID ¶
func (vrm *VRFProofMessage) GetMsgID() messages.MsgID
GetMsgID returns the MsgID for this specific header.
func (*VRFProofMessage) PeekHeaders ¶
func (*VRFProofMessage) PeekHeaders(m *messages.Message, unmarFunc types.ConsensusIndexFuncs) (index types.ConsensusIndex, err error)
PeekHeader returns the indices related to the messages without impacting m.
Source Files ¶
- aux_both_message.go
- aux_proof_message.go
- aux_stage0.go
- aux_stage1.go
- basic_msg.go
- bin_propose_message.go
- bv_message0.go
- bv_message1.go
- coin_message.go
- coinpre_message.go
- combinedmsg.go
- cons_binstate_message.go
- cons_message.go
- doc.go
- event_message.go
- hash_msg.go
- index_message.go
- local_msg_interface.go
- mv_commit_msg.go
- mv_echo_hash_msg.go
- mv_echo_msg.go
- mv_init_message.go
- mv_init_support_message.go
- mv_multi_init_msg.go
- mv_propose_message.go
- mv_recover_message.go
- network_test_message.go
- no_progress_message.go
- partial_interface.go
- partial_msg.go
- simple_cons_message.go
- simple_cons_propose_msg.go
- test_message.go
- vrf_message.go