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
Conversation
if peer.is_trusted() { | ||
self.ban_list.ban_peer_until( | ||
peer_id, | ||
std::time::Instant::now() + self.backoff_durations.medium, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed with @mattsse
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
smol nit
fixes: #7056