Filecoin Lotus (libp2p/Gossipsub)

This report is the result of ProbeLab’s audit on the Gossipsub configuration for the Filecoin network. The recommended changes are being taken into account and tracked in this issue: https://github.com/filecoin-project/core-devs/issues/218

1. PeerExchange Logic

1.1 PeerExchange flag only for bootnodes

The current implementation only enables PeerExchange for bootstrapper nodes. This means that only bootnodes share information about other peers subscribed to the topic over PRUNE messages. From our continuous network crawls, we’ve observed that there are two types of success rates related to the PeerExchange feature:

The reviewed GossipSub configuration for Lotus and Venus nodes explains both peer discovery low success rates observed during the Nebula network crawling. This could be a limiting factor for the overall peer discovery in FIlecoin, as nodes have limited interactions with bootstrapper nodes (basically, when they join the network) and therefore receiving PRUNE messages with PX happens rarely.

Recommendation:

1.2 PeerExchange is currently not supported for rust-libp2p

After a review of the existing implementations (Lotus, Venus, and Forest), we’ve identified that GossipSub’s PeerExchange feature only applies for Lotus and Venus, as they are the ones using the Go implementation. The rust implementation (Forest) does not fully support the PeerExchange feature. The current code can successfully parse and read the full PRUNE message with the shared SignedPeerRecords, but since there is no support for SignedPeerRecords in rust, the feature is effectively unsupported.

Recommendation:


2. Pubsub Configuration Issues

2.1 Global Flood Publishing