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:
Record with fields:
src
: NodeIdentity
Source Node ID
dst
: NodeIdentity
Destination Node ID
tprefs
: Option<TransportPrefs>
Transport preferences for outgoing messages
expiry
: Option
Expiry time for outgoing messages
msg
: Vec
Encrypted and padded EngineMessageV1 or RelayMessageV1
sig
: Signature
Signature over the above fields by src
Triggers:
Behavior¶
When the router receives a RelayMessage from a remote node via the Transport engine, it processes it the following way:
- 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
- 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]