Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(swarm): separate errors for pending inbound and outbound connection #5861

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

akaladarshi
Copy link

Description

  • Removes the PendingConnectionError
  • Create separate errors for PendingOutboundConnectionError and PendingInboundConnectionError

Fixes: #2767

Notes & open questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@akaladarshi akaladarshi changed the title refactor: use separate errors for pending inbound and outbound connections refactor: separate errors for pending inbound and outbound connection Feb 16, 2025
@akaladarshi akaladarshi marked this pull request as ready for review February 19, 2025 04:43
@akaladarshi akaladarshi marked this pull request as draft February 19, 2025 04:45
@akaladarshi
Copy link
Author

Hey @elenaf9 @jxs,

Can someone give me few pointer about why the test could be failing: dial_back_to_not_supporting, it's when alice and bob is trying to connect to each other inside bootstrap().await.

AFAIU: The test was supposed to check if we can dail back to the same host which is sending the request.

Copy link
Contributor

@elenaf9 elenaf9 left a comment

Choose a reason for hiding this comment

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

Can someone give me few pointer about why the test could be failing: dial_back_to_not_supporting, it's when alice and bob is trying to connect to each other inside bootstrap().await.

AFAIU: The test was supposed to check if we can dail back to the same host which is sending the request.

Do you have some logs when running it with DEBUG logging? Looking through the code I didn't find something obvious.

I think it's because you didn't include the obtained peer-id in case of a the PendingOutboundConnectionError when WrongPeerId, which resulted in the test's match statement not being fulfilled.

@akaladarshi
Copy link
Author

akaladarshi commented Feb 21, 2025

I tried the changes as per your suggestion, but the tests are still failing, anyways thanks @elenaf9 for the review and the pointers, will try to fix them ASAP.

@akaladarshi akaladarshi marked this pull request as ready for review February 24, 2025 19:38
@akaladarshi akaladarshi requested a review from elenaf9 February 24, 2025 19:38
@elenaf9
Copy link
Contributor

elenaf9 commented Feb 24, 2025

Also missing a major minor version bump of libp2p-swarm and a changelog entry 🙂

@akaladarshi
Copy link
Author

akaladarshi commented Feb 25, 2025

Also missing a major version bump of libp2p-swarm and a changelog entry 🙂

Thanks 🙏, I wasn't not sure which version to bump to.

Edit: @elenaf9 Just to clarify major version would be 1.0.0 ?

Copy link
Contributor

@elenaf9 elenaf9 left a comment

Choose a reason for hiding this comment

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

Two last nits, rest LGTM. Thanks for the follow ups @akaladarshi!

Copy link
Contributor

@elenaf9 elenaf9 left a comment

Choose a reason for hiding this comment

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

LGTM!

@elenaf9 elenaf9 changed the title refactor: separate errors for pending inbound and outbound connection feat(swarm): separate errors for pending inbound and outbound connection Feb 26, 2025
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.

Replace ConnectedPoint with Dialer in libp2p_swarm::DialError::WrongPeerId
2 participants