Refactor/quic: Add capability check for transport #1214
Refactor/quic: Add capability check for transport #1214ChayanDass wants to merge 3 commits intolibp2p:mainfrom
Conversation
|
@seetadev , @acul71 , @sumanjeet0012 .. could you give it a review? |
Quick auto review here: AI Pull Request Review: #1214 — Refactor/quic: Add capability check for transportPR: libp2p/py-libp2p#1214 1. Summary of ChangesThis PR refactors the core (swarm, basic_host) to use capability-based checks instead of concrete QUIC types ( What changed:
Issues addressed: #395 (modularity/interfaces). Discussion #1204 is referenced for design context. Modules affected: 2. Branch Sync Status and Merge ConflictsBranch Sync Status
Merge Conflict Analysis
3. Strengths
4. Issues FoundCriticalNone. Major
Minor
5. Security Review
Conclusion: No security concerns identified; Security impact: None. 6. Documentation and Examples
7. Newsfragment Requirement
8. Tests and ValidationLinting (
|
|
@ChayanDass What's the status of this PR? Do you need assistance ? |
|
Sorry for the delay! My exams are going on , so i will fix those by Sunday 😞 |
…d transport tests - Add libp2p.capabilities with transport_provides_secure_and_muxed, connection_provides_muxed, connection_needs_establishment_wait - QUIC transport/connection set provides_secure=True, provides_muxed=True - Swarm and BasicHost use capability checks instead of isinstance(QUICTransport/ QUICConnection); INFO logs when upgrade is skipped - QUIC listener: fix getsockname() for IPv6 (use sockname[0:2]) - Add tests/core/transport/test_capabilities.py (TCP + helpers) - Add test_quic_transport_capability_flags in quic/test_transport.py - Newsfragment 395.feature.rst Signed-off-by: Chayan Das <01chayandas@gmail.com>
4b9f70e to
4b2dcc5
Compare
|
hey i updated the code... |
|
@ChayanDass Reviewed the PR, the failing docs ci check, was caused by |
What was wrong?
isinstance(QUICTransport),isinstance(QUICConnection)), which:How was it fixed?
libp2p/transport/capabilities.pywith:provides_secure_connection,provides_muxed_connection(and helpertransport_provides_secure_muxed).muxed_conn_has_resource_scope,muxed_conn_has_establishment_wait,muxed_conn_has_negotiation_semaphore,muxed_conn_get_establishment_waiter,muxed_conn_is_established.provides_secure_connection=True,provides_muxed_connection=True) instead of being detected by type.muxed_conn_has_negotiation_semaphore) instead ofisinstance(..., QUICConnection).tests/core/transport/test_capabilities.py(edge cases for all capability helpers) and swarm tests that assert TCP has no capability flags and QUIC has both.To-Do
Cute Animal Picture