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
: NodeIdentitySource Node ID
-
dst
: NodeIdentityDestination Node ID
-
tprefs
: Option<TransportPrefs>Transport preferences for outgoing messages
-
expiry
: OptionExpiry time for outgoing messages
-
msg
: VecEncrypted and padded EngineMessageV1 or RelayMessageV1
-
sig
: SignatureSignature over the above fields by
src
Triggers:
Behaviour¶
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]