Lightning network: which update messages are replayed?

by Sergei Tikhomirov   Last Updated June 12, 2019 11:27 AM

If I understand correctly, after a new node connects to a peer in the Lightning network, it receives all past channel announcement / update messages for currently open channels to recreate a local snapshot of the network. What messages are replayed? For example, for a very old channel with lots of channel updates, are all of them replayed? Why not just report the latest update message?



Answers 1


You should look at BOLT 07 which describes the gossip protocol and depends on BOLT 08 (Transport via the Noise Protocol framework) and BOLT 01 (Messaging)

In particular if you look at the channel_update message you will find this quote from the BOLT 07:

if timestamp is NOT greater than that of the last-received channel_update for this short_channel_id AND for node_id: SHOULD ignore the message.

otherwise: if the timestamp is equal to the last-received channel_update AND the fields (other than signature) differ: MAY blacklist this node_id. MAY forget all channels associated with it.

if the timestamp is unreasonably far in the future: MAY discard the channel_updat

Also in the section about rebroadcasting you can find the following quotes:

upon receiving a new channel_announcement or a channel_update or node_announcement with an updated timestamp: SHOULD update its local view of the network's topology accordingly.

after applying the changes from the announcement:

[...]

SHOULD update the appropriate metadata AND store the signature associated with the announcement. Note: this will later allow the node to rebuild the announcement for its peers.

The way how I read this is that nodes only store the latest channel_update message per channel which they can detect via the timestamp. Also when the initial sync takes place the latest update messages for each channel are also being sent.

Rene Pickhardt
Rene Pickhardt
June 12, 2019 11:17 AM

Related Questions


Updated January 13, 2019 17:27 PM

Updated February 07, 2019 14:27 PM

Updated February 11, 2019 11:27 AM

Updated May 02, 2019 23:27 PM

Updated November 05, 2018 18:27 PM