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(p2p): persistent storage for known peers #1056

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jansegre
Copy link
Member

@jansegre jansegre commented Jun 7, 2024

Motivation

Fixes #1036

Acceptance Criteria

  • Add a peer discovery strategy that stores peer entrypoints from peers we've previously connected to on previous starts
  • Use a rocksdb column family to store the entrypoints
  • Enable this strategy when using a data dir, and do not enable when not using one
  • Make peer manager aware of this object so it can call the appropriate methods to mark when a connection was attempted, when it successfully connected, and periodically clean up
  • Add tests that covers the new module

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@jansegre jansegre self-assigned this Jun 7, 2024
Copy link

codecov bot commented Jun 7, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 14 lines in your changes missing coverage. Please review.

Project coverage is 84.96%. Comparing base (4a46f3a) to head (75ec8ff).

Files Patch % Lines
hathor/p2p/manager.py 31.25% 7 Missing and 4 partials ⚠️
hathor/p2p/peer_discovery/storage.py 96.70% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1056      +/-   ##
==========================================
+ Coverage   84.88%   84.96%   +0.08%     
==========================================
  Files         300      301       +1     
  Lines       22944    23054     +110     
  Branches     3471     3488      +17     
==========================================
+ Hits        19476    19588     +112     
+ Misses       2777     2776       -1     
+ Partials      691      690       -1     

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

@jansegre jansegre force-pushed the feat/persist-known-peers branch 3 times, most recently from 3d711e4 to 3c17f8f Compare June 17, 2024 16:32
@jansegre jansegre marked this pull request as ready for review June 17, 2024 16:52
@jansegre jansegre requested a review from msbrogli as a code owner June 17, 2024 16:52
@jansegre jansegre force-pushed the feat/persist-known-peers branch from 3c17f8f to 75ec8ff Compare June 17, 2024 16:53
@jansegre jansegre requested a review from glevco June 17, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

improvement: Store the connection table in disk
1 participant