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: do not connect to v1 peers #767

Closed

Conversation

darrenvechain
Copy link
Member

@darrenvechain darrenvechain commented Jun 4, 2024

Description

Prevent connecting to v1 nodes

TODO: Test peer cache

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • comm/communicator_test.go
  • - Manually running:
./bin/thor --network main --allowed-peers=enode://ba4c84f7804d477feca2ba0ae5924cbefe529284457aaf3239a9ac5b5d96752c47e6d71e1088acbb02c74c0210265246528144c6e3aaebe9a3887c85b85b98c0@18.167.12.43:11235,enode://09e158ca5f30ca5b191c3c33ba4dd169908f2a38647c4842a3d8ff3e011ea09fa3f0f2a7e73734c7b5ed841579192ebafcd5cd600dc3b9822af150c5d114f90a@152.32.156.92:11235

☝️ 1 good node, 1 old node

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • New and existing E2E tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have not added any vulnerable dependencies to my code

@darrenvechain darrenvechain requested a review from a team as a code owner June 4, 2024 15:37
comm/communicator.go Outdated Show resolved Hide resolved
comm/communicator.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 37.50000% with 10 lines in your changes missing coverage. Please review.

Project coverage is 62.68%. Comparing base (43d1fde) to head (c297567).

Files Patch % Lines
p2psrv/server.go 37.50% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #767      +/-   ##
==========================================
+ Coverage   62.57%   62.68%   +0.11%     
==========================================
  Files         199      199              
  Lines       18098    18113      +15     
==========================================
+ Hits        11324    11355      +31     
+ Misses       5691     5673      -18     
- Partials     1083     1085       +2     

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

@darrenvechain darrenvechain changed the title feat: do not connect to peers that have a different major version feat: do not connect to v1 peers Jun 5, 2024
@darrenvechain darrenvechain marked this pull request as draft June 5, 2024 13:13
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.

4 participants