Tracking: Transport, Relay, and Discovery Enhancements #996
Tracking: Transport, Relay, and Discovery Enhancements #996seetadev merged 18 commits intolibp2p:mainfrom
Conversation
71ea513 to
271cdd6
Compare
|
@codemaestro64 : Thank you so much for opening the PR for completing all the required enhancements and todos in circuit relay. Appreciate your efforts. Updated the branch and re-run CI/CD pipeline. You will get immediate results on CI/CD test cases. |
|
@codemaestro64 : Appreciate your efforts. Wish to invite @acul71 , @lla-dane, @Winter-Soren for sharing feedback points on the PR. |
|
Hey @codemaestro64, |
libp2p/relay/circuit_v2/transport.py
Outdated
| # Prefer stored /p2p-circuit addrs from peerstore | ||
| # Try first to read addresses from peerstore | ||
| peer_store = self.host.get_peerstore() | ||
| stored_addrs = peer_store.addrs(peer_info.peer_id) |
There was a problem hiding this comment.
peer_store.addrs will raise a PeerStoreError if the peer we're dialing isn't already in the peerstore, making dialing new peers impossible. Maybe wrap in a try/except or similar?
add pymock to test depenencies
…nnects and discovery
174dc7f to
a34f3b4
Compare
473066e to
968dfff
Compare
|
@codemaestro64 : Great work. Appreciate the progress. Please reply to @pacrob so that he can review and mark the feedback as resolved. There is one CI/CD failure, which can be ignored for now (not related to the PR): =========================== short test summary info ============================ |
|
@codemaestro64 : Wonderful efforts indeed. Appreciate your contribution. Wish if you could mark the todos at #691 completed in your PR. We are reviewing the PR in details, once again. It is indeed heading towards final review + merge. Great progress. On the same note, wish if you could open up a discussion page sharing more details on the implementation steps and test suite. CCing @pacrob, @Winter-Soren, who are reviewing this PR. Looking forward to their pointers and feedback. |
pyproject.toml
Outdated
| [tool.ruff.per-file-ignores] | ||
| "tests/*.py" = ["F821"] # undefined name (e.g., pytest fixtures like mocker) | ||
|
|
There was a problem hiding this comment.
I'm not getting an error with this. Is it necessary?
There was a problem hiding this comment.
No longer needed. Removed
libp2p/relay/circuit_v2/transport.py
Outdated
| async def handle_incoming_connection( | ||
| self, | ||
| stream: INetStream, | ||
| remote_peer_id: ID, |
There was a problem hiding this comment.
This arg is never used in the function.
There was a problem hiding this comment.
My bad. It's been removed
| voucher=b"", # We don't use vouchers yet | ||
| signature=b"", # We don't use signatures yet |
There was a problem hiding this comment.
Should these be updated? It looks like we are checking against these values in RelayResourceManager->verify_reservation, but they are always empty strings here.
There was a problem hiding this comment.
@codemaestro64 : Thank you for sharing your feedback on voucher implementation.
Vouchers have been implemented. In #698, @guha-rahul fixed voucher verification and data transfer limits in Circuit Relay v2. We are just merging that PR in a day or so.
Wish to invite @sukhman-sukh, @Winter-Soren, @acul71 and @guha-rahul to also do a peer review of the features added in this PR.
Wish to ensure that we have all the requisite features in circuit relay as discussed in maintainer's meeting.
|
@codemaestro64 : Wish if you could address the improvements shared by @pacrob. Appreciate your contribution. Wish if you also could discuss with @Winter-Soren and @sumanjeet0012 and get their pointers while addressing important feedback points by @pacrob. |
|
@pacrob : Hi Paul. Thank you so much for your feedback. Appreciate it. This PR is indeed ready for final review + merged. @codemaestro64: Wish to recommend you to open a discussion page and share a note for other NAT traversal developers on your implementation details in this PR, test suite. We will like you to follow up this PR with an example demonstrating real use-case of circuit relay and other NAT traversal components in a project. |
What was wrong?
Issue #691
The libp2p stack lacked robust relay support, secure resource validation, and dynamic peer discovery, impacting reliability in NATed or firewalled environments.
Description
This PR enhances the py-libp2p networking layer with improvements to relay functionality and security, advancing the library toward production-grade reliability for decentralized applications.
TODOs
resources.pytransport.pyrun()method inCircuitV2Listenercloses #691