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

[Merged by Bors] - p2p: use backoff during routing discovery #5882

Closed
wants to merge 9 commits into from

Conversation

ivan4th
Copy link
Contributor

@ivan4th ivan4th commented Apr 25, 2024

Motivation

Previous attempts at enabling routing discovery caused network overload on some of the nodes

Description

Avoid excess DHT queries and connection attempts by using the same backoff mechanisms as those used by Kubo and peer discovery code in go-libp2p-pubsub

Test Plan

Tested on a mainnet node

TODO

  • Explain motivation or link existing issue(s)
  • Test changes and document test plan
  • Update changelog as needed

Avoid excess DHT queries and connection attempts
Copy link

codecov bot commented Apr 25, 2024

Codecov Report

Attention: Patch coverage is 75.89286% with 27 lines in your changes are missing coverage. Please review.

Project coverage is 80.6%. Comparing base (327c3e3) to head (f18de62).

Files Patch % Lines
p2p/dhtdiscovery/discovery.go 72.1% 21 Missing and 6 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #5882   +/-   ##
=======================================
  Coverage     80.6%   80.6%           
=======================================
  Files          285     285           
  Lines        29521   29568   +47     
=======================================
+ Hits         23805   23849   +44     
- Misses        4125    4127    +2     
- Partials      1591    1592    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

p2p/dhtdiscovery/discovery.go Outdated Show resolved Hide resolved
p2p/dhtdiscovery/discovery.go Outdated Show resolved Hide resolved
p2p/dhtdiscovery/discovery_test.go Outdated Show resolved Hide resolved
p2p/dhtdiscovery/discovery.go Outdated Show resolved Hide resolved
p2p/dhtdiscovery/discovery.go Outdated Show resolved Hide resolved
ivan4th and others added 5 commits April 29, 2024 16:15
Co-authored-by: Bartosz Różański <bartek.roza@gmail.com>
Co-authored-by: Bartosz Różański <bartek.roza@gmail.com>
There was no error checking for DHT discovery startup, yet it could fail e.g. during LevelDB corruption:
```
Error: init services: error starting discovery: open leveldb at /opt/go-spacemesh/go-spacemesh-0/p2p: leveldb/journal: block/chunk corrupted: chunk length overflows block (1270 bytes) [file=000247.log]
```
In this case, error was being swallowed and DHT not started, breaking acquisition of new peers.

Co-authored-by: Ivan Shvedunov <ivan4th@users.noreply.github.com>
@ivan4th
Copy link
Contributor Author

ivan4th commented Apr 30, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Apr 30, 2024
## Motivation

Previous attempts at enabling routing discovery caused network overload on some of the nodes



Co-authored-by: Ivan Shvedunov <ivan4th@users.noreply.github.com>
@spacemesh-bors
Copy link

Pull request successfully merged into develop.

Build succeeded:

@spacemesh-bors spacemesh-bors bot changed the title p2p: use backoff during routing discovery [Merged by Bors] - p2p: use backoff during routing discovery Apr 30, 2024
@spacemesh-bors spacemesh-bors bot closed this Apr 30, 2024
@spacemesh-bors spacemesh-bors bot deleted the feature/slower-disc branch April 30, 2024 15:59
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.

None yet

3 participants