Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filecoin DHT Metrics #1756

Closed
yiannisbot opened this issue Jun 12, 2024 · 2 comments
Closed

Filecoin DHT Metrics #1756

yiannisbot opened this issue Jun 12, 2024 · 2 comments
Assignees

Comments

@yiannisbot
Copy link

yiannisbot commented Jun 12, 2024

Open Grant Proposal: Filecoin DHT Metrics

Project Name: Filecoin DHT Metrics: Weekly Reports, Bootstrappers Uptime Monitoring, DHT Keyspace Density

Proposal Category: Developer and data tooling

Individual or Entity Name: ProbeLab (https://probelab.io) / Interplanetary Shipyard (https://ipshipyard.com/)

Proposer: @yiannisbot

Project Repo(s) Please list Github repos used for this project work.

(Optional) Filecoin ecosystem affiliations:

The ProbeLab team has been part of Protocol Labs until January 2024.

(Optional) Technical Sponsor:

Do you agree to open source all work you do on behalf of this RFP under the MIT/Apache-2 dual-license?:

Yes

Project Summary

The Filecoin network is using the libp2p DHT for peer discovery and peer routing. We will produce Weekly Network Health reports for Filecoin's DHT network that include several critical metrics, such as node geolocation, node uptime, node deployment (cloud vs non-cloud) and connectivity errors. You can see similar reports we're publishing for Ethereum at: https://probelab.io/ethereum/discv5/2024-19/ and for Celestia at: https://probelab.io/celestia/dht/2024-19/.

We will go beyond standard metrics to monitor and report the Filecoin DHT's bootstrappers and report their uptime, as well as the keyspace density distribution of nodes in the Filecoin DHT. The latter is a very useful metric for detecting sybil attacks.

Impact

The Filecoin network is using the libp2p DHT for peer discovery and peer routing. As such, on the one hand, it is not central to the consensus part of the network, but on the other it is critical for peers joining the network, or wanting to find other peers to interact with.

Although so far the DHT has been seen as a separate, isolated part, it is imperative to get a better view of the DHT network health and whether it is functioning the way it is expected to. Hiccups in the operation of the DHT, or security vulnerabilities (e.g., Sybil attacks) can cause SPs to connect to potentially malicious or underperforming peers. Lotus has a peer exchange mechanism as part of the Gossipsub protocol, but depending on one peer discovery and peer exchange mechanism only becomes risky when one of the two is not working properly. This is exemplified by this hiccup reported recently on the peer exchange operation of Gossipsub [link].

This proposal is addressing these issues by creating a group of tools, metrics, reports and alerts that will help Filecoin network protocol engineers and SPs to have a better idea of the state of Filecoin’s DHT network.

Outcomes

  1. Weekly Reports on the state of the Filecoin DHT network. You can find similar reports for:
    1. IPFS here: https://stats.ipfs.network/
    2. Ethereum’s discv5 DHT here: https://probelab.io/discv5/2024-09/
    3. Celestia's DHT here: https://probelab.io/celestia/dht/2024-19/
    4. Filecoin (from 2021) here: https://github.com/probe-lab/network-measurements/blob/main/reports/2021/calendar-week-43/filecoin/README.md
    5. Soon for Polkadot, Avail and others at: https://probelab.io/
  2. Monitoring of Filecoin’s bootstrapper nodes, their uptime, downtime and availability per different transport protocols. If desired, alerts can be set up and directed to specific individuals at FF or elsewhere.
  3. DHT Keyspace Density Monitor to detect an imminent Sybil attack to the DHT network. The plot is going to be integrated and be available at https://probelab.io/.

Adoption, Reach, and Growth Strategies

The target audience of this developer tooling project is the core maintainers of the Filecoin protocol and the developers of the Filecoin ecosystem. Storage Providers are also going to benefit from having deeper insights into the operation and correct functioning of the network as a whole.

Development Roadmap

Milestone 1: Adapt Nebula Crawler & Weekly Reports for the Filecoin Network

  • Development Cost: $30k
  • Maintenance Cost: Free for the duration of this project, $30k/yr thereafter
  • Delivery estimate (not effort estimate): ~3 weeks

Description: The weekly reports will include a list of metrics to provide an overview of the health and operation of the network. Among other metrics, the reports will include agent version distribution, geolocation of nodes, operational details, such as uptime and deployment distribution in known cloud providers.

Outcomes: Weekly reports published at https://probelab.io/

Milestone 2: DHT keyspace density monitoring for Sybil attack detection

  • Development Cost: $15k
  • Maintenance Cost: Free for the duration of this project, $5k/yr thereafter
  • Delivery estimate (not effort estimate): ~1-2 weeks

Description: Monitoring of the DHT keyspace density can reveal potential security vulnerabilities in the network. The density of the keyspace is not expected to be completely uniform, but large variations can reveal malicious behaviour, i.e., when a large number of nodes join the network with forged PeerIDs close to the node(s) that they want to eclipse and basically eclipsing the node. The attack can be executed in minutes from a laptop and has been demonstrated recently for the IPFS DHT [link]. The PeerID distribution we have seen for the IPFS network in the past is shown in the graphic below. The spike shows higher density of peers, which indicates that further investigation is needed. We will run the necessary infrastructure and tooling to be producing a similar graph for the Filecoin DHT. Although this vulnerability is not expected to bring down the network as a whole, it can remain unnoticed and have impact on particular SPs.

ipfs-keyspace-distribution

Outcomes: Development of a tool to monitor keyspace density across the DHT and visualisation of the result at https://probelab.io/.

Milestone 3: Build, deploy and maintain Bootstrapper Monitoring for the Filecoin Network

  • Development Cost: $15k
  • Maintenance Cost: Free for the duration of this project, $5k/yr thereafter
  • Delivery estimate (not effort estimate): ~1-2 weeks

Description: Uptime and correct operation of bootstrapper nodes is critical for the network as a whole. Earlier incarnations of our monitoring infrastructure (found here: https://probelab.io/bootstrappers/filecoin/) has helped Filecoin Infrastructure engineers debug issues with the bootstrapper nodes. Up to now, ProbeLab has been footing the bill for the maintenance and infrastructure cost of these tools. In this milestone we will do some small improvements to the tool and integrate plots into probelab.io together with explanations on what the tool actually does for a better user experience.

Outcomes: The plots that are currently in Grafana will migrate to https://probelab.io/ and will be accompanied by an explanation of the setup and details.

Total Budget Requested

| Milestone # | Description | Deliverables | Completion Date | Funding |
| Milestone 1 | Weekly Reports | Weekly Reports | 2-3 weeks from start | $30k |
| Milestone 2 | Bootstrapper Uptime Monitoring | Bootstrapper Uptime Monitoring | 3-4 weeks from start | $15k |
| Milestone 3 | DHT Keyspace Density Monitoring | DHT Keyspace Density Monitoring | 4 weeks from start | $15k |

Development budget: $60k
Delivery estimate: 1 month from start of project
Maintenance budget: $40k for 1 year of Weekly Network Health Reports (which include all the outcomes of all Milestones) after completion of the development part.
Total Budget: $100k for development and weekly reports for 1 year.

Maintenance and Upgrade Plans

The project includes two phases: i) development and setup (see cost and delivery time above), ii) maintenance of infrastructure and surrounding tooling to produce one report per week.

The cost and delivery date of the development part is shown above. The cost of the maintenance for 1 year after completion of development is costed at $40k.

Costing example assuming the project starts July 1st 2024:

  • Development cost ($60k) for an approximate delivery on August 1st 2024.
  • Maintenance cost ($40k) for 1 year from August 1st 2024 to August 1st 2025.

Team

Team Members

  • Team Member 1: Yiannis Psaras, @yiannisbot (Team Lead)
  • Team Member 2: Guillaume Michel, @guillaumemichel (Software Engineer)
  • Team Member 3: Mikel Cortes, @cortze (Software Engineer)
  • Team Member 4: Steph Samson, @kasteph (Infrastructure Engineer)

Team Member LinkedIn Profiles

Team Website

https://probelab.io

Relevant Experience

The ProbeLab team has been part of Protocol Labs for multiple years (until January 2024) and has been focusing on monitoring and measurement studies for IPFS and libp2p-based networks for several years. The team has extensive experience in building tooling for monitoring, measurement, as well as the relevant infrastructure. Apart from the several metrics and tools that the team is maintaining and can be found at https://probelab.io, the team has carried out detailed studies for both IPFS and libp2p. These studies can be found at: https://github.com/probe-lab/network-measurements/tree/master/results.

Team code repositories

Additional Information

Contact email: yiannis@probelab.io

@ErinOCon
Copy link
Collaborator

ErinOCon commented Aug 1, 2024

Hi @yiannisbot, this proposal has advanced to our final round of reviews scheduled to be completed by the end of August (if not sooner).

If we have questions during this review round, I will be in touch. Thank you again for your patience and for your interest in our grants program!

@ErinOCon
Copy link
Collaborator

ErinOCon commented Sep 3, 2024

This proposal has advanced to the next steps in our processing. Please respond to the email from grants@fil.org if you have any questions or updates.

Thank you again for your proposal and for your interest in our grants program!

@ErinOCon ErinOCon closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants