Skip to content

Conversation

@guha-rahul
Copy link
Contributor

What was wrong?

Issue #697

How was it fixed?

Summary of approach.

To-Do

  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

Cute Animal Picture

put a cute animal picture link inside the parentheses

@guha-rahul guha-rahul marked this pull request as ready for review June 26, 2025 17:03
@guha-rahul guha-rahul marked this pull request as draft June 26, 2025 17:03
@guha-rahul guha-rahul marked this pull request as ready for review June 30, 2025 00:16
@seetadev
Copy link
Contributor

@guha-rahul : Nice work on the PR, Rahul. Appreciate the initiative and your efforts.

Circuit Relay v2 is a very important module of NAT traversal. Wish to recommend some tests that would enable verification of the voucher verification and data transfer limit enforcement in a relay protocol.

Please visit #715

Also, CCing @Winter-Soren and @sukhman-sukh if they would like to share feedback and thoughts on both the tests added and the PR itself. They have been collaborating on NAT traversal efforts and will be bootstrapping webrtc transport layer using NAT traversal soon.

@acul71
Copy link
Contributor

acul71 commented Jun 30, 2025

hi @guha-rahul nice work, I would like you to give an opinion on those TODOs since you just worked on this module.
Thanks
#720

@guha-rahul
Copy link
Contributor Author

@acul71 sure will give you some feedback in the coming days.

"""Handle a connect request."""
peer_id = ID(msg.peer)
dst_stream: INetStream | None = None
logger.debug("Handling connect request to peer %s", peer_id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion. Can we have a self.resource_manager._reservations.get(peer_id) check at start, and if it fails, then we can directly reject the request with NO_RESERVATION = 204 status. (similar to other implementations).

@sukhman-sukh
Copy link
Contributor

Also, one doubt. Does the current implementation handle the refresh of the reservation? I mean, if a connection is already made between a relay and a device, it refreshes the reservation to maintain connectivity and stability. Is that present in our version of the circuit relay?

@sukhman-sukh
Copy link
Contributor

Interestingly, I found one thing in other implementations(go and js): they are issuing vouchers but not verifying them, but out implementation does. Nice to see that.

@sukhman-sukh
Copy link
Contributor

Also, https://github.com/libp2p/go-libp2p/blob/7b7c3ed4ce048c99a865d4349b5f7484a6a93c04/p2p/protocol/circuitv2/relay/relay.go#L265-L269 here, they are denying the connection from relays with response = STATUS.PERMISSION_DENIED. I am not sure why they did this? Any thoughts on this @Winter-Soren @guha-rahul?
They are denying multi-hop relay and allows only single-hop where connection is from client to relay directly. So, should we also keep this check? @seetadev @acul71

@sukhman-sukh
Copy link
Contributor

Rest of the code looks good to me. Logic is well covered and looks neat. Great work @guha-rahul.

@guha-rahul
Copy link
Contributor Author

guha-rahul commented Jul 6, 2025

@sukhman-sukh https://github.com/libp2p/specs/blob/master/relay/circuit-v2.md#connection-initiation I think the note above this should be the reason aka to prevent multi-hop relay chaining. Thanks for the catch
added the fix. Would appreciate a review . cc : @seetadev @sukhman-sukh

@sukhman-sukh
Copy link
Contributor

sukhman-sukh commented Jul 7, 2025

LGTM.

@seetadev
Copy link
Contributor

@sukhman-sukh : Thank you Sukhman for the update. Appreciate your and @guha-rahul's efforts to arrive at a good conclusion on the circuit relay issues.

@seetadev
Copy link
Contributor

@sukhman-sukh, @guha-rahul : This looks good for a final review + merge. Wish to ask if the circuit relay issues have been resolved.

@seetadev
Copy link
Contributor

@guha-rahul : Wish if you could add @sukhman-sukh and @Winter-Soren as a collaborator in this PR.

They have made recent contributions to circuit relay and we look forward to completing the circuit relay outstanding issues this week. @sukhman-sukh will be sharing important fixes to circuit relay soon.

@guha-rahul
Copy link
Contributor Author

@guha-rahul : Wish if you could add @sukhman-sukh and @Winter-Soren as a collaborator in this PR.

They have made recent contributions to circuit relay and we look forward to completing the circuit relay outstanding issues this week. @sukhman-sukh will be sharing important fixes to circuit relay soon.

added all of them.

@LogicalGuy77
Copy link
Contributor

@seetadev @sukhman-sukh is anything blocking the merging of this PR? I'd like to help in the relay circuit if it's needed.

@seetadev
Copy link
Contributor

seetadev commented Oct 8, 2025

@LogicalGuy77 : Thank you so much Harshit for your initiative. Indeed, please collaborate with @sukhman-sukh and @Winter-Soren and focus on this PR: #767.

Once the other PR is fixed, you can collaborate with @Winter-Soren and @sukhman-sukh on this one.

@guha-rahul : Wish if you could add @Winter-Soren , @LogicalGuy77 and @sukhman-sukh as collaborators on this PR.

This PR was very well done indeed, and was also ready for final review + merge. However, with important changes made in relay directory, we might have to revisit the PR once again. Also, there are some merge conflicts in this PR, which now need to be addressed. Once the merge conflicts are resolved, I'll re-run the CI/CD pipeline too.

@seetadev
Copy link
Contributor

@LogicalGuy77 and @Winter-Soren : Hi Harshit. Wish if you could resolve the CI/CD issues and merge conflicts in this PR. Once this is merged, I will discuss with @codemaestro64, @pacrob and re-test his PR, in parallel.

@LogicalGuy77
Copy link
Contributor

LogicalGuy77 commented Nov 29, 2025

hey @seetadev I've fixed the merge conflicts and ran the tests successfuly. #1067

@seetadev
Copy link
Contributor

@LogicalGuy77 : Hi Harshit. Wish to share that CI/CD issues are still pending in this PR. Kindly collaborate with @Winter-Soren, @sumanjeet0012, @sukhman-sukh and arrive at a good conclusion on this PR.

Wish to share that we don't need to open another PR. We can do it here itself in the same branch as @guha-rahul.

@guha-rahul : Could you please add @LogicalGuy77 as a collaborator to this PR, in case he has not been added.

@Winter-Soren
Copy link
Contributor

Hi @guha-rahul,
Could you add me as a collaborator on your repo? I’m working on resolving some merge conflicts.

@guha-rahul
Copy link
Contributor Author

@Winter-Soren Fixed those but also added you

@seetadev
Copy link
Contributor

seetadev commented Dec 1, 2025

@guha-rahul , @Winter-Soren and @LogicalGuy77 : Merge conflicts have been resolved. However, CI/CD issues need to be fixed.

Re-running the CI/CD pipeline once again after updating the branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants