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

fix: ban trusted peer for a short period #7071

Merged
merged 5 commits into from Mar 11, 2024
Merged

Conversation

int88
Copy link
Contributor

@int88 int88 commented Mar 9, 2024

fixes: #7056

emhane
emhane previously requested changes Mar 10, 2024
if peer.is_trusted() {
self.ban_list.ban_peer_until(
peer_id,
std::time::Instant::now() + self.backoff_durations.medium,
Copy link
Member

Choose a reason for hiding this comment

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

please import Instant in prelude of module

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already prelude Instant of tokio, conflict?

if peer.is_trusted() {
self.ban_list.ban_peer_until(
peer_id,
std::time::Instant::now() + self.backoff_durations.medium,
Copy link
Member

Choose a reason for hiding this comment

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

where did self.backoff_durations.medium come from? isn't it supposed to use a fraction of self.ban_duration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed with @mattsse

Copy link
Member

Choose a reason for hiding this comment

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

Then will let @mattsse continue review :)

@int88
Copy link
Contributor Author

int88 commented Mar 11, 2024

@mattsse @emhane updated! :)

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

smol nit

crates/net/network/src/peers/manager.rs Outdated Show resolved Hide resolved
@mattsse mattsse enabled auto-merge March 11, 2024 13:51
@mattsse mattsse added this pull request to the merge queue Mar 11, 2024
Merged via the queue into paradigmxyz:main with commit ef1a196 Mar 11, 2024
27 checks passed
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.

Prevent banning trusted peers for a long time
3 participants