Skip to content

RelayMessage

Purpose

A RelayMessage is used to relay an encrypted EngineMessage via multiple routing hops. It is sent between two nodes and encapsulates either an EngineMessage or another RelayMessage.

Type

Reception:

RelayMessageV1

Record with fields:

  • tprefs: Option<TransportPrefs>

    Transport preferences for outgoing messages

  • expiry: Option

    Expiry time for outgoing messages

  • sig: Signature

    Signature over the above fields by src

Triggers:

EngineMessage

Behaviour

When the router receives a RelayMessage from a remote node via the Transport engine, it processes it the following way:

  1. It checks whether it is configured to allow relaying either from the source node or to the destination node.
    • If not, it drop the message
  2. It decrypts the contained EngineMessage or RelayMessage, and processes it.

Message flow

sequenceDiagram

%% --8<-- [start:sequence]
Router -) Router: RelayMessage
Router -) Router: EngineMessage
%% --8<-- [end:sequence]