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

Improve peer discovery mechanism #347

Open
2 tasks
Warchant opened this issue Nov 26, 2021 · 9 comments
Open
2 tasks

Improve peer discovery mechanism #347

Warchant opened this issue Nov 26, 2021 · 9 comments
Assignees
Labels
enhancement New feature or request prio:medium spv

Comments

@Warchant
Copy link
Collaborator

Warchant commented Nov 26, 2021

  • use more hardcoded peers
  • use p2p to query more peers from connected peers

Fixes https://github.com/VeriBlock/vbk-ri-btc/issues/630

@Warchant Warchant added enhancement New feature or request spv labels Nov 26, 2021
@Warchant Warchant assigned Warchant and unassigned blackyblack Dec 7, 2021
@Warchant Warchant assigned Warchant and blackyblack and unassigned Warchant Dec 13, 2021
@blackyblack
Copy link
Contributor

@Warchant do you have a list of peers that we want to hardcode?

@Warchant
Copy link
Collaborator Author

@blackyblack it turns out mainnet NC does DNS resolution to get peers. And it is already implemented in APM.
Just make sure for (1) that all peers found by DNS resolution are used.

@blackyblack
Copy link
Contributor

I see that DNS IPs are added to the peers table as soon as they are resolved. And we have such a test case for a single IP for a single DNS record.
Should we consider (1) as done then?
As for (2), I haven't found the ability to download peers list from the connected peers. Should I implement this functionality?

@blackyblack
Copy link
Contributor

For (2) scratch this. Found some code that looks like it.

@blackyblack
Copy link
Contributor

blackyblack commented Dec 20, 2021

@Warchant Also I found that peers may stay in candidates list but not being connected to. It happens if minimum amount of peers has been reached. Do we want to fix this behavior?

@Warchant
Copy link
Collaborator Author

@blackyblack

  1. SPV should maintain minpeers active connections. It should connect connect up until minpeers is reached, then we can accept only incoming connections up until maxpeers.
  2. regularly check connection status. Is there a "ping" p2p command or something?
  3. Set default minpeers to 5

@blackyblack
Copy link
Contributor

blackyblack commented Dec 20, 2021

@Warchant

  1. Well it seems it already works this way.
  2. Yes, it regularly checks for peers' last received message.
  3. It is set to 8 now.

@Warchant
Copy link
Collaborator Author

@blackyblack wow. Okay.
Do you have any idea why this may happen #369 ?

@blackyblack
Copy link
Contributor

I was looking at the nodecore peer discovery code and the logs are for SPV app. I will check if there is any difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request prio:medium spv
Projects
Status: Backlog
Development

No branches or pull requests

2 participants