Replies: 1 comment
-
|
This is fantastic!! Thank you @acul71 🚀 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
TODO Analysis Summary: py-libp2p Issues Overview
Last review: November 2025
Executive Summary
This document provides a comprehensive overview of all TODO and FIXME issues analyzed in the py-libp2p codebase. The analysis covers 15 major issues from Discussion #730 across 8 different modules, plus 5 additional TODOs identified in the expanded report, ranging from simple type fixes to complex architectural improvements.
Table of Contents
Issue Categorization Table
Sorted by Priority (High → Medium → Low) then by Difficulty (Expert → Medium → Easy)
Detailed Issue Analysis
BasicHost.get_addrs() p2p postfix
Location:
libp2p/host/basic_host.py:204Type: API Design
Priority: Medium
Difficulty: Medium
Breaking Change: Yes
Discussion: GitHub Discussion #716
GitHub Tracking: ❌ No GitHub issue found - Needs to be created
Summary: The
get_addrs()method currently adds/p2p/{peer_id}postfix to transport addresses, but the TODO suggests this should be removed for cleaner separation of concerns.Current Status:⚠️ OPEN - TODO comment still present at line 204
Impact:
Recommendation: Implement Option B (add new method) for backward compatibility. Create GitHub issue for API redesign discussion.
Circuit v2 Relay Issues
Location:
libp2p/relay/circuit_v2/Type: Security
Priority: High
Difficulty: Expert
Breaking Change: No
Discussion: GitHub Discussion #720
Summary: Four critical security issues in circuit v2 relay implementation:
resources.py:119)resources.py:215)transport.py:295)transport.py:383)Current Status:⚠️ WORK IN PROGRESS (1/4 resolved, 2/4 tracked on GitHub)
Impact:
Recommendation: Address issues 2, 3, and 4 in order of priority.
Get Mux Return Type
Location:
libp2p/abc.py:1799,libp2p/host/basic_host.py:194Type: Type Safety
Priority: Low
Difficulty: Easy
Breaking Change: No
Discussion: GitHub Discussion #729
GitHub Tracking: ✅ Issue #736 (OPEN)
Summary: The
get_mux()method returnsMultiselectbut should returnIMultiselectMuxerfor proper type safety.Current Status:⚠️ OPEN - Still returns
Multiselectinstead ofIMultiselectMuxerImpact:
Recommendation: Update return type to
IMultiselectMuxerin both interface and implementation. Tracked in Issue #736.Mplex Stream Muxer Issues
Location:
libp2p/stream_muxer/mplex/mplex.pyType: Type Safety
Priority: Medium
Difficulty: Easy
Breaking Change: No
Discussion: GitHub Discussion #722
GitHub Tracking: ✅ Issue #741 + PR #742 (OPEN, active work)
Summary: Four type consistency and logging issues in mplex implementation:
Current Status:⚠️ OPEN - All 4 issues still present, actively being addressed in PR #742
Impact:
Recommendation: Address all four issues for better code quality.
MplexStream Issues
Location:
libp2p/stream_muxer/mplex/mplex_stream.pyType: Concurrency
Priority: High
Difficulty: Medium
Breaking Change: No
Discussion: GitHub Discussion #723
GitHub Tracking: ✅ Issue #984 (CLOSED - 2025-10-19)
Summary: Four concurrency and error handling issues:
set_deadline,set_read_deadline,set_write_deadline)Current Status: ✅ DONE (4/4 completed)
Note: Issue #984 was closed as deadline functionality is now fully implemented. Issues #852 and #832 are outdated and should be closed.
Impact:
Recommendation: All issues resolved. No further action needed.
Multiselect Type Consistency
Location:
libp2p/protocol_muxer/multiselect.py:48Type: Type Safety
Priority: Medium
Difficulty: Easy
Breaking Change: No
Discussion: GitHub Discussion #718
Summary: Type inconsistency between interface and implementation.
Current Status: ✅ DONE - Resolved in PR #770
Impact:
Recommendation: Issue resolved. No further action needed.
MuxerMultistream Timeout
Location:
libp2p/stream_muxer/muxer_multistream.py:55Type: Configurability
Priority: High
Difficulty: Medium / Low
Breaking Change: No
Discussion: GitHub Discussion #725
Summary: Missing timeout configuration in MuxerMultistream.
Current Status: ✅ RESOLVED - Timeout is now configurable via
negotiate_timeoutparameter in__init__(defaults toDEFAULT_NEGOTIATE_TIMEOUT = 5)Impact:
Recommendation: Issue resolved. No further action needed.
Pubsub Issues
Location:
libp2p/pubsub/Type: Performance
Priority: Medium
Difficulty: Medium
Breaking Change: No
Discussion: GitHub Discussion #719
Summary: Missing GossipSub optimizations and type consistency:
gossipsub.py:337)get_message_id()method exists)MAX_CONCURRENT_VALIDATORS = 10and semaphore)Current Status:⚠️ PARTIALLY RESOLVED (2/3 resolved)
Impact:
Recommendation: Address remaining sendRPC piggybacking issue.
Pubsub Missing Tests
Location:
tests/core/pubsub/test_pubsub.py:536Type: Testing
Priority: Medium
Difficulty: Medium
Breaking Change: No
Discussion: GitHub Discussion #728
GitHub Tracking: ❌ Issue #191 mentioned in code but not found - Needs verification or new issue
Summary: Missing tests for
test_stream_handlerandtest_handle_peer_queuethat need alignment with Go implementation.Current Status:⚠️ OPEN - TODO comment still present, tests not implemented
Impact:
Recommendation: Implement hybrid approach (direct + integration tests). Verify Issue #191 status or create new issue.
Swarm Issues
Location:
libp2p/network/swarm.py:657Type: Architecture
Priority: High
Difficulty: Expert
Breaking Change: No
Discussion: GitHub Discussion #717
GitHub Tracking: ✅ PR #876 (MERGED - 2025-09-01) - Some swarm issues addressed, but listener nursery TODO still present. Related: Issue #417, Issue #604
Summary: Listener nursery bounding issue.
Current Status:⚠️ OPEN - TODO comment still present at line 657
Impact:
Recommendation: Design API changes for I/O agnostic listener implementation. May be related to Issue #417 or #604.
Test Notify Issues
Location:
tests/core/network/test_notify.pyType: Testing
Priority: Low
Difficulty: Easy
Breaking Change: No
Discussion: GitHub Discussion #825
GitHub Tracking: ✅ Issue #825 (CLOSED - 2025-08-28)
Summary: Missing test coverage for notify functionality.
Current Status: ✅ DONE - Tests exist (
test_notify,test_notify_with_closed_stream_and_listen_close,test_notify_edge_cases)Impact:
Recommendation: Issue resolved. No further action needed.
Transport Issues
Location:
libp2p/transport/Type: Transport Architecture
Priority: High
Difficulty: Expert
Breaking Change: Yes
Discussion: GitHub Discussion #717
Summary: Transport-related architectural improvements needed.
Current Status:⚠️ OPEN - Needs investigation
Impact:
Recommendation: Further investigation needed to identify specific transport issues.
Additional TODOs (Not in Original Discussion #730)
These TODOs were identified in the expanded TODO report but are not part of the original Discussion #730 scope. They are included here for completeness.
IPv6 Support
Location:
libp2p/utils/address_validation.py:67Type: Feature Gap
Priority: High
Difficulty: Medium-High
Breaking Change: No
Summary: IPv6 support is temporarily disabled due to libp2p handshake issues. IPv6 connections fail during protocol negotiation (SecurityUpgradeFailure).
Current Status:⚠️ OPEN - IPv6 code is commented out, needs re-enablement
Impact:
Recommendation: Re-enable IPv6 support once security handshake and multiselect protocol issues are resolved. See downloads/2025-11-19-TODO.md for detailed implementation steps.
IPNS Implementation
Location:
libp2p/kad_dht/kad_dht.py:254, 282, 290Type: Planned Feature
Priority: High
Difficulty: Difficult
Breaking Change: No
Summary: IPNS (InterPlanetary Name System) support is planned but not implemented. Multiple TODOs indicate this is a planned feature that allows mutable pointers to content-addressed data.
Current Status:⚠️ OPEN - Not implemented, 3 TODOs present
Impact:
Recommendation: This is a large feature that should be tracked as a separate issue/PR, not just fixing TODOs. See downloads/2025-11-19-TODO.md for implementation approach.
Pubsub P6/P7 Penalties
Location:
libp2p/pubsub/score.py:160Type: Security Features
Priority: Medium
Difficulty: Medium
Breaking Change: No
Summary: GossipSub scoring system has penalties P1-P5 implemented, but P6 (Application-specific penalty) and P7 (IP colocation penalty) are documented but not implemented.
Current Status:⚠️ OPEN - TODO comment present
Impact:
Recommendation: Implement when concrete use cases are identified. See downloads/2025-11-19-TODO.md for implementation details.
TCP Nursery TODO
Location:
libp2p/transport/tcp/tcp.py:44Type: Design Question
Priority: Low
Difficulty: Easy
Breaking Change: No
Summary: TODO questions whether
nurseryparameter is still needed inlisten()method.Current Status:⚠️ OPEN - TODO present, but nursery is required by IListener interface
Impact:
Recommendation: Remove TODO and add clarifying comment. The nursery is required by the
IListenerinterface and is essential for managing async task lifecycle in trio.QUIC Type Fix
Location:
libp2p/transport/quic/exceptions.py:354Type: Type Annotation
Priority: Low
Difficulty: Easy
Breaking Change: No
Summary: Type annotation has duplicate
Nonein__exit__method signature:type[BaseException] | None | None.Current Status:⚠️ OPEN - Simple typo in type annotation
Impact:
type[BaseException] | NoneRecommendation: Simple fix - remove duplicate
None. See downloads/2025-11-19-TODO.md for fix.Good First Issues
These issues are suitable for new contributors:
Expert Level Issues
These require deep understanding of the codebase:
Implementation Roadmap
Phase 1: High Priority Security (Expert)
Phase 2: High Priority Reliability (Medium)
Phase 3: Medium Priority Improvements (Easy-Medium)
Phase 4: Low Priority Cleanup (Easy)
Phase 5: Additional High Priority Features (Not in Discussion #730)
Risk Assessment
High Risk
Medium Risk
Low Risk
Conclusion
Summary of Status:
Next Steps:
Last Updated: November 2025 (based on origin/main branch)
GitHub Tracking: See DISCUSSION_730_GITHUB_TRACKING.md for complete mapping of TODOs to GitHub issues and PRs.
Related Documentation: See downloads/2025-11-19-TODO.md for expanded TODO report with detailed context and solutions (42 total items, 18 active TODOs).
Beta Was this translation helpful? Give feedback.
All reactions