delvingbitcoin

Quick peer gossip catchup protocol

Quick peer gossip catchup protocol

Original Postby rustyrussell

Posted on: December 5, 2023 03:22 UTC

The latest enhancements to the CLN gossip daemon have introduced the possibility of a more efficient way to handle gossip data with peers.

The proposed feature, known as "option_serves_gossip_catchup," is designed to store a small amount of information for each peer and provide them with the gossip collected since their last disconnection, with certain exclusions. To utilize this feature, a peer would indicate its desire to receive gossip since the last interaction via an odd TLV field in the gossip_timestamp_filter message. However, there are scenarios where it may not be possible to serve historical gossip—for instance, if the peer lacks a channel or due to data loss. Under these circumstances, the system would default to streaming current gossip from that point forward. Peers seeking the entire gossip history can obtain it by resending the gossip_timestamp_filter with a zero timestamp.

For the implementation of this feature within CLN's infrastructure, it would necessitate tracking the last sent gossip_store offset and making adjustments upon compaction during restarts. This process involves additional work and storage for each peer, which suggests the feature might be limited to peers that have channels established with the node. There is also consideration for prioritizing significant gossip, such as updates about new channels, although defining what constitutes "important" gossip presents its own set of challenges.