Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

validates gossip addresses before sending pull-requests #16748

Merged
merged 2 commits into from
May 3, 2021

Conversation

behzadnouri
Copy link
Contributor

@behzadnouri behzadnouri commented Apr 22, 2021

Problem

ip addresses need to be validated before sending packets to them.

Summary of Changes

  • send a ping packet to ip addresses before any pull requests.
  • only pull from ip addresses which have responded with the correct hash of their respective ping packet.

@behzadnouri behzadnouri force-pushed the more-ping-pong branch 2 times, most recently from 11937f5 to dff911b Compare April 22, 2021 19:27
@codecov
Copy link

codecov bot commented Apr 22, 2021

Codecov Report

Merging #16748 (4d29505) into master (8fe2668) will decrease coverage by 0.0%.
The diff coverage is 97.5%.

❗ Current head 4d29505 differs from pull request most recent head 72292a6. Consider uploading reports for the commit 72292a6 to get more accurate results

@@            Coverage Diff            @@
##           master   #16748     +/-   ##
=========================================
- Coverage    82.7%    82.7%   -0.1%     
=========================================
  Files         416      416             
  Lines      116948   116698    -250     
=========================================
- Hits        96831    96605    -226     
+ Misses      20117    20093     -24     

@behzadnouri behzadnouri marked this pull request as ready for review April 22, 2021 22:20
@behzadnouri behzadnouri force-pushed the more-ping-pong branch 5 times, most recently from 914a73a to 4d29505 Compare April 29, 2021 12:23
@behzadnouri behzadnouri force-pushed the more-ping-pong branch 2 times, most recently from 2e01b3b to 14d1f8a Compare May 3, 2021 11:31
@behzadnouri
Copy link
Contributor Author

behzadnouri commented May 3, 2021

@mvines @sakridge @carllin

any objection to merging this?

sakridge
sakridge previously approved these changes May 3, 2021
Copy link
Contributor

@sakridge sakridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mergify mergify bot dismissed sakridge’s stale review May 3, 2021 14:55

Pull request has been modified.

IP addresses need to be validated before sending packets to them.
This commit, sends a ping packet to nodes before any pull requests.
Pull requests are then only sent to the nodes which have responded with
the correct hash of their respective ping packet.
@behzadnouri behzadnouri merged commit 7cea2c4 into solana-labs:master May 3, 2021
@behzadnouri behzadnouri deleted the more-ping-pong branch May 3, 2021 18:21
mergify bot added a commit that referenced this pull request May 3, 2021
) (#17009)

* uses Mutex instead of RwLock for ping_cache

(cherry picked from commit 2231017)

* validates gossip addresses before sending pull-requests

IP addresses need to be validated before sending packets to them.
This commit, sends a ping packet to nodes before any pull requests.
Pull requests are then only sent to the nodes which have responded with
the correct hash of their respective ping packet.

(cherry picked from commit 7cea2c4)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
@brooksprumo brooksprumo mentioned this pull request Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants