libp2p / libp2p/py-libp2p

Follow-up: sub-ms peerstore RTT, real-network health tests, and health GUI polish (#1453/#1455)

Open
#1,474 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
624
Forks
256
Avg merge
1d 34m
Merged PRs (30d)
47

Description

Description

Follow-up to #1453 / #1455 (opt-in connection health monitor with /ipfs/ping/1.0.0 probes, docs, tests, and demo GUI).

#1455 landed the core work. This issue tracks remaining quality gaps called out in review and unfinished polish for the real-network and GUI deliverables.

Motivation

  • Ping RTT is stored as integer milliseconds (perform_ping_roundtrip / _ping). On fast localhost paths that truncates to 0, so peerstore LatencyEWMA can record 0.0 even after a successful probe.
  • Real-network coverage still depends on host interfaces and can be skipped on loopback-only CI; we should harden the integration story so dropped paths and RTT updates are reliable where a real network is available.
  • The health GUI is useful but still minimal (no screenshots/docs walkthrough beyond CLI flags); polish would help operators adopt the demo.

Proposed work

1. Sub-ms peerstore RTT
  • Record peerstore latency with finer resolution than truncated integer ms (e.g. fractional milliseconds, or a small floor when converting to seconds), without breaking the public ping helper’s go-libp2p-style ms convention if that remains intentional.
  • Add/adjust tests so CI does not depend on EWMA > 0 alone when sub-ms RTTs are possible.
2. Real-network health integration test

Goal (from #1453): integration test with real peers on a real network (not only 127.0.0.1): at least two hosts, health enabled, assert scores/RTT update and that a dropped path is observed.

Current state after #1455: non-loopback binds + skip when only loopback exists. Follow-up:

  • Keep skip-on-loopback-only, but document when CI/runners will skip.
  • Strengthen assertions around score/RTT update and closed-connection detection on a true non-loopback path.
  • Consider optional CI labeling / manual job for environments with real NICs so the test is exercised regularly.
3. Health GUI polish (nice to have)

Goal (from #1453): small live view of peer table (score, latency, success, protected, unhealthy); TUI or local web page fed by get_network_health_summary / export_health_metrics (JSON or Prometheus).

Current state after #1455: --gui tui|web exists. Follow-up:

  • Docs polish: short operator walkthrough and/or screenshots of TUI and web UI.
  • Optional UX improvements (refresh controls, clearer unhealthy highlighting) without expanding scope into a full dashboard product.

Out of scope

  • Reworking default-off health monitoring semantics.
  • Cross-implementation (go/js) comparison docs.

References

  • Issue: #1453
  • PR: #1455
  • Review note: integer-ms RTT → peerstore 0.0 on fast CI (AI review v1)

Are you planning to do it yourself in a pull request?

Yes (maintainer follow-up; contributions welcome)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with perform_ping_roundtrip and _ping for RTT conversion, then inspect get_network_health_summary and export_health_metrics plus the existing non-loopback integration coverage. Done means sub-ms latency is represented reliably, real-network tests cover score/RTT updates and dropped paths while documenting loopback skips, and the GUI walkthrough or listed UX polish is complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, documentation, networking, observability, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.