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: add ipblocker package #1323

Merged
merged 7 commits into from
Jun 9, 2024
Merged

feat: add ipblocker package #1323

merged 7 commits into from
Jun 9, 2024

Conversation

Ja7ad
Copy link
Contributor

@Ja7ad Ja7ad commented Jun 6, 2024

Description

This PR allows nodes to block peers based on a given CIDR range, instead of individual IP addresses. This enables each node to block a range of IPs more effectively.

@Ja7ad Ja7ad requested a review from b00f June 6, 2024 06:36
@b00f
Copy link
Collaborator

b00f commented Jun 6, 2024

@Ja7ad

There are some items that need to be added to this PR:

  1. Add IPBlocker to the firewall. Look here and check where it is used.

  2. In the connect event, check if the IP is blocked. Look here.

  3. Update the config to include user-defined blacklisted IPs.

  4. Please include a description for this PR. Example can be found here

@Ja7ad
Copy link
Contributor Author

Ja7ad commented Jun 8, 2024

@Ja7ad

There are some items that need to be added to this PR:

  1. Add IPBlocker to the firewall. Look here and check where it is used.
  2. In the connect event, check if the IP is blocked. Look here.
  3. Update the config to include user-defined blacklisted IPs.
  4. Please include a description for this PR. Example can be found here

We have many changes before merge PR #1309 about query votes, peerset and ...

https://github.com/pactus-project/pactus/tree/971500b7a5612b32317e7509ddd2f0d7edda3afa

First need add this changes before add ipblocker on sync and firewall.

Copy link

codecov bot commented Jun 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.43%. Comparing base (20e991a) to head (2894e9f).
Report is 16 commits behind head on main.

Current head 2894e9f differs from pull request most recent head 34470c3

Please upload reports for the commit 34470c3 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1323      +/-   ##
==========================================
+ Coverage   76.05%   76.43%   +0.37%     
==========================================
  Files         206      231      +25     
  Lines       10672    11718    +1046     
==========================================
+ Hits         8117     8957     +840     
- Misses       2169     2347     +178     
- Partials      386      414      +28     

@Ja7ad
Copy link
Contributor Author

Ja7ad commented Jun 8, 2024

@Ja7ad

There are some items that need to be added to this PR:

  1. Add IPBlocker to the firewall. Look here and check where it is used.
  2. In the connect event, check if the IP is blocked. Look here.
  3. Update the config to include user-defined blacklisted IPs.
  4. Please include a description for this PR. Example can be found here

Done

@b00f b00f changed the title feat(util): add ipblocker package feat: add pblocker package Jun 9, 2024
@b00f b00f merged commit 7912557 into pactus-project:main Jun 9, 2024
11 checks passed
@b00f b00f changed the title feat: add pblocker package feat: add ipblocker package Jun 9, 2024
themantre pushed a commit that referenced this pull request Jun 9, 2024
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.

2 participants