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?
1 Answer
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 fornode_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 achannel_update
ornode_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.
-
This looks like a pattern: I ask a question, you cite a BOLT and explain it to me :) With all due respect, BOLT's language is not easy to grasp... So, after A joins and connects to B, B sends to A all latest updates for all channels B thinks are live? Does A even have to ask for this a-la GETADDR - ADDR in Bitcoin? Jun 12, 2019 at 11:27