This PR introduces the ProcessingMessage structure to be used in the qbft module.
This structure encompasses a SignedSSVMessage and its associated decoded qbft.Message.
The SignedSSVMessage is needed in the qbft module due to QBFT justifications, while the cached qbft.Message in the structure allows us to remove the decoding duplication behaviour.
Usage
We avoid using SignedSSVMessage in qbft as much as possible. The two exceptions are:
the qbft.Controller.ProcessMsg function which is considered the message's entry point to the qbft module. This function transforms the SignedSSVMessage to a ProcessingMessage right away, which is, then, used in the rest of qbft.
the Instance.Broadcast function since we broadcast a SignedSSVMessage (and not a message to be processed).
Thus, ProcessingMessage is used everywhere else, as in MsgContainer, State.ProposalAcceptedForCurrentRound, and in Instance methods.
Overview
This PR introduces the
ProcessingMessage
structure to be used in theqbft
module.This structure encompasses a
SignedSSVMessage
and its associated decodedqbft.Message
.The
SignedSSVMessage
is needed in theqbft
module due to QBFT justifications, while the cachedqbft.Message
in the structure allows us to remove the decoding duplication behaviour.Usage
We avoid using
SignedSSVMessage
inqbft
as much as possible. The two exceptions are:qbft.Controller.ProcessMsg
function which is considered the message's entry point to theqbft
module. This function transforms theSignedSSVMessage
to aProcessingMessage
right away, which is, then, used in the rest ofqbft
.Instance.Broadcast
function since we broadcast aSignedSSVMessage
(and not a message to be processed).Thus,
ProcessingMessage
is used everywhere else, as inMsgContainer
,State.ProposalAcceptedForCurrentRound
, and inInstance
methods.