$$ \newcommand \tag {\mathrm{tag}} \newcommand \MessageHandler {\mathrm{MH}} \newcommand \ForwardingPolicy {\mathrm{ForwardingPolicy}} \newcommand \InMsg {\ast\texttt{M}} \newcommand \OutMsg {\texttt{M}\ast} $$
Message Handlers
Each incoming message \( \InMsg \) is deferred to the correct message handler \( \MessageHandler_t(\InMsg) \) given its protocol \( tag \) (\( t \)).
The message handler then processes the message and decides on a \( \ForwardingPolicy \) (see the definition of this data type for further details).
A message handler \( \MessageHandler_t(\InMsg) \) contains the logic for handling incoming messages.
The following is the list of registered message handlers defined in the reference implementation, ordered by \( tag \):
-
AVfor Agreement Vote: -
MIfor Message of Interest: -
MSfor Message Digest Skip: -
NPfor Net Priority Response: -
NIfor Network ID Verification: -
PPfor Proposal Payload: -
SPfor State Proof Signature: -
TSfor Topic Message Response: -
TXfor Transaction: -
UEfor Unicast Catchup Request: -
VBfor Vote Bundle: -
Unrecognized Tag case (a special tag value to account for transmission errors or adversarial behavior):
In general, after a preliminary validation and a series of computations, the produced output is an outgoing message \( \OutMsg \).
Internally, \( \MessageHandler_t(\InMsg) \) routes data to the corresponding component of the node (e.g., “Agreement” for protocol messages, “Transaction Pool” for transactions, etc.).
Refer to the normative section of each node component to see how these messages are processed and their impact on the node’s overarching state.
⚙️ IMPLEMENTATION
In the reference implementation, a single entry point callback
Notify()is used to monitor an outgoing connection whenever a message is received. This function then sends the message metadata to the appropriate processing stage of thePerformanceMonitor.Usage in Relay Network.
Usage in P2P Network.