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

Can dial myself #817

Closed
a1300 opened this issue Nov 27, 2020 · 3 comments · Fixed by #826
Closed

Can dial myself #817

a1300 opened this issue Nov 27, 2020 · 3 comments · Fixed by #826
Assignees
Labels
kind/bug A bug in existing code (including security flaws) status/ready Ready to be worked

Comments

@a1300
Copy link
Contributor

a1300 commented Nov 27, 2020

  • Version: v0.29.3
  • Platform: Linux
  • Subsystem:

Type: Bug

Severity: Medium

Description: I can dial myself

Steps to reproduce the error:

Reproduction gist

git clone https://gist.github.com/a1300/74706c0a7119e0fce1a1cc2366779f1c libp2p-dial-myself
cd libp2p-dial-myself
npm install
node index.js

Output

[0.0.0.0] I am peer "QmZUaDLvgtmaTYgwRcyvd7vXkAEQDXdKhimab6BVwjD7p4"
[0.0.0.0] peer:discovery peer "QmZUaDLvgtmaTYgwRcyvd7vXkAEQDXdKhimab6BVwjD7p4"
(node:27430) ExperimentalWarning: Readable[Symbol.asyncIterator] is an experimental feature. This feature could change at any time
[0.0.0.0] peer:connect peer "QmZUaDLvgtmaTYgwRcyvd7vXkAEQDXdKhimab6BVwjD7p4
[0.0.0.0] peer:connect peer "QmZUaDLvgtmaTYgwRcyvd7vXkAEQDXdKhimab6BVwjD7p4
connections: 1
@a1300
Copy link
Contributor Author

a1300 commented Nov 27, 2020

Related to #356 #274

@vasco-santos
Copy link
Member

Well, this was introduced by storing the self peer in the AddressBook. We should get this fixed and verify on the auto dial if we are trying to dial self

@vasco-santos vasco-santos self-assigned this Nov 29, 2020
@vasco-santos vasco-santos added the status/ready Ready to be worked label Nov 29, 2020
@jacobheun jacobheun added the kind/bug A bug in existing code (including security flaws) label Nov 30, 2020
@vasco-santos
Copy link
Member

Looking into this, we already protect the discovery of self. So, after I checked the provided code I noticed that this is a manual dial to self and not a subsequent dial from discovery.

We should just need to add a check into the dialer connect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) status/ready Ready to be worked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants