Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

$$ \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 \):

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 the PerformanceMonitor.

Usage in Relay Network.

Usage in P2P Network.