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

fix(rpc): return error if peer cant be connected #1476

Merged
merged 1 commit into from
Jan 9, 2023

Conversation

alrevuelta
Copy link
Contributor

@alrevuelta alrevuelta commented Jan 4, 2023

Closes #1469

Summary:

  • When trying to connect to a i) peer not listening or ii) malformed multiaddress via the RPC, the api was returning result:true which is missleading since no connection was made.
  • Moreover connectToNodes was used with a timeout but dialPeer already has a timeout. And note that connectToNodes discards the dialing result, so we can't know if the connection failed.
  • This PR uses dialPeer instead and raises an exception if we can't connect to the peer and adds a unit test for the bug it fixes.
  • Relevant for wakurtosis testing efforts.

@status-im-auto
Copy link
Collaborator

status-im-auto commented Jan 4, 2023

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
c2af5b5 #1 2023-01-04 23:02:56 ~15 min macos 📄log
c2af5b5 #2 2023-01-09 12:19:38 ~2 min macos 📄log
c2af5b5 #3 2023-01-09 13:15:38 ~2 min macos 📄log

Copy link
Contributor

@LNSD LNSD left a comment

Choose a reason for hiding this comment

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

LGTM ✅

Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

Thanks!

@alrevuelta alrevuelta merged commit 333ce0a into master Jan 9, 2023
@alrevuelta alrevuelta deleted the fixrpc-connectpeer branch January 9, 2023 13:15
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.

bug(rpc): connecting to a peer via RPC returns true even when failed
4 participants